Skip to content

Commit

Permalink
Concentrate CI checks to "format" and "style"
Browse files Browse the repository at this point in the history
  • Loading branch information
leouieda committed Dec 14, 2021
1 parent 4bf7db3 commit 523bb7e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 58 deletions.
60 changes: 6 additions & 54 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# token stolen if the Action is compromised. See the comments and links here:
# https://github.com/pypa/gh-action-pypi-publish/issues/27
#
name: code-style
name: checks

# Only build PRs and the main branch. Pushes to branches will only be built
# when a PR is opened.
Expand All @@ -16,8 +16,7 @@ on:

###############################################################################
jobs:
black:
name: black [format]
format:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -28,7 +27,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "3.10"

- name: Install requirements
run: python -m pip install -r env/requirements-style.txt
Expand All @@ -37,10 +36,9 @@ jobs:
run: python -m pip freeze

- name: Check code format
run: make black-check
run: make black-check isort-check license-check

flake8:
name: flake8 [style]
style:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -51,7 +49,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "3.10"

- name: Install requirements
run: python -m pip install -r env/requirements-style.txt
Expand All @@ -61,49 +59,3 @@ jobs:

- name: Check code style
run: make flake8

pylint:
name: pylint [style]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Install requirements
run: python -m pip install -r env/requirements-style.txt

- name: List installed packages
run: python -m pip freeze

- name: Linting
run: make lint

license:
name: license [format]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Install requirements
run: python -m pip install -r env/requirements-style.txt

- name: List installed packages
run: python -m pip freeze

- name: Check license notice on all source files
run: make license-check
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test:

format: license isort black

check: black-check isort-check flake8 license-check
check: black-check isort-check license-check flake8

black:
black $(CHECK_STYLE)
Expand Down
14 changes: 11 additions & 3 deletions env/requirements-style.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
black>=20.8b1
pylint==2.4.*
flake8
black
pathspec
isort
flake8
flake8-bugbear
flake8-builtins
flake8-functions
flake8-mutable
flake8-rst-docstrings
flake8-simplify
flake8-unused-arguments
pep8-naming

0 comments on commit 523bb7e

Please sign in to comment.