From 98ebae62a67fe915df46396ee40935597948ca4d Mon Sep 17 00:00:00 2001 From: Jon Meow <46229924+jonmeow@users.noreply.github.com> Date: Tue, 15 Sep 2020 09:00:24 -0700 Subject: [PATCH] Update pre-commit versions and fix black break (#160) Caught by black stable change, done by `pre-commit autoupdate` `pre-commit autoupdate` also wanted to update pre-commit-hooks, but that gave me some pyenv errors so I'm leaving it alone for now. --- .pre-commit-config.yaml | 4 ++-- proposals/p0044.md | 37 +++++++++++++++++---------------- src/scripts/new_proposal.py | 4 +++- src/scripts/pr_comments.py | 3 +-- src/scripts/pr_comments_test.py | 7 +++++-- 5 files changed, 30 insertions(+), 25 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aa8f7bda5fd4..c4e7fd23beef 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,12 +41,12 @@ repos: pass_filenames: false # Formatters should be run late so that they can re-format any prior changes. - repo: https://github.com/psf/black - rev: stable + rev: 20.8b1 hooks: - id: black language_version: python3 - repo: https://github.com/prettier/prettier - rev: 2.0.5 + rev: 2.1.1 hooks: - id: prettier exclude: ^src/jekyll/theme/ diff --git a/proposals/p0044.md b/proposals/p0044.md index ef62ea124193..6f753dffc140 100644 --- a/proposals/p0044.md +++ b/proposals/p0044.md @@ -618,18 +618,19 @@ Cons: In a workflow where there's always a tracking issue: -1. Create the tracking issue, e.g. #123. -2. Create the PR, e.g. #456, naming the proposal p0123.md after the tracking - issue. +1. Create the tracking issue, e.g. #123. +2. Create the PR, e.g. #456, naming the proposal p0123.md after the tracking + issue. 1. Use GitHub features to link #123 and #456. -3. Update the status in p0123.md and labels of #123 when progressing a proposal. -4. When a decision is made, create a new PR, e.g. #789, containing the decision - p0123-decision.md. - 2. This does not replace the Discourse Forum topic announcing a decision. - 3. Use GitHub features to link #123 and #789. - 4. Comments on the decision may go on the decision PR, similar to the +3. Update the status in p0123.md and labels of #123 when progressing a + proposal. +4. When a decision is made, create a new PR, e.g. #789, containing the decision + p0123-decision.md. + 1. This does not replace the Discourse Forum topic announcing a decision. + 2. Use GitHub features to link #123 and #789. + 3. Comments on the decision may go on the decision PR, similar to the proposal PR discussion. -5. Declined/deferred proposals may be committed or not; it doesn't matter. +5. Declined/deferred proposals may be committed or not; it doesn't matter. Pros: @@ -646,17 +647,17 @@ Cons: In a workflow where there's no need for a tracking issue (although contributors may create them for bucketing work, they are non-essential): -1. Create the PR, e.g. #456, naming the proposal p0456.md. -2. Update the labels of #456 when progressing a proposal. +1. Create the PR, e.g. #456, naming the proposal p0456.md. +2. Update the labels of #456 when progressing a proposal. 1. Don't bother putting the status in p0456.md: people should rely on the PR labels since it's in the same place. -3. When a decision is made, add it as a comment to #456. - 2. This does not replace the Discourse Forum topic announcing a decision. - 3. Comments on the decision should go in Discourse Forums. - 4. The author is asked to link to the decision in p0456.md before the commit +3. When a decision is made, add it as a comment to #456. + 1. This does not replace the Discourse Forum topic announcing a decision. + 2. Comments on the decision should go in Discourse Forums. + 3. The author is asked to link to the decision in p0456.md before the commit is approved. -4. If declined/deferred proposals are committed, it would be best to add a - status in p0456.md before committing. +4. If declined/deferred proposals are committed, it would be best to add a + status in p0456.md before committing. Pros: diff --git a/src/scripts/new_proposal.py b/src/scripts/new_proposal.py index 0ad491f5267a..7636aae40145 100755 --- a/src/scripts/new_proposal.py +++ b/src/scripts/new_proposal.py @@ -36,7 +36,9 @@ def _parse_args(args=None): "specified title." ) parser.add_argument( - "title", metavar="TITLE", help="The title of the proposal.", + "title", + metavar="TITLE", + help="The title of the proposal.", ) parser.add_argument( "--branch", diff --git a/src/scripts/pr_comments.py b/src/scripts/pr_comments.py index 66a8c65b129d..172b14ee8cd1 100755 --- a/src/scripts/pr_comments.py +++ b/src/scripts/pr_comments.py @@ -292,8 +292,7 @@ def _parse_args(args=None): def _query(parsed_args, field_name=None): - """Returns a query for the given field, or all fields if none are specified. - """ + """Returns a query for the given field, or all fields if none are specified.""" print(".", end="", flush=True) format = { "pr_num": parsed_args.pr_num, diff --git a/src/scripts/pr_comments_test.py b/src/scripts/pr_comments_test.py index ff3b6581ef2a..2e66bb1a268c 100644 --- a/src/scripts/pr_comments_test.py +++ b/src/scripts/pr_comments_test.py @@ -191,7 +191,9 @@ class TestPRComments(unittest.TestCase): ] for thread in review_threads: pr_comments._accumulate_thread( - parsed_args, threads_by_path, thread, + parsed_args, + threads_by_path, + thread, ) self.assertEqual(sorted(threads_by_path.keys()), ["foo.md", "other.md"]) threads = sorted(threads_by_path["foo.md"]) @@ -209,7 +211,8 @@ class TestPRComments(unittest.TestCase): @staticmethod def fake_pr_comment_dict( - body="comment", created_at="2001-02-03T04:05:06Z", + body="comment", + created_at="2001-02-03T04:05:06Z", ): pr_comment_dict = { "author": {"login": "author"},