Repository navigation
Description
Pre-commit formats the code (black, isort with the black profile, shfmt, pretty-format-yaml, actionlint, the old-name check), but nothing enforces it: no workflow runs pre-commit, so a contribution made without the local hooks is not checked, and there is no Python linter at all (CI runs Bandit only).
What a linter finds on main (a53f9cd6cc) with ruff's default rules (E4, E7, E9, F): 63 findings, 25 auto-fixable.
| Rule | Count | Note |
|---|---|---|
| F401 unused import | 22 | e.g. core.py:34 json_bulk_dumps |
| E402 import not at top | 15 | |
| F811 redefinition | 9 | tests/test_bulk_insert.py:249 defines TestInsertManyVertexType a second time, byte-identical to the class at line 151 (a duplicated block); the other 8 are pytest fixture parameters named like the fixture |
| F841 unused variable | 8 | |
| F541 f-string without placeholders | 4 | |
| E731, E741 | 2 each | |
| F821 undefined name | 1 | core.py:1562, the string annotation "VectorIndex" (no import under TYPE_CHECKING) |
Proposal, after the 26.11.1 tag (it touches many files and would conflict with the release pull requests):
- add
ruff checkwith its default rules to pre-commit, fix the 63 findings (keep black and isort as the formatters); - add the basic hygiene hooks (trailing whitespace, end of file, merge-conflict markers, large files, private keys);
- add a CI job that runs
uvx pre-commit run --all-fileson every pull request and push, so the hooks are enforced for every contribution; - keep the line length at 88, Black's default, which already applies to code, and state it in
pyproject.toml; no hard limit on comments and strings (ruff'sE501at 88 would flag 2,904 lines that Black deliberately leaves alone); - say how to install the hooks (
uvx pre-commit install) inCONTRIBUTING.md. - cover every file type, not only Python, and match upstream ArcadeDB where the code shares its style:
| Files | Tool | Width |
|---|---|---|
Java (src/java, native/src/main/java), XML (pom.xml) |
prettier 3.9.10 with prettier-plugin-java 2.11.0 and prettier-plugin-xml, the hook and versions of ArcadeData/arcadedb's .pre-commit-config.yaml |
160, upstream's printWidth |
| Python | black + isort (as today), ruff check | 88 |
| Markdown, JSON | prettier with proseWrap: preserve (prose is not hard-wrapped) |
no limit on prose |
| Shell | shfmt (as today) and shellcheck | |
Dockerfile (scripts/Dockerfile.build) |
hadolint | |
| YAML, TOML | pretty-format-yaml (as today), check-yaml, check-toml |
|
| GitHub Actions | actionlint (as today) | |
| AsciiDoc docs | the Antora build in docs.yml already fails on any warning |
The first run of prettier on the Java and XML files may reformat many lines; it lands as its own commit in the same PR, so the review can skip it.
Edited 2026-11-05: the scope widened from Python to every file type in the repository, with upstream ArcadeDB's Java and XML formatter.
Activity
abhirajadhikary06 commentedon Nov 9, 2026
Hi @tae898! I'd love to take this on and set up the pre-commit checks and Ruff linter integration for the repository.
Here is the plan I can follow to address this:
.pre-commit-config.yamlandpyproject.tomlto runruff check(targeting default rulesetsE4,E7,E9,Fwith line length 88) and resolve the existing 63 findings acrossmain.prettier(Java/XML/Markdown/JSON) and formatters/linters for Shell, Dockerfile, and GitHub Actions as outlined in the proposal.uvx pre-commit run --all-filesonpushandpull_requesttriggers to ensure ongoing enforcement.Let me know if this scope looks good to you, and I can open a PR shortly!
tae898 commentedon Nov 9, 2026
Thank you, that is the plan I had in mind, and it matches the issue: ruff with its default rules (
E4,E7,E9,F) at line length 88, the hygiene hooks, prettier for Java, XML, Markdown and JSON, shellcheck and hadolint, and a CI job that runsuvx pre-commit run --all-fileson every pull request and push. I have assigned the issue to you.One request about timing. Twelve pull requests of mine for
26.11.1.post1are open and touch most of the Python and Java files (type_conversion.py,core.py,graph_batch.py,_native/*,BulkOps.java,NativeExtras.javaand many tests), so the ruff fixes and the first prettier run would conflict with all of them. Please start with the parts that touch no source file: the ruff and line-length settings inpyproject.toml, the pre-commit hook configuration, the CI job andCONTRIBUTING.md. The 63 fixes and the prettier reformat should start frommainafterrelease/26.11.1has been merged into it. I will comment here when that has happened. If the configuration is ready before then, open it as a draft pull request.Two details so that the pull request stays easy to review: keep the prettier reformat of the Java and XML files in its own commit, and keep the ruff fixes in a separate commit from the configuration. Questions are welcome here.
tae898 commentedon Nov 10, 2026
The release line is merged into
main(#351, merge commit6619f13), as I wrote I would tell you here. You can start the parts that touch source files from that commit:mainif it needs it. I will review it first.a53f9cd6cc; the merge brought in many files, so please runuvx ruff checkwith the default rules (E4,E7,E9,F) on the newmainand put the new count in the PR description.Black and isort already report a handful of files on
mainthat the merge did not touch (uvx black==26.10.1 --check .); they belong to the same cleanup, in the formatting commit.Questions are welcome here.
Pre-commit: add ruff and enforce all hooks in CI
Pre-commit: add ruff and enforce all hooks in CI (#343)