From 573bee1d87d51d103ffbb19265f9c900321c920e Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Mon, 6 May 2024 23:35:34 +0200 Subject: [PATCH] Apply ruff/flake8-implicit-str-concat rule ISC001 - Revert to multiline strings, as before #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/ --- testing/test_mercurial.py | 14 ++++++++++++-- testing/test_regressions.py | 5 ++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/testing/test_mercurial.py b/testing/test_mercurial.py index 22481623..af085769 100644 --- a/testing/test_mercurial.py +++ b/testing/test_mercurial.py @@ -115,12 +115,22 @@ def test_version_from_archival(wd: WorkDir) -> None: # entrypoints are unordered, # cleaning the wd ensure this test won't break randomly wd.cwd.joinpath(".hg").rename(wd.cwd / ".nothg") - wd.write(".hg_archival.txt", "node: 000000000000\n" "tag: 0.1\n") + wd.write( + ".hg_archival.txt", + """\ +node: 000000000000 +tag: 0.1 +""", + ) assert wd.get_version() == "0.1" wd.write( ".hg_archival.txt", - "node: 000000000000\n" "latesttag: 0.1\n" "latesttagdistance: 3\n", + """\ +node: 000000000000 +latesttag: 0.1 +latesttagdistance: 3 +""", ) assert wd.get_version() == "0.2.dev3+h000000000000" diff --git a/testing/test_regressions.py b/testing/test_regressions.py index df2fb2fd..d523f60c 100644 --- a/testing/test_regressions.py +++ b/testing/test_regressions.py @@ -35,7 +35,10 @@ 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 +setup(use_scm_version={"root": ".."}) +""", encoding="utf-8", )