Skip to content

Commit

Permalink
custom markers
Browse files Browse the repository at this point in the history
  • Loading branch information
orsinium committed Sep 11, 2020
1 parent 144176d commit 83dcbc4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions deal/linter/_rules.py
Expand Up @@ -203,10 +203,13 @@ def _check(cls, func: Func, has: Has) -> Iterator[Error]:

for token in get_markers(body=func.body):
assert token.marker
if getattr(has, 'has_{}'.format(token.marker)):
has_marker = getattr(has, 'has_{}'.format(token.marker), None)
if has_marker is None:
has_marker = token.marker in has.markers
if has_marker:
continue
yield Error(
code=cls.codes[token.marker],
code=cls.codes.get(token.marker, 40),
text=cls.message,
value=token.marker,
row=token.line,
Expand Down

0 comments on commit 83dcbc4

Please sign in to comment.