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

🚨 Fix Pylint errors #337

Draft
wants to merge 60 commits into
base: pylint-ci
Choose a base branch
from
Draft

🚨 Fix Pylint errors #337

wants to merge 60 commits into from

Conversation

mayankpatibandla
Copy link
Contributor

@mayankpatibandla mayankpatibandla commented Mar 5, 2024

Summary:

Should enable these

  • C0114: Missing module docstring
  • C0115: Missing class docstring
  • C0116: Missing function or method docstring
  • C0415: Import outside toplevel
  • R1705: Unnecessary "else" after "return"
  • E1120: No value for argument in function call
  • E1123: Unexpected argument in function call
  • C0209: Consider using an f-string
  • R1710: Either all return statements in a function should return an expression, or none of them should
  • W0621: Redefining name from outer scope
  • C0121: Comparison to singletons is unnecessary
  • W0614: Unused import from wildcard import
  • W0401: Wildcard import
  • C0117: Unnecessary negation
  • R0205: Useless object inheritance
  • R0402: Consider using from import
  • R1725: Super with arguments
  • W0237: Renamed arguments
  • W0223: Abstract method is not overridden
  • W0613: Unused argument
  • W0108: Lambda may not be necessary
  • W0511: TODO
  • E1136: Value is unsubscriptable
  • W0611: Unused import
  • C0103: Variable name doesn't conform to naming style
  • R1732: Consider using with
  • W1514: Using open without explicitly specifying an encoding
  • R1718: Consider using set comprehension
  • W1510: Subprocess run without explicitly defining check
  • E0602: Undefined variable
  • W1309: Using an f-string that does not have any interpolated variables
  • C0325: Unnecessary parenthesis
  • E1101: Nonexistent member
  • R1714: Consider using in
  • R0916: Too many boolean expressions in if statement
  • W0719: Broad exception raised
  • E1133: Not an iterable
  • W0107: Unnecessary pass statement
  • W3101: Missing timeout
  • W0640: Cell variable from loop
  • C0201: Consider iterating over a dict instead of calling keys
  • W1113: Keyword argument before variable argument
  • W0246: Useless parent delegation
  • W0622: Redefining built-in
  • W0221: Arguments number differs from overridden method
  • E1111: Assigning to function call which doesn't return
  • R1720: Unnecessary "else" after "raise"
  • R1723: Unnecessary "else" after "break"
  • E0102: Function already defined
  • W0201: Attribute defined outside init
  • E0203: Access to member before its definition
  • E0401: Unable to import
  • W0602: Undefined global variable
  • W0212: Access to a protected member
  • W0707: Missing raising from
  • W0101: Unreachable code
  • E0110: Instantiated abstract class
  • R1701: Consider merging isinstance
  • W0106: Expression is assigned to nothing
  • R1721: Unnecessary comprehension
  • W0601: Global variable undefined at the module level
  • W0612: Unused variable
  • W1406: Redundant u-string prefix
  • R1731: Use max builtin function
  • W4902: Using deprecated method

Performance optimization

  • W1203: Use % formatting in logging functions and pass the parameters as arguments
  • R1729: Use a generator instead of comprehension
  • W1202: Use % formatting in logging functions and pass the parameters as arguments
  • R1735: Use literal syntax instead of function calls to create dict
  • R1734: Use literal syntax instead of function calls to create list
  • W1201: Specify string format arguments as logging function parameters

Fixed by auto formatter #325

  • C0411: Wrongly ordered import
  • C0412: Ungrouped imports
  • C0301: Line too long
  • C0303: Trailing whitespace

Might be difficult to refactor in some cases

  • W0718: Broad exception caught
  • W0702: No exception type(s) specified

Should disable these for now, would require too much refactoring

  • R0903: Too few public methods
  • R0913: Too many arguments
  • R0914: Too many local variables
  • R0912: Too many branches
  • R0911: Too many return statements
  • R0902: Too many instance attributes
  • R0915: Too many statements
  • R0904: Too many public methods
  • C0302: Too many lines in module
  • W0603: Using the global statement
  • R0401: Cyclic import -- Seems to be platform specific

Motivation:

The goal is to have a consistent code standard that is easy to read and allows for performance optimizations.

References (optional):

Merges into #301

Test Plan:

Although functionality should theoretically be unaffected, this PR is very large and makes changes to some core components. It's possible that there may unintended side affects that break some features.

  • Thoroughly review all changes to ensure functionality is unaffected
  • Test every command???

@mayankpatibandla mayankpatibandla self-assigned this Mar 5, 2024
@mayankpatibandla mayankpatibandla changed the title 🚨 Fix pylint errors 🚨 Fix Pylint errors Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant