-
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
[INF] simplify a bit linting, use pre-commit as CI linting checker #892
Conversation
There is two similar linting CIs (pre-commit and code-checks) but also have tiny differences. We should use one of them as the standard, not both.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
code-checks.yml has flake8, but pre-commit doesn't.
Codecov Report
@@ Coverage Diff @@
## dev #892 +/- ##
==========================================
- Coverage 95.66% 95.62% -0.05%
==========================================
Files 19 19
Lines 2448 2448
==========================================
- Hits 2342 2341 -1
- Misses 106 107 +1 |
Because the linting standard is different, so https://github.com/pyjanitor-devs/pyjanitor/pull/892/checks is red. Now we should determine to use which linting is the standard. |
@Zeroto521 thanks for handling this! In the interest of minimizing the diff, I think we should defer to the codechecks.yml file for the settings, but use pre-commit as our actual code checker. Would you be open to making that happen please? |
`-c` = `--code TEXT`, Format the code passed in as a string.
keep the same with the old code-checks.yml
…21/pyjanitor into simplify-code-checks.yml
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.
Now use the old code-checks.yml as the base standard and pre-commit as the lining checker.
But these hooks weren't removed. They changed a little. Just remove some whitespace when lint.
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/kynan/nbstripout | ||
rev: 0.5.0 | ||
hooks: | ||
- id: nbstripout | ||
files: ".ipynb" |
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.)
Let's get one more review in before merging. Tagging @loganthomas and @hectormz, whom I think might take an interest in the PR. |
@Zeroto521 I'm going to merge as I'd like to have these changes present in #897. Thanks for your contributions here, much appreciated! |
* [INF] simplify a bit linting, use pre-commit as CI linting checker (#892) * [INF] simplify a bit linting There is two similar linting CIs (pre-commit and code-checks) but also have tiny differences. We should use one of them as the standard, not both. * Update CHANGELOG.md * should be `--config` not `-c` `-c` = `--code TEXT`, Format the code passed in as a string. * remove nbstripout keep the same with the old code-checks.yml * lint via pre-commit * Update CHANGELOG.md Co-authored-by: Eric Ma <[email protected]> * [DOC] mkdocs updates to ml module * [DOC] mkdocs updates to ml module * [DOC] mkdocs updates to ml module * [DOC] mkdocs updates to ml module; black formatting Co-authored-by: Zero <[email protected]> Co-authored-by: Eric Ma <[email protected]>
* [INF] simplify a bit linting, use pre-commit as CI linting checker (#892) * [INF] simplify a bit linting There is two similar linting CIs (pre-commit and code-checks) but also have tiny differences. We should use one of them as the standard, not both. * Update CHANGELOG.md * should be `--config` not `-c` `-c` = `--code TEXT`, Format the code passed in as a string. * remove nbstripout keep the same with the old code-checks.yml * lint via pre-commit * Update CHANGELOG.md Co-authored-by: Eric Ma <[email protected]> * [DOC] mkdocs updates to read_csv() in io * [DOC] mkdocs updates to incldue io in docs Co-authored-by: Zero <[email protected]> Co-authored-by: Eric Ma <[email protected]>
* [INF] simplify a bit linting, use pre-commit as CI linting checker (#892) * [INF] simplify a bit linting There is two similar linting CIs (pre-commit and code-checks) but also have tiny differences. We should use one of them as the standard, not both. * Update CHANGELOG.md * should be `--config` not `-c` `-c` = `--code TEXT`, Format the code passed in as a string. * remove nbstripout keep the same with the old code-checks.yml * lint via pre-commit * Update CHANGELOG.md Co-authored-by: Eric Ma <[email protected]> * [DOC] mkdocs updates to log() in math * [DOC] mkdocs updates to ecdf() in math * [DOC] mkdocs updates to exp() in math * [DOC] mkdocs updates to logit() in math * [DOC] mkdocs updates to normal_cdf() in math * [DOC] mkdocs updates to probit() in math * [DOC] mkdocs updates to single line docstrings in math * [DOC] mkdocs updates to z_score() in math Co-authored-by: Zero <[email protected]> Co-authored-by: Eric Ma <[email protected]>
* mkdocstrings on chemistry functions * Minor update to biology.py * Proper config for syntax highlighting * Switch to nord theme for syntax highlighting * [INF] simplify a bit linting, use pre-commit as CI linting checker (#892) * [INF] simplify a bit linting There is two similar linting CIs (pre-commit and code-checks) but also have tiny differences. We should use one of them as the standard, not both. * Update CHANGELOG.md * should be `--config` not `-c` `-c` = `--code TEXT`, Format the code passed in as a string. * remove nbstripout keep the same with the old code-checks.yml * lint via pre-commit * Update CHANGELOG.md Co-authored-by: Eric Ma <[email protected]> * FLake8 fix. Co-authored-by: Zero <[email protected]>
* [INF] simplify a bit linting, use pre-commit as CI linting checker (#892) * [INF] simplify a bit linting There is two similar linting CIs (pre-commit and code-checks) but also have tiny differences. We should use one of them as the standard, not both. * Update CHANGELOG.md * should be `--config` not `-c` `-c` = `--code TEXT`, Format the code passed in as a string. * remove nbstripout keep the same with the old code-checks.yml * lint via pre-commit * Update CHANGELOG.md Co-authored-by: Eric Ma <[email protected]> * [CLN] remove README.rst in favor of mkdocs/index.md * [CLN] remove CONTRIBUTING.rst in favor of mkdocs/devguide.md * [DOC] add symlink to mkdocs/devguide.md for CONTRIBUTING.md * [FIX] remove file CONTRIBUTING.md * [DOC] add symlink to mkdocs/devguide.md for CONTRIBUTING.md * [INF] update setup.py to replace README.rst with mkdocs/index.md Co-authored-by: Zero <[email protected]> Co-authored-by: Eric Ma <[email protected]>
* [INF] simplify a bit linting, use pre-commit as CI linting checker (#892) * [INF] simplify a bit linting There is two similar linting CIs (pre-commit and code-checks) but also have tiny differences. We should use one of them as the standard, not both. * Update CHANGELOG.md * should be `--config` not `-c` `-c` = `--code TEXT`, Format the code passed in as a string. * remove nbstripout keep the same with the old code-checks.yml * lint via pre-commit * Update CHANGELOG.md Co-authored-by: Eric Ma <[email protected]> * [DOC] mkdocs updates to convert_units() in engineering Co-authored-by: Zero <[email protected]> Co-authored-by: Eric Ma <[email protected]>
* [INF] simplify a bit linting, use pre-commit as CI linting checker (#892) * [INF] simplify a bit linting There is two similar linting CIs (pre-commit and code-checks) but also have tiny differences. We should use one of them as the standard, not both. * Update CHANGELOG.md * should be `--config` not `-c` `-c` = `--code TEXT`, Format the code passed in as a string. * remove nbstripout keep the same with the old code-checks.yml * lint via pre-commit * Update CHANGELOG.md Co-authored-by: Eric Ma <[email protected]> * [DOC] mkdocs updates to refactored_function() in utils * [DOC] mkdocs updates to rename_kwargs() in utils * [DOC] mkdocs updates to check_column() in utils * [DOC] mkdocs updates to skipna() in utils * [DOC] mkdocs updates to skiperror() in utils Co-authored-by: Zero <[email protected]> Co-authored-by: Eric Ma <[email protected]>
* [INF] simplify a bit linting, use pre-commit as CI linting checker (#892) * [INF] simplify a bit linting There is two similar linting CIs (pre-commit and code-checks) but also have tiny differences. We should use one of them as the standard, not both. * Update CHANGELOG.md * should be `--config` not `-c` `-c` = `--code TEXT`, Format the code passed in as a string. * remove nbstripout keep the same with the old code-checks.yml * lint via pre-commit * Update CHANGELOG.md Co-authored-by: Eric Ma <[email protected]> * [DOC] mkdocs updates to check() in utils * [DOC] mkdocs updates to _strip_underscores() in utils * [DOC] mkdocs updates to import_message() in utils * [DOC] mkdocs updates to idempotent() in utils * [DOC] mkdocs updates to deprecated_alias() in utils Co-authored-by: Zero <[email protected]> Co-authored-by: Eric Ma <[email protected]>
* [INF] simplify a bit linting, use pre-commit as CI linting checker (#892) * [INF] simplify a bit linting There is two similar linting CIs (pre-commit and code-checks) but also have tiny differences. We should use one of them as the standard, not both. * Update CHANGELOG.md * should be `--config` not `-c` `-c` = `--code TEXT`, Format the code passed in as a string. * remove nbstripout keep the same with the old code-checks.yml * lint via pre-commit * Update CHANGELOG.md Co-authored-by: Eric Ma <[email protected]> * DOC: update _sub_expand_grid(pd.DataFrame) in utils * DOC: update _sub_expand_grid(pd.Index) in utils * DOC: update _data_checks_complete() in utils * DOC: update _computations_complete() in utils * DOC: update _create_indexer_for_complete() in utils Co-authored-by: Zero <[email protected]> Co-authored-by: Eric Ma <[email protected]>
* [INF] simplify a bit linting, use pre-commit as CI linting checker (#892) * [INF] simplify a bit linting There is two similar linting CIs (pre-commit and code-checks) but also have tiny differences. We should use one of them as the standard, not both. * Update CHANGELOG.md * should be `--config` not `-c` `-c` = `--code TEXT`, Format the code passed in as a string. * remove nbstripout keep the same with the old code-checks.yml * lint via pre-commit * Update CHANGELOG.md Co-authored-by: Eric Ma <[email protected]> * DOC: update _computations_expand_grid() in utils * DOC: update _expand_grid() in utils * DOC: update _sub_expand_grid() in utils * DOC: update _sub_expand_grid(np.ndarray) in utils * DOC: update _sub_expand_grid(pd.Series) in utils * [DOC] fix NumPy Co-authored-by: Zero <[email protected]> Co-authored-by: Eric Ma <[email protected]>
PR Description
Please describe the changes proposed in the pull request:
There is two similar linting CIs (pre-commit and code-checks) but also have tiny differences.
We should use one of them as the standard, not both. Otherwise, we would get confused.
PR Checklist
Please ensure that you have done the following:
<your_username>
:dev
, but rather from<your_username>
:<feature-branch_name>
.AUTHORS.rst
.CHANGELOG.md
under the latest version header (i.e. the one that is "on deck") describing the contribution.Automatic checks
There will be automatic checks run on the PR. These include:
Relevant Reviewers
Please tag maintainers to review.