-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
chore: add pylint to pre-commit hook #28137
Conversation
@@ -31,10 +31,6 @@ jobs: | |||
- name: Setup Python | |||
uses: ./.github/actions/setup-backend/ | |||
if: steps.check.outputs.python | |||
- name: pylint |
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.
NOTE: this other action here https://github.com/apache/superset/blob/master/.github/workflows/pre-commit.yml#L38 will cover for this one.
@mistercrunch per here it seems like this pre-commit hook will only work locally and will be ineffective in a remote CI setting. |
Seems good to me, but I think @john-bodley might be the right stakeholder approver here. |
@john-bodley I think it should be fine as long as I install it in the I just realized it's only pylinting the |
I think turning this on as pre-commit is a clear win if we're going to enforce pylint in CI. It's a bit slow, but pre-commit is a good place to pay the cost of verification (CI is too late, and pylint IDE integrations are sluggish in my experience) |
21d6b2a
to
d7150dc
Compare
Can I get the @john-bodley seal of approval :)? |
I got bit by the old pylint failing in CI again recently. pylint is too slow for IDEs so I turn it off since it made vim too sluggish to my taste. Feels about right as a pre-commit hook, I'd rather get that too take a moment than waiting for a CI cycle. Not sure why it wasn't there in the first place, too slow? We should also consider moving to `ruff` and streamlining all this, but ruff doesn't support all the pylint rules [yet].
d7150dc
to
26e4ab8
Compare
@mistercrunch regarding your comment,
There's a few WIP PRs—by @betodealmeida (I believe) and myself—which have custom Pylint extensions so I'm not sure if/when we'll actually can switch off Pylint as I believe Ruff doesn't support custom lint rules. |
@john-bodley I don't think we should deprecate One thing that we could consider though is disabling the specific (200+) pylint rules where ruff already covers currently. This could allow pylint to perform better as it's pretty slow currently. This could accelerate commit hooks execution (usually that's not bad as is currently) but significantly speed up |
I got bit by the old pylint failing in CI again recently. pylint is too slow for IDEs
so I turn it off since it made vim too sluggish to my taste. Feels about
right as a pre-commit hook, I'd rather get that too take a moment than
waiting for a CI cycle.
Not sure why it wasn't there in the first place, too slow?
We should also consider moving to
ruff
and streamlining all this, but ruffdoesn't support all the pylint rules [yet].