Skip to content

Commit

Permalink
FIX: disable duplicate code in linter
Browse files Browse the repository at this point in the history
  • Loading branch information
amilcarlucas committed Nov 6, 2024
1 parent ca60f1b commit a5ce335
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions MethodicConfigurator/frontend_tkinter_component_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def argument_parser():
Returns:
argparse.Namespace: An object containing the parsed arguments.
"""
# pylint: disable=duplicate-code
parser = ArgumentParser(
description=_(
"A GUI for editing JSON files that contain vehicle component configurations. "
Expand All @@ -49,6 +50,7 @@ def argument_parser():
parser = LocalFilesystem.add_argparse_arguments(parser)
parser = ComponentEditorWindow.add_argparse_arguments(parser)
return add_common_arguments_and_parse(parser)
# pylint: enable=duplicate-code


class VoltageTooLowError(Exception):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def argument_parser():
Returns:
argparse.Namespace: An object containing the parsed arguments.
"""
# pylint: disable=duplicate-code
parser = ArgumentParser(
description=_(
"A GUI for editing JSON files that contain vehicle component configurations. "
Expand All @@ -49,6 +50,7 @@ def argument_parser():
parser = LocalFilesystem.add_argparse_arguments(parser)
parser = ComponentEditorWindowBase.add_argparse_arguments(parser)
return add_common_arguments_and_parse(parser)
# pylint: enable=duplicate-code


class ComponentEditorWindowBase(BaseWindow):
Expand Down
2 changes: 2 additions & 0 deletions MethodicConfigurator/frontend_tkinter_connection_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ def argument_parser():
return add_common_arguments_and_parse(parser)


# pylint: disable=duplicate-code
def main():
args = argument_parser()

Expand All @@ -268,6 +269,7 @@ def main():
"another script"
)
)
# pylint: enable=duplicate-code

flight_controller = FlightController(args.reboot_time) # Initialize your FlightController instance
result = flight_controller.connect(device=args.device) # Connect to the flight controller
Expand Down
2 changes: 2 additions & 0 deletions MethodicConfigurator/frontend_tkinter_directory_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ def argument_parser():
return add_common_arguments_and_parse(parser)


# pylint: disable=duplicate-code
def main():
args = argument_parser()

Expand All @@ -498,6 +499,7 @@ def main():
" called from another script"
)
)
# pylint: enable=duplicate-code

local_filesystem = LocalFilesystem(args.vehicle_dir, args.vehicle_type, None, args.allow_editing_template_files)

Expand Down

0 comments on commit a5ce335

Please sign in to comment.