Skip to content

Commit

Permalink
actualize flake8_pie extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
orsinium committed May 23, 2022
1 parent da89cd2 commit 1b55254
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions flake8_codes/_codes/_adhoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,23 @@ def extract_flake8_strict() -> Dict[str, str]:
return codes


@registry.add
def extract_flake8_pie() -> Dict[str, str]:
# external
import flake8_pie

codes = dict()
rex = re.compile(r'"(?P<code>PIE[0-9]{3,4}): (?P<message>.+?)"')
for path in Path(flake8_pie.__file__).parent.iterdir():
if not path.name.startswith('pie'):
continue
text = path.read_text()
matches = rex.finditer(text)
match = list(matches)[-1]
codes[match.group('code')] = match.group('message')
return codes


@registry.add
def extract_flake8_docstrings() -> Dict[str, str]:
# external
Expand Down

0 comments on commit 1b55254

Please sign in to comment.