Skip to content

Commit

Permalink
cmake: only run prettier explicitly (#14228)
Browse files Browse the repository at this point in the history
  • Loading branch information
nektro authored Oct 1, 2024
1 parent 2f7ff95 commit 016ebf7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,7 @@ include(BuildBun)
include(RunClangFormat)
include(RunClangTidy)
include(RunZigFormat)
include(RunPrettier)

if (ENABLE_PRETTIER)
include(RunPrettier)
endif()
2 changes: 2 additions & 0 deletions cmake/Options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ if(LINUX)
optionx(ENABLE_VALGRIND BOOL "If Valgrind support should be enabled" DEFAULT OFF)
endif()

optionx(ENABLE_PRETTIER BOOL "If prettier should be ran" DEFAULT OFF)

if(USE_VALGRIND AND NOT USE_BASELINE)
message(WARNING "If valgrind is enabled, baseline must also be enabled")
setx(USE_BASELINE ON)
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
"zig-format": "bun run cmake --target zig-format",
"zig-format:check": "bun run cmake --target zig-format-check",
"zig-format:diff": "bun run cmake --target zig-format-diff",
"prettier": "bun run cmake --target prettier",
"prettier:check": "bun run cmake --target prettier-check",
"prettier:extra": "bun run cmake --target prettier-extra",
"prettier:diff": "bun run cmake --target prettier-diff"
"prettier": "bun run cmake -DENABLE_PRETTIER=ON --target prettier",
"prettier:check": "bun run cmake -DENABLE_PRETTIER=ON --target prettier-check",
"prettier:extra": "bun run cmake -DENABLE_PRETTIER=ON --target prettier-extra",
"prettier:diff": "bun run cmake -DENABLE_PRETTIER=ON --target prettier-diff"
}
}

0 comments on commit 016ebf7

Please sign in to comment.