Skip to content
Draft
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
2 changes: 1 addition & 1 deletion lint-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
clang-format>=20.1
clang-tidy>=20.1
clang-tidy~=20.1
yamllint>=1.35.1
24 changes: 24 additions & 0 deletions taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ includes:
vars:
G_BUILD_DIR: "{{.ROOT_DIR}}/build"
G_CLP_FFI_JS_BUILD_DIR: "{{.G_BUILD_DIR}}/clp-ffi-js"
G_CLP_FFI_JS_LINT_BUILD_DIR: "{{.G_BUILD_DIR}}/clp-ffi-js-lint"
G_DEPS_DIR: "{{.G_BUILD_DIR}}/deps"
G_DIST_DIR: "{{.ROOT_DIR}}/dist"
G_EMSDK_DIR: "{{.G_BUILD_DIR}}/emsdk"
G_EMSCRIPTEN_CMAKE_TOOLCHAIN_FILE: >-
{{.G_EMSDK_DIR}}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
G_EMSCRIPTEN_SYSROOT: "{{.G_EMSDK_DIR}}/upstream/emscripten/cache/sysroot"
G_EMSDK_CLANG_C_COMPILER: "{{.G_EMSDK_DIR}}/upstream/bin/clang"
G_EMSDK_CLANG_CXX_COMPILER: "{{.G_EMSDK_DIR}}/upstream/bin/clang++"

G_CLP_FFI_JS_ENV_NAMES: ["node", "worker"]
G_CLP_FFI_JS_TARGET_PREFIX: "ClpFfiJs-"
Expand Down Expand Up @@ -162,6 +166,26 @@ tasks:
-S "{{.ROOT_DIR}}" \
-B "{{.G_CLP_FFI_JS_BUILD_DIR}}"

config-cmake-project-lint:
internal: true
sources:
- "{{.G_EMSDK_CHECKSUM}}"
- "{{.TASKFILE}}"
- "CMakeLists.txt"
generates:
- "{{.G_CLP_FFI_JS_LINT_BUILD_DIR}}/CMakeCache.txt"
- "{{.G_CLP_FFI_JS_LINT_BUILD_DIR}}/compile_commands.json"
cmd: |-
cmake \
-DCLP_FFI_JS_SUPPORTED_ENVIRONMENTS="{{.G_CLP_FFI_JS_ENV_NAMES | join ";"}}" \
-DCMAKE_TOOLCHAIN_FILE="{{.G_EMSCRIPTEN_CMAKE_TOOLCHAIN_FILE}}" \
-DCMAKE_C_COMPILER="{{.G_EMSDK_CLANG_C_COMPILER}}" \
-DCMAKE_CXX_COMPILER="{{.G_EMSDK_CLANG_CXX_COMPILER}}" \
-DCMAKE_C_FLAGS="--target=wasm32-unknown-emscripten --sysroot={{.G_EMSCRIPTEN_SYSROOT}} -isystem {{.G_EMSDK_DIR}}/upstream/emscripten/system/include -isystem {{.G_EMSDK_DIR}}/upstream/emscripten/system/include/compat" \
-DCMAKE_CXX_FLAGS="--target=wasm32-unknown-emscripten --sysroot={{.G_EMSCRIPTEN_SYSROOT}} -isystem {{.G_EMSDK_DIR}}/upstream/emscripten/system/include -isystem {{.G_EMSDK_DIR}}/upstream/emscripten/system/include/compat" \
-S "{{.ROOT_DIR}}" \
-B "{{.G_CLP_FFI_JS_LINT_BUILD_DIR}}"

node-modules:
internal: true
sources:
Expand Down
6 changes: 3 additions & 3 deletions taskfiles/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ tasks:
# NOTE: We alias the fix task until we determine which clang-tidy fixes can be applied safely.
aliases: ["fix-cpp-static-diff"]
deps:
- ":config-cmake-project"
- ":config-cmake-project-lint"
- "cpp-lint-configs"
- "venv"
cmds:
- task: ":utils:cpp-lint:clang-tidy-diff"
vars:
FLAGS: &clang_tidy_flags
- "--config-file '{{.ROOT_DIR}}/.clang-tidy'"
- "-p '{{.G_CLP_FFI_JS_BUILD_DIR}}/compile_commands.json'"
- "-p '{{.G_CLP_FFI_JS_LINT_BUILD_DIR}}/compile_commands.json'"
- >-
$(cat "{{.G_CLP_FFI_JS_BUILD_DIR}}/compiler-extra-args.txt" \
$(cat "{{.G_CLP_FFI_JS_LINT_BUILD_DIR}}/compiler-extra-args.txt" \
| tr ' ' '\n' \
| sed 's/^/--extra-arg /' \
| tr '\n' ' ')
Expand Down
Loading