]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

add more flake8 lints (#2653)
authordanieleades <33452915+danieleades@users.noreply.github.com>
Mon, 29 Nov 2021 02:20:52 +0000 (02:20 +0000)
committerGitHub <noreply@github.com>
Mon, 29 Nov 2021 02:20:52 +0000 (18:20 -0800)
.pre-commit-config.yaml
CHANGES.md
src/black/__init__.py
src/black/output.py
tests/optional.py
tests/test_black.py

index a3cd66393848aff55adbe3a67c69b231df9966de..45810d2844a443606c9913015b82100288abf3e9 100644 (file)
@@ -35,7 +35,10 @@ repos:
     rev: 3.9.2
     hooks:
       - id: flake8
     rev: 3.9.2
     hooks:
       - id: flake8
-        additional_dependencies: [flake8-bugbear]
+        additional_dependencies:
+          - flake8-bugbear
+          - flake8-comprehensions
+          - flake8-simplify
 
   - repo: https://github.com/pre-commit/mirrors-mypy
     rev: v0.910
 
   - repo: https://github.com/pre-commit/mirrors-mypy
     rev: v0.910
index d81c1fd4fc4c4ddcdc24a63f6f4d58122604743b..235919ec7acbbbe9be293dbb5262e8ae82ef2001 100644 (file)
@@ -7,6 +7,7 @@
 - Fixed Python 3.10 support on platforms without ProcessPoolExecutor (#2631)
 - Fixed `match` statements with open sequence subjects, like `match a, b:` (#2639)
 - Fixed assignment to environment variables in Jupyter Notebooks (#2642)
 - Fixed Python 3.10 support on platforms without ProcessPoolExecutor (#2631)
 - Fixed `match` statements with open sequence subjects, like `match a, b:` (#2639)
 - Fixed assignment to environment variables in Jupyter Notebooks (#2642)
+- Add `flake8-simplify` and `flake8-comprehensions` plugins (#2653)
 
 ## 21.11b1
 
 
 ## 21.11b1
 
index aa7970cfd6c443e90375e6c342185f74174dec4d..d99c48a1b04f7686f50678db7421b4ea2210eb0f 100644 (file)
@@ -181,7 +181,7 @@ def validate_regex(
 
 
 @click.command(
 
 
 @click.command(
-    context_settings=dict(help_option_names=["-h", "--help"]),
+    context_settings={"help_option_names": ["-h", "--help"]},
     # While Click does set this field automatically using the docstring, mypyc
     # (annoyingly) strips 'em so we need to set it here too.
     help="The uncompromising code formatter.",
     # While Click does set this field automatically using the docstring, mypyc
     # (annoyingly) strips 'em so we need to set it here too.
     help="The uncompromising code formatter.",
index c85b253c159c885c2fd2e04f9691fdec279fa736..f030d0a0d08d67f07acc5516749ceb5095913a5a 100644 (file)
@@ -59,8 +59,8 @@ def diff(a: str, b: str, a_name: str, b_name: str) -> str:
     """Return a unified diff string between strings `a` and `b`."""
     import difflib
 
     """Return a unified diff string between strings `a` and `b`."""
     import difflib
 
-    a_lines = [line for line in a.splitlines(keepends=True)]
-    b_lines = [line for line in b.splitlines(keepends=True)]
+    a_lines = a.splitlines(keepends=True)
+    b_lines = b.splitlines(keepends=True)
     diff_lines = []
     for line in difflib.unified_diff(
         a_lines, b_lines, fromfile=a_name, tofile=b_name, n=5
     diff_lines = []
     for line in difflib.unified_diff(
         a_lines, b_lines, fromfile=a_name, tofile=b_name, n=5
index e12b94cd29e47acf24a6f7b6cabefa7948526525..1cddeeaa57609424d20cb19809c4f6725bb843e3 100644 (file)
@@ -96,7 +96,7 @@ def pytest_collection_modifyitems(config: "Config", items: "List[Node]") -> None
     enabled_optional_markers = store[ENABLED_OPTIONAL_MARKERS]
 
     for item in items:
     enabled_optional_markers = store[ENABLED_OPTIONAL_MARKERS]
 
     for item in items:
-        all_markers_on_test = set(m.name for m in item.iter_markers())
+        all_markers_on_test = {m.name for m in item.iter_markers()}
         optional_markers_on_test = all_markers_on_test & all_possible_optional_markers
         if not optional_markers_on_test or (
             optional_markers_on_test & enabled_optional_markers
         optional_markers_on_test = all_markers_on_test & all_possible_optional_markers
         if not optional_markers_on_test or (
             optional_markers_on_test & enabled_optional_markers
index 4267c6110a9bc9b0efeb87d3fb116e312db5ee1c..51a20307e5697466ba6510ed2023427ed43fe8c2 100644 (file)
@@ -1755,7 +1755,7 @@ def assert_collected_sources(
         report=black.Report(),
         stdin_filename=stdin_filename,
     )
         report=black.Report(),
         stdin_filename=stdin_filename,
     )
-    assert sorted(list(collected)) == sorted(gs_expected)
+    assert sorted(collected) == sorted(gs_expected)
 
 
 class TestFileCollection:
 
 
 class TestFileCollection: