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
58 changes: 58 additions & 0 deletions .github/workflows/python_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: python linting

on:
workflow_call:
inputs:
python_version:
required: true
type: string

jobs:
python_linting:
name: python linting
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python_version }}

- name: flake8
uses: py-actions/flake8@v2
with:
ignore: "E501"

- name: Install pylint and yapf
run: |
pip install --upgrade pip
pip install pylint yapf
if test -e requirements.txt; then
pip install -r requirements.txt
fi

# This is an opinionated list of disabled warnings.
# It potentially makes sense to eventually remove
# this in favor of a per-project configuration but
# a lot of these will be useless in most projects
# that will take advantage of this workflow.

# C0114: missing-module-docstring
# C0115: missing-class-docstring
# C0116: missing-function-docstring
# C0301: line-too-long
# C0302: too-many-lines
# R0902: too-many-instance-attributes
# R0903: too-few-public-methods
# R0911: too-many-returns
# R0912: too-many-branches
# R0913: too-many-arguments
# R0914: too-many-locals
# R0915: too-many-statements
- name: pylint
run: pylint --disable C0114,C0115,C0116,C0301,C0302,R0902,R0903,R0911,R0912,R0913,R0914,R0915 --jobs $(nproc) $(git ls-files '*.py')

- name: yapf
run: yapf --diff --recursive $GITHUB_WORKSPACE
14 changes: 0 additions & 14 deletions .github/workflows/yapf.yml

This file was deleted.