Skip to content

Commit

Permalink
[lint] Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
jslee02 committed Mar 17, 2024
1 parent 5d53afd commit b16d100
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
30 changes: 19 additions & 11 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ freeglut = ">=3.2.2,<3.3"

[target.linux-64.tasks]
configure = "cmake -G Ninja -S . -B build -DDART_VERBOSE=ON"
lint = { cmd= "cmake --build build --target format && black . && isort .", depends_on = ["configure"] }
check-lint = { cmd= "black . --check && isort . --check", depends_on = ["configure"] }
build = { cmd = "cmake --build build -j", depends_on = [
lint = { cmd = "cmake --build build --target format && black . && isort .", depends_on = [
"configure",
] }
check-lint = { cmd = "cmake --build build --target check-format && black . --check && isort . --check", depends_on = [
"configure",
] }
build = { cmd = "cmake --build build -j", depends_on = ["configure"] }
build_dartpy = { cmd = "cmake --build build -j --target dartpy", depends_on = [
"configure",
] }
Expand All @@ -68,11 +70,13 @@ clang-format-14 = ">=14.0.6,<14.1"

[target.osx-64.tasks]
configure = "cmake -G Ninja -S . -B build -DDART_VERBOSE=ON"
lint = { cmd= "cmake --build build --target format && black . && isort .", depends_on = ["configure"] }
check-lint = { cmd= "cmake --build build --target check-format && black . --check && isort . --check", depends_on = ["configure"] }
build = { cmd = "cmake --build build -j", depends_on = [
lint = { cmd = "cmake --build build --target format && black . && isort .", depends_on = [
"configure",
] }
check-lint = { cmd = "cmake --build build --target check-format && black . --check && isort . --check", depends_on = [
"configure",
] }
build = { cmd = "cmake --build build -j", depends_on = ["configure"] }
build_dartpy = { cmd = "cmake --build build -j --target dartpy", depends_on = [
"configure",
] }
Expand All @@ -91,11 +95,13 @@ clang-format-14 = ">=14.0.6,<14.1"

[target.osx-arm64.tasks]
configure = "cmake -G Ninja -S . -B build -DDART_VERBOSE=ON"
lint = { cmd= "cmake --build build --target format && black . && isort .", depends_on = ["configure"] }
check-lint = { cmd= "cmake --build build --target check-format && black . --check && isort . --check", depends_on = ["configure"] }
build = { cmd = "cmake --build build -j", depends_on = [
lint = { cmd = "cmake --build build --target format && black . && isort .", depends_on = [
"configure",
] }
check-lint = { cmd = "cmake --build build --target check-format && black . --check && isort . --check", depends_on = [
"configure",
] }
build = { cmd = "cmake --build build -j", depends_on = ["configure"] }
build_dartpy = { cmd = "cmake --build build -j --target dartpy", depends_on = [
"configure",
] }
Expand All @@ -117,8 +123,10 @@ freeglut = ">=3.2.2,<3.3"

[target.win-64.tasks]
configure = "cmake -S . -B build -G 'Visual Studio 17 2022' -DCMAKE_BUILD_TYPE=Release -DDART_MSVC_DEFAULT_OPTIONS=ON -DBUILD_SHARED_LIBS=OFF -DDART_VERBOSE=ON"
lint = { cmd= "black . && isort .", depends_on = ["configure"] }
check-lint = { cmd= "black . --check && isort . --check", depends_on = ["configure"] }
lint = { cmd = "black . && isort .", depends_on = ["configure"] }
check-lint = { cmd = "black . --check && isort . --check", depends_on = [
"configure",
] }
build = { cmd = "cmake --build build --config Release -j", depends_on = [
"configure",
] }
Expand Down
4 changes: 2 additions & 2 deletions tools/check_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ if [ "$#" -lt 2 ]; then
exit 0
fi

num_changes=`$1 -style=file -output-replacements-xml "${@:2}" | grep -c "<replacement "`
num_changes=$($1 -style=file -output-replacements-xml "${@:2}" | grep -c "<replacement ")

if [ "$num_changes" = "0" ]; then
echo "Every file seems to comply with our code convention."
exit 0
else
echo "Found" $num_changes "necessary changes."
exit 0
exit 1
fi

0 comments on commit b16d100

Please sign in to comment.