Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/all-lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ jobs:
use-check-manifest: false
use-pyroma: false
extra-rstcheck-options: "-r"
docformatter-version: "==1.5.0"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Container image that runs your code
FROM weibullguy/python-lint-image:1.10.0
FROM python:3.10-alpine3.16

# Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh
Expand Down
52 changes: 44 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@ recommended that the tools you use in this action be used in-line with your
editor or IDE and/or as pre-commit hooks. This action just verifies you didn't
forget to do that.

However, you could choose to have fixes applied by each tool. If you do, it's
recommended that the autoformatters come first, followed by the style checking
tools to verify the autoformatter results. After this, the type checkers and
linters can be run.

All tools are enabled by default with the exception of black and yapf. It's
certainly your prerogative to use as many autoformatters as you'd like, but I
recommend using only one. Which you choose should be enabled with the
use-black or use-yapf input.

Each run of the action creates a virtual environment. Each of the enabled
tools is installed in this virtual environment before that tool is executed.
The default name of the virtual environment is ```python-lint-plus```, but you
can set it to whatever you'd like with the ```virtual-env``` option.
This can be helpful if your running a matrix of various versions of python.

## Usage

See [action.yml](action.yml)
Expand All @@ -61,21 +62,37 @@ steps:
- uses: weibullguy/python-lint-plus@master
with:
python-root-list: "tests"
virtual-env: "python-lint-plus"
use-black: false
black-version:
use-yapf: false
yapf-version:
use-isort: false
isort-version:
use-docformatter: false
docformatter-version:
use-pycodestyle: false
pycodestyle-version:
use-autopep8: false
autopep8-version:
use-pydocstyle: false
pydocstyle-version:
use-mypy: false
mypy-version:
use-pylint: false
pylint-version:
use-flake8: false
flake8-version:
use-mccabe: false
mccabe-version:
use-radon: false
radon-version:
use-rstcheck: false
rstcheck-version:
use-check-manifest: false
check-manifest-version:
use-pyroma: false
pyroma-version:
extra-black-options: ""
extra-yapf-options: ""
extra-isort-options: ""
Expand Down Expand Up @@ -136,17 +153,36 @@ steps:
- uses: actions/checkout@v2
- uses: weibullguy/python-lint-plus@master
with:
python-root-list: "python_alelo tests"
python-root-list: "tests"
virtual-environment: "python-lint-plus"
use-radon: true
extra-radon-options: "cc -s"
```

To run multiple radon checks, you'll need to add a step for each in your
workflow file.

## Versions used
## Tool Versions Used

To identify the version used you must consult the [CHANGELOG.md](https://github.com/weibullguy/python-lint-image/blob/master/CHANGELOG.md) of the image used in the [Dockerfile](Dockerfile).
If the version input is left unset, the action will use the latest version of
the tool available on PyPi. In the following example action.yml, the
docformatter version used will be 1.5.0, the isort version used will be the
latest available on PyPi, and the pydocstyle version used will be the latest
available on PyPi with a version number greater than or equal to 6.1.0.

```yml
steps:
- uses: actions/checkout@v2
- uses: weibullguy/python-lint-plus@master
with:
python-root-list: "tests"
virtual-env: "python-lint-plus"
use-docformatter: true
docformatter-version: "==1.5.0"
use-isort: true
use-pydocstyle: true
pydocstyle-version: ">=6.1.0"
```

## License

Expand Down
80 changes: 80 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,130 @@ inputs:
description: "A list of all paths to test"
required: false
default: "."
virtual-env:
description: "The name of the virtual environment to use for running the tools"
required: false
default: "python-lint-plus"
use-black:
description: "Use Black"
required: false
default: false
black-version:
description: "The version of black to use"
required: false
default: ""
use-yapf:
description: "Use yapf"
required: false
default: false
yapf-version:
description: "The version of yapf to use"
required: false
default: ""
use-isort:
description: "Use isort"
required: false
default: true
isort-version:
description: "The version of isort to use"
required: false
default: ""
use-docformatter:
description: "Use docformatter"
required: false
default: true
docformatter-version:
description: "The version of docformatter to use"
required: false
default: ""
use-pycodestyle:
description: "Use pycodestyle"
required: false
default: true
pycodestyle-version:
description: "The version of pycodestyle to use"
required: false
default: ""
use-autopep8:
description: "Use autopep8"
required: false
default: false
autopep8-version:
description: "The version of autope8 to use"
required: false
default: ""
use-pydocstyle:
description: "Use pydocstyle"
required: false
default: true
pydocstyle-version:
description: "The version of pydocstyle to use"
required: false
default: ""
use-mypy:
description: "Use mypy"
required: false
default: true
mypy-version:
description: "The version of mypy to use"
required: false
default: ""
use-pylint:
description: "Use Pylint"
required: false
default: true
pylint-version:
description: "The version of pylint to use"
required: false
default: ""
use-flake8:
description: "Use Flake8"
required: false
default: true
flake8-version:
description: "The version of flake8 to use"
required: false
default: ""
use-mccabe:
description: "Use mccabe"
required: false
default: false
mccabe-version:
description: "The version of mccabe to use"
required: false
default: ""
use-radon:
description: "Use radon"
required: false
default: false
radon-version:
description: "The version of radon to use"
required: false
default: ""
use-rstcheck:
description: "Use rstcheck"
required: false
default: true
rstcheck-version:
description: "The version of rstcheck to use"
required: false
default: ""
use-check-manifest:
description: "Use check-manifest"
required: false
default: true
check-manifest-version:
description: "The version of check-manifest to use"
required: false
default: ""
use-pyroma:
description: "Use pyroma"
required: false
default: true
pyroma-version:
description: "The version of pyroma to use"
required: false
default: ""
extra-black-options:
description: "Extra options: black --check $(extra-black-options) $(python-root-list)"
required: false
Expand Down Expand Up @@ -131,21 +195,37 @@ runs:
image: "Dockerfile"
args:
- ${{ inputs.python-root-list }}
- ${{ inputs.virtual-env }}
- ${{ inputs.use-black }}
- ${{ inputs.black-version }}
- ${{ inputs.use-yapf }}
- ${{ inputs.yapf-version }}
- ${{ inputs.use-isort }}
- ${{ inputs.isort-version }}
- ${{ inputs.use-docformatter }}
- ${{ inputs.docformatter-version }}
- ${{ inputs.use-pycodestyle }}
- ${{ inputs.pycodestyle-version }}
- ${{ inputs.use-autopep8 }}
- ${{ inputs.autopep8-version }}
- ${{ inputs.use-pydocstyle }}
- ${{ inputs.pydocstyle-version }}
- ${{ inputs.use-mypy }}
- ${{ inputs.mypy-version }}
- ${{ inputs.use-pylint }}
- ${{ inputs.pylint-version }}
- ${{ inputs.use-flake8 }}
- ${{ inputs.flake8-version }}
- ${{ inputs.use-mccabe }}
- ${{ inputs.mccabe-version }}
- ${{ inputs.use-radon }}
- ${{ inputs.radon-version }}
- ${{ inputs.use-rstcheck }}
- ${{ inputs.rstcheck-version }}
- ${{ inputs.use-check-manifest }}
- ${{ inputs.check-manifest-version }}
- ${{ inputs.use-pyroma }}
- ${{ inputs.pyroma-version }}
- ${{ inputs.extra-black-options }}
- ${{ inputs.extra-yapf-options }}
- ${{ inputs.extra-isort-options }}
Expand Down
Loading