Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

marian-code/python-lint-annotate

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

Repository files navigation

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 fromselected 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.

Linters supported

Usage

Basic:

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

Options:

steps:  -uses:actions/checkout@v4  -uses:marian-code/python-lint-annotate@v3with:python-root-list:"src/ tests/*"# accepts wildcardsuse-pycodestyle:falseuse-mypy:falseuse-vulture:trueextra-pylint-options:"--output-format="colorized"python-version:"3.8"

Examples

Details

Usesactions/setup-python@v5. Only python3.8 -3.10 versions prior to3.8are not tested since they are EOL now.Any python2.x versions are unsupported! You can lint on Linux, Windows and MacOS.

The lintner versions are:

pycodestyle==2.8.0pydocstyle==6.1.1pylint==2.12.1mypy==0.910black==21.11b1flake8==4.0.1vulture==2.3isort==5.10.1

IMPORTANT - test environment

The python version is set byactions/setup-python@v5 using composite actions. Thismeans that the the action will change python you might have previously set withactions/setup-python@v5. 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 notaffect anything else

Example:

on:push:pull_request:name:Lint Pythonjobs:lintpython:name:Lint Pythonruns-on:ubuntu-lateststeps:    -uses:actions/checkout@v4    -uses:actions/setup-python@v5with:python-version:3.9    -run:|        python --version  # this will output 3.9 now        run tests or other things using python ...    -uses:marian-code/python-lint-annotate@v3with:python-root-list:"./tests/*.py"use-black:trueuse-isort:trueuse-mypy:trueuse-pycodestyle:trueuse-pydocstyle:trueextra-pycodestyle-options:"--max-line-length=88"use-pylint:falseuse-flake8:falseuse-vulture:truepython-version:"3.8"    -run:|        python --version  # this will output 3.8 now !!!

License

The scripts and documentation in this project are released under theMIT License

Contributions

Contributions are welcome through PRs.

TODO

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


[8]ページ先頭

©2009-2025 Movatter.jp