Skip to content
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

Maintenance: remove outdated Conan 2 linter #23757

Closed

Conversation

jcar87
Copy link
Contributor

@jcar87 jcar87 commented Apr 25, 2024

No longer relevant:

  • Conan 2 is mandatory in all PRs, so invalid syntax will be immediately shown.

Historically, this was useful when there was no Conan 2.0 pipeline running.

Copy link
Contributor

@ericLemanissier ericLemanissier left a comment

Choose a reason for hiding this comment

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

please don't, you're removing pylint alltogether, which catches real bugs.
Instead, please remove individual checkers from https://github.com/conan-io/conan-center-index/blob/master/linter/conanv2_transition.py

if: steps.changed_files.outputs.any_changed == 'true'
run: |
echo '## Linter summary (recipes)' >> $GITHUB_STEP_SUMMARY
pylint --rcfile=linter/pylintrc_recipe `ls recipes/*/*/conanfile.py | shuf -n 500` --output-format=json --output=recipes.json --score=y --exit-zero
Copy link
Member

Choose a reason for hiding this comment

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

The linter/pylintrc_recipe is only used here and mentioned in docs/linters.md and docs/developing_recipes_locally.md. So it could be removed as well.

if: steps.changed_files.outputs.any_changed == 'true'
run: |
echo '## Linter summary (test_package)' >> $GITHUB_STEP_SUMMARY
pylint --rcfile=linter/pylintrc_testpackage `ls recipes/*/*/test_package/conanfile.py | shuf -n 500` --output-format=json --output=recipes.json --exit-zero
Copy link
Member

Choose a reason for hiding this comment

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

Same for linter/pylintrc_testpackage. It could be removed as well.

- name: Run linter
if: steps.changed-files.outputs.any_changed == 'true'
run: |
echo "::add-matcher::linter/recipe_linter.json"
Copy link
Member

Choose a reason for hiding this comment

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

The file linter/recipe_linter.json is only used by this file. So it could be removed as well.

@ericLemanissier
Copy link
Contributor

Once again, pylint is very useful to catch bugs. please consider #23758 which should drop conan1 support for the linter

@jcar87
Copy link
Contributor Author

jcar87 commented Apr 25, 2024

Once again, pylint is very useful to catch bugs. please consider #23758 which should drop conan1 support for the linter

Could you provide examples of bugs that have been recently raised by the linter where this has been useful? I'm assuming these fall under the category of "all methods in the recipe actually work, but it may not be working as intended?

@ericLemanissier
Copy link
Contributor

ericLemanissier commented Apr 25, 2024

any typo in variable/attribute/function name in a non-taken branch can only caught by a static analyzer.

not very recent, but still: #7749 (comment)

#11238
#11239
#11213
983176e

@jcar87
Copy link
Contributor Author

jcar87 commented Apr 25, 2024

I meant recent examples where the linter is actively reporting actual recipe bugs in GitHub PRs. Happy to consider the removal on that basis.

We are currently working on a revamped pipeline, which will centralise all reporting (linting and builds, and all checks) - so functionality will be assumed and reported by our CI.

@ericLemanissier
Copy link
Contributor

Maybe you did not see the edits to my message ?

@jcar87
Copy link
Contributor Author

jcar87 commented Apr 25, 2024

Maybe you did not see the edits to my message ?

PRs from 2 years ago that look like manual runs of the linter on code that was checked in before that?

I'm not arguing the linter isn't useful - but I want to measure how often and how recently and exactly what sort of errors it is catching. Otherwise, if it's covering low probability stuff, we can live with it disabled until our new implementation.

@ericLemanissier
Copy link
Contributor

ericLemanissier commented Apr 25, 2024

Can you please update the description of the PR so that the community understands why this change is needed ? You are not removing outdated conan 2 linters, you are removing ALL PYTHON LINTERS.
You say No longer relevant: which is wrong. I agree that the linters that exist only to help transition to conan 2 can be dropped, and I proposed the fix in #23758.
you say Historically, this was useful when there was no Conan 2.0 pipeline running. which is also wrong, pytlint was considered and implemented before conan 2 migration tools and
Dropping all other pylints checks is a very serious reduction on the quality of conan-center recipe.
I obviously cannot go through all the runs of the checkers, with more than 50 runs per day. One recent actual bug catch was in https://github.com/conan-io/conan-center-index/commit/983176e1c4d6a40bd130a32e851505fb2cc3af87#diff-89f04a00c7ace6261a53[…]25526ec09f965d57fa2bf7R97 which from #23437 (but it is not visible in the PR because the author force pushed)
Let me repost examples of bugs which actually where merged in CCI, because pylint was not yet implemented:

In addition to catching bug which are not detected other wise, running pylint has a great advantage: It provides very quick feedback (in the 20 seconds ballpark) on syntax errors, in a very readable way on github (directly in the source code):
image.
It also works when C3I is in maintenance or out of order.

Also, it does not cost you anything, it does not run on your CI servers, it does not add any traffic on conan-center, and the maintenance is very low (see the number of commits in https://github.com/conan-io/conan-center-index/commits/master/linter and https://github.com/conan-io/conan-center-index/commits/master/.github/workflows/linter-conan-v2.yml)

Removing pylint is a net loss in quality, and I see no valid reason to take this move.

@jwillikers
Copy link
Contributor

I think the benefit of the Python linters to reviewers and maintainers is likely worth the cost. I've definitely benefited from it in my PR's in the past.

@jcar87 jcar87 closed this Jun 26, 2024
This was referenced Sep 19, 2024
@jcar87 jcar87 deleted the lcc/maintenance/remove-v2-linter branch September 23, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants