Skip to content

Commit

Permalink
Replace pylint with more flake8 plugins (#337)
Browse files Browse the repository at this point in the history
Following fatiando/harmonica#285, replace pylint with a bunch of new flake8
plugins. They cover most of the checks that were performed before, add a few
new ones, and are less troublesome to maintain and silence when necessary.
Fixes the formatting issues raised after applying the changes: making
tutorials/examples fit 79 char comments/docstrings, silence a few issues
because of scikit-learn style code, reorder imports because of isort. I also
combined the CI checks into only 2: "format" and "style". If formatting is
broken, we don't need to know which one is complaining, just run make format.
And style is now only flake8 anyway.
  • Loading branch information
leouieda authored Dec 14, 2021
1 parent ab83074 commit a39215a
Show file tree
Hide file tree
Showing 77 changed files with 989 additions and 1,382 deletions.
10 changes: 0 additions & 10 deletions .flake8

This file was deleted.

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
Loading

0 comments on commit a39215a

Please sign in to comment.