-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Implement flake8-pie #1543
Comments
Yeah these are all quite nice. I can try to implement one of them tomorrow to lay the groundwork for the plugin and we can run from there. |
(Thanks for this thoughtful collation.) |
I didn't realize you actually wrote that plugin, very cool. |
I was passing by and was wondering if can i write some of these ? I'm actually learning rust, but, these plugins look easy enough. I actually got around to developing the prefer_unique_enums rule last night 😅 and i made a mistake with a PR so i closed it 😓 |
@ljesparis - Yes please, thanks! |
I accept any suggestion. By the way, I have a doubt, I have checked and all flake8-pie plugins can be fixed by ruff, but is it necessary that this one is also fixed automatically ? rel #1543
@sbdchd - Are you planning to do PIE810 to close this one out? Just trying to keep tabs on who's working on what. Thanks! |
Yeah I can do that one as well |
Gonna close this for now, can always do that final rule if anyone wants to grab it. |
There might be some overlap with these rules and pylint / flake8-simplify, but I think I eliminated most of the dupes / unnecessary rules:
Instead of calling startswith or endswith on the same string for multiple prefixes, pass the prefixes as a tuple in a single startswith or endswith call.
pass
is unnecessary when definining a class or function with an empty body.Finds duplicate definitions for the same field, which can occur in large ORM model definitions.
By default the stdlib enum allows multiple field names to map to the same value, this lint requires each enum value be unique.
Check for unnecessary dict unpacking.
As long as the keys of the dict are valid Python identifier names, we can safely remove the surrounding dict.
lambda: []
is equivalent to the builtin listDo these all sound good / are there any I should leave out? I skipped a few different ones from the original package that were too specific / awkward.
Also skipped rules that overlapped with:
The text was updated successfully, but these errors were encountered: