summaryrefslogtreecommitdiff
path: root/gitlab/v4/cli.py
diff options
context:
space:
mode:
authorJohn L. Villalovos <john@sodarock.com>2021-12-07 23:05:08 -0800
committerJohn L. Villalovos <john@sodarock.com>2021-12-07 23:05:08 -0800
commita90eb23cb4903ba25d382c37ce1c0839642ba8fd (patch)
tree13fd5faed4bc11fb0e80e071ddbdb4b19670ccb1 /gitlab/v4/cli.py
parent3a7d6f6b7d168f00513266f5770624158f49ca2c (diff)
downloadgitlab-a90eb23cb4903ba25d382c37ce1c0839642ba8fd.tar.gz
chore: fix pylint error "expression-not-assigned"
Fix pylint error "expression-not-assigned" and remove check from the disabled list. And I personally think it is much more readable now and is less lines of code.
Diffstat (limited to 'gitlab/v4/cli.py')
-rw-r--r--gitlab/v4/cli.py48
1 files changed, 20 insertions, 28 deletions
diff --git a/gitlab/v4/cli.py b/gitlab/v4/cli.py
index 1b98193..675f93a 100644
--- a/gitlab/v4/cli.py
+++ b/gitlab/v4/cli.py
@@ -266,20 +266,16 @@ def _populate_sub_parser_by_class(
sub_parser_action.add_argument(f"--{id_attr}", required=True)
required, optional, dummy = cli.custom_actions[name][action_name]
- [
- sub_parser_action.add_argument(
- f"--{x.replace('_', '-')}", required=True
- )
- for x in required
- if x != cls._id_attr
- ]
- [
- sub_parser_action.add_argument(
- f"--{x.replace('_', '-')}", required=False
- )
- for x in optional
- if x != cls._id_attr
- ]
+ for x in required:
+ if x != cls._id_attr:
+ sub_parser_action.add_argument(
+ f"--{x.replace('_', '-')}", required=True
+ )
+ for x in optional:
+ if x != cls._id_attr:
+ sub_parser_action.add_argument(
+ f"--{x.replace('_', '-')}", required=False
+ )
if mgr_cls.__name__ in cli.custom_actions:
name = mgr_cls.__name__
@@ -293,20 +289,16 @@ def _populate_sub_parser_by_class(
sub_parser_action.add_argument("--sudo", required=False)
required, optional, dummy = cli.custom_actions[name][action_name]
- [
- sub_parser_action.add_argument(
- f"--{x.replace('_', '-')}", required=True
- )
- for x in required
- if x != cls._id_attr
- ]
- [
- sub_parser_action.add_argument(
- f"--{x.replace('_', '-')}", required=False
- )
- for x in optional
- if x != cls._id_attr
- ]
+ for x in required:
+ if x != cls._id_attr:
+ sub_parser_action.add_argument(
+ f"--{x.replace('_', '-')}", required=True
+ )
+ for x in optional:
+ if x != cls._id_attr:
+ sub_parser_action.add_argument(
+ f"--{x.replace('_', '-')}", required=False
+ )
def extend_parser(parser: argparse.ArgumentParser) -> argparse.ArgumentParser: