Răsfoiți Sursa

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.
Jon Meow 5 ani în urmă
părinte
comite
98ebae62a6

+ 2 - 2
.pre-commit-config.yaml

@@ -41,12 +41,12 @@ repos:
         pass_filenames: false
         pass_filenames: false
   # Formatters should be run late so that they can re-format any prior changes.
   # Formatters should be run late so that they can re-format any prior changes.
   - repo: https://github.com/psf/black
   - repo: https://github.com/psf/black
-    rev: stable
+    rev: 20.8b1
     hooks:
     hooks:
       - id: black
       - id: black
         language_version: python3
         language_version: python3
   - repo: https://github.com/prettier/prettier
   - repo: https://github.com/prettier/prettier
-    rev: 2.0.5
+    rev: 2.1.1
     hooks:
     hooks:
       - id: prettier
       - id: prettier
         exclude: ^src/jekyll/theme/
         exclude: ^src/jekyll/theme/

+ 19 - 18
proposals/p0044.md

@@ -618,18 +618,19 @@ Cons:
 
 
 In a workflow where there's always a tracking issue:
 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.
     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.
        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:
 Pros:
 
 
@@ -646,17 +647,17 @@ Cons:
 In a workflow where there's no need for a tracking issue (although contributors
 In a workflow where there's no need for a tracking issue (although contributors
 may create them for bucketing work, they are non-essential):
 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
     1. Don't bother putting the status in p0456.md: people should rely on the PR
        labels since it's in the same place.
        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.
        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:
 Pros:
 
 

+ 3 - 1
src/scripts/new_proposal.py

@@ -36,7 +36,9 @@ def _parse_args(args=None):
         "specified title."
         "specified title."
     )
     )
     parser.add_argument(
     parser.add_argument(
-        "title", metavar="TITLE", help="The title of the proposal.",
+        "title",
+        metavar="TITLE",
+        help="The title of the proposal.",
     )
     )
     parser.add_argument(
     parser.add_argument(
         "--branch",
         "--branch",

+ 1 - 2
src/scripts/pr_comments.py

@@ -292,8 +292,7 @@ def _parse_args(args=None):
 
 
 
 
 def _query(parsed_args, field_name=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)
     print(".", end="", flush=True)
     format = {
     format = {
         "pr_num": parsed_args.pr_num,
         "pr_num": parsed_args.pr_num,

+ 5 - 2
src/scripts/pr_comments_test.py

@@ -191,7 +191,9 @@ class TestPRComments(unittest.TestCase):
         ]
         ]
         for thread in review_threads:
         for thread in review_threads:
             pr_comments._accumulate_thread(
             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"])
         self.assertEqual(sorted(threads_by_path.keys()), ["foo.md", "other.md"])
         threads = sorted(threads_by_path["foo.md"])
         threads = sorted(threads_by_path["foo.md"])
@@ -209,7 +211,8 @@ class TestPRComments(unittest.TestCase):
 
 
     @staticmethod
     @staticmethod
     def fake_pr_comment_dict(
     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 = {
         pr_comment_dict = {
             "author": {"login": "author"},
             "author": {"login": "author"},