Skip to content

Commit

Permalink
Check C++ formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Apr 16, 2024
1 parent a2bcc49 commit 42fbafa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:

- run: pixi run build

# TODO(emilk): Add a step to check formatting etc
- run: pixi run fmt-check
1 change: 0 additions & 1 deletion .vscode/spellright.dict

This file was deleted.

16 changes: 15 additions & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,30 @@ version = "0.1.0"


[tasks]
# ------------------------------------------------------------------------------------------
# C++ stuff:
# Note: extra CLI argument after `pixi run TASK` are passed to the task cmd.

# Clean C++ build artifacts
clean = { cmd = "rm -rf build bin CMakeFiles/" }
print-env = { cmd = "echo $PATH" }
prepare = "cmake -G 'Ninja' -B build -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo"

# Build C++ example
build = { cmd = "cmake --build build --config RelWithDebInfo --target all", depends_on = [
"prepare",
] }

# Run C++ example
example = { cmd = "build/rerun_template", depends_on = ["build"] }
format = { cmd = "clang-format -i src/*" }

# Format C++ code
fmt = { cmd = "clang-format -i src/*" }

# Check formatting of C++ code
fmt-check = { cmd = "clang-format --dry-run --Werror -i src/*" }

# ------------------------------------------------------------------------------------------

[dependencies]
# C++ build-tools:
Expand Down

0 comments on commit 42fbafa

Please sign in to comment.