File tree Expand file tree Collapse file tree 4 files changed +56
-0
lines changed
Expand file tree Collapse file tree 4 files changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ Checks : >
2+ clang-diagnostic-*,
3+ clang-analyzer-*,
4+ cppcoreguidelines-*,
5+ modernize-*,
6+ performance-*,
7+ readability-*,
8+ -modernize-use-trailing-return-type,
9+ -readability-identifier-length
10+
11+ # Treat all warnings as errors
12+ WarningsAsErrors : ' *'
13+
14+ # Only warn on headers in the code tree
15+ HeaderFilterRegex : ' builtins/|runtime/'
16+
17+ # Use the same style as clang-format (look for .clang-format)
18+ FormatStyle : file
19+
20+ # Don’t analyze temporary dtors (speeds up checking)
21+ AnalyzeTemporaryDtors : false
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ include("spidermonkey")
3838include ("openssl" )
3939include ("${HOST_API} /host_api.cmake" )
4040include ("build-crates" )
41+ include ("lint" )
4142
4243option (ENABLE_JS_DEBUGGER "Enable support for debugging content via a socket connection" ON )
4344
Original file line number Diff line number Diff line change 1+ set (CLANG_TIDY ${WASI_SDK_PREFIX} /bin/clang-tidy)
2+ set (RUN_CLANG_TIDY ${WASI_SDK_PREFIX} /bin/run-clang-tidy)
3+ set (CLANG_APPLY_REPLACEMENTS ${WASI_SDK_PREFIX} /bin/clang-apply-replacements)
4+ set (WASI_SYSROOT ${WASI_SDK_PREFIX} /share/wasi-sysroot)
5+
6+ add_custom_target (clang-tidy
7+ COMMAND ${RUN_CLANG_TIDY}
8+ -p=${CMAKE_BINARY_DIR}
9+ -clang-tidy-binary=${CLANG_TIDY}
10+ -extra-arg=--sysroot=${WASI_SYSROOT}
11+ -config-file=${CMAKE_SOURCE_DIR}/.clang-tidy
12+ ${CMAKE_SOURCE_DIR} /builtins
13+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
14+ COMMENT "Running clang‑tidy over the codebase"
15+ VERBATIM )
16+
17+ add_custom_target (clang-tidy-fix
18+ COMMAND ${RUN_CLANG_TIDY}
19+ -p=${CMAKE_BINARY_DIR}
20+ -clang-tidy-binary=${CLANG_TIDY}
21+ -clang-apply-replacements-binary=${CLANG_APPLY_REPLACEMENTS}
22+ -extra-arg=--sysroot=${WASI_SYSROOT}
23+ -config-file=${CMAKE_SOURCE_DIR}/.clang-tidy
24+ -fix
25+ ${CMAKE_SOURCE_DIR} /builtins
26+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
27+ COMMENT "Running clang‑tidy over the codebase and applying fixes"
28+ VERBATIM )
Original file line number Diff line number Diff line change @@ -45,6 +45,12 @@ do_clean:
4545clean -all: && do_clean
4646 @ echo " This will remove {{ builddir}} "
4747
48+ # Run clang-tidy
49+ lint : (build " clang-tidy" )
50+
51+ # Run clang-tidy and apply offered fixes
52+ lint-fix : (build " clang-tidy-fix" )
53+
4854# Componentize js script
4955componentize script = " " outfile = " starling.wasm": build
5056 {{ builddir }} / componentize.sh {{ script }} -o {{ outfile }}
You can’t perform that action at this time.
0 commit comments