Skip to content

feat: make lint-fix target + working lint-autofix workflow (split 5/6 of #125)#134

Merged
cryptoxdog merged 3 commits into
mainfrom
feat/lint-autofix-workflow
Jul 23, 2026
Merged

feat: make lint-fix target + working lint-autofix workflow (split 5/6 of #125)#134
cryptoxdog merged 3 commits into
mainfrom
feat/lint-autofix-workflow

Conversation

@cryptoxdog

Copy link
Copy Markdown
Collaborator

Summary

Makefile and automation improvements extracted from #125 (commits 77c5dd4 and 9cd837d).

Changes

  • Makefile: make lint now matches CI's blocking gate (check-only: ruff check, ruff format --check, mypy engine/); new make lint-fix target performs the mutations
  • Removes .github/workflows/auto-fix-adr.yml — it depended on ci/auto_fix_adr.py and ci/check_imports.py, neither of which exists in this repo, so it failed on every run
  • Adds .github/workflows/lint-autofix.yml — runs Ruff autofix on push to develop or on demand, and opens a PR with the results (never pushes directly to a protected branch; contents: read + PR-based flow)
  • docs/CI_PIPELINE.md: documents the new workflow

Verification

  • Workflow YAML parses cleanly
  • No direct-push-to-protected-branch behavior; fixes land via PR only

See #130 for the full split-series map replacing #125.

@cursor

cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Too Many Files Changed
Changed: 80 files
Limit: 50 files
Action Required: Split into multiple focused PRs

PR Too Large
Lines changed: 1687
Limit: 1000 lines
Action Required: Break into smaller, atomic PRs

📋 Best Practices for Large Changes

  1. Refactoring + Features: Separate into 2 PRs
  2. Multiple Features: One PR per feature
  3. Database + Code: Separate migration from logic
  4. Generated Code: Separate from manual changes

🚫 This PR is blocked from merging until size limits are met.

cursoragent and others added 3 commits July 22, 2026 21:18
AGENTS.md, .cursorrules, and docs/CI_PIPELINE.md all document and
instruct agents/contributors to run `make lint-fix` to autofix lint
failures, and describe `make lint` as the check-only ruff+mypy gate
that mirrors CI. Neither existed: the Makefile only had a `lint` target
that already mutated the tree via `ruff check . --fix` + `ruff format .`
and never ran mypy, so it did not actually match what CI enforces, and
`make lint-fix` didn't exist at all.

- `make lint` now runs `ruff check .` (no --fix) + `ruff format --check .`
  + `mypy engine/` -- the same non-mutating checks CI runs, so a clean
  `make lint` locally is a reliable predictor of a passing CI lint job.
- `make lint-fix` is the new autofix entry point: `ruff check . --fix`
  + `ruff format .` (matches the long-documented but missing command).
- `make check` (full local gate) keeps its previous autofix-then-verify
  behavior for convenience, just relabeled for clarity.

Co-authored-by: Igor Beylin <cryptoxdog@users.noreply.github.com>
(cherry picked from commit 77c5dd4)
…workflow

.github/workflows/auto-fix-adr.yml (triggered on push to develop /
workflow_dispatch) called `python ci/auto_fix_adr.py` and
`python ci/check_imports.py`, but the ci/ directory does not exist
anywhere in this repo, so the workflow could never run successfully.

Ruff already mechanically enforces (and can --fix) the same class of
issues that workflow targeted: sorted __all__ (RUF022), Optional[T] ->
T | None (UP045), datetime.now() -> datetime.now(UTC) (UP017/DTZ003),
zip(strict=True) (B905), unused/unsorted imports (F401/I001), etc. --
see [tool.ruff.lint] in pyproject.toml.

Add .github/workflows/lint-autofix.yml: same trigger/safety model
(develop push + workflow_dispatch, never pushes directly to a
protected branch, opens a PR via peter-evans/create-pull-request
instead), but running `ruff check . --fix` + `ruff format .`, with a
syntax-validation step and a check that ruff has no remaining
autofixable violations before opening the PR. Skips opening a PR when
there is nothing to fix.

Document both the new workflow and `make lint-fix` as the two ways to
autofix lint violations in docs/CI_PIPELINE.md.

Co-authored-by: Igor Beylin <cryptoxdog@users.noreply.github.com>
(cherry picked from commit 9cd837d)
…issions

- on.push.branches, checkout ref, and PR base changed develop -> main:
  this repository has no develop branch, so the workflow could never
  fire and its checkout/PR base would have failed if it did.
- permissions.contents: read -> write: peter-evans/create-pull-request
  must push the autofix branch, which requires contents: write per the
  action's documentation (pull-requests: write alone is insufficient).
- Documented the GITHUB_TOKEN limitation: PRs created with the default
  token do not trigger push/pull_request workflows; a GitHub App token
  or PAT secret is needed if autofix PRs must run the normal CI suite.
@cryptoxdog
cryptoxdog force-pushed the feat/lint-autofix-workflow branch from 836d0d0 to 3c9c400 Compare July 22, 2026 21:20
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

💡 Need a hand with PR review? Try Gitar by Sonar!

@cryptoxdog
cryptoxdog changed the base branch from main to fix/pytest-config July 22, 2026 21:21
@cryptoxdog
cryptoxdog changed the base branch from fix/pytest-config to main July 23, 2026 00:52
@cryptoxdog
cryptoxdog merged commit 95b59ff into main Jul 23, 2026
10 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants