Skip to content

Commit 82da096

Browse files
committed
ruff(pydocstyle): Run automated fixes
`ruff --show-fixes --fix-only .` Fixed 45 errors: - docs/_ext/aafig.py: 7 × D208 (over-indentation) 1 × D202 (no-blank-line-after-function) - src/tmuxp/cli/__init__.py: 2 × D202 (no-blank-line-after-function) 1 × D209 (new-line-after-last-paragraph) - src/tmuxp/cli/freeze.py: 1 × D209 (new-line-after-last-paragraph) - src/tmuxp/cli/import_config.py: 2 × D209 (new-line-after-last-paragraph) - src/tmuxp/cli/load.py: 2 × D412 (blank-lines-between-header-and-content) 1 × D406 (new-line-after-section-name) 1 × D407 (dashed-underline-after-section) - src/tmuxp/cli/utils.py: 3 × D202 (no-blank-line-after-function) - src/tmuxp/exc.py: 5 × D211 (blank-line-before-class) - src/tmuxp/log.py: 1 × D202 (no-blank-line-after-function) - src/tmuxp/types.py: 1 × D412 (blank-lines-between-header-and-content) - src/tmuxp/workspace/builder.py: 2 × D202 (no-blank-line-after-function) 1 × D412 (blank-lines-between-header-and-content) - src/tmuxp/workspace/finders.py: 1 × D202 (no-blank-line-after-function) - src/tmuxp/workspace/freezer.py: 1 × D202 (no-blank-line-after-function) - src/tmuxp/workspace/importers.py: 2 × D202 (no-blank-line-after-function) 1 × D412 (blank-lines-between-header-and-content) - src/tmuxp/workspace/loader.py: 2 × D202 (no-blank-line-after-function) - tests/cli/test_cli.py: 1 × D202 (no-blank-line-after-function) - tests/tests/test_helpers.py: 1 × D202 (no-blank-line-after-function) - tests/workspace/test_finder.py: 3 × D202 (no-blank-line-after-function) - tests/workspace/test_freezer.py: 1 × D202 (no-blank-line-after-function) - tests/workspace/test_import_teamocil.py: 1 × D209 (new-line-after-last-paragraph) Fixed 45 errors (35 additional fixes available with `--unsafe-fixes`).
1 parent 3bcd28a commit 82da096

File tree

19 files changed

+19
-44
lines changed

19 files changed

+19
-44
lines changed

