Skip to content

Commit cdbc1bc

Browse files
committed
Fix comma. [skip ci]
1 parent fbb3701 commit cdbc1bc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+661
-636
lines changed

scripts/update_plugin_list.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def _iter_plugins() -> Generator[dict[str, str], None, None]:
123123
for release in sorted(releases, key=packaging.version.parse, reverse=True):
124124
if releases[release]:
125125
release_date = datetime.date.fromisoformat(
126-
releases[release][-1]["upload_time_iso_8601"].split("T")[0],
126+
releases[release][-1]["upload_time_iso_8601"].split("T")[0]
127127
)
128128
last_release = release_date.strftime("%b %d, %Y")
129129
break
@@ -151,7 +151,7 @@ def _plugin_definitions(plugins: list[dict[str, str]]) -> Generator[str, None, N
151151
*requires*: {plugin["requires"]}
152152
153153
{plugin["summary"]}
154-
""",
154+
"""
155155
)
156156

157157

src/_pytask/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def main(raw_config: dict[str, Any]) -> Session: # noqa: C901
170170
help=("Choose whether tracebacks should be displayed or not."),
171171
)
172172
@click.option(
173-
"--dry-run", type=bool, is_flag=True, default=False, help="Perform a dry-run.",
173+
"--dry-run", type=bool, is_flag=True, default=False, help="Perform a dry-run."
174174
)
175175
def build(**raw_config: Any) -> NoReturn:
176176
"""Collect tasks, execute them and report the results.

src/_pytask/capture.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class DontReadFromInput:
156156

157157
def read(self, *_args: Any) -> None:
158158
raise OSError(
159-
"pytask: reading from stdin while output is captured! Consider using `-s`.",
159+
"pytask: reading from stdin while output is captured! Consider using `-s`."
160160
)
161161

162162
readline = read
@@ -270,7 +270,7 @@ def _assert_state(self, op: str, states: tuple[str, ...]) -> None:
270270
assert (
271271
self._state in states
272272
), "cannot {} in state {!r}: expected one of {}".format(
273-
op, self._state, ", ".join(states),
273+
op, self._state, ", ".join(states)
274274
)
275275

276276
def start(self) -> None:
@@ -398,7 +398,7 @@ def _assert_state(self, op: str, states: tuple[str, ...]) -> None:
398398
assert (
399399
self._state in states
400400
), "cannot {} in state {!r}: expected one of {}".format(
401-
op, self._state, ", ".join(states),
401+
op, self._state, ", ".join(states)
402402
)
403403

404404
def start(self) -> None:
@@ -512,14 +512,14 @@ def __len__(self) -> int:
512512
def __iter__(self) -> Iterator[AnyStr]:
513513
return iter((self.out, self.err))
514514

515-
def __getitem__(self, item: int) -> AnyStr:
515+
def __getitem__(self, item: int) -> AnyStr: # noqa: ARG002
516516
return tuple(self)[item]
517517

518518
def _replace(
519-
self, *, out: AnyStr | None = None, err: AnyStr | None = None,
519+
self, *, out: AnyStr | None = None, err: AnyStr | None = None
520520
) -> CaptureResult[AnyStr]:
521521
return CaptureResult(
522-
out=self.out if out is None else out, err=self.err if err is None else err,
522+
out=self.out if out is None else out, err=self.err if err is None else err
523523
)
524524

525525
def count(self, value: AnyStr) -> int:
@@ -634,8 +634,14 @@ def is_started(self) -> bool:
634634
return self._state == "started"
635635

636636
def readouterr(self) -> CaptureResult[AnyStr]:
637-
out = self.out.snap() if self.out else ""
638-
err = self.err.snap() if self.err else ""
637+
if self.out:
638+
out = self.out.snap()
639+
else:
640+
out = ""
641+
if self.err:
642+
err = self.err.snap()
643+
else:
644+
err = ""
639645
return CaptureResult(out, err) # type: ignore
640646

641647

@@ -654,7 +660,7 @@ def _get_multicapture(method: _CaptureMethod) -> MultiCapture[str]:
654660
return MultiCapture(in_=None, out=None, err=None)
655661
if method == _CaptureMethod.TEE_SYS:
656662
return MultiCapture(
657-
in_=None, out=SysCapture(1, tee=True), err=SysCapture(2, tee=True),
663+
in_=None, out=SysCapture(1, tee=True), err=SysCapture(2, tee=True)
658664
)
659665
raise ValueError(f"unknown capturing method: {method!r}")
660666

@@ -681,7 +687,7 @@ def __init__(self, method: _CaptureMethod) -> None:
681687

682688
def __repr__(self) -> str:
683689
return ("<CaptureManager _method={!r} _capturing={!r}>").format(
684-
self._method, self._capturing,
690+
self._method, self._capturing
685691
)
686692

687693
def is_capturing(self) -> bool:

src/_pytask/clean.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def clean(**raw_config: Any) -> NoReturn: # noqa: C901
113113
session = Session({}, None)
114114
session.exit_code = ExitCode.CONFIGURATION_FAILED
115115
exc_info: tuple[
116-
type[BaseException], BaseException, TracebackType | None,
116+
type[BaseException], BaseException, TracebackType | None
117117
] = sys.exc_info()
118118
console.print(render_exc_info(*exc_info))
119119

@@ -126,10 +126,10 @@ def clean(**raw_config: Any) -> NoReturn: # noqa: C901
126126
exclude = session.config["exclude"]
127127
include_directories = session.config["directories"]
128128
unknown_paths = _find_all_unknown_paths(
129-
session, known_paths, exclude, include_directories,
129+
session, known_paths, exclude, include_directories
130130
)
131131
common_ancestor = find_common_ancestor(
132-
*unknown_paths, *session.config["paths"],
132+
*unknown_paths, *session.config["paths"]
133133
)
134134

135135
if unknown_paths:
@@ -145,7 +145,7 @@ def clean(**raw_config: Any) -> NoReturn: # noqa: C901
145145
should_be_deleted = session.config[
146146
"mode"
147147
] == _CleanMode.FORCE or click.confirm(
148-
f"Would you like to remove {short_path}?",
148+
f"Would you like to remove {short_path}?"
149149
)
150150
if should_be_deleted:
151151
if not session.config["quiet"]:
@@ -157,7 +157,7 @@ def clean(**raw_config: Any) -> NoReturn: # noqa: C901
157157
else:
158158
console.print()
159159
console.print(
160-
"There are no files and directories which can be deleted.",
160+
"There are no files and directories which can be deleted."
161161
)
162162

163163
console.print()
@@ -241,8 +241,8 @@ def _find_all_unknown_paths(
241241
[
242242
_find_all_unkown_paths_per_recursive_node(node, include_directories)
243243
for node in recursive_nodes
244-
],
245-
),
244+
]
245+
)
246246
)
247247
return unknown_paths
248248

@@ -269,7 +269,7 @@ class _RecursivePathNode:
269269

270270
@classmethod
271271
def from_path(
272-
cls, path: Path, known_paths: Iterable[Path], exclude: tuple[str, ...],
272+
cls, path: Path, known_paths: Iterable[Path], exclude: tuple[str, ...]
273273
) -> _RecursivePathNode:
274274
"""Create a node from a path.
275275
@@ -310,7 +310,7 @@ def __repr__(self) -> str:
310310

311311

312312
def _find_all_unkown_paths_per_recursive_node(
313-
node: _RecursivePathNode, include_directories: bool,
313+
node: _RecursivePathNode, include_directories: bool
314314
) -> Generator[Path, None, None]:
315315
"""Return unknown paths per recursive file node.
316316

src/_pytask/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def _sort_options_for_each_command_alphabetically(cli: click.Group) -> None:
4444
"""Sort command line options and arguments for each command alphabetically."""
4545
for command in cli.commands:
4646
cli.commands[command].params = sorted(
47-
cli.commands[command].params, key=lambda x: x.name,
47+
cli.commands[command].params, key=lambda x: x.name
4848
)
4949

5050

@@ -105,6 +105,7 @@ def pytask_add_hooks(pm: pluggy.PluginManager) -> None:
105105
@click.version_option(**_VERSION_OPTION_KWARGS)
106106
def cli() -> None:
107107
"""Manage your tasks with pytask."""
108+
pass
108109

109110

110111
_extend_command_line_interface(cli)

src/_pytask/click.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(self, enum_type: type[enum.Enum], case_sensitive: bool = True) -> N
4242
self.enum_type = enum_type
4343

4444
def convert(
45-
self, value: Any, param: click.Parameter | None, ctx: click.Context | None,
45+
self, value: Any, param: click.Parameter | None, ctx: click.Context | None
4646
) -> Any:
4747
if isinstance(value, enum.Enum):
4848
value = value.value
@@ -66,17 +66,17 @@ class ColoredGroup(DefaultGroup):
6666
"""A subclass which colors groups with default commands."""
6767

6868
def format_help(
69-
self: DefaultGroup, ctx: click.Context, formatter: Any, # noqa: ARG002
69+
self: DefaultGroup, ctx: click.Context, formatter: Any # noqa: ARG002
7070
) -> None:
7171
"""Format the help text."""
7272
highlighter = _OptionHighlighter()
7373

7474
console.print(
75-
f"[b]pytask[/b] [dim]v{version}[/]\n", justify="center", highlight=False,
75+
f"[b]pytask[/b] [dim]v{version}[/]\n", justify="center", highlight=False
7676
)
7777

7878
console.print(
79-
"Usage: [b]pytask[/b] [b][OPTIONS][/b] [b][COMMAND][/b] [b][PATHS][/b]\n",
79+
"Usage: [b]pytask[/b] [b][OPTIONS][/b] [b][COMMAND][/b] [b][PATHS][/b]\n"
8080
)
8181

8282
console.print(self.help, style="dim")
@@ -100,7 +100,7 @@ def format_help(
100100
title="[bold #f2f2f2]Commands[/]",
101101
title_align="left",
102102
border_style="grey37",
103-
),
103+
)
104104
)
105105

106106
_print_options(self, ctx)
@@ -115,15 +115,15 @@ class ColoredCommand(click.Command):
115115
"""Override Clicks help with a Richer version."""
116116

117117
def format_help(
118-
self: click.Command, ctx: click.Context, formatter: Any, # noqa: ARG002
118+
self: click.Command, ctx: click.Context, formatter: Any # noqa: ARG002
119119
) -> None:
120120
"""Format the help text."""
121121
console.print(
122-
f"[b]pytask[/b] [dim]v{version}[/]\n", justify="center", highlight=False,
122+
f"[b]pytask[/b] [dim]v{version}[/]\n", justify="center", highlight=False
123123
)
124124

125125
console.print(
126-
f"Usage: [b]pytask[/b] [b]{self.name}[/b] [b][OPTIONS][/b] [b][PATHS][/b]\n",
126+
f"Usage: [b]pytask[/b] [b]{self.name}[/b] [b][OPTIONS][/b] [b][PATHS][/b]\n"
127127
)
128128

129129
console.print(self.help, style="dim")
@@ -138,7 +138,7 @@ def format_help(
138138

139139

140140
def _print_options(
141-
group_or_command: click.Command | DefaultGroup, ctx: click.Context,
141+
group_or_command: click.Command | DefaultGroup, ctx: click.Context
142142
) -> None:
143143
"""Print options formatted with a table in a panel."""
144144
highlighter = _OptionHighlighter()
@@ -187,7 +187,7 @@ def _print_options(
187187
title="[bold #f2f2f2]Options[/]",
188188
title_align="left",
189189
border_style="grey37",
190-
),
190+
)
191191
)
192192

193193

@@ -252,7 +252,7 @@ def _format_help_text(param: click.Parameter, ctx: click.Context) -> str: # noq
252252
# For boolean flags that have distinct True/False opts,
253253
# use the opt without prefix instead of the value.
254254
default_string = split_opt(
255-
(param.opts if param.default else param.secondary_opts)[0],
255+
(param.opts if param.default else param.secondary_opts)[0]
256256
)[1]
257257
elif (
258258
param.is_bool_flag # type: ignore[attr-defined]

0 commit comments

Comments
 (0)