Skip to content

Commit 03d5bd6

Browse files
scripts: format example_west_command to follow ruff guidelines
Format example_west_command to comply with ruff CI checks Signed-off-by: Daniel DeGrasse <daniel.degrasse@analog.com>
1 parent dd91b4b commit 03d5bd6

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

scripts/example_west_command.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
from west.commands import WestCommand # your extension must subclass this
1010

11-
class ExampleWestCommand(WestCommand):
1211

12+
class ExampleWestCommand(WestCommand):
1313
def __init__(self):
1414
super().__init__(
15-
'example-west-command', # gets stored as self.name
15+
'example-west-command', # gets stored as self.name
1616
'an example west extension command', # self.help
1717
# self.description:
1818
'''\
@@ -22,21 +22,20 @@ def __init__(self):
2222
reflowed for you. You can also pass
2323
formatter_class=argparse.RawDescriptionHelpFormatter when calling
2424
parser_adder.add_parser() below if you want to keep your line
25-
endings.''')
25+
endings.''',
26+
)
2627

2728
def do_add_parser(self, parser_adder):
2829
# This is a bit of boilerplate, which allows you full control over the
2930
# type of argparse handling you want. The "parser_adder" argument is
3031
# the return value of an argparse.ArgumentParser.add_subparsers() call.
31-
parser = parser_adder.add_parser(self.name,
32-
help=self.help,
33-
description=self.description)
32+
parser = parser_adder.add_parser(self.name, help=self.help, description=self.description)
3433

3534
# Add some example options using the standard argparse module API.
3635
parser.add_argument('-o', '--optional', help='an optional argument')
3736
parser.add_argument('required', help='a required argument')
3837

39-
return parser # gets stored as self.parser
38+
return parser # gets stored as self.parser
4039

4140
def do_run(self, args, unknown_args):
4241
# This gets called when the user runs the command, e.g.:

0 commit comments

Comments
 (0)