Skip to content

Commit

Permalink
add dedicated pylint and black stage
Browse files Browse the repository at this point in the history
  • Loading branch information
rekup committed Dec 14, 2023
1 parent 781f10e commit 5c0c243
Show file tree
Hide file tree
Showing 4 changed files with 492 additions and 330 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Lint

on: [pull_request]

concurrency:
group: >-
${{ github.workflow }}-${{
github.event.pull_request.number || github.sha
}}
cancel-in-progress: true

jobs:
linter:
name: Run linter
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.10"

- name: Install Python dependencies
run: pip install -r requirements.txt

- name: Run pylint
run: pylint tests plugins

- name: Run black
run: python -m black --check --diff plugins tests
22 changes: 22 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[MESSAGES CONTROL]

disable=
import-error,
no-name-in-module,
wrong-import-position,

[BASIC]

good-names=
ex,
__metaclass__,

[TYPECHECK]

ignored-modules=
_MovedItems,

[IMPORTS]

preferred-modules =
distutils.version:ansible.module_utils.compat.version,
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ pytest = "==7.4.3"
pytest-forked = "==1.6.0"
pytest-xdist = "==3.3.1"
pyyaml = "==6.0.1"
pylint = "==3.0.3"
black = "==23.12.0"
Loading

0 comments on commit 5c0c243

Please sign in to comment.