osbuild: avoid [] as default value
Using `[]` as default value for arguments makes `pylint` complain. The reason is that it creates an array statically at the time the function is parsed, rather than dynamically on invocation of the function. This means, when you append to this array, you change the global instance and every further invocation of that function works on this modified array. While our use-cases are safe, this is indeed a common pitfall. Lets avoid using this and resort to `None` instead. This silences a lot of warnings from pylint about "dangerous use of []".
This commit is contained in:
parent
14ada360bd
commit
46526cf205
4 changed files with 8 additions and 8 deletions
|
|
@ -95,7 +95,7 @@ def parse_arguments(sys_argv):
|
|||
|
||||
|
||||
# pylint: disable=too-many-branches
|
||||
def osbuild_cli(*, sys_argv=[]):
|
||||
def osbuild_cli(*, sys_argv):
|
||||
args = parse_arguments(sys_argv)
|
||||
manifest = parse_manifest(args.manifest_path)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue