-
-
Notifications
You must be signed in to change notification settings - Fork 47.7k
Automate the basic review process to the bot #8578
dhruvmanila
started this conversation in
Team Posts
-
I have been using the fixit
framework which is itself based on libcst
to create custom rules and lint all the Python files. The module fixit
provides built-in rules with the package. Here's a link to the documentation for fixit
and on the left side you will see the Rules section.
I am thinking of integrating some of the useful ones in the bot. It's as simple as importing the rule class in the __init__.py
of the algorithms.parser.rules
package, the rest will be taken care of by the code. A lot of them are taken directly from the PEP8 style guide.
Some of the useful ones:
- CollapseIsinstanceChecksRule
- ComparePrimitivesByEqualRule
- CompareSingletonPrimitivesByIsRule
- NoInheritFromObjectRule
- NoRedundantArgumentsSuperRule
- NoRedundantFStringRule
- NoRedundantListComprehensionRule
- ReplaceUnionWithOptionalRule
- UseIsNoneOnOptionalRule
- UseTypesFromTypingRule
We can define any arbitrary rule, so if there is something that you have in mind, please do share.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment