Skip to content

Commit

Permalink
Merge pull request #84 from redhatrises/add_py_linting
Browse files Browse the repository at this point in the history
Add Python linting for modules
  • Loading branch information
carlosmmatos committed Dec 20, 2021
2 parents 05320ce + 31a9e10 commit 81673d4
Show file tree
Hide file tree
Showing 7 changed files with 697 additions and 29 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
ignore = E501,E402
61 changes: 61 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Python Lint

on:
push:
paths:
- 'plugins/**'
- '.github/workflows/linting.yml'

pull_request:
paths:
- 'plugins/**'
- '.github/workflows/linting.yml'

jobs:
flake8:
runs-on: ubuntu-latest
env:
PY_COLORS: 1
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8
- name: Lint with flake8
run:
flake8 ./plugins/

pylint:
runs-on: ubuntu-latest
env:
PY_COLORS: 1
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pylint
- name: Lint with pylint
run: |
pylint ./plugins/
bandit:
runs-on: ubuntu-latest
env:
PY_COLORS: 1
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install bandit
- name: Lint with bandit
run: |
bandit -l -i -r ./plugins/
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
*.tar.gz

*DS_Store
*.swp
Loading

0 comments on commit 81673d4

Please sign in to comment.