-
Notifications
You must be signed in to change notification settings - Fork 173
[INF] simplify a bit linting, use pre-commit as CI linting checker #892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ericmjl
merged 9 commits into
pyjanitor-devs:dev
from
Zeroto521:simplify-code-checks.yml
Sep 4, 2021
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
57c979a
[INF] simplify a bit linting
Zeroto521 f876e73
Update CHANGELOG.md
Zeroto521 cdd5af9
Merge branch 'dev' into simplify-code-checks.yml
Zeroto521 729a96b
should be `--config` not `-c`
Zeroto521 365422d
remove nbstripout
Zeroto521 869159e
lint via pre-commit
Zeroto521 086908f
Update CHANGELOG.md
Zeroto521 71fee7c
Merge branch 'simplify-code-checks.yml' of https://github.com/Zeroto5…
Zeroto521 a9a7c8c
Merge branch 'dev' into simplify-code-checks.yml
ericmjl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
This file is copied into the container along with environment.yml* from the | ||
parent folder. This is done to prevent the Dockerfile COPY instruction from | ||
failing if no environment.yml is found. | ||
parent folder. This is done to prevent the Dockerfile COPY instruction from | ||
failing if no environment.yml is found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,70 +3,9 @@ name: Code style checks | |
on: [push, pull_request] | ||
|
||
jobs: | ||
black: | ||
name: Check black compliance. | ||
linting: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Install black | ||
run: python -m pip install black==21.7b0 | ||
|
||
- name: Run black | ||
run: black --config pyproject.toml --check . | ||
|
||
interrogate: | ||
name: Check interrogate compliance. | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Install interrogate | ||
run: python -m pip install interrogate | ||
|
||
- name: Run interrogate | ||
run: interrogate . | ||
|
||
darglint: | ||
name: Check darglint compliance. | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Install darglint | ||
run: python -m pip install darglint | ||
|
||
- name: Run darglint | ||
run: darglint janitor -v 2 | ||
|
||
flake8: | ||
name: Check flake8 compliance. | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Install flake8 | ||
run: python -m pip install flake8 | ||
|
||
- name: Run flake8 | ||
run: flake8 . --exclude ./nbconvert_config.py | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- uses: pre-commit/[email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,12 +12,7 @@ repos: | |
rev: 21.7b0 | ||
hooks: | ||
- id: black | ||
args: [-l 79] | ||
- repo: https://github.com/kynan/nbstripout | ||
rev: 0.5.0 | ||
hooks: | ||
- id: nbstripout | ||
files: ".ipynb" | ||
args: [--config, pyproject.toml] | ||
- repo: https://github.com/econchick/interrogate | ||
rev: 1.4.0 | ||
hooks: | ||
|
@@ -28,3 +23,8 @@ repos: | |
hooks: | ||
- id: darglint | ||
args: [-v 2] # this config makes the error messages a bit less cryptic. | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.9.2 | ||
hooks: | ||
- id: flake8 | ||
args: [--exclude, nbconvert_config.py] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. code-checks.yml has flake8, but pre-commit doesn't. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ janitor.add\_columns | |
|
||
.. currentmodule:: janitor | ||
|
||
.. autofunction:: add_columns | ||
.. autofunction:: add_columns |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ janitor.filter\_on | |
|
||
.. currentmodule:: janitor | ||
|
||
.. autofunction:: filter_on | ||
.. autofunction:: filter_on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ janitor.find\_replace | |
|
||
.. currentmodule:: janitor | ||
|
||
.. autofunction:: find_replace | ||
.. autofunction:: find_replace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ janitor.get\_dupes | |
|
||
.. currentmodule:: janitor | ||
|
||
.. autofunction:: get_dupes | ||
.. autofunction:: get_dupes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -480,4 +480,4 @@ | |
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,4 +215,4 @@ | |
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -222,4 +222,4 @@ | |
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -932,4 +932,4 @@ | |
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nbstripout should be removed.
It changed a lot, even would make ipynb outputs become empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thanks @Zeroto521.
We can remove it for now. In a future setting, though, I think we'd want to do the notebooks such that they are built in the CI system and deployed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see conf.py already adds nbsphinx, but no a
.rst
file index these notebooks.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. Regarding the notebooks (and docs more generally), I have been debating, btw, to switch the docs over to mkdocs + mkdocs-material. It is much easier to maintain in the long-run than Sphinx; I know I have been hesitant to make any changes to the docs as it stands right now because of a lot of magic that happens behind the scenes that I'm just not well-versed in, whereas MkDocs and mkdocs-material are much easier to maintain combined. (It feels... flatter.)