Skip to content

Commit

Permalink
Update linters
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidy22 committed Jan 4, 2025
1 parent 0eba0bb commit 4e4573a
Show file tree
Hide file tree
Showing 16 changed files with 155 additions and 123 deletions.
6 changes: 4 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ ignore =
E402,
C901,
E722,
W503, # line break before binary operator
E231, # missing whitespace after ','
W503,
# line break before binary operator
E231,
# missing whitespace after ','
max-line-length = 100
exclude = env,.direnv,docs
max-complexity = 25
12 changes: 2 additions & 10 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ confidence=
disable=
arguments-differ,
attribute-defined-outside-init,
bad-continuation,
broad-except,
consider-using-ternary,
deprecated-method,
Expand All @@ -73,24 +72,24 @@ disable=
import-error, # needed for travis build
inconsistent-return-statements,
invalid-name,
locally-enabled,
missing-docstring,
no-member,
no-method-argument,
no-name-in-module,
no-self-use,
no-value-for-parameter,
pointless-string-statement,
protected-access,
redefined-builtin,
too-few-public-methods,
too-many-arguments,
too-many-boolean-expressions,
too-many-branches,
too-many-instance-attributes,
too-many-lines,
too-many-locals,
too-many-nested-blocks,
too-many-public-methods,
too-many-positional-arguments,
too-many-statements,
undefined-variable,
ungrouped-imports,
Expand Down Expand Up @@ -307,13 +306,6 @@ max-line-length=100
# Maximum number of lines in a module.
max-module-lines=1000

# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,
dict-separator

# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
single-line-class-stmt=no
Expand Down
9 changes: 4 additions & 5 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ python_version = "3"

[dev-packages]
"autopep8" = "*"
"flake8" = ">=3.8.0,<4.0.0"
"flake8" = "==7.1.1"
"pep8" = "*"
pylint = "*"
typed-ast = "*"
pylint = "==3.3.2"
astroid = "*"
fiximports = ">=0.1.18"
mock = ">=2.0.0"
Expand All @@ -31,8 +30,8 @@ scandir = {markers = "python_version > '3.5'"}
pyfakefs = "*"
pytest-cov = "*"
pew = "*"
black = "==21.8b0"
flakehell = "*"
black = "==24.10.0"
typing-extensions = "*"
toml = "*"
pre-commit = "==2.17.0"

Expand Down
70 changes: 21 additions & 49 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion guake/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@


class AboutDialog(SimpleGladeApp):

"""The About Guake dialog class"""

def __init__(self):
Expand Down
17 changes: 5 additions & 12 deletions guake/boxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@ def get_terminals(self):

def iter_terminals(self):
if self.get_child() is not None:
for t in self.get_child().iter_terminals():
yield t
yield from self.get_child().iter_terminals()

def replace_child(self, old, new):
self.remove(old)
Expand Down Expand Up @@ -221,17 +220,14 @@ def save_box_layout(self, box, panes: list):

def restore_box_layout(self, box, panes: list):
"""Restore box layout by `panes`"""
if not panes or not isinstance(panes, list):
return
if not box or not isinstance(box, TerminalBox):
# Should only called on TerminalBox
if not panes or not isinstance(panes, list) or not box or not isinstance(box, TerminalBox):
return

cur = panes.pop(0)
if cur["type"].startswith("dual"):
while True:
if self.guake:
# If Guake are not visible, we should pending the restore, then do the
# If Guake is not visible, we should pending the restore, then do the
# restore when Guake is visible again.
#
# Otherwise we will stuck in the infinite loop, since new DualTerminalBox
Expand Down Expand Up @@ -384,7 +380,6 @@ def do_search(self, widget):


class TerminalBox(Gtk.Box, TerminalHolder):

"""A box to group the terminal and a scrollbar."""

