Skip to content

feat(ci): add pylint workflow#1

Closed
sysfox wants to merge 4 commits intojsshmzx:mainfrom
sysfox:main
Closed

feat(ci): add pylint workflow#1
sysfox wants to merge 4 commits intojsshmzx:mainfrom
sysfox:main

Conversation

@sysfox
Copy link
Member

@sysfox sysfox commented Feb 14, 2026

Summary by CodeRabbit

  • Chores
    • Added automated linting that runs on pushes and pull requests to main, validating Python code across multiple interpreter versions (3.10, 3.12, 3.14) to help maintain code quality and catch issues earlier in the workflow.

Copilot AI review requested due to automatic review settings February 14, 2026 11:03
@coderabbitai
Copy link

coderabbitai bot commented Feb 14, 2026

Warning

Rate limit exceeded

@sysfox has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 25 minutes and 41 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

Adds a new GitHub Actions workflow that runs pylint on push and pull requests against main across Python 3.10, 3.12, and 3.14, setting up Python, upgrading pip, installing pylint, and linting all tracked Python files.

Changes

Cohort / File(s) Summary
CI/CD Workflow Configuration
​.github/workflows/pylint.yml
Adds a workflow named "Pylint" triggered on push and PRs to main; runs on ubuntu-latest with a Python matrix (3.10, 3.12, 3.14), checks out the repo, sets up Python, upgrades pip, installs pylint, and runs pylint on tracked Python files.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 I hopped and sniffed the code today,

A linting trail to clear the way,
On pushes now I peer and pry,
Polishing Python as I sky-hop by ✨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(ci): add pylint workflow' accurately describes the main change—adding a GitHub Actions workflow for pylint linting.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new GitHub Actions workflow to run pylint as part of CI, complementing the existing Docker build/syntax checks.

Changes:

  • Introduces .github/workflows/pylint.yml workflow to run pylint on tracked *.py files.
  • Runs the workflow across a Python version matrix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/pylint.yml:
- Line 14: The workflow currently pins the GitHub Action as "uses:
actions/setup-python@v3", which relies on a deprecated Node.js runtime; update
that reference to "uses: actions/setup-python@v6" so the workflow uses the
supported runtime and future-proof the CI; locate the uses line (e.g., the entry
containing actions/setup-python@v3) and replace the version tag from v3 to v6,
then run the workflow linter/CI to confirm no other compatibility changes are
required.
🧹 Nitpick comments (3)
.github/workflows/pylint.yml (3)

3-3: Consider scoping the trigger and adding pull_request.

Running on every push to every branch can be noisy. Consider restricting to specific branches and adding pull_request so contributors get lint feedback before merge:

Suggested change
-on: [push]
+on:
+  push:
+    branches: [main]
+  pull_request:
+    branches: [main]

17-20: Install project dependencies to avoid false-positive import errors.

Only pylint is installed. If the project has a requirements.txt or pyproject.toml, pylint will report import-error for every third-party dependency. Consider installing project deps as well:

Suggested addition
     - name: Install dependencies
       run: |
         python -m pip install --upgrade pip
         pip install pylint
+        if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

21-23: pylint will fail if no .py files are tracked.

If the repo has no tracked Python files, git ls-files '*.py' expands to nothing and pylint exits with an error. A small guard helps:

Suggested fix
     - name: Analysing the code with pylint
       run: |
-        pylint $(git ls-files '*.py')
+        FILES=$(git ls-files '*.py')
+        if [ -n "$FILES" ]; then pylint $FILES; fi

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

actions/setup-python latest version GitHub 2025 2026

💡 Result:

As of February 14, 2026, the latest release of actions/setup-python is v6.2.0 (released January 22, 2026). [1]

Recommended usage in workflows:

  • Track the latest v6: uses: actions/setup-python@v6 [2]
  • Or pin to the latest specific release: uses: actions/setup-python@v6.2.0 [1]

Sources: [1] https://github.com/actions/setup-python/releases, [2] https://github.com/actions/setup-python


Upgrade actions/setup-python to v6.

actions/setup-python@v3 uses a deprecated Node.js runtime and will stop working on GitHub Actions. The latest version is v6, which you should use instead.

Suggested fix
-      uses: actions/setup-python@v3
+      uses: actions/setup-python@v6
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uses: actions/setup-python@v3
uses: actions/setup-python@v6
🧰 Tools
🪛 actionlint (1.7.10)

[error] 14-14: the runner of "actions/setup-python@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
In @.github/workflows/pylint.yml at line 14, The workflow currently pins the
GitHub Action as "uses: actions/setup-python@v3", which relies on a deprecated
Node.js runtime; update that reference to "uses: actions/setup-python@v6" so the
workflow uses the supported runtime and future-proof the CI; locate the uses
line (e.g., the entry containing actions/setup-python@v3) and replace the
version tag from v3 to v6, then run the workflow linter/CI to confirm no other
compatibility changes are required.

sysfox and others added 3 commits February 14, 2026 20:17
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sysfox sysfox closed this Feb 14, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @.github/workflows/pylint.yml:
- Around line 25-27: The pylint step named "Analysing the code with pylint"
currently runs "pylint $(git ls-files '*.py')" which fails when no .py files are
tracked; change the step to first capture the file list from "git ls-files
'*.py'" into a variable, test if that variable is non-empty, and only invoke
pylint with that list when non-empty (otherwise print a message and exit
success). Update the run block so it conditionally calls pylint with the
gathered filenames instead of invoking pylint with zero arguments.
- Around line 21-24: The "Install dependencies" step currently only installs
pylint which causes E0401 import errors; update that step (named "Install
dependencies") to install the project's dependencies before installing pylint —
e.g. run python -m pip install --upgrade pip then install project deps (python
-m pip install -r requirements.txt, or if you use pyproject/poetry use python -m
pip install . or pip install -e . / poetry install) and only after that install
pylint so pylint can resolve third-party imports.

Comment on lines +25 to +27
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

pylint will fail if no .py files are tracked.

If the repo has no tracked Python files, git ls-files '*.py' expands to nothing and pylint (invoked with zero arguments) exits non-zero, failing the build. A simple guard avoids this:

Suggested fix
       - name: Analysing the code with pylint
         run: |
-          pylint $(git ls-files '*.py')
+          FILES=$(git ls-files '*.py')
+          if [ -n "$FILES" ]; then pylint $FILES; fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
- name: Analysing the code with pylint
run: |
FILES=$(git ls-files '*.py')
if [ -n "$FILES" ]; then pylint $FILES; fi
🤖 Prompt for AI Agents
In @.github/workflows/pylint.yml around lines 25 - 27, The pylint step named
"Analysing the code with pylint" currently runs "pylint $(git ls-files '*.py')"
which fails when no .py files are tracked; change the step to first capture the
file list from "git ls-files '*.py'" into a variable, test if that variable is
non-empty, and only invoke pylint with that list when non-empty (otherwise print
a message and exit success). Update the run block so it conditionally calls
pylint with the gathered filenames instead of invoking pylint with zero
arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant