-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add Pylint workflow for Python code analysis #3992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| name: Pylint | ||
|
|
||
| on: [push] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [SECURITY] No jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read |
||
| strategy: | ||
| matrix: | ||
| python-version: ["3.8", "3.9", "3.10"] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [BUG] The matrix targets Python versions this project does not support and omits the ones it does. Also, linting is interpreter-independent here — a single version is enough. Align with the rest of the repo: strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]Or drop the matrix entirely and pin one version, as |
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
bmchains marked this conversation as resolved.
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v3 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install pylint | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [GENERAL] Add pylint to |
||
| - name: Analysing the code with pylint | ||
| run: | | ||
| pylint $(git ls-files '*.py') | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [GENERAL] This step will fail on every run, permanently red-flagging the branch. Two independent reasons:
Beyond that, this largely duplicates existing tooling: If pylint is genuinely wanted alongside ruff, it needs a checked-in config plus the project installed, and it should go through the - run: make init
- run: pylint samtranslator bin schema_sourcewith a |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[GENERAL]
on: [push]is inconsistent with every other workflow here and gives the wrong coverage. It fires on pushes to all branches (including personal/scratch branches, burning runner minutes) yet never runs onpull_request, so contributions from forks — the common case for this repo — are never linted. It also omitsmerge_group, whichbuild.yml,codeql.yml, andcheck_compatibility.ymlall declare; without it this check can never be satisfied in the merge queue if it is ever made required.Match the existing pattern: