Repository navigation
ci: add prek hooks and lint/test workflows - #10
Merged
Merged
Conversation
Add a pytest dev group, `exclude-newer = "7 days"`, the uv audit preview flag, and ruff/pytest settings. Lock bumps cryptography, pyjwt and urllib3 so that `uv audit` reports no advisories. Assisted-by: ClaudeCode:claude-sonnet-5-5
Import sorting, unused imports, and pyupgrade rewrites (redundant open modes, universal_newlines -> text, class parentheses). The unused `l` in sorter_wrappers keeps its pop() side effect and gets a noqa instead. Assisted-by: ClaudeCode:claude-sonnet-5-5
Mechanical formatting only, in its own commit so it can be skipped in review. Assisted-by: ClaudeCode:claude-sonnet-5-5
Output of the pre-commit-hooks whitespace fixers on the repo's own scripts (MATLAB, shell, slurm). Vendored sorters and preprocess_libs are excluded. Assisted-by: ClaudeCode:claude-sonnet-5-5
Adds .pre-commit-config.yaml (pre-commit-hooks, ruff, gitleaks, zizmor, uv-lock, validate-pyproject), lint and tests workflows with a uv audit job, an import smoke test, and a README Development section. Workflow actions are pinned to commit hashes. Assisted-by: ClaudeCode:claude-sonnet-5-5
Collapses manual from-imports, regex flag aliases and an if with identical arms. Assisted-by: ClaudeCode:claude-sonnet-5-5
Use extend-select with the shared BrainCOGS rule families (A, N, SIM, C4, ...) with commented ignores for findings that would need renames or behavior changes. Require pytest>=9.1.1 and enable strict config/markers, xfail_strict and filterwarnings=error (no third-party warnings needed ignoring). Assisted-by: ClaudeCode:claude-sonnet-5-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Human guided, AI assisted PR (using this skill). AI text below. 🤖
Adds prek/pre-commit hooks and the first GitHub Actions workflows. No Python source files are changed.
Added
.pre-commit-config.yaml:name-tests-test(tests/dbskip.pyexcluded)ruff-check --fixuv-lock.github/workflows/lint.yml: runsuvx prek run --all-files --show-diff-on-failure..github/workflows/tests.yml:uv sync --locked(base deps plus the dev group; the tests don't need the heavypipelineextra). Thedbtests skip without a database, as before.auditjob runninguv audit --lockedover the whole lock.Fixes needed to make the checks pass
ruff.tomltakes precedence overpyproject.toml, so[tool.ruff] line-length = 120in pyproject was never applied. I removed it and set the effective values inruff.toml:line-length = 88andtarget-version = "py312". Behavior is the same. E501 is ignored anyway, so line length only affectsruff format.notebooks/. The 405 existing findings are handled in config only:-> lab.Lab), so removing "unused" imports would break schemas.exclude-newerwindow: urllib3 2.8.0, pyjwt 2.14.0, tornado 6.5.10, and click 8.5.0. The click fix needs dandi 0.76 -> 0.80, which comes in through element-interface in thepipelineextra.tests.yml:cooldown: default-days: 7to the docker Dependabot entry because zizmor'sdependabot-cooldownaudit flags it. The Dependabot PR makes the same change, so whichever merges second should merge cleanly..gitleaksignorelists 8 historicalgeneric-api-keyfalse positives by fingerprint (things likefetch1("KEY", as_dict=True)). Real findings are not allowlisted: the Slack webhooks and a 2021 DB password are handled separately.Likely bugs found (not fixed here)
u19_pipeline/utils/matlab_utils.py:339: F821,current_block_trialis undefined. This raises NameError when the line runs.u19_pipeline/automatic_job/clusters_paths_and_transfers.py:142: B016,raiseof a string literal. This raisesTypeErrorinstead of the intended error.Both are in the per-file ignores with a comment pointing here.
Left out on purpose
Using the hooks locally
Assisted-by: ClaudeCode:claude-opus-5-5