GitHub Action
Python flake8 Lint
This GitHub Action installs the Python flake8 package in an environment with a Python interpreter and executes flake8 stylistic and logical linting of Python source files. flake8 installation and execution defaults can be configured with optional Action settings.
name: flake8 Lint
on: [push, pull_request]
jobs:
flake8-lint:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Check out source repository
uses: actions/checkout@v2
- name: Set up Python environment
uses: actions/setup-python@v1
with:
python-version: "3.8"
- name: flake8 Lint
uses: py-actions/flake8@v1
name: flake8 Lint
on: [push, pull_request]
jobs:
flake8-lint:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Check out source repository
uses: actions/checkout@v2
- name: Set up Python environment
uses: actions/setup-python@v1
with:
python-version: "3.8"
- name: flake8 Lint
uses: py-actions/flake8@v1
with:
ignore: "F401"
exclude: "src/ignoreme.py"
max-line-length: "100"
path: "src"
See the Inputs section below for details on the defaults and optional configuration settings.
Configure the Action with the following optional settings:
Optional flake8 version for testing. Options: ['latest', 'master', '[VERSION NUMBER]'].Default = "latest"
.
- 'latest' = current PyPI release version
- 'master' = current GitLab source repository master branch version
- '[VERSION NUMBER]' = the version number of the flake8 PyPI package (e.g.,
"3.7.9"
)
Optional The path to the Python source file(s) or directory. Default = "."
.
Optional Command line arguments to the flake8 executable. Default = None.
Please note that some command line arguments can be defined with other fields in your configuration. You may combine the args
setting with the other settings below, or use args
to configure flake8 without the other Action settings.
See the inputs below for additional details.
Optional Comma-delimited list of ignored file paths. Default = flake8 default.
Optional Comma-delimited list of ignored flake8 rule codes. Default = flake8 default.
Optional Integer value (as string) representing maximum acceptable line length. Default = flake8 default.
Optional Update pip
before the flake8 install. Options: ["true"
, "false"
]. Default = "false"
.
None
The project is tested against the latest GitHub Actions CI releases of the cPython versions 3.6 - 3.10 and pypy3 interpreters on a nightly basis.