Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #3081

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
- id: pyproject-fmt
additional_dependencies: ["tox>=4.6.4"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0"
rev: "v3.0.1"
hooks:
- id: prettier
args: ["--print-width=120", "--prose-wrap=always"]
Expand All @@ -29,7 +29,7 @@ repos:
- id: blacken-docs
additional_dependencies: [black==23.7]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.280"
rev: "v0.0.282"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
2 changes: 1 addition & 1 deletion src/tox/config/of_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def __call__(
args.chain.append(chain_key)
try:
value = loader.load(key, self.of_type, self.factory, conf, args)
except KeyError: # noqa: PERF203
except KeyError:
continue
else:
break
Expand Down
4 changes: 2 additions & 2 deletions src/tox/config/source/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def discover_source(config_file: Path | None, root_dir: Path | None) -> Source:
try:
src = src_type(candidate)
break
except ValueError: # noqa: PERF203
except ValueError:
continue
if src is None:
msg = f"could not find any config file in {config_file}"
Expand All @@ -53,7 +53,7 @@ def _locate_source() -> Source | None:
candidate: Path = base / src_type.FILENAME
try:
return src_type(candidate)
except ValueError: # noqa: PERF203
except ValueError:
pass
return None

Expand Down
2 changes: 1 addition & 1 deletion src/tox/provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def _get_missing(requires: list[Requirement]) -> list[tuple[Requirement, str | N
package_name = canonicalize_name(package.name)
try:
dist = distribution(package_name)
except PackageNotFoundError: # noqa: PERF203
except PackageNotFoundError:
missing.append((package, None))
else:
if not package.specifier.contains(dist.version, prereleases=True):
Expand Down
2 changes: 1 addition & 1 deletion src/tox/session/cmd/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def _handle_legacy_only_flags(option: Parsed, envs: EnvSelector) -> None: # noq
for at, entry in enumerate(as_root_args):
try:
req = Requirement(entry)
except InvalidRequirement: # noqa: PERF203
except InvalidRequirement:
continue
if req.name in to_force:
as_root_args[at] = str(to_force[req.name])
Expand Down
2 changes: 1 addition & 1 deletion src/tox/session/cmd/run/single.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def run_command_set(
outcomes.append(current_outcome)
try:
current_outcome.assert_success()
except SystemExit as exception: # noqa: PERF203
except SystemExit as exception:
if cmd.ignore_exit_code:
logging.warning("command failed but is marked ignore outcome so handling it as success")
continue
Expand Down
2 changes: 1 addition & 1 deletion src/tox/session/cmd/show_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def print_conf(is_colored: bool, conf: ConfigSet, keys: Iterable[str]) -> None:
try:
value = conf[key]
as_str, multi_line = stringify(value)
except Exception as exception: # because e.g. the interpreter cannot be found # noqa: BLE001, PERF203
except Exception as exception: # because e.g. the interpreter cannot be found # noqa: BLE001
as_str, multi_line = _colored(is_colored, Fore.LIGHTRED_EX, f"# Exception: {exception!r}"), False
if multi_line and "\n" not in as_str:
multi_line = False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def perform_packaging(self, for_env: EnvConfigSet) -> list[Package]:
msg = "stopping as failed to build package"
raise Fail(msg)
package_glob = self.conf["package_glob"]
found = glob.glob(package_glob)
found = glob.glob(package_glob) # noqa: PTH207
if not found:
msg = f"no package found in {package_glob}"
raise Fail(msg)
Expand Down
4 changes: 2 additions & 2 deletions tests/config/loader/ini/replace/test_replace_env_var.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def test_replace_env_set_triple_bs(replace_one: ReplaceOne, monkeypatch: MonkeyP
def test_replace_env_set_quad_bs(replace_one: ReplaceOne, monkeypatch: MonkeyPatch) -> None:
"""Quad backslash should remain but not affect surrounding replacements."""
monkeypatch.setenv("MAGIC", "something good")
result = replace_one(r"\\{env:MAGIC}\\\\{env:MAGIC}" + "\\") # noqa: ISC003
assert result == r"\\something good\\\\something good" + "\\" # noqa: ISC003
result = replace_one(r"\\{env:MAGIC}\\\\{env:MAGIC}" + "\\")
assert result == r"\\something good\\\\something good" + "\\"


def test_replace_env_when_value_is_backslash(replace_one: ReplaceOne, monkeypatch: MonkeyPatch) -> None:
Expand Down