-
Notifications
You must be signed in to change notification settings - Fork 536
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
Add Pylint support and enable Pylint CI checks #2658
Conversation
Maybe I'm missing something here but why is there a need for ruff and pylint? Isn't ruff covering everything? |
Pylint catches bugs that ruff misses because ruff doesn't analyze code across multiple files (astral-sh/ruff#7447). The Pylint also catches bugs that mypy misses because Pylint doesn't automatically trust type annotations. https://docs.astral.sh/ruff/faq/#how-does-ruffs-linter-compare-to-pylint has some additional details. |
Before we merge this, I have to create a makedepends=(
'python-setuptools'
'python-sphinx'
'python-build'
'python-installer'
'python-wheel'
+ 'python-pylint'
+ 'python-pylint-pydantic'
) However that package does not exist currently in any repo, not even in AUR. It's not a major showstopper, but I just need to sit down a few minutes and make that happen. |
@Torxed why is it needed for a build? Those packages are part of the dev packages in pyproject.toml so they shouldn't be dependencies for a build? |
Hmm, is there a way to pin versions of dev dependencies in PKGBUILD? One scenario that comes to mind:
I wouldn't want the linters to cause packaging issues down the line. |
Hmm I'm still somewhat worried that mixing the build with linting may cause issues down the line. If these checks run on PRs and only PRs that validate successfully get merged then the master branch should be considered ckean and ready for a build. |
2c25302
to
2388752
Compare
There's also the odd "arch packaging patches" where any trusted user can go in and submit Which is what you see sometimes where, a package didn't change version upstream like It's a low probability of issues, but best practice in packaging is to have the And it's no problem for me to make a PKGBUILD for pylint-pydantic as long as it's maintained upstream :) I just need to find my way to my laptop 😅 |
Maybe we should pause the pylint addition for a bit and see how well ruff in combination with the others work, get mypy fully compliant and see if we need pylint in addition? |
My preference would be to enable Pylint checks without the PKGBUILD changes for now. The checks will help validate the fixes for the remaining mypy and ruff violations and prevent new issues from being introduced. I think a lot of the remaining violations are going to require code changes as opposed to just annotation changes, so having the additional linting checks will help detect regressions. I can start fixing more issues next week, but I think it will still take a while to be fully mypy compliant. |
It's true, we could skip the But the tests that pylint adds sounds nice tbh. |
@correctmost I'm soon (TM) about to raise an integration PR for the new menu system which is going to shuffle things around, so just to prevent any throwaway work being done just ignore any menu related linting |
575a4b8
to
653f99e
Compare
I've successfully built the dependencies now. I just need to sign and publish the packages :) Edit: Been on vacation for a week, but picking this up again. |
95b33b8
to
13b9014
Compare
08a31e3
to
e3369cf
Compare
e3369cf
to
54a6f37
Compare
54a6f37
to
9c29239
Compare
9c29239
to
9267ccb
Compare
9267ccb
to
3d44f7a
Compare
I've now managed to package python-pylint-pydantic. |
PR Description:
Pylint can help catch issues like #2625:
I didn't add the Pylint checks to the pre-commit config because they might be a bit too slow to run on each commit.
Tests and Checks