Skip to content

Commit

Permalink
Version 0.0.16 pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Sep 30, 2018
1 parent 4690064 commit 6abc1fe
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ We used to have incremental versioning before `0.1.0`.

- Adds `flake8-logging-format` dependency
- Adds `flake8-type-annotations` dependency
- Adds `flake8-breaking-line` dependency
- Removes `flake8-super-call` dependency
- Adds `PartialFloatViolation`
- Adds `MagicNumberViolation`
Expand Down
1 change: 1 addition & 0 deletions docs/_pages/errors/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ flake8-eradicate `E800 <https://github.com/sobolevn/flake8-eradicate>`_
flake8 `F400 - F901 <http://flake8.pycqa.org/en/latest/user/error-codes.html>`_
flake8-logging-format `G001 - G202 <https://github.com/globality-corp/flake8-logging-format>`_
flake8-isort `I001 - I005 <https://github.com/gforcada/flake8-isort/blob/master/flake8_isort.py>`_
flake8-broken-line `N400 <https://github.com/sobolevn/flake8-broken-line>`_
pep8-naming `N800 - N820 <https://github.com/PyCQA/pep8-naming>`_
flake8-string-format `P101 - P302 <https://github.com/xZise/flake8-string-format#error-codes>`_
flake8-quotes `Q000 <https://github.com/zheller/flake8-quotes>`_
Expand Down
15 changes: 14 additions & 1 deletion pyproject.lock
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,18 @@ bandit = "*"
flake8 = "*"
flake8-polyfill = "*"

[[package]]
category = "main"
description = "Flake8 plugin to forbid backslashes for line breaks"
name = "flake8-broken-line"
optional = false
platform = "*"
python-versions = ">=3.6,<4.0"
version = "0.1.0"

[package.dependencies]
flake8 = ">=3.5,<4.0"

[[package]]
category = "main"
description = "A plugin for flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle."
Expand Down Expand Up @@ -912,7 +924,7 @@ python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4"
version = "1.23"

[metadata]
content-hash = "7affe331e0a571d216d882f94af864d29c94542ddbe5337032a6f1c7eb661b9a"
content-hash = "7636ccf296172b92b28a5af8ad03d5425e2f4bd88d951e25196a439e45008174"
platform = "*"
python-versions = "^3.6 || ^3.7"

Expand All @@ -932,6 +944,7 @@ docutils = ["02aec4bd92ab067f6ff27a38a38a41173bf01bed8f89157768c1573f53e474a6",
eradicate = ["f9af01c544ccd8f71bc2f7f3fa39dc363d842cfcb9c730a83676a59026ab5f24"]
flake8 = ["7253265f7abd8b313e3892944044a365e3f4ac3fcdcfb4298f55ee9ddf188ba0", "c7841163e2b576d435799169b78703ad6ac1bbb0f199994fc05f700b2a90ea37"]
flake8-bandit = ["a66c7b42af9530d5e988851ccee02958a51a85d46f1f4609ecc3546948f809b8", "f7c3421fd9aebc63689c0693511e16dcad678fd4a0ce624b78ca91ae713eacdc"]
flake8-broken-line = ["3eb823f48b4ec67735ebbe8e282319826c8e8be7dfc185c9e259228084c21de2", "84147d38a1562d011a8de0bb1de299a715f7dea1a7332bd6946db04a1e4c3ddd"]
flake8-bugbear = ["07b6e769d7f4e168d590f7088eae40f6ddd9fa4952bed31602def65842682c83", "0ccf56975f4db1d69dc1cf3598c99d768ebf95d0cad27d76087954aa399b515a"]
flake8-builtins = ["8d806360767947c0035feada4ddef3ede32f0a586ef457e62d811b8456ad9a51", "cd7b1b7fec4905386a3643b59f9ca8e305768da14a49a7efb31fe9364f33cd04"]
flake8-coding = ["549c2b22c08711feda11795fb49f147a626305b602c547837bab405e7981f844", "f2ee7c3c8ae47f2d278111a2090655bcf170789c24ccfea519d93be2ede7571c"]
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ flake8-eradicate = "^0.1"
flake8-bandit = "^1.0"
flake8-logging-format = "^0.5"
flake8-type-annotations = "^0.1"
flake8-broken-line = "^0.1"
pep8-naming = "^0.7"

[tool.poetry.dev-dependencies]
Expand Down
4 changes: 4 additions & 0 deletions tests/fixtures/external_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ def camelCase(): ...

def function_name(plugin: str ='flake8') ->str:
return plugin


multiline_string = 'some\
string'
1 change: 1 addition & 0 deletions tests/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def test_noqa_fixture_disabled(absolute_path):
assert output.count('F401') > 0 # flake8
assert output.count('G001') > 0 # flake8-logging-format
assert output.count('I001') > 0 # flake8-isort
assert output.count('N400') > 0 # flake8-broken-line
assert output.count('N802') > 0 # pep8-naming
assert output.count('P101') > 0 # flake8-string-format
assert output.count('Q000') > 0 # flake8-quotes
Expand Down
9 changes: 4 additions & 5 deletions wemake_python_styleguide/visitors/tokenize/wrong_comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import re
import tokenize
from typing.re import Match, Pattern

from wemake_python_styleguide.errors.tokens import (
WrongDocCommentViolation,
Expand All @@ -28,15 +27,15 @@
class WrongCommentVisitor(BaseTokenVisitor):
"""Checks comment tokens."""

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

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

def _check_noqa(self, token: tokenize.TokenInfo) -> None:
comment_text = self._get_comment_text(token)
match: Match = self.noqa_check.match(comment_text)
match = self.noqa_check.match(comment_text)
if not match:
return

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

def _check_typed_ast(self, token: tokenize.TokenInfo) -> None:
comment_text = self._get_comment_text(token)
match: Match = self.type_check.match(comment_text)
match = self.type_check.match(comment_text)
if not match:
return

Expand Down

0 comments on commit 6abc1fe

Please sign in to comment.