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

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

Merged
merged 1 commit into from
May 15, 2024

Conversation

DimitriPapadopoulos
Copy link
Contributor

@RonnyPfannschmidt
Copy link
Contributor

At first glance all occurences where intentionally line split and had gotten cobbled to a single line, i think multi line Strings are needed

@DimitriPapadopoulos
Copy link
Contributor Author

DimitriPapadopoulos commented May 6, 2024

This is the result of applying black in #255, and ruff format will again fold the multiple lines into a single line — unless the code is enclosed in # fmt: off and # fmt: on.

Would you rather add # fmt: directives?

@RonnyPfannschmidt
Copy link
Contributor

I think real multi line Strings should be used

@DimitriPapadopoulos
Copy link
Contributor Author

I'll try to do that with # fmt.

@RonnyPfannschmidt
Copy link
Contributor

what i meant was using tripple quote string, not disabling fmt

@@ -35,7 +35,8 @@ def test_pkginfo_noscmroot(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> N

tmp_path.joinpath(".git").mkdir()
p.joinpath("setup.py").write_text(
"from setuptools import setup;" 'setup(use_scm_version={"root": ".."})',
'''from setuptools import setup;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to keep setup.py as an one-liner?

from setuptools import setup;setup(use_scm_version={"root": ".."})

Or perhaps change as follows?

from setuptools import setup
setup(use_scm_version={"root": ".."})

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea

- Revert to multiline strings, as before pypa#255 / ac2fee8.
- Guard the multiline strings from black (and now ruff) unfolding
  them back to a single line.

https://docs.astral.sh/ruff/rules/single-line-implicit-string-concatenation/
@RonnyPfannschmidt
Copy link
Contributor

thanks!

@RonnyPfannschmidt RonnyPfannschmidt merged commit 102f56a into pypa:main May 15, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants