Skip to content

Commit bb3e8d1

Browse files
authored
Merge pull request #235 from sandialabs/pre-commit-ci-update-config
ci: pre-commit auto-update
2 parents 569eca2 + 3f646dd commit bb3e8d1

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ci:
77
repos:
88

99
- repo: https://github.com/astral-sh/ruff-pre-commit
10-
rev: v0.13.3
10+
rev: v0.14.1
1111
hooks:
1212
- id: ruff-check
1313
- id: ruff-format

shell_logger/shell.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from threading import Thread
1919
from time import time
2020
from types import SimpleNamespace
21-
from typing import IO, Optional, TextIO
21+
from typing import IO, TextIO
2222

2323
END_OF_READ = 4
2424

@@ -44,7 +44,7 @@ class Shell: # noqa: PLW1641
4444
"""
4545

4646
def __init__(
47-
self, pwd: Optional[Path] = None, *, login_shell: bool = False
47+
self, pwd: Path | None = None, *, login_shell: bool = False
4848
) -> None:
4949
"""
5050
Initialize a :class:`Shell` object.
@@ -233,7 +233,7 @@ def run(self, command: str, **kwargs) -> SimpleNamespace:
233233

234234
@staticmethod
235235
def tee( # noqa: C901
236-
stdout: Optional[IO[bytes]], stderr: Optional[IO[bytes]], **kwargs
236+
stdout: IO[bytes] | None, stderr: IO[bytes] | None, **kwargs
237237
) -> SimpleNamespace:
238238
"""
239239
Write output/error streams to multiple files.
@@ -317,9 +317,7 @@ def write(input_file: TextIO, output_files: list[TextIO]) -> None:
317317
file.close()
318318
return SimpleNamespace(stdout_str=stdout_str, stderr_str=stderr_str)
319319

320-
def auxiliary_command(
321-
self, **kwargs
322-
) -> tuple[Optional[str], Optional[str]]:
320+
def auxiliary_command(self, **kwargs) -> tuple[str | None, str | None]:
323321
"""
324322
Run auxiliary commands like `umask`, `pwd`, `env`, etc.
325323

shell_logger/shell_logger.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from pathlib import Path
2121
from tempfile import NamedTemporaryFile
2222
from types import SimpleNamespace
23-
from typing import Optional
2423

2524
from .html_utilities import (
2625
append_html,
@@ -135,15 +134,15 @@ def __init__( # noqa: PLR0913
135134
self,
136135
name: str,
137136
*,
138-
log_dir: Optional[Path] = None,
139-
stream_dir: Optional[Path] = None,
140-
html_file: Optional[Path] = None,
137+
log_dir: Path | None = None,
138+
stream_dir: Path | None = None,
139+
html_file: Path | None = None,
141140
indent: int = 0,
142141
login_shell: bool = False,
143-
log: Optional[list[object]] = None,
144-
init_time: Optional[datetime] = None,
145-
done_time: Optional[datetime] = None,
146-
duration: Optional[str] = None,
142+
log: list[object] | None = None,
143+
init_time: datetime | None = None,
144+
done_time: datetime | None = None,
145+
duration: str | None = None,
147146
) -> None:
148147
"""
149148
Initialize a :class:`ShellLogger` object.
@@ -488,7 +487,7 @@ def log( # noqa: PLR0913
488487
msg: str,
489488
cmd: str,
490489
*,
491-
cwd: Optional[Path] = None,
490+
cwd: Path | None = None,
492491
live_stdout: bool = False,
493492
live_stderr: bool = False,
494493
return_info: bool = False,

0 commit comments

Comments
 (0)