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

Score, fail-on, fail-under, etc ignores messages emitted by PyLinter itself #9059

Closed
jacobtylerwalls opened this issue Sep 24, 2023 · 2 comments · Fixed by #9082 or #9093
Closed

Score, fail-on, fail-under, etc ignores messages emitted by PyLinter itself #9059

jacobtylerwalls opened this issue Sep 24, 2023 · 2 comments · Fixed by #9082 or #9093
Assignees
Labels
Bug 🪲 Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Milestone

Comments

@jacobtylerwalls
Copy link
Member

jacobtylerwalls commented Sep 24, 2023

Bug description

Attempt to use --fail-on=W, or evaluation=, etc., and see they don't take into account messages from PyLinter itself such as unknown-option-value.

Command used

pylint pylint.lint --enable=unknown --fail-on=W --evaluation='2 if warning else 10'

Pylint output

jwalls@Jacobs-MacBook-Air-4 pylint % pylint pylint.lint --enable=unknown --fail-on=W --evaluation='2 if warning else 10'
************* Module Command line
Command line:1:0: W0012: Unknown option value for '--enable', expected a valid pylint message and got 'unknown' (unknown-option-value)

-------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 9.98/10, +0.02)

jwalls@Jacobs-MacBook-Air-4 pylint % echo $?
0

Expected behavior

non-zero exit code, score less than 10

Pylint version

dev

other

Found while investigating #8457

@jacobtylerwalls jacobtylerwalls added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Sep 24, 2023
@jacobtylerwalls jacobtylerwalls changed the title Machinery around score, fail-on, fail-under, etc ignores messages emitted by PyLinter itself Score, fail-on, fail-under, etc ignores messages emitted by PyLinter itself Sep 24, 2023
@jacobtylerwalls

This comment was marked as outdated.

@Pierre-Sassoulas
Copy link
Member

It seems like we should design the order of operations during initialization and configuration loading in a rational and global manner. (I'm working on #5701 atm and this is a mess honestly, there's no way to simply add default=x, because there's so much special cases everywhere. We can't even dream of doing #2293 in the current state either). For the current issue, we should probably iterate on the MessageDefinitionStore.messages content after proper message initialization but it's not immediately clear to me if there are any special cases related to fail-on/under we need to handle before "proper message initialization" that justify that we did not do that already.

@Pierre-Sassoulas Pierre-Sassoulas added Bug 🪲 Needs investigation 🔬 A bug or crash where it's not immediately obvious what is happenning and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Sep 24, 2023
@jacobtylerwalls jacobtylerwalls added Needs PR This issue is accepted, sufficiently specified and now needs an implementation and removed Needs investigation 🔬 A bug or crash where it's not immediately obvious what is happenning labels Sep 30, 2023
@jacobtylerwalls jacobtylerwalls self-assigned this Sep 30, 2023
@jacobtylerwalls jacobtylerwalls added this to the 3.0.0 milestone Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants