summaryrefslogtreecommitdiff
path: root/doc/data/messages/m/missing-parentheses-for-call-in-test/good.py
Commit message (Collapse)AuthorAgeFilesLines
* [doc] Apply black on the documentation where it makes sense (#8650)Pierre Sassoulas2023-05-021-0/+1
| | | Co-authored-by: Daniel van Noord <13665637+DanielNoord@users.noreply.github.com>
* missing-parentheses-for-call-in-test] Generate imaginative example with GhatGPTPierre Sassoulas2023-02-051-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | Prompt: Could you give me an example of bad code raising a 'missing-parentheses-for-call-in-test' message in pylint Could you make it more lively, the name is very generic ? That's kinda expected and boring, could you be more imaginative ? Also I don't think it should return a string, it's supposed to return a boolean. You need to add a ``# [missing-parentheses-for-call-in-test]`` on the line the actual message would be raised, could you update the bad example, please ? Final result: def is_it_a_good_day(): import random return random.choice([True, False]) if is_it_a_good_day: # [missing-parentheses-for-call-in-test] print("Today is a good day!") In this code, the line if is_it_a_good_day: would raise the "missing-parentheses-for-call-in-test" message, because Pylint is expecting to see a function call in the test expression of an if statement, but there are no parentheses after is_it_a_good_day. To correct this, you can add parentheses to make it a function call, as shown in the corrected code in my previous answer.
* Generate the data message directories with an advert for potential ↵Pierre Sassoulas2022-05-261-0/+1
contributors (#6702)