Files
clice/pixi.toml
ykiko 342d82a7aa chore: add CLAUDE.md, clang-tidy, and agent workflow tooling (#419)
## Summary
- Add `.claude/CLAUDE.md` with project guide, C++ coding style,
correction patterns from past AI interactions, and pre-commit/pre-PR
workflows
- Add `.claude/commands/` with `/build`, `/test`, `/format` slash
commands for Claude Code
- Add `.clang-tidy` configuration
- Add `scripts/run_clang_tidy.py` for parallel clang-tidy with progress
reporting (reads CDB, filters to `src/` and `tests/` only)
- Add pixi tasks: `clang-tidy`, `lint-cpp`, `lint-python`, `lint`
- Add `clang-tools` dependency for clang-tidy
- Update `.gitignore` to track `.claude/CLAUDE.md` and
`.claude/commands/`

## Test plan
- [x] `pixi run format` passes
- [x] `pixi run lint-python` passes (ruff check)
- [x] `scripts/run_clang_tidy.py` correctly filters to project files
only

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 19:09:39 +08:00

230 lines
7.2 KiB
TOML

# tombi: format.rules.table-keys-order.disabled = true
[workspace]
name = "clice"
version = "0.1.0"
description = "A next-generation C++ language server for modern C++"
authors = [
"ykiko <ykiko@clice.io>",
"clice contributors <clice@clice.io>",
]
license = "Apache-2.0"
license-file = "LICENSE"
readme = "README.md"
documentation = "https://docs.clice.io/clice/"
repository = "https://github.com/clice-io/clice"
channels = ["conda-forge"]
platforms = ["win-64", "linux-64", "osx-arm64"]
[environments]
default = ["build", "test"]
package = ["build", "test", "package"]
node = ["node"]
format = ["format"]
# ============================================================================== #
# DEPENDENCIES #
# ============================================================================== #
[feature.build.dependencies]
python = ">=3.13"
cmake = ">=3.30"
ninja = "*"
clang = "==20.1.8"
clangxx = "==20.1.8"
lld = "==20.1.8"
llvm-tools = "==20.1.8"
clang-tools = "==20.1.8"
compiler-rt = "==20.1.8"
[feature.build.target.win-64.dependencies]
sccache = "*"
[feature.build.target.linux-64.dependencies]
sysroot_linux-64 = "==2.17"
gcc = "==14.2.0"
gxx = "==14.2.0"
ccache = "*"
[feature.build.target.osx-arm64.dependencies]
ccache = "*"
[feature.build.target.linux-64.activation]
scripts = ["scripts/activate_linux.sh"]
[feature.build.target.win-64.activation]
scripts = ["scripts/activate_asan.bat"]
[feature.test.pypi-dependencies]
pytest = "*"
pytest-asyncio = ">=1.1.0"
pygls = ">=2.0.0"
lsprotocol = ">=2024.0.0"
[feature.package.dependencies]
xz = ">=5.8.1,<6"
[feature.package.tasks.package]
cmd = """
cmake -B build/RelWithDebInfo -G Ninja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain.cmake \
-DCLICE_RELEASE=ON && \
cmake --build build/RelWithDebInfo
"""
# ============================================================================== #
# CMAKE #
# ============================================================================== #
[feature.build.tasks.cmake-config]
args = [
{ arg = "type", default = "RelWithDebInfo" },
{ arg = "ci", default = "OFF" },
{ arg = "extra", default = "" },
]
cmd = """
cmake -B build/{{ type }} -G Ninja \
-DCMAKE_BUILD_TYPE={{ type }} \
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain.cmake \
-DCLICE_ENABLE_TEST=ON \
-DCLICE_CI_ENVIRONMENT={{ ci }} {{extra}} \
"""
[feature.build.tasks.cmake-build]
args = [{ arg = "type", default = "RelWithDebInfo" }]
cmd = "cmake --build build/{{ type }}"
[feature.build.tasks.build]
args = [
{ arg = "type", default = "RelWithDebInfo" },
{ arg = "ci", default = "OFF" },
{ arg = "extra", default = "" },
]
depends-on = [
{ task = "cmake-config", args = ["{{ type }}", "{{ ci }}", "{{extra}}"] },
{ task = "cmake-build", args = ["{{ type }}"] },
]
[feature.build.tasks.clang-tidy]
args = [{ arg = "type", default = "RelWithDebInfo" }]
depends-on = [{ task = "lint-cpp", args = ["{{ type }}"] }]
[feature.build.tasks.unit-test]
args = [{ arg = "type", default = "RelWithDebInfo" }]
cmd = './build/{{ type }}/bin/unit_tests --test-dir="./tests/data"'
[feature.test.tasks.integration-test]
args = [{ arg = "type", default = "RelWithDebInfo" }]
cmd = """
pytest -s --log-cli-level=INFO tests/integration \
--executable=./build/{{ type }}/bin/clice
"""
[feature.test.tasks.smoke-test]
args = [{ arg = "type", default = "RelWithDebInfo" }]
cmd = """
python tests/replay.py tests/smoke/*.jsonl \
--clice=./build/{{ type }}/bin/clice
"""
[feature.test.tasks.test]
args = [{ arg = "type", default = "RelWithDebInfo" }]
depends-on = [
{ task = "unit-test", args = ["{{ type }}"] },
{ task = "integration-test", args = ["{{ type }}"] },
]
# ============================================================================== #
# HELPER TASKS #
# ============================================================================== #
[tasks.build-llvm]
cmd = ["python3", "scripts/build-llvm.py"]
[tasks.upload-llvm]
args = ["workflow_id", "llvm_version", { "arg" = "branch", default = "main" }]
cmd = """
gh workflow run upload-llvm.yml \
--ref {{ branch }} \
--field workflow_id={{workflow_id}} \
--field version={{llvm_version}}
"""
[tasks.delete-artifacts]
args = ["file_name"]
cmd = ["scripts/delete-artifacts.bash", "{{ file_name }}"]
# ============================================================================== #
# DOCS & VSCODE EXTENSION #
# ============================================================================== #
[feature.node.dependencies]
nodejs = ">=20"
pnpm = "*"
[feature.node.tasks]
build-docs = { cwd = "docs", cmd = "pnpm run docs:build", depends-on = ["install-docs"] }
preview-docs = { cwd = "docs", cmd = "pnpm run docs:preview", depends-on = ["install-docs"] }
build-vscode = { cwd = "editors/vscode", cmd = "pnpm run package", depends-on = ["install-vscode"] }
publish-vscode = { cwd = "editors/vscode", cmd = "pnpm run publish", depends-on = ["install-vscode"] }
[feature.node.tasks.install-docs]
cwd = "docs"
cmd = "pnpm install"
inputs = ["docs/package.json", "docs/pnpm-lock.yaml"]
outputs = ["docs/node_modules/.modules.yaml"]
[feature.node.tasks.install-vscode]
cwd = "editors/vscode"
cmd = "pnpm install"
inputs = ["editors/vscode/package.json", "editors/vscode/pnpm-lock.yaml"]
outputs = ["editors/vscode/node_modules/.modules.yaml"]
# ============================================================================== #
# FORMAT #
# ============================================================================== #
[feature.format.dependencies]
ruff = "*"
tombi = "*"
stylua = "*"
fd-find = "*"
prettier = "*"
clang-format = "==21.1.7"
[feature.format.tasks]
format-cpp = "fd -H -e cpp -e h -e cc -e hpp -e cppm -x clang-format -i"
format-python = "ruff format ."
format-lua = "stylua ."
format-web = "fd -H -e js -e ts -e css -x prettier --write"
format-markdown = "fd -H -e md -x prettier --write"
format-json = "fd -H -e json -E package-lock.json -x prettier --write"
format-toml = "fd -H -e toml -x tombi format"
format-yaml = """
fd -H -e yaml -e yml -E pnpm-lock.yaml -x prettier --write && \
fd -H "^\\.clang-(format|tidy)$" -x prettier --write --parser yaml
"""
format = { depends-on = [
"format-cpp",
"format-python",
"format-lua",
"format-web",
"format-markdown",
"format-json",
"format-toml",
"format-yaml"
] }
# ============================================================================== #
# LINT #
# ============================================================================== #
[feature.format.tasks.lint-python]
cmd = "ruff check ."
[feature.build.tasks.lint-cpp]
args = [{ arg = "type", default = "RelWithDebInfo" }]
cmd = "python scripts/run_clang_tidy.py build/{{ type }}"
[feature.build.tasks.lint]
args = [{ arg = "type", default = "RelWithDebInfo" }]
depends-on = [
"lint-python",
{ task = "lint-cpp", args = ["{{ type }}"] },
]