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

[internal] No need for two f-strings/two strings. #14119

Merged
merged 1 commit into from
Jan 8, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/python/pants/backend/codegen/thrift/subsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def register_options(cls, register):
# TODO: Implement dependency inference at a later point in this PR.
default=True,
help=(
"Infer Thrift dependencies on other Thrift files by analyzing import " "statements."
"Infer Thrift dependencies on other Thrift files by analyzing import statements."
),
)
register(
Expand Down
4 changes: 1 addition & 3 deletions src/python/pants/backend/codegen/thrift/target_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ class ThriftSourceTarget(Target):
ThriftDependenciesField,
ThriftSourceField,
)
help = (
"A single Thrift file used to generate various languages.\n\n" f"See {doc_url('thrift')}."
)
help = f"A single Thrift file used to generate various languages.\n\nSee {doc_url('thrift')}."


# -----------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def _from_json_dict(
"""

raise NotImplementedError(
"`LockfileMetadata._from_json_dict` should not be directly " "called."
"`LockfileMetadata._from_json_dict` should not be directly called."
)

def add_header_to_lockfile(self, lockfile: bytes, *, regenerate_command: str) -> bytes:
Expand Down
4 changes: 1 addition & 3 deletions src/python/pants/backend/shell/target_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,7 @@ async def generate_targets_from_shell_sources(
class ShellCommandCommandField(StringField):
alias = "command"
required = True
help = (
"Shell command to execute.\n\n" "The command is executed as 'bash -c <command>' by default."
)
help = "Shell command to execute.\n\nThe command is executed as 'bash -c <command>' by default."


class ShellCommandOutputsField(StringSequenceField):
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/engine/internals/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def _raise_on_error(self, throws: list[Throw]) -> NoReturn:
else:
exception_strs = "\n ".join(f"{type(t.exc).__name__}: {str(t.exc)}" for t in throws)
raise ExecutionError(
f"{exception_noun} encountered:\n\n" f" {exception_strs}\n",
f"{exception_noun} encountered:\n\n {exception_strs}\n",
wrapped_exceptions=tuple(t.exc for t in throws),
)

Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/engine/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def _check_deprecated(cls, raw_value: Optional[Any], address: Address) -> None:
warn_or_error(
cls.removal_version,
entity=f"the {repr(cls.alias)} field",
hint=(f"Using the `{cls.alias}` field in the target {address}. " f"{cls.removal_hint}"),
hint=(f"Using the `{cls.alias}` field in the target {address}. {cls.removal_hint}"),
)

def __repr__(self) -> str:
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/option/custom_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class UnsetBool:

def __init__(self) -> None:
raise NotImplementedError(
"UnsetBool cannot be instantiated. It should only be used as a " "sentinel type."
"UnsetBool cannot be instantiated. It should only be used as a sentinel type."
)

@classmethod
Expand Down