Skip to content

task lint and task format run tools the project does not enforce #1368

Description

@davidberenstein1957

Running uv run task lint or uv run task format on a clean checkout of master reports roughly 1300 findings and rewrites about 120 files that CI considers perfectly fine. One of the autofixes produces broken code.

Reproduction

git checkout master
uv run pre-commit run --all-files   # all hooks pass
uv run task lint                    # ~1300 findings
uv run task format                  # rewrites ~120 files

Root cause

The two tasks invoke linters the project does not actually use:

lint   = "black --check --diff . && ruff check . && mypy ."
format = "black . && ruff check --fix --exit-non-zero-on-fix ."
  • There is no ruff configuration anywhere in the repository — no [tool.ruff] in pyproject.toml, no ruff.toml, no .ruff.toml. Ruff therefore runs against its own defaults, which have no relationship to the style the codebase is written in.
  • Ruff is not in .pre-commit-config.yaml, and .github/workflows/pre-commit.yml is the only lint job in CI. Ruff has never gated a single commit.
  • mypy . walks the whole monorepo, including carbonserver/ and webapp/, rather than the -m codecarbon scope the existing mypy-check task uses.

The style that is enforced comes from pre-commit: autoflake, isort, black (pinned), and flake8 with .flake8.

Impact

Contributors and coding agents are told by CLAUDE.md and docs/how-to/agent-instructions.md to run these tasks before submitting. Doing so either buries a real change under a repo-wide reformat, or requires manually reverting all of it. Worse, ruff's SIM117 autofix currently rewrites a nested with in tests/test_powermetrics.py into syntactically invalid Python.

Expected

task lint and task format should run what CI runs, and pass on a clean master.

Also in scope

Two adjacent dead entries in the same task table:

  • precommit = "c" — the command is the stray string c.
  • docs-check-drift = "python scripts/check-docs-drift.py" — that script does not exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions