Skip to content

Modify precommit config yaml and change name of typing step to Typing + pylint. #49527

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

Conversation

sudhansubhushanmishra
Copy link
Contributor

@sudhansubhushanmishra sudhansubhushanmishra commented Nov 4, 2022

Modify the pre-commit config.yml file and change name of step in code-checks.yml. Possible attempt to resolve #49526
Please provide feedback an I'd try to incorporate those changes.

Comment on lines 64 to 68
hooks:
- id: pylint
- language: system
- pass_filenames: false
- stages: [manual]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't quite right, check the mypy hook for an example of the syntax

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, are the changes ok now?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be fine, thanks!

@mroeschke mroeschke added the Code Style Code style, linting, code_checks label Nov 4, 2022
Copy link
Contributor

@akx akx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beyond the inline comment, it's not quite clear why more pylint codes need to be disabled..?

Comment on lines +66 to +67
language: system
stages: [manual]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the implications of these changes?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'll run like the mypy one, only in CI

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @the-lazy-learner ! I just merged upstream/main, added pylint to the environment file, and added a couple more checks to the ignore list as pylint also has some dynamic checks which don't run when it's just a pre-commit hook, hope that's OK

@MarcoGorelli MarcoGorelli added this to the 2.0 milestone Nov 4, 2022
@MarcoGorelli
Copy link
Member

MarcoGorelli commented Nov 4, 2022

merging as the affected checks all pass

EDIT: github won't let me, let's see if #49538 solves this

@lithomas1 lithomas1 closed this Nov 4, 2022
@lithomas1 lithomas1 reopened this Nov 4, 2022
@@ -89,6 +89,7 @@ dependencies:
- flake8-bugbear=22.7.1 # used by flake8, find likely bugs
- isort>=5.2.1 # check that imports are in the right order
- mypy=0.981
- pylint=2.15.5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarcoGorelli is there a reason to add pylint to the env file? The check is still run through pre-commit, which will make install it in its own env?

(although that's also the case for black et al, and those are also here, so it's all OK, just wondering)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pylint can do some extra inference if it has everything built (hence a few extra checks that need to be turned off in this PR) - if it's only running in CI, then we might as well use the environment where pandas has been built (like we do for mypy, that one also has language: system)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I missed the language: system . Thanks for the explanation!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 though language: system is less reliable, so maybe this should still run in its own little env...yeah let's do that, then the risk of it annoying contributors / maintainers is reduced

@jorisvandenbossche
Copy link
Member

BTW, there is an actual failure:

 pylint...................................................................Failed
- hook id: pylint
- exit code: 8

************* Module pandas.core.dtypes.concat
pandas/core/dtypes/concat.py:284:8: R1720: Unnecessary "elif" after "raise", remove the leading "el" from "elif" (no-else-raise)

@MarcoGorelli
Copy link
Member

BTW, there is an actual failure:

 pylint...................................................................Failed
- hook id: pylint
- exit code: 8

************* Module pandas.core.dtypes.concat
pandas/core/dtypes/concat.py:284:8: R1720: Unnecessary "elif" after "raise", remove the leading "el" from "elif" (no-else-raise)

Yup, fixed in #49537

@MarcoGorelli
Copy link
Member

A couple of us have had issues merging this one, not sure if the issue is on GitHub's side, but I've opened #49538 to take this forwards (and have kept @the-lazy-learner as the commit author)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI: only run pylint in CI
6 participants