Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development: Improve spotless config for pre commit hook #9600

Merged
merged 2 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,15 @@ idea {
}

spotless {

// allows to execute the code formatting commands ./gradlew spotlessApply and ./gradlew spotlessCheck
java {
target {
fileTree(rootDir) {
include "**/*.java"
include (
"src/main/java/**/*.java",
"src/test/java/**/*.java",
)
exclude(
"**/src/test/resources/test-data/repository-export/EncodingISO_8559_1.java",
"**/node_modules/**",
Expand All @@ -71,7 +75,6 @@ spotless {
"**/src/main/resources/templates/**",
"/docker/**",
"checked-out-repos/**",
"**/src/main/java/org/eclipse/**",
"supporting_scripts/**"
)
}
Expand Down
15 changes: 1 addition & 14 deletions linting.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
#!/bin/sh
join_by () {
local IFS="$1";
shift;
echo "$*";
}

FILES=$(join_by "," "$@")

if [[ "$OSTYPE" == "msys" ]]; then
# replace backslashes with double backslashes in Windows file paths when
# using MinGW (msys = lightweight shell and GNU utilities compiled for Windows (part of MinGW)
FILES=$(echo $FILES | sed 's/\\/\\\\/g')
fi

./gradlew spotlessApply -PspotlessFiles="${FILES}"
./gradlew spotlessApply -PratchetFrom='develop'
krusche marked this conversation as resolved.
Show resolved Hide resolved
Loading