tonybaloney / wily

A Python application for tracking, reporting on timing and complexity in Python code
Apache License 2.0
1.2k stars 58 forks source link

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

Closed devdanzin closed 1 year ago

devdanzin commented 1 year ago

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 commented 1 year ago

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% <ø> (ø)