paper-dynasty-discord/ruff.toml
Cal Corum bf7a8f8394
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m39s
Ruff Lint / lint (pull_request) Successful in 1m42s
fix: tighten ruff.toml + add CI lint step (#108)
- Remove global F841/F401 suppression; scope to legacy directories via
  per-file-ignores so new files outside those paths get full enforcement
- Add per-file-ignores covering all 26 pre-existing violations that
  currently block the pre-commit hook (E711/E713/E721/E722/F811/F821)
- Keep global ignores only for genuine project patterns:
  F403/F405 (star imports in __init__.py), E712 (SQLModel ORM ==),
  F541 (1000+ legacy f-strings, cosmetic, deferred cleanup)
- Add .gitea/workflows/ruff-lint.yml — ruff check on every PR to main,
  so violations are caught before merge even if hook was bypassed

Closes #108

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 01:37:24 -05:00

38 lines
1.6 KiB
TOML

# Ruff configuration for paper-dynasty discord bot
# See https://docs.astral.sh/ruff/configuration/
[lint]
# Rules suppressed globally because they reflect intentional project patterns:
# F403/F405: star imports — __init__.py files use `from .module import *` for re-exports
# E712: SQLAlchemy/SQLModel ORM comparisons require == syntax (not `is`)
# F541: f-strings without placeholders — 1000+ legacy occurrences; cosmetic, deferred
ignore = ["F403", "F405", "F541", "E712"]
# Per-file suppressions for pre-existing violations in legacy code.
# New files outside these paths get the full rule set.
# Remove entries here as files are cleaned up.
[lint.per-file-ignores]
# Core cogs — F841/F401 widespread; E711/E713/F811 pre-existing
"cogs/**" = ["F841", "F401", "E711", "E713", "F811"]
# Game engine — F841/F401 widespread; E722/F811 pre-existing bare-excepts and redefinitions
"in_game/**" = ["F841", "F401", "E722", "F811"]
# Helpers — F841/F401 widespread; E721/E722 pre-existing type-comparison and bare-excepts
"helpers/**" = ["F841", "F401", "E721", "E722"]
# Game logic and commands
"command_logic/**" = ["F841", "F401"]
# Test suite — E711/F811/F821 pre-existing test assertion patterns
"tests/**" = ["F841", "F401", "E711", "F811", "F821"]
# Utilities
"utilities/**" = ["F841", "F401"]
# Migrations
"migrations/**" = ["F401"]
# Top-level legacy files
"db_calls_gameplay.py" = ["F841", "F401"]
"gauntlets.py" = ["F841", "F401"]
"dice.py" = ["F841", "E711"]
"manual_pack_distribution.py" = ["F841"]
"play_lock.py" = ["F821"]
"paperdynasty.py" = ["F401"]
"api_calls.py" = ["F401"]
"health_server.py" = ["F401"]