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

Fix ruff error due to use of .format() in diff.py #207

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

devdanzin
Copy link
Collaborator

Newer versions of ruff started flagging an error in src/wily/commands/diff.py. This PR is the result of merely calling ruff with the --fix option:

src\wily\commands\diff.py:143:25: UP032 [*] Use f-string instead of `format` call
141 |                   if current > new:  # type: ignore
142 |                       metrics_data.append(
143 |                           "{0:n} -> \u001b[{2}m{1:n}\u001b[0m".format(
    |  _________________________^
144 | |                             current, new, BAD_COLORS[metric.measure]
145 | |                         )
    | |_________________________^ UP032
146 |                       )
147 |                   elif current < new:  # type: ignore
    |
    = help: Convert to f-string
src\wily\commands\diff.py:149:25: UP032 [*] Use f-string instead of `format` call
    |
148 |                       metrics_data.append(
149 |                           "{0:n} -> \u001b[{2}m{1:n}\u001b[0m".format(
    |  _________________________^
150 | |                             current, new, GOOD_COLORS[metric.measure]
151 | |                         )
    | |_________________________^ UP032
152 |                       )
153 |                   else:
    |
    = help: Convert to f-string

Found 2 errors.
[*] 2 potentially fixable with the --fix option.

This currently blocks #206.

@codecov-commenter
Copy link

codecov-commenter commented Aug 16, 2023

Codecov Report

Merging #207 (00fb994) into master (8eb4416) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #207   +/-   ##
=======================================
  Coverage   95.46%   95.46%           
=======================================
  Files          26       26           
  Lines        1346     1346           
  Branches      287      287           
=======================================
  Hits         1285     1285           
  Misses         37       37           
  Partials       24       24           
Files Changed Coverage Δ
src/wily/commands/diff.py 89.53% <ø> (ø)
@tonybaloney tonybaloney merged commit acf39d2 into tonybaloney:master Aug 24, 2023
20 checks passed
@devdanzin devdanzin deleted the fix_format_in_diff branch August 26, 2023 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants