Skip to content

fix: ensure agents run ruff lint before every commit #156

@ohld

Description

@ohld

Problem

PR #155 CI failed because src/tgbot/handlers/stats/wrapped.py wasn't formatted with ruff. This file was modified by agent commits on production (stats performance fixes 9eec311, 6ddfc95, etc.) that skipped ruff format.

Root cause: Agent workflows (CTO, Release Engineer) don't enforce just lint before committing.

Expected behavior

Every commit from agents should pass ruff check src/ tests/ and ruff format --check src/ tests/ before pushing.

Proposed fix

Options (pick one or combine):

  1. Add just lint to agent AGENTS.md instructions — CTO and Release Engineer instructions should include "always run just lint before committing"
  2. Add a pre-commit hook.pre-commit-config.yaml with ruff check + format, so it's impossible to commit unformatted code
  3. Add lint step to deploy.sh — run lint check before allowing push

Option 2 (pre-commit hook) is the most robust since it can't be skipped accidentally.

Files to check

  • agents/cto/AGENTS.md — add lint instruction
  • agents/release-engineer/AGENTS.md — add lint instruction
  • Consider: .pre-commit-config.yaml for automated enforcement

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions