Skip to content

Commit 6abc1fe

Browse files
committed
Version 0.0.16 pre-release
1 parent 4690064 commit 6abc1fe

File tree

7 files changed

+26
-6
lines changed

7 files changed

+26
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ We used to have incremental versioning before `0.1.0`.
99

1010
- Adds `flake8-logging-format` dependency
1111
- Adds `flake8-type-annotations` dependency
12+
- Adds `flake8-breaking-line` dependency
1213
- Removes `flake8-super-call` dependency
1314
- Adds `PartialFloatViolation`
1415
- Adds `MagicNumberViolation`

docs/_pages/errors/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ flake8-eradicate `E800 <https://github.com/sobolevn/flake8-eradicate>`_
2222
flake8 `F400 - F901 <http://flake8.pycqa.org/en/latest/user/error-codes.html>`_
2323
flake8-logging-format `G001 - G202 <https://github.com/globality-corp/flake8-logging-format>`_
2424
flake8-isort `I001 - I005 <https://github.com/gforcada/flake8-isort/blob/master/flake8_isort.py>`_
25+
flake8-broken-line `N400 <https://github.com/sobolevn/flake8-broken-line>`_
2526
pep8-naming `N800 - N820 <https://github.com/PyCQA/pep8-naming>`_
2627
flake8-string-format `P101 - P302 <https://github.com/xZise/flake8-string-format#error-codes>`_
2728
flake8-quotes `Q000 <https://github.com/zheller/flake8-quotes>`_

pyproject.lock

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,18 @@ bandit = "*"
165165
flake8 = "*"
166166
flake8-polyfill = "*"
167167

168+
[[package]]
169+
category = "main"
170+
description = "Flake8 plugin to forbid backslashes for line breaks"
171+
name = "flake8-broken-line"
172+
optional = false
173+
platform = "*"
174+
python-versions = ">=3.6,<4.0"
175+
version = "0.1.0"
176+
177+
[package.dependencies]
178+
flake8 = ">=3.5,<4.0"
179+
168180
[[package]]
169181
category = "main"
170182
description = "A plugin for flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle."
@@ -912,7 +924,7 @@ python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4"
912924
version = "1.23"
913925

914926
[metadata]
915-
content-hash = "7affe331e0a571d216d882f94af864d29c94542ddbe5337032a6f1c7eb661b9a"
927+
content-hash = "7636ccf296172b92b28a5af8ad03d5425e2f4bd88d951e25196a439e45008174"
916928
platform = "*"
917929
python-versions = "^3.6 || ^3.7"
918930

@@ -932,6 +944,7 @@ docutils = ["02aec4bd92ab067f6ff27a38a38a41173bf01bed8f89157768c1573f53e474a6",
932944
eradicate = ["f9af01c544ccd8f71bc2f7f3fa39dc363d842cfcb9c730a83676a59026ab5f24"]
933945
flake8 = ["7253265f7abd8b313e3892944044a365e3f4ac3fcdcfb4298f55ee9ddf188ba0", "c7841163e2b576d435799169b78703ad6ac1bbb0f199994fc05f700b2a90ea37"]
934946
flake8-bandit = ["a66c7b42af9530d5e988851ccee02958a51a85d46f1f4609ecc3546948f809b8", "f7c3421fd9aebc63689c0693511e16dcad678fd4a0ce624b78ca91ae713eacdc"]
947+
flake8-broken-line = ["3eb823f48b4ec67735ebbe8e282319826c8e8be7dfc185c9e259228084c21de2", "84147d38a1562d011a8de0bb1de299a715f7dea1a7332bd6946db04a1e4c3ddd"]
935948
flake8-bugbear = ["07b6e769d7f4e168d590f7088eae40f6ddd9fa4952bed31602def65842682c83", "0ccf56975f4db1d69dc1cf3598c99d768ebf95d0cad27d76087954aa399b515a"]
936949
flake8-builtins = ["8d806360767947c0035feada4ddef3ede32f0a586ef457e62d811b8456ad9a51", "cd7b1b7fec4905386a3643b59f9ca8e305768da14a49a7efb31fe9364f33cd04"]
937950
flake8-coding = ["549c2b22c08711feda11795fb49f147a626305b602c547837bab405e7981f844", "f2ee7c3c8ae47f2d278111a2090655bcf170789c24ccfea519d93be2ede7571c"]

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ flake8-eradicate = "^0.1"
5959
flake8-bandit = "^1.0"
6060
flake8-logging-format = "^0.5"
6161
flake8-type-annotations = "^0.1"
62+
flake8-broken-line = "^0.1"
6263
pep8-naming = "^0.7"
6364

6465
[tool.poetry.dev-dependencies]

tests/fixtures/external_plugins.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ def camelCase(): ...
2727

2828
def function_name(plugin: str ='flake8') ->str:
2929
return plugin
30+
31+
32+
multiline_string = 'some\
33+
string'

tests/test_plugins.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def test_noqa_fixture_disabled(absolute_path):
3535
assert output.count('F401') > 0 # flake8
3636
assert output.count('G001') > 0 # flake8-logging-format
3737
assert output.count('I001') > 0 # flake8-isort
38+
assert output.count('N400') > 0 # flake8-broken-line
3839
assert output.count('N802') > 0 # pep8-naming
3940
assert output.count('P101') > 0 # flake8-string-format
4041
assert output.count('Q000') > 0 # flake8-quotes

wemake_python_styleguide/visitors/tokenize/wrong_comments.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import re
1818
import tokenize
19-
from typing.re import Match, Pattern
2019

2120
from wemake_python_styleguide.errors.tokens import (
2221
WrongDocCommentViolation,
@@ -28,15 +27,15 @@
2827
class WrongCommentVisitor(BaseTokenVisitor):
2928
"""Checks comment tokens."""
3029

31-
noqa_check: Pattern = re.compile(r'^noqa:?($|[A-Z\d\,\s]+)')
32-
type_check: Pattern = re.compile(r'^type:\s?([\w\d\[\]\'\"\.]+)$')
30+
noqa_check = re.compile(r'^noqa:?($|[A-Z\d\,\s]+)')
31+
type_check = re.compile(r'^type:\s?([\w\d\[\]\'\"\.]+)$')
3332

3433
def _get_comment_text(self, token: tokenize.TokenInfo) -> str:
3534
return token.string[1:].strip()
3635

3736
def _check_noqa(self, token: tokenize.TokenInfo) -> None:
3837
comment_text = self._get_comment_text(token)
39-
match: Match = self.noqa_check.match(comment_text)
38+
match = self.noqa_check.match(comment_text)
4039
if not match:
4140
return
4241

@@ -48,7 +47,7 @@ def _check_noqa(self, token: tokenize.TokenInfo) -> None:
4847

4948
def _check_typed_ast(self, token: tokenize.TokenInfo) -> None:
5049
comment_text = self._get_comment_text(token)
51-
match: Match = self.type_check.match(comment_text)
50+
match = self.type_check.match(comment_text)
5251
if not match:
5352
return
5453

0 commit comments

Comments
 (0)