Skip to content

Added chained-comparison message example#6107

Merged
Pierre-Sassoulas merged 1 commit intopylint-dev:mainfrom
matusvalo:chained-comparison
Apr 2, 2022
Merged

Added chained-comparison message example#6107
Pierre-Sassoulas merged 1 commit intopylint-dev:mainfrom
matusvalo:chained-comparison

Conversation

@matusvalo
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator Author

Aren't good and bad inverted here ?

fixed

@matusvalo
Copy link
Copy Markdown
Collaborator Author

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

created #6145

Copy link
Copy Markdown
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