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

replaced sum of strings for fstrings #503

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions fire/helptext.py
Expand Up @@ -111,7 +111,7 @@ def _NameSection(component, info, trace=None, verbose=False):
LINE_LENGTH)

if summary:
text = current_command + ' - ' + summary
text = f'{current_command} - {summary}'
else:
text = current_command
return ('NAME', text)
Expand Down Expand Up @@ -582,7 +582,7 @@ def _CreateItem(name, description, indent=2):
def _GetArgDescription(name, docstring_info):
if docstring_info.args:
for arg_in_docstring in docstring_info.args:
if arg_in_docstring.name in (name, '*' + name, '**' + name):
if arg_in_docstring.name in (f'{name}', f'*{name}', f'**{name}'):
return arg_in_docstring.description
return None

Expand Down Expand Up @@ -752,10 +752,10 @@ def _GetCallableAvailabilityLines(spec):
args_with_defaults = spec.args[len(spec.args) - len(spec.defaults):]

# TODO(dbieber): Handle args_with_no_defaults if not accepts_positional_args.
optional_flags = [('--' + flag) for flag in itertools.chain(
optional_flags = [f'--{flag}' for flag in itertools.chain(
args_with_defaults, _KeywordOnlyArguments(spec, required=False))]
required_flags = [
('--' + flag) for flag in _KeywordOnlyArguments(spec, required=True)
f'--{flag}' for flag in _KeywordOnlyArguments(spec, required=True)
]

# Flags section:
Expand Down