[CI]: Add automated linter tool for repo-level rules#22
Conversation
72106fd to
2128925
Compare
cb6ab83 to
a2bbdb6
Compare
|
I don't see any changes to RAMPART002 in this PR for existing files, just additions of missing |
|
Instead of writing a custom linter - have you considered creating custom I asked GHCLI if existing linters can replace this custom tool & then asked for more details about how we'd implement, see output below :-) Plugin file (~40 lines)Registration via pyproject.tomlThe entry point key (RAMPART) must match the prefix of your error codes. Flake8 uses this to route # noqa: RAMPART001 suppression automatically. What you get for free
Trade-off vs. the custom linterThe custom linter in this PR gives you a standalone tool with no flake8 dependency, a purpose-built CLI (check, list, explain subcommands), and full test isolation. The flake8 approach is ~40 lines vs.
|
LOL that's way easier - what the heck Copilot - I said "use existing tools if possible" 🤣 |
http://rampart/pytest_plugin/plugin.py#L244 and a few others have noqa's |
2128925 to
eb26d6e
Compare
a2bbdb6 to
c895536
Compare
|
Closing for prioritization, may revisit |
Description
Add
rampart_lint— a custom AST-based linter that enforces two project coding conventions that ruff cannot check natively:_asyncsuffix (dunders exempt)*(dunders exempt)Architecture
Rules implement a
Ruleprotocol and register concrete AST node types.Suppression follows ruff semantics — same-line
# noqa: RAMPART001or bare# noqa. Codes are declared asexternalin ruff config soRUF100won't flag them.Integration
rampart-linthook runs on rampart filesRAMPART lintstep to lint job; test job now usestestpathsfrompyproject.toml(includes tool tests)pyproject.toml:external,testpaths, pyrightinclude, per-file-ignores for toolsExisting code
Added
# noqa: RAMPART002to 3 pytest hook functions in plugin.py whose signatures are defined by the pytest framework.Breaking changes
None
Checklist
pre-commit run --all-filespasses