def __init__(self):
Expand Down Expand Up @@ -588,10 +583,8 @@ def get_terminals(self):
return self.get_child1().get_terminals() + self.get_child2().get_terminals()

def iter_terminals(self):
for t in self.get_child1().iter_terminals():
yield t
for t in self.get_child2().iter_terminals():
yield t
yield from self.get_child1().iter_terminals()
yield from self.get_child2().iter_terminals()

def replace_child(self, old, new):
if self.get_child1() is old:
Expand Down
1 change: 0 additions & 1 deletion guake/customcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


class CustomCommands:

"""
Example for a custom commands file
[
Expand Down
2 changes: 0 additions & 2 deletions guake/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def get_text(self):


class PromptQuitDialog(Gtk.MessageDialog):

"""Prompts the user whether to quit/close a tab."""

def __init__(self, parent, procs, tabs, notebooks):
Expand Down Expand Up @@ -99,7 +98,6 @@ def close_tab(self):


class PromptResetColorsDialog(Gtk.MessageDialog):

"""Prompts the user whether to reset tab colors."""

def __init__(self, parent):
Expand Down
1 change: 0 additions & 1 deletion guake/gsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@


class GSettingHandler:

"""Handles gconf changes, if any gconf variable is changed, a
different method is called to handle this change.
"""
Expand Down
5 changes: 1 addition & 4 deletions guake/guake_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@


class Guake(SimpleGladeApp):

"""Guake main class. Handles specialy the main window."""

def __init__(self):
Expand Down Expand Up @@ -288,9 +287,7 @@ def window_event(*args):
filename = pixmapfile("guake-notification.png")
notifier.showMessage(
_("Guake Terminal"),
_("Guake is now running,\n" "press <b>{!s}</b> to use it.").format(
xml_escape(label)
),
_("Guake is now running,\npress <b>{!s}</b> to use it.").format(xml_escape(label)),
filename,
)

Expand Down
1 change: 0 additions & 1 deletion guake/keybindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@


class Keybindings:

"""Handles changes in keyboard shortcuts."""

def __init__(self, guake):
Expand Down
13 changes: 6 additions & 7 deletions guake/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,31 +288,31 @@ def main():
dest="bgcolor",
action="store",
default="",
help=_("Set the hexadecimal (#rrggbb) background color of " "the selected tab."),
help=_("Set the hexadecimal (#rrggbb) background color of the selected tab."),
)

parser.add_argument(
"--fgcolor",
dest="fgcolor",
action="store",
default="",
help=_("Set the hexadecimal (#rrggbb) foreground color of the " "selected tab."),
help=_("Set the hexadecimal (#rrggbb) foreground color of the selected tab."),
)

parser.add_argument(
"--bgcolor-current",
dest="bgcolor_current",
action="store",
default="",
help=_("Set the hexadecimal (#rrggbb) background color of " "the current terminal."),
help=_("Set the hexadecimal (#rrggbb) background color of the current terminal."),
)

parser.add_argument(
"--fgcolor-current",
dest="fgcolor_current",
action="store",
default="",
help=_("Set the hexadecimal (#rrggbb) foreground color of " "the current terminal."),
help=_("Set the hexadecimal (#rrggbb) foreground color of the current terminal."),
)

parser.add_argument(
Expand Down Expand Up @@ -346,8 +346,7 @@ def main():
action="store",
default="",
help=_(
"Rename the specified tab by --tab-index. Reset to default if TITLE is "
'a single dash "-".'
'Rename tab specified by --tab-index. Reset to default if TITLE is a single dash "-".'
),
)

Expand All @@ -358,7 +357,7 @@ def main():
metavar="TITLE",
action="store",
default="",
help=_("Rename the current tab. Reset to default if TITLE is a " 'single dash "-".'),
help=_('Rename the current tab. Reset to default if TITLE is a single dash "-".'),
)

parser.add_argument(
Expand Down
Loading

0 comments on commit 4e4573a

Please sign in to comment.