You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enforce pre-commit in CI and add a linter (ruff defaults: 63 findings on main); line length stays 88 #270
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:34json_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 check with 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-files on 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's E501 at 88 would flag 2,904 lines that Black deliberately leaves alone);
say how to install the hooks (uvx pre-commit install) in CONTRIBUTING.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)
Activity