GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - marian-code/python-lint-annotate: Zero-configuration GitHub Action to maintain code quality with push and PR annotations.

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
BranchesTags
Open more actions menu
 
 

Latest commit

 

History

223 Commits
223 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.vscode
.vscode
 
 
examples
examples
 
 
matchers
matchers
 
 
static
static
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
action.yml
action.yml
 
 
entrypoint.sh
entrypoint.sh
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

python-lint-annotate

Zero-configuration GitHub Action to maintain code quality with push and PR annotations.

On every push and pull request git diffs will get inline annotated with found errors from selected linters.

Screenshot of annotations

Features

  • Zero configuration based: Add a single line in your CI and done!
  • GitHub Annotations on PR: Highlights issues inline on the PR diff.
  • Most of the popular community trusted linters in one place.
  • Allows to use either a new or existing Python version using use-external-python. See this example.

Linters supported

  • black
  • flake8
  • isort
  • mypy
  • pylint
  • pycodestyle
  • vulture
  • pydocstyle

Usage

Basic:

steps:
  - uses: actions/checkout@v6
  - uses: marian-code/python-lint-annotate@v4

Options:

steps:
  - uses: actions/checkout@v6
  - uses: marian-code/python-lint-annotate@v4
    with:
      python-root-list: "src/ tests/*"  # accepts wildcards
      use-pycodestyle: false
      use-mypy: false
      use-vulture: true
      extra-pylint-options: "--output-format="colorized"
      python-version: "3.10"

Examples

  • Only lint changed files, and ignore missing docstrings

Details

Uses actions/setup-python@v6. Only python 3.10 - 3.14 versions are tested. Python 3.x versions prior to 3.10 are not tested since they are EOL now. Any python 2.x versions are unsupported! You can lint on Linux, Windows and MacOS.

The linter versions are defined in requirements.txt.

IMPORTANT - test environment

The python version is set by actions/setup-python@v6 using composite actions. This means that the the action will change python you might have previously set with actions/setup-python@v6. There are two ways to circumvent this.

  • Keep the lintnig action separated from others
  • Use it at the and of your workflow when the change in python version will not affect anything else

Example:

on:
  push:
  pull_request:
name: Lint Python
jobs:
  lintpython:
    name: Lint Python
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v6
    - uses: actions/setup-python@v6
      with:
        python-version: 3.10
    - run: |
        python --version  # this will output 3.10 now
        run tests or other things using python ...
    - uses: marian-code/python-lint-annotate@v4
      with:
        python-root-list: "./tests/*.py"
        use-black: true
        use-isort: true
        use-mypy: true
        use-pycodestyle: true
        use-pydocstyle: true
        extra-pycodestyle-options: "--max-line-length=88"
        use-pylint: false
        use-flake8: false
        use-vulture: true
        python-version: "3.10"
    - run: |
        python --version  # this will output 3.10 now !!!

License

The scripts and documentation in this project are released under the MIT License

Contributions

Contributions are welcome through PRs.

TODO

Wait until this is resolved: PR646 so we can implement better python version control

About

Zero-configuration GitHub Action to maintain code quality with push and PR annotations.

github.com/marketplace/actions/python-lint-annotate-maintain-code-quality-with-annotated-prs-and-pushes

Topics

actionsannotationscode-qualitycode-quality-analyzergithub-actionslinterlintingpull-requestspython

Resources

Readme
MIT license

Contributing

Contributing
Activity

Stars

24 stars

Watchers

1 watching

Forks

10 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.