ci: add python linters to cover future python code#225
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces Python linting/formatting (ruff) and type-checking (pyright) to ensure embedded (and future) Python code is held to consistent quality standards across local development (Mage), CI, and the devcontainer/editor setup.
Changes:
- Add repository-wide ruff and pyright configurations (
ruff.toml,pyrightconfig.json). - Extend Mage targets to support
mage check python/mage fix pythonand include them incheck all. - Add a dedicated GitHub Actions workflow and update developer docs/devcontainer/VS Code recommendations to support the new Python tooling.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
ruff.toml |
Adds ruff lint/format configuration for Python code. |
pyrightconfig.json |
Adds pyright type-check configuration and exclusions. |
magefiles/magecheckfix/checkfix.go |
Adds check/fix python Mage targets and wires them into existing meta-targets. |
internal/app/azldev/core/sources/render_process.py |
Updates embedded Python script to satisfy new linting/typing expectations (pathlib, typing, lint pragmas). |
docs/developer/reference/coding-standards.md |
Documents the new Python lint/type-check standards and Mage commands. |
docs/developer/how-to/get-started.md |
Adds developer onboarding guidance for installing ruff/pyright. |
.vscode/settings.json |
Adds VS Code Python formatting/linting/type-check settings aligned with ruff/pyright. |
.vscode/extensions.json |
Recommends VS Code extensions for Python linting/type-checking and EditorConfig. |
.github/workflows/python.yml |
Adds CI workflow to run mage check python on PRs, pushes, and schedule. |
.devcontainer/README.md |
Notes Python tooling availability in the devcontainer and installed extensions. |
.devcontainer/Dockerfile.AZL-3.0 |
Installs Python/Node and ruff/pyright in the devcontainer image. |
.devcontainer/devcontainer.json |
Adds Python-related VS Code extensions to devcontainer customization. |
Tonisal-byte
left a comment
There was a problem hiding this comment.
This will be very helpful (painful) for when I add azlpkg to the repo, approved!
| branches: [main] | ||
| workflow_dispatch: | ||
| schedule: | ||
| # Run every night at 3:15am PST (11:15am UTC) |
There was a problem hiding this comment.
Just curious, why do we need the linters to run on as schedule? Is it not enough to have them run on push?
There was a problem hiding this comment.
We have it on the others, but probably don't truly need it. Mostly it catches if the linters themselves change.
No description provided.