meltano
meltano copied to clipboard
Resolve all non-doc lint issues
As discussed in a recent call, editing an old file only to have it spring dozens of linter issues on you because we currently only lint changed files is always a nasty surprise, particularly for an external or first-time contributor.
While resolving all of the doc/docstring lint issues will be tricky (since it requires good knowledge of every piece of the codebase that lacks docstrings), and is potentially not worth it at this time, resolving all of the other ones should be an easy win.
CC @aaronsteers
Here's a summary of the lint issues found by flake8 for 8ee30c2867a513621b7d48dec7f7780c11aef78f:
2 B001 Do not use bare `except:`, it also catches unexpected events like memory errors, interrupts, system exit, and so on. Prefer `except Exception:`. If you're sure what you're doing, be explicit and write `except BaseException:`.
6 B006 Do not use mutable data structures for argument defaults. They are created during function definition time. All calls to the function reuse this one instance of that data structure, persisting changes between them.
51 D100 Missing docstring in public module
70 D101 Missing docstring in public class
111 D102 Missing docstring in public method
46 D103 Missing docstring in public function
16 D104 Missing docstring in public package
19 D105 Missing docstring in magic method
42 D107 Missing docstring in __init__
3 D200 One-line docstring should fit on one line with quotes
3 D202 No blank lines allowed after function docstring
11 D205 1 blank line required between summary line and description
11 D400 First line should end with a period
2 D401 First line should be in imperative mood
2 DAR003 Incorrect indentation: ~<
155 DAR101 Missing parameter(s) in Docstring: - d
32 DAR201 Missing "Returns" in Docstring: - return
3 DAR301 Missing "Yields" in Docstring: - yield
15 DAR401 Missing exception(s) in Raises section: -r KeyboardInterrupt
1 E711 comparison to None should be 'if cond is None:'
2 E712 comparison to True should be 'if cond is True:' or 'if cond:'
3 E713 test for membership should be 'not in'
2 E722 do not use bare 'except'
1 E731 do not assign a lambda expression, use a def
8 F401 'sqlalchemy.types' imported but unused
4 F403 'from meltano.api.headers import *' used; unable to detect undefined names
2 F405 'VERSION_HEADER' may be undefined, or defined from star imports: meltano.api.headers
3 F541 f-string is missing placeholders
6 F811 redefinition of unused '_handle' from line 138
1 F821 undefined name 'Settings'
1 F841 local variable 'fake_role' is assigned to but never used
1 N801 class name 'visit_with' should use CapWords convention
1 N802 function name 'Popen_options' should be lowercase
2 N816 variable 'settingsBP' in global scope should not be mixedCase
8 N818 exception name 'PluginInstallWarning' should be named with an Error suffix
1 S105 Possible hardcoded password: 'bcrypt'
1 S110 Try, Except, Pass detected.
1 S324 Use of weak MD4, MD5, or SHA1 hash for security. Consider usedforsecurity=False
2 S607 Starting a process with a partial executable path
1 WPS117 Found name reserved for first argument: cls
6 WPS125 Found builtin shadowing: ImportError
5 WPS202 Found too many module members: 9 > 7
1 WPS235 Found too many imported names from a module: 11 > 8
1 WPS238 Found too many raises in a function: 6 > 3
6 WPS301 Found dotted raw import: click.globals
1 WPS303 Found underscored number: 4_194_304
4 WPS323 Found `%` string formatting
6 WPS324 Found inconsistent `return` statement
1 WPS325 Found inconsistent `yield` statement
1 WPS326 Found implicit string concatenation
1 WPS328 Found useless node: with
2 WPS331 Found variables that are only used for `return`: url
1 WPS333 Found implicit complex compare
4 WPS335 Found incorrect `for` loop iter type
6 WPS347 Found vague import that may cause confusion: *
2 WPS411 Found empty module
13 WPS421 Found wrong function call: print
14 WPS432 Found magic number: 255
14 WPS440 Found block variables overlap: _handle
4 WPS441 Found control variable used after block: need
1 WPS442 Found outer scope names shadowing: self
3 WPS450 Found protected object import: _identity_loaded_hook
1 WPS465 Found likely bitwise and boolean operation mixup
4 WPS503 Found useless returning `else` statement
3 WPS504 Found negated condition
6 WPS507 Found useless `len()` compare
3 WPS508 Found incorrect `not` with compare usage
2 WPS510 Found `in` used with a non-set container
1 WPS516 Found `type()` used to compare types
1 WPS529 Found implicit `.get()` dict usage
1 WPS531 Found simplifiable returning `if` condition in a function
6 WPS604 Found incorrect node inside `class` body
2 WPS605 Found method without arguments: api_version
2 WPS615 Found unpythonic getter or setter
Related: #6637