1
0
mirror of https://github.com/google/nomulus synced 2026-01-09 07:33:42 +00:00

Add better integration for console formatting check and apply (#2070)

This commit is contained in:
Pavlo Tkach
2023-07-06 12:33:32 -04:00
committed by GitHub
parent ad68052524
commit 845f792044
4 changed files with 786 additions and 963 deletions

View File

@@ -505,6 +505,7 @@ task javaIncrementalFormatCheck {
println("Omitting format check: not in a git directory.")
}
}
dependsOn('console-webapp:checkFormatting')
}
// Shows how modified lines in Java source files will change after formatting.
@@ -522,6 +523,7 @@ task javaIncrementalFormatApply {
doLast {
invokeJavaDiffFormatScript("format")
}
dependsOn('console-webapp:applyFormatting')
}
task javadoc(type: Javadoc) {

View File

@@ -50,12 +50,19 @@ task buildConsoleWebappProd(type: Exec) {
args 'run', 'build'
}
task applyFormatting() {
exec {
workingDir "${consoleDir}/"
commandLine 'npm', 'run', 'prettify'
}
task applyFormatting(type: Exec) {
workingDir "${consoleDir}/"
executable 'npm'
args 'run', 'prettify'
}
task checkFormatting(type: Exec) {
workingDir "${consoleDir}/"
executable 'npm'
args 'run', 'prettify:check'
}
tasks.runConsoleWebappUnitTests.dependsOn(tasks.npmInstallDeps)
tasks.buildConsoleWebappProd.dependsOn(tasks.npmInstallDeps)
tasks.applyFormatting.dependsOn(tasks.npmInstallDeps)
tasks.checkFormatting.dependsOn(tasks.npmInstallDeps)

File diff suppressed because it is too large Load Diff

View File

@@ -10,6 +10,7 @@
"test": "ng test --browsers=ChromeHeadless --watch=false",
"run:dev": "",
"prettify": "npx prettier --write ./src/",
"prettify:check": "npx prettier --check ./src/",
"start:dev": "concurrently \"./../gradlew :core:runTestServer\" \"ng serve --proxy-config dev-proxy.config.json\"",
"lint": "ng lint"
},