Skip to content

Commit

Permalink
Add cargo fix to format-all.sh (#1849)
Browse files Browse the repository at this point in the history
<!-- start git-machete generated -->

## Tree of downstream PRs as of 2024-12-10

* **PR #1849 (THIS ONE)**:
  `main` ← `wb/froeht/cargo-fix`

    * PR #1851:
      `wb/froeht/cargo-fix` ← `wb/froeht/1850-serverfigmadoc`

<!-- end git-machete generated -->

Adding it because I kept missing it when i was formatting my changes.

Also re-arranged it a little bit and added some comments.
  • Loading branch information
timothyfroehlich authored Dec 10, 2024
1 parent 6f7c8cb commit d01c120
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions dev-scripts/format-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,31 @@ if ! which "$GOPATH"/addlicense; then
exit 1
fi

"$GOPATH"/addlicense \
-ignore "**/.idea/**" \
-ignore "**/.vscode/**" \
-ignore "**/.gradle/**" \
-ignore "**/build/**" \
-ignore "**/target/**" \
-ignore "**/gen_strings.xml" \
-c "Google LLC" \
-l apache \
"$GIT_ROOT"

# Run in a subshell so that we don't end up in the wrong directory if the script fails
(
cd "$GIT_ROOT" || exit
"$GOPATH"/addlicense \
-ignore "**/.idea/**" \
-ignore "**/.vscode/**" \
-ignore "**/.gradle/**" \
-ignore "**/build/**" \
-ignore "**/target/**" \
-ignore "**/gen_strings.xml" \
-c "Google LLC" \
-l apache \
"$GIT_ROOT"

cargo fix --allow-dirty --allow-staged --workspace --all-features
cargo fmt

# Format each Gradle project individually, so that Gradle doesn't complain that build files
# changed while we were running the format
cd "$GIT_ROOT/build-logic" || exit
./gradlew spotlessApply --no-configuration-cache
)
(
cd "$GIT_ROOT/plugins" || exit
./gradlew spotlessApply --no-configuration-cache
)
(
cd "$GIT_ROOT" || exit
./gradlew spotlessApply --no-configuration-cache
cargo fmt
)

if which protolint >/dev/null; then
Expand Down

0 comments on commit d01c120

Please sign in to comment.