chore: unify pre-commit configuration across repositories - #135
Conversation
Up to standards ✅🟢 Issues
|
|
| hooks: | ||
| - id: ruff-check | ||
| args: [--fix, --unsafe-fixes] | ||
| - id: ruff-format |
There was a problem hiding this comment.
WARNING: Five overlapping auto-fixers now run on the same Python files in one pre-commit pass
ruff-check --fix --unsafe-fixes (line 47), ruff-format (49), pyupgrade (63), autopep8 (68) and isort (74) all mutate the same files. pre-commit aborts the run as soon as a hook rewrites a file, and these tools do not agree by default (autopep8 reformats what ruff-format produced, isort and ruff's I001 rules sort differently), so every commit touching Python can need several manual re-commit rounds and may never settle.
Recommendation: keep a single formatter (ruff-format) plus one import sorter, and move the redundant fixers (autopep8, pyupgrade, isort) to their own opt-in config rather than the canonical shared file.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| - repo: https://github.com/pycqa/flake8 | ||
| rev: "7.4.1" | ||
| hooks: | ||
| - id: flake8 |
There was a problem hiding this comment.
WARNING: flake8 defaults conflict with ruff-format (79 vs 88 columns)
ruff-format formats to a 88-character line length, while flake8 with no arguments and no config file (there is no setup.cfg, tox.ini, or .flake8 in this repository) reports E501 for any line longer than 79 characters. In any repository that contains Python files this makes the newly added flake8 hook fail on code that ruff-format just produced, so the two hooks can never both pass.
Either pin them to the same width, e.g.
- id: flake8
args: [--max-line-length=88]or drop flake8 from the canonical set since ruff-check already covers most of what it reports.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| - repo: https://github.com/sqlfluff/sqlfluff | ||
| rev: "4.3.0" | ||
| hooks: | ||
| - id: sqlfluff-lint |
There was a problem hiding this comment.
WARNING: sqlfluff will error out because no dialect is configured
Neither hook here passes --dialect, and this repository has no .sqlfluff config file. sqlfluff refuses to lint a file without a dialect and exits non-zero with No dialect was specified, so the moment a .sql file is added (and this config is being rolled out fleet-wide, so some of the target repositories do have SQL), both sqlfluff-lint and sqlfluff-fix fail instead of reporting lint violations.
Add a repository-level .sqlfluff, or pass the dialect explicitly:
- id: sqlfluff-lint
args: [--dialect, ansi]Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| rev: "4.3.0" | ||
| hooks: | ||
| - id: sqlfluff-lint | ||
| - id: sqlfluff-fix |
There was a problem hiding this comment.
SUGGESTION: Run sqlfluff-fix before sqlfluff-lint
pre-commit executes hooks in declaration order, so linting happens against the unfixed sources and every violation that the fixer would have resolved still fails the run, forcing an unnecessary re-commit. Swapping the two ids makes the fix land first and the lint pass verify the result.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 4 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (1 files)
Notes and assumptions
Fix these issues in Kilo Cloud Reviewed by free · Input: 53.2K · Output: 14.7K · Cached: 248K |



Summary
Unifies
.pre-commit-config.yamlto the canonical version managed ingvatsal60/.github.The repositories in this account had drifted to 25 different pre-commit configurations, ranging from 8 to 23 hooks each. This change replaces every copy with the canonical superset so all repositories enforce an identical set of checks.
gvatsal60/.githubruff-check,ruff-format,pyupgrade,autopep8,isort,flake8,nbstripout,mypy,actionlint,shfmt,shellcheck,bashate,checkmake,gitleaks,talisman,sqlfluff-lint,sqlfluff-fix,rubocop,tf-fmt,tf-validate,clang-format,eslint,jshint,scss-lint,csslint,fixmyjsand the meta hookcheck-useless-excludesgoogle/yamlfmtv0.21.0is retained for YAML formattingNormalization applied
Only divergent arguments and revisions were normalized. Every hook still runs.
check-yamlnow uses--allow-multiple-documentsso repositories containing multi-document YAML keep passingbashateruns with default argumentssqlfluff-lintandsqlfluff-fixrun with default arguments; dialect-specific configuration belongs in a repository-level.sqlflufffileruff-checkuses--fix --unsafe-fixespretty-format-jsonuses--autofixand excludes*.ipynb;check-jsonexcludes*.ipynbshellcheck-py v0.11.0.1,checkmake v0.3.2,gitleaks v8.30.1Known interactions
ruff-format,autopep8,flake8,ruff-check,pyupgrade,isort) now runs in every repository.ruff-formatandflake8/autopep8can disagree on line length, so the first run may reformat Python files.check-useless-excludeswill report the*.ipynbexcludes as useless in repositories that contain no notebooks.detect-aws-credentialsremains disabled, matching the canonical configuration.Validation
sha256 dc1572904755b412337165b69c9dc8f6b875aa3f0573f9105ec17c699b2424d7)repo,revandhooks, and there are no duplicate repository/id pairsChecklist