Skip to content

Commit

Permalink
Merge pull request pypa#12289 from lgeiger/noqa
Browse files Browse the repository at this point in the history
Remove outdated `noqa` comments
  • Loading branch information
sbidoul committed Oct 1, 2023
2 parents cb21251 + 3d6b0be commit ff05e42
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 11 deletions.
Empty file.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ select = [
"PLE",
"PLR0",
"W",
"RUF100",
]

[tool.ruff.isort]
Expand Down
6 changes: 3 additions & 3 deletions src/pip/_internal/cli/cmdoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ def _handle_config_settings(
) -> None:
key, sep, val = value.partition("=")
if sep != "=":
parser.error(f"Arguments to {opt_str} must be of the form KEY=VAL") # noqa
parser.error(f"Arguments to {opt_str} must be of the form KEY=VAL")
dest = getattr(parser.values, option.dest)
if dest is None:
dest = {}
Expand Down Expand Up @@ -921,13 +921,13 @@ def _handle_merge_hash(
algo, digest = value.split(":", 1)
except ValueError:
parser.error(
"Arguments to {} must be a hash name " # noqa
"Arguments to {} must be a hash name "
"followed by a value, like --hash=sha256:"
"abcde...".format(opt_str)
)
if algo not in STRONG_HASHES:
parser.error(
"Allowed hash algorithms for {} are {}.".format( # noqa
"Allowed hash algorithms for {} are {}.".format(
opt_str, ", ".join(STRONG_HASHES)
)
)
Expand Down
4 changes: 2 additions & 2 deletions src/pip/_internal/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def _update_defaults(self, defaults: Dict[str, Any]) -> Dict[str, Any]:
val = strtobool(val)
except ValueError:
self.error(
"{} is not a valid value for {} option, " # noqa
"{} is not a valid value for {} option, "
"please specify a boolean value like yes/no, "
"true/false or 1/0 instead.".format(val, key)
)
Expand All @@ -240,7 +240,7 @@ def _update_defaults(self, defaults: Dict[str, Any]) -> Dict[str, Any]:
val = int(val)
if not isinstance(val, int) or val < 0:
self.error(
"{} is not a valid value for {} option, " # noqa
"{} is not a valid value for {} option, "
"please instead specify either a non-negative integer "
"or a boolean value like yes/no or false/true "
"which is equivalent to 1/0.".format(val, key)
Expand Down
4 changes: 1 addition & 3 deletions src/pip/_internal/commands/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ def show_tags(options: Values) -> None:


def ca_bundle_info(config: Configuration) -> str:
# Ruff misidentifies config as a dict.
# Configuration does not have support the mapping interface.
levels = {key.split(".", 1)[0] for key, _ in config.items()} # noqa: PERF102
levels = {key.split(".", 1)[0] for key, _ in config.items()}
if not levels:
return "Not specified"

Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def run(self, options: Values, args: List[str]) -> int:
show_traceback,
options.use_user_site,
)
logger.error(message, exc_info=show_traceback) # noqa
logger.error(message, exc_info=show_traceback)

return ERROR

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_install_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
PipTestEnvironment,
TestData,
assert_all_changes,
pyversion, # noqa: F401
pyversion,
)


Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from tests.lib import (
PipTestEnvironment,
TestData,
pyversion, # noqa: F401
pyversion,
)


Expand Down

0 comments on commit ff05e42

Please sign in to comment.