diff --git a/CLAUDE.md b/CLAUDE.md index 9adacdc..001cda1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -12,12 +12,15 @@ Plyngent is an LLM chat and agent toolkit (Python 3.14+, PDM-managed). Single-us pdm install # first-time dependency setup pdm sync # sync after pulling changes -pdm run basedpyright . # type checking (basedpyright, "recommended" strictness) -pdm run ruff check . # linting -pdm run ruff format . # formatting -pdm run pytest # tests (pytest-asyncio auto mode) +pdm run ruff check . # linting +pdm run ruff format . # apply formatting +pdm run ruff format --check . # CI: fail if unformatted (do not skip) +pdm run basedpyright . # type checking (basedpyright, "recommended" strictness) +pdm run pytest # tests (pytest-asyncio auto mode) ``` +GitHub Actions runs `ruff check`, `ruff format --check`, `basedpyright`, then `pytest`. Format locally with `pdm run ruff format .` so CI does not fail after publish. + ## Architecture ### Data modeling: `msgspec.Struct` diff --git a/README.md b/README.md index aaa7663..0899fbf 100644 --- a/README.md +++ b/README.md @@ -62,15 +62,17 @@ pdm sync # after pull pdm run plyngent --help ``` -Dev checks: +Dev checks (same order as CI): ```bash -pdm run basedpyright . pdm run ruff check . -pdm run ruff format . +pdm run ruff format --check . # or: pdm run ruff format . to apply +pdm run basedpyright . pdm run pytest ``` +CI fails if sources are not Ruff-formatted (`ruff format --check`). Run `pdm run ruff format .` before push. + ## Basic usage ```bash diff --git a/doc/development-principles.md b/doc/development-principles.md index 96fe01f..4843e51 100644 --- a/doc/development-principles.md +++ b/doc/development-principles.md @@ -45,7 +45,10 @@ Then for every projects, check the dev dependency group where you can find tools Type checking: `pdm run basedpyright .` Linting: `pdm run ruff check .` -Formating: `pdm run ruff format .` +Formatting (apply): `pdm run ruff format .` +Formatting (CI check): `pdm run ruff format --check .` + +CI (`.github/workflows/ci.yml`) runs lint, **format check**, typecheck, then tests. Always run `pdm run ruff format .` before push so `ruff format --check` does not fail on `main` after a release tag has already published.