diff --git a/CHANGES b/CHANGES index 2c514ad7f3..9d92e30a23 100644 --- a/CHANGES +++ b/CHANGES @@ -50,6 +50,7 @@ environment and file an issue on the tracker. ### Development +- Another `ruff` linting pass, this time with ruff 0.3.7 (#928) - poetry: 1.8.1 -> 1.8.2 See also: https://github.com/python-poetry/poetry/blob/1.8.2/CHANGELOG.md diff --git a/docs/_ext/aafig.py b/docs/_ext/aafig.py index 0c49b62151..3adeae2c95 100644 --- a/docs/_ext/aafig.py +++ b/docs/_ext/aafig.py @@ -193,7 +193,8 @@ def render_aafigure( try: try: with open( - metadata_fname, encoding=locale.getpreferredencoding(False) + metadata_fname, + encoding=locale.getpreferredencoding(False), ) as f: extra = f.read() except Exception as e: @@ -217,7 +218,9 @@ def render_aafigure( if options["format"].lower() == "svg": extra = visitor.get_size_attrs() with open( - metadata_fname, "w", encoding=locale.getpreferredencoding(False) + metadata_fname, + "w", + encoding=locale.getpreferredencoding(False), ) as f: f.write(extra) diff --git a/src/tmuxp/cli/load.py b/src/tmuxp/cli/load.py index f03447bf1a..db80df3e51 100644 --- a/src/tmuxp/cli/load.py +++ b/src/tmuxp/cli/load.py @@ -143,9 +143,8 @@ def _load_attached(builder: WorkspaceBuilder, detached: bool) -> None: builder.session.switch_client() # switch client to new session os.environ["TMUX"] = tmux_env # set TMUX back again - else: - if not detached: - builder.session.attach_session() + elif not detached: + builder.session.attach_session() def _load_detached(builder: WorkspaceBuilder) -> None: diff --git a/src/tmuxp/plugin.py b/src/tmuxp/plugin.py index 1f8ad53e65..7b0dab357a 100644 --- a/src/tmuxp/plugin.py +++ b/src/tmuxp/plugin.py @@ -157,25 +157,19 @@ def __init__(self, **kwargs: "Unpack[PluginConfigSchema]") -> None: "version": self.tmux_version, "vmin": config["tmux_min_version"], "vmax": config["tmux_max_version"], - "incompatible": config["tmux_version_incompatible"] - if config["tmux_version_incompatible"] - else [], + "incompatible": config["tmux_version_incompatible"] or [], }, "libtmux": { "version": self.libtmux_version, "vmin": config["libtmux_min_version"], "vmax": config["libtmux_max_version"], - "incompatible": config["libtmux_version_incompatible"] - if config["libtmux_version_incompatible"] - else [], + "incompatible": config["libtmux_version_incompatible"] or [], }, "tmuxp": { "version": self.tmuxp_version, "vmin": config["tmuxp_min_version"], "vmax": config["tmuxp_max_version"], - "incompatible": config["tmuxp_version_incompatible"] - if config["tmuxp_version_incompatible"] - else [], + "incompatible": config["tmuxp_version_incompatible"] or [], }, } diff --git a/src/tmuxp/workspace/builder.py b/src/tmuxp/workspace/builder.py index 78e99b3353..0b341dd58c 100644 --- a/src/tmuxp/workspace/builder.py +++ b/src/tmuxp/workspace/builder.py @@ -24,7 +24,7 @@ def get_default_columns() -> int: """Return default session column size use when building new tmux sessions.""" return int( - os.getenv("TMUXP_DEFAULT_COLUMNS", os.getenv("COLUMNS", COLUMNS_FALLBACK)) + os.getenv("TMUXP_DEFAULT_COLUMNS", os.getenv("COLUMNS", COLUMNS_FALLBACK)), ) @@ -250,7 +250,7 @@ def build(self, session: t.Optional[Session] = None, append: bool = False) -> No and os.getenv("TMUXP_DETECT_TERMINAL_SIZE", "1") == "1" ): terminal_size = shutil.get_terminal_size( - fallback=(get_default_columns(), get_default_rows()) + fallback=(get_default_columns(), get_default_rows()), ) new_session_kwargs["x"] = terminal_size.columns new_session_kwargs["y"] = terminal_size.lines