cog
d8a81ef7 - Resolve or ignore Ruff and Pylint warnings (#1825)

Commit
1 year ago
Resolve or ignore Ruff and Pylint warnings (#1825) * Add pylint tool settings to pyproject.toml * Fix R1732: Consider using 'with' for resource-allocating operations (consider-using-with) * Fix W3101: Missing timeout argument for method 'requests.put' can cause your program to hang indefinitely (missing-timeout) * Fix R1705: Unnecessary else after return, remove the else and de-indent the code inside it (no-else-return) * Fix W3101: Missing timeout argument for method 'requests.get' can cause your program to hang indefinitely (missing-timeout) * Fix R1732: Consider using 'with' for resource-allocating operations (consider-using-with) * Fix R1720: Unnecessary else after raise, remove the else and de-indent the code inside it (no-else-raise) * Fix R1723: Unnecessary elif after break, remove the leading el from elif (no-else-break) * Fix W0201: Attribute '_stream_redirector' defined outside __init__ (attribute-defined-outside-init) * Fix E0401: Unable to import 'requests.packages.urllib3.util.retry' (import-error) * Fix W0223: Method '__next__' is abstract in class 'Iterator' but is not overridden in child class 'ConcatenateIterator' (abstract-method) * Fix R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) * Fix R0402: Use 'from cog import code_xforms' instead (consider-using-from-import) * Fix W0107: Unnecessary pass statement (unnecessary-pass) * Fix W1514: Using open without explicitly specifying an encoding (unspecified-encoding) * Fix R1720: Unnecessary elif after raise, remove the leading el from elif (no-else-raise) * Fix R1732: Consider using 'with' for resource-allocating operations (consider-using-with) * Fix R1714: Consider merging these comparisons with 'in' by using 'parsed_url.scheme in ('http', 'https')'. Use a set instead if elements are hashable. (consider-using-in) * Fix R1705: Unnecessary elif after return, remove the leading el from elif (no-else-return) * R1705: Unnecessary else after return, remove the else and de-indent the code inside it (no-else-return) * Fix W1514: Using open without explicitly specifying an encoding (unspecified-encoding) * Refactor type checking for cog.http * Refactor await_explicit_shutdown in cog.http * Fix R1705: Unnecessary else after return, remove the else and de-indent the code inside it (no-else-return) * Fix C0103: Constant name "threads" doesn't conform to UPPER_CASE naming style (invalid-name) * Fix W0621: Redefining name 's' from outer scope (line 574) (redefined-outer-name) * Fix W1508: os.getenv default type is builtins.int. Expected str or None. (invalid-envvar-default) * Fix R1722: Consider using 'sys.exit' instead (consider-using-sys-exit) * Fix R1705: Unnecessary elif after return, remove the leading el from elif (no-else-return) * Fix W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) * Ignore remaining pylint warnings * Ignore Pyright warnings * Revert "Fix R1732: Consider using 'with' for resource-allocating operations (consider-using-with)" Ignore warning instead This reverts commit 46ed73427c0db93e9799b9bf4bf741321c09dac4. * Revert "Fix W0223: Method '__next__' is abstract in class 'Iterator' but is not overridden in child class 'ConcatenateIterator' (abstract-method)" Ignore warning instead This reverts commit f1ae4b62c7aaeba2dbdfd36f65dea3e716855be6.
Author
Parents
Loading