fix(lint): satisfy ansible-test pylint in the molecule selector
ansible-test sanity runs pylint over scripts/ and tests/scripts/ too and rejects a mutable default argument (environ=os.environ) and `_` as a variable name. main() now takes environ=None and reads os.environ itself, and the tests name the values they ignore. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
This commit is contained in:
1 parent
fdab483109
commit
a94bee8fd3
2 files changed
+20
-19
No files matched your search
@@ -148,7 +148,8 @@ def changed_paths(base_ref):
|
||||
return [os.fsdecode(p) for p in out.split(b"\0") if p]
|
||||
|
||||
|
||||
def main(argv, environ=os.environ):
|
||||
def main(argv, environ=None):
|
||||
environ = os.environ if environ is None else environ
|
||||
if len(argv) > 2:
|
||||
print("usage: select_molecule_scenarios.py [<base-ref>]", file=sys.stderr)
|
||||
return 2
|
||||
|
||||
Reference in new issue
Block a user