wheel icon indicating copy to clipboard operation
wheel copied to clipboard

Apply ruff/flake8-implicit-str-concat rule ISC001

Open DimitriPapadopoulos opened this issue 1 year ago • 5 comments

https://docs.astral.sh/ruff/rules/single-line-implicit-string-concatenation/

DimitriPapadopoulos avatar May 06 '24 21:05 DimitriPapadopoulos

Codecov Report

Attention: Patch coverage is 20.00000% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 71.09%. Comparing base (bd8ab85) to head (c8cac99).

Files Patch % Lines
src/wheel/cli/convert.py 0.00% 2 Missing :warning:
src/wheel/bdist_wheel.py 0.00% 1 Missing :warning:
src/wheel/cli/__init__.py 0.00% 1 Missing :warning:
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #615   +/-   ##
=======================================
  Coverage   71.09%   71.09%           
=======================================
  Files          13       13           
  Lines        1083     1083           
=======================================
  Hits          770      770           
  Misses        313      313           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 06 '24 21:05 codecov[bot]

I think what would be best is to actually add the relevant ruff rule to pyproject.toml and then let nature take its course.

agronholm avatar May 06 '24 21:05 agronholm

It is not compatible with ruff format (yet): https://github.com/astral-sh/ruff/issues/8272

DimitriPapadopoulos avatar May 06 '24 21:05 DimitriPapadopoulos

In the link issue, this is discussed and, as far as I could understand, ISC001 is not actually incompatible with the formatter.

agronholm avatar May 06 '24 22:05 agronholm

It's still in the conflict list.

DimitriPapadopoulos avatar May 06 '24 22:05 DimitriPapadopoulos

I could change: https://github.com/pypa/wheel/blob/376373b9690e746c36e3984808759e9c32d5e014/.pre-commit-config.yaml#L20-L25 into:

- repo: https://github.com/astral-sh/ruff-pre-commit
  rev: v0.4.3
  hooks:
    - id: ruff
      args: [--fix, --show-fixes]
    - id: ruff-format
    - id: ruff
      args: [ --select, ISC001, --fix, --show-fixes ]

DimitriPapadopoulos avatar May 08 '24 08:05 DimitriPapadopoulos

Actually I now have a sweeping change commit locally that would do all this, and more.

agronholm avatar May 08 '24 09:05 agronholm

These sweeping changes covered all of the changes here, so I'm closing this PR as no longer necessary. Thanks for bringing this up!

agronholm avatar May 08 '24 10:05 agronholm

Now I get this warning whenever I run ruff:

$ ruff format
warning: The following rules may cause conflicts when used with the formatter: `ISC001`. To avoid unexpected behavior, we recommend disabling these rules, either by removing them from the `select` or `extend-select` configuration, or adding them to the `ignore` configuration.
54 files left unchanged
$ 

DimitriPapadopoulos avatar May 08 '24 17:05 DimitriPapadopoulos