Skip to content

Commit

Permalink
ruff: select flake8-bugbear Ruff rules and fix existing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
KKoukiou committed Dec 18, 2024
1 parent 18e4088 commit d5bc99b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyanaconda/argument_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def __init__(self, *args, **kwargs):
# long option variants could be allowed from multiple, so it would have to be list which
# somehow kills the benefit.
self._require_prefix_ignore_list = ["proxy"]
# ruff: noqa: B026
ArgumentParser.__init__(self, description=DESCRIPTION,
formatter_class=lambda prog: HelpFormatter(
prog, max_help_position=LEFT_PADDING, width=help_width),
Expand Down
4 changes: 4 additions & 0 deletions tests/ruff/ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ line-length = 99
[lint]
select = [
"A", # flake8-builtins
"B", # flake8-bugbear
"E", # pycodestyle error
"F", # pyflakes
"W", # pycodestyle warning (mostly whitespace related)
Expand All @@ -15,6 +16,9 @@ select = [
"SIM", # flake8-simplify
]
ignore = [
"B024", # abstract-base-class-without-abstract-method
"B027", # empty-method-without-abstract-decorator
"B028", # No explicit stacklevel
"E501", # Line too long
"E402", # Module level import not at top of file
"F405", # `<type>` may be undefined, or defined from star imports: `<module>`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ def _check_localed_wrapper_signals(last_known_state, compositor_state,
mocked_localed_proxy.X11Variant = ",".join(map(lambda x: x[1], last_known_state))
# loading the above values to local last known list
# pylint: disable=pointless-statement
# ruff: noqa: B018
localed_wrapper.layouts_variants

for k in compositor_state:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ def test_handler(self):

# Test if the handler provides the required data objects.
for command in specification.commands:
# ruff: noqa: B009
getattr(handler.commands[command], "dataClass")

def test_parser(self):
Expand Down

0 comments on commit d5bc99b

Please sign in to comment.