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

Added chained-comparison message example #6107

Merged
merged 1 commit into from
Apr 2, 2022

Conversation

matusvalo
Copy link
Collaborator

Co-authored-by: Vladyslav Krylasov vladyslav.krylasov@gmail.com

Type of Changes

Type
πŸ› Bug fix
✨ New feature
πŸ”¨ Refactoring
βœ“ πŸ“œ Docs

Description

Related: #5953

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

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

Aren't good and bad inverted here ?

@matusvalo
Copy link
Collaborator Author

Aren't good and bad inverted here ?

https://vald-phoenix.github.io/pylint-errors/plerr/errors/refactoring/R1716

matus@MacBook-Pro:~/dev/pylint/doc$ cat test.py
a = int(input())
b = int(input())
c = int(input())
if a < b and b < c:
    pass
matus@MacBook-Pro:~/dev/pylint/doc$ pylint test.py
************* Module test
test.py:1:0: C0114: Missing module docstring (missing-module-docstring)
test.py:4:3: R1716: Simplify chained comparison between the operands (chained-comparison)

------------------------------------------------------------------
Your code has been rated at 6.00/10 (previous run: 6.00/10, +0.00)

@Pierre-Sassoulas
Copy link
Member

Pierre-Sassoulas commented Apr 1, 2022

I mean the a < b and b < c: # [chained-comparison] is in good.py file not in bad.py. Probably something that our documentation tests should catch now that I think of it (nothing should be raised for good.py and at least one message for bad.py).

@matusvalo
Copy link
Collaborator Author

Yes you are right nie I see it. I will fix it.

Co-authored-by: Vladyslav Krylasov <vladyslav.krylasov@gmail.com>
@matusvalo matusvalo force-pushed the chained-comparison branch from 0463f1f to 9aea9ad Compare April 2, 2022 19:34
@matusvalo
Copy link
Collaborator Author

Aren't good and bad inverted here ?

fixed

@matusvalo
Copy link
Collaborator Author

Probably something that our documentation tests should catch now that I think of it

created #6145

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

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

Thanks for the generic fix, much appreciated !

@Pierre-Sassoulas Pierre-Sassoulas merged commit c002f59 into pylint-dev:main Apr 2, 2022
@matusvalo matusvalo deleted the chained-comparison branch April 2, 2022 22:05
@Pierre-Sassoulas Pierre-Sassoulas removed this from the 2.14.0 milestone May 17, 2022
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.

2 participants