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