-
-
Notifications
You must be signed in to change notification settings - Fork 47
[pre-commit.ci] pre-commit autoupdate #177
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
Changes from 5 commits
ca5b2e9
707cd2c
39fb100
e0f70de
e09216f
47a4776
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,7 +133,8 @@ def tmp_git_repo_dir(tmpdir, cd, git_init, git_commit, git_config): | |
| try: | ||
| git_init() | ||
| except subprocess.CalledProcessError: | ||
| version = subprocess.run(("git", "--version"), capture_output=True) | ||
| git_version_cmd = "git", "--version" | ||
| version = subprocess.run(git_version_cmd, capture_output=True) | ||
| # the output looks like "git version 2.34.1" | ||
| v = version.stdout.decode("utf-8").removeprefix("git version ").split(".") | ||
| if (int(v[0]), int(v[1])) < (2, 28): | ||
|
|
@@ -475,14 +476,12 @@ def test_find_config_not_git(tmpdir, cd): | |
|
|
||
| def test_load_full_config(tmp_git_repo_dir, git_add, git_commit): | ||
| relative_config_path = ".cherry_picker.toml" | ||
| tmp_git_repo_dir.join(relative_config_path).write( | ||
| """\ | ||
| tmp_git_repo_dir.join(relative_config_path).write("""\ | ||
| team = "python" | ||
| repo = "core-workfolow" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unrelated to this PR, but this seems to be unintentionally misspelled in several tests?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, didn't notice that! Might as well fix it. I'll slip it into this PR. |
||
| check_sha = "5f007046b5d4766f971272a0cc99f8461215c1ec" | ||
| default_branch = "devel" | ||
| """ | ||
| ) | ||
| """) | ||
| git_add(relative_config_path) | ||
| git_commit("Add config") | ||
| scm_revision = get_sha1_from("HEAD") | ||
|
|
@@ -503,11 +502,9 @@ def test_load_full_config(tmp_git_repo_dir, git_add, git_commit): | |
|
|
||
| def test_load_partial_config(tmp_git_repo_dir, git_add, git_commit): | ||
| relative_config_path = ".cherry_picker.toml" | ||
| tmp_git_repo_dir.join(relative_config_path).write( | ||
| """\ | ||
| tmp_git_repo_dir.join(relative_config_path).write("""\ | ||
| repo = "core-workfolow" | ||
| """ | ||
| ) | ||
| """) | ||
| git_add(relative_config_path) | ||
| git_commit("Add config") | ||
| scm_revision = get_sha1_from("HEAD") | ||
|
|
@@ -528,14 +525,12 @@ def test_load_partial_config(tmp_git_repo_dir, git_add, git_commit): | |
|
|
||
| def test_load_config_no_head_sha(tmp_git_repo_dir, git_add, git_commit): | ||
| relative_config_path = ".cherry_picker.toml" | ||
| tmp_git_repo_dir.join(relative_config_path).write( | ||
| """\ | ||
| tmp_git_repo_dir.join(relative_config_path).write("""\ | ||
| team = "python" | ||
| repo = "core-workfolow" | ||
| check_sha = "5f007046b5d4766f971272a0cc99f8461215c1ec" | ||
| default_branch = "devel" | ||
| """ | ||
| ) | ||
| """) | ||
| git_add(relative_config_path) | ||
| git_commit(f"Add {relative_config_path}") | ||
|
|
||
|
|
@@ -572,8 +567,7 @@ def test_normalize_long_commit_message(): | |
| title == "[3.6] Fix broken `Show Source` links on documentation pages (GH-3113)" | ||
| ) | ||
| assert ( | ||
| body | ||
| == """The `Show Source` was broken because of a change made in sphinx 1.5.1 | ||
| body == """The `Show Source` was broken because of a change made in sphinx 1.5.1 | ||
| In Sphinx 1.4.9, the sourcename was "index.txt". | ||
| In Sphinx 1.5.1+, it is now "index.rst.txt". | ||
| (cherry picked from commit b9ff498793611d1c6a9b99df464812931a1e2d69) | ||
|
|
@@ -596,8 +590,7 @@ def test_normalize_short_commit_message(): | |
| title == "[3.6] Fix broken `Show Source` links on documentation pages (GH-3113)" | ||
| ) | ||
| assert ( | ||
| body | ||
| == """(cherry picked from commit b9ff498793611d1c6a9b99df464812931a1e2d69) | ||
| body == """(cherry picked from commit b9ff498793611d1c6a9b99df464812931a1e2d69) | ||
|
|
||
|
|
||
| Co-authored-by: Elmar Ritsch <35851+elritsch@users.noreply.github.com>""" | ||
|
|
@@ -775,12 +768,10 @@ def test_paused_flow(tmp_git_repo_dir, git_add, git_commit): | |
| initial_scm_revision = get_sha1_from("HEAD") | ||
|
|
||
| relative_file_path = "some.toml" | ||
| tmp_git_repo_dir.join(relative_file_path).write( | ||
| f"""\ | ||
| tmp_git_repo_dir.join(relative_file_path).write(f"""\ | ||
| check_sha = "{initial_scm_revision}" | ||
| repo = "core-workfolow" | ||
| """ | ||
| ) | ||
| """) | ||
| git_add(relative_file_path) | ||
| git_commit("Add a config") | ||
| config_scm_revision = get_sha1_from("HEAD") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can commit this if you like, and we can watch the formatter remove them again :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a broken formatter :). Took me a bit too long to see that
git_version_cmdwas in fact still a tuple and not just a string (I was apparently just glossing over the", "as).then. Not sure why it's changing in the first place, though...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually my memory that is broken 🙃
Here's what was added to Black's 2026 style:
https://github.com/psf/black/blob/main/CHANGES.md#version-2610
So it's safe to add parentheses. PR welcome! There's more than this one instance though, so do them all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, now I see the comment about this being a hack around S607. Honestly, I'd rather just ignore S607 (or use comment suppression), at least in
test_*.py.I'm just complaining with no intent to put time into fixing it in any kind of reasonable time though, so please feel free to ignore me! :)