docs/_ext/aafig.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
"""
2-
sphinxcontrib.aafig
3-
~~~~~~~~~~~~~~~~~~~
2+
sphinxcontrib.aafig
3+
~~~~~~~~~~~~~~~~~~~
44
5-
Allow embedded ASCII art to be rendered as nice looking images
6-
using the aafigure reStructuredText extension.
5+
Allow embedded ASCII art to be rendered as nice looking images
6+
using the aafigure reStructuredText extension.
77
8-
See the README file for details.
8+
See the README file for details.
99
10-
:author: Leandro Lucarella <llucax@gmail.com>
11-
:license: BOLA, see LICENSE for details
10+
:author: Leandro Lucarella <llucax@gmail.com>
11+
:license: BOLA, see LICENSE for details
1212
"""
1313
import logging
1414
import posixpath
@@ -158,7 +158,6 @@ def render_aafigure(
158158
"""
159159
Render an ASCII art figure into the requested format output file.
160160
"""
161-
162161
if aafigure is None:
163162
raise AafigureNotInstalled()
164163

src/tmuxp/cli/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ def cli(_args: t.Optional[t.List[str]] = None) -> None:
111111
112112
Pass the "--help" argument to any command to see detailed help.
113113
See detailed documentation and examples at:
114-
http://tmuxp.git-pull.com/"""
115-
114+
http://tmuxp.git-pull.com/
115+
"""
116116
try:
117117
has_minimum_version()
118118
except TmuxCommandNotFound:
@@ -186,6 +186,5 @@ def startup(config_dir: pathlib.Path) -> None:
186186
----------
187187
str : get_workspace_dir(): Config directory to search
188188
"""
189-
190189
if not os.path.exists(config_dir):
191190
os.makedirs(config_dir)

src/tmuxp/cli/freeze.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ def command_freeze(
9090
"""Snapshot a tmux session into a tmuxp workspace.
9191
9292
If SESSION_NAME is provided, snapshot that session. Otherwise, use the
93-
current session."""
93+
current session.
94+
"""
9495
server = Server(socket_name=args.socket_name, socket_path=args.socket_path)
9596

9697
try:

src/tmuxp/cli/import_config.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ def command_import_tmuxinator(
176176
parser: t.Optional[argparse.ArgumentParser] = None,
177177
) -> None:
178178
"""Convert a tmuxinator config from workspace_file to tmuxp format and import
179-
it into tmuxp."""
179+
it into tmuxp.
180+
"""
180181
workspace_file = find_workspace_file(
181182
workspace_file, workspace_dir=get_tmuxinator_dir()
182183
)
@@ -188,7 +189,8 @@ def command_import_teamocil(
188189
parser: t.Optional[argparse.ArgumentParser] = None,
189190
) -> None:
190191
"""Convert a teamocil config from workspace_file to tmuxp format and import
191-
it into tmuxp."""
192+
it into tmuxp.
193+
"""
192194
workspace_file = find_workspace_file(
193195
workspace_file, workspace_dir=get_teamocil_dir()
194196
)

src/tmuxp/cli/load.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class CLILoadNamespace(argparse.Namespace):
5050
def set_layout_hook(session: Session, hook_name: str) -> None:
5151
"""Set layout hooks to normalize layout.
5252
53-
References:
54-
53+
References
54+
----------
5555
- tmuxp issue: https://github.com/tmux-python/tmuxp/issues/309
5656
- tmux issue: https://github.com/tmux/tmux/issues/1106
5757
@@ -305,7 +305,6 @@ def load_workspace(
305305
306306
Notes
307307
-----
308-
309308
tmuxp will check and load a workspace file. The file will use ConfigReader
310309
to load a JSON/YAML into a :py:obj:`dict`. Then :func:`loader.expand` and
311310
:func:`loader.trickle` will be used to expand any shorthands, template

src/tmuxp/cli/utils.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ def prompt(
4747
:param default: default value if no input provided.
4848
:rtype: string
4949
"""
50-
5150
_prompt = name + (default and " [%s]" % default or "")
5251
_prompt += name.endswith("?") and " " or ": "
5352
while True:
@@ -78,7 +77,6 @@ def prompt_bool(
7877
:param no_choices: default 'n', 'no', '0', 'off', 'false', 'f'
7978
:rtype: bool
8079
"""
81-
8280
yes_choices = yes_choices or ("y", "yes", "1", "on", "true", "t")
8381
no_choices = no_choices or ("n", "no", "0", "off", "false", "f")
8482

@@ -121,7 +119,6 @@ def prompt_choices(
121119
:param no_choice: acceptable list of strings for "null choice"
122120
:rtype: str
123121
"""
124-
125122
_choices: t.List[str] = []
126123
options: t.List[str] = []
127124

src/tmuxp/exc.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@
1212

1313

1414
class TmuxpException(Exception):
15-
1615
"""Base Exception for Tmuxp Errors."""
1716

1817

1918
class WorkspaceError(TmuxpException):
20-
2119
"""Error parsing tmuxp workspace data."""
2220

2321

@@ -52,7 +50,6 @@ def __init__(
5250

5351

5452
class EmptyWorkspaceException(WorkspaceError):
55-
5653
"""Workspace file is empty."""
5754

5855
def __init__(self, *args: object, **kwargs: object) -> None:
@@ -75,7 +72,6 @@ def __init__(self, *args: object, **kwargs: object) -> None:
7572

7673

7774
class TmuxpPluginException(TmuxpException):
78-
7975
"""Base Exception for Tmuxp Errors."""
8076

8177

@@ -88,7 +84,6 @@ def __init__(self, *args: object, **kwargs: object) -> None:
8884

8985
@implements_to_string
9086
class BeforeLoadScriptError(Exception):
91-
9287
"""Exception replacing :py:class:`subprocess.CalledProcessError` for
9388
:meth:`tmuxp.util.run_before_script`.
9489
"""

src/tmuxp/log.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ def debug_log_template(
155155
str
156156
Log template.
157157
"""
158-
159158
reset = Style.RESET_ALL
160159
levelname = (
161160
LEVEL_COLORS.get(record.levelname, "")

src/tmuxp/types.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
Notes
44
-----
5-
65
:class:`StrPath` and :class:`StrOrBytesPath` is based on `typeshed's`_.
76
87
.. _typeshed's: https://github.com/python/typeshed/blob/9687d5/stdlib/_typeshed/__init__.pyi#L98

src/tmuxp/workspace/builder.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class WorkspaceBuilder:
3333
3434
Examples
3535
--------
36-
3736
>>> import yaml
3837
3938
>>> session_config = yaml.load('''
@@ -161,7 +160,6 @@ def __init__(
161160
TODO: Initialize :class:`libtmux.Session` from here, in
162161
``self.session``.
163162
"""
164-
165163
if plugins is None:
166164
plugins = []
167165
if not session_config:
@@ -222,7 +220,6 @@ def build(self, session: t.Optional[Session] = None, append: bool = False) -> No
222220
append : bool
223221
append windows in current active session
224222
"""
225-
226223
if not session:
227224
if not self.server:
228225
raise exc.TmuxpException(

0 commit comments

Comments
 (0)