Skip to content

Add reproducible Python quality checks and CI lint job - #54

Merged
AlexKitipov merged 1 commit into
mainfrom
codex/add-code-quality-configuration
Jun 9, 2026
Merged

Add reproducible Python quality checks and CI lint job#54
AlexKitipov merged 1 commit into
mainfrom
codex/add-code-quality-configuration

Conversation

@AlexKitipov

Copy link
Copy Markdown
Owner

Motivation

  • Make formatting, import ordering and static typing checks reproducible across environments by providing pinned tool configurations and CI enforcement.

Description

  • Add pyproject.toml with Black, isort and mypy settings (Python target, excludes, mypy plugin and selective error suppression).
  • Add .pre-commit-config.yaml with pinned hooks for black, isort, flake8, and mypy to enable local pre-commit enforcement.
  • Add a dedicated lint job to .github/workflows/ci.yml that runs black --check, isort --check-only, flake8 and mypy before the existing backend/frontend jobs.
  • Run isort/black and apply formatting/import fixes to several backend files so the new checks pass (notable files: app/api/v1/links.py, app/api/v1/analytics.py, app/api/v1/users.py, app/models/link.py, app/models/analytics.py, app/models/audit_log.py, app/config.py, app/database/base.py, migrations/versions/0001_initial_schema.py).

Testing

  • Ran formatting and lint checks with python -m black --check app tests migrations && python -m isort --check-only app tests migrations && python -m flake8 app tests migrations --max-line-length=88 --extend-ignore=E203,W503 --exclude=.git,__pycache__,.mypy_cache,.pytest_cache,.venv,build,dist,node_modules && python -m mypy --config-file pyproject.toml and the checks passed after applying formatting and adjusting mypy configuration.
  • Ran python -m pytest and all tests passed (26 passed).
  • Attempted to run python -m pre_commit run --all-files after installing pre-commit, but installation was blocked in this environment due to the package index returning 403, so the pre-commit hooks could not be exercised end-to-end here.

Codex Task

@AlexKitipov
AlexKitipov merged commit 2dc4a38 into main Jun 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant