Skip to content

Commit

Permalink
Merge pull request #16 from StateFarmIns/plugin-version
Browse files Browse the repository at this point in the history
fix: show package version for plugins
  • Loading branch information
MichaelKim0407 authored Oct 20, 2021
2 parents eb25851 + f6832c0 commit 96008d5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion flake8_use_fstring/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
from .base import (
BaseGreedyLogicalLineChecker as _Base,
)
from . import __version__


class StrFormatDetector(_Base):
name = 'use-fstring-format'
version = '1.0'
version = __version__

def __getitem__(self, i: int) -> bool:
token = self.tokens[i]
Expand Down
3 changes: 2 additions & 1 deletion flake8_use_fstring/percent.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
from .base import (
BaseGreedyLogicalLineChecker as _Base,
)
from . import __version__


class PercentFormatDetector(_Base):
name = 'use-fstring-percent'
version = '1.0'
version = __version__

def __getitem__(self, i: int) -> bool:
return self.tokens[i].exact_type == _token.PERCENT
Expand Down
4 changes: 3 additions & 1 deletion flake8_use_fstring/prefix.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
BaseLogicalLineChecker as _Base,
)

from . import __version__

FSTRING_REGEX = _re.compile(r'^([a-zA-Z]*?[fF][a-zA-Z]*?){1}["\']')
NON_FSTRING_REGEX = _re.compile(
r'^[a-zA-Z]*(?:\'\'\'|\'|"""|")(.*?{.+?}.*)(?:\'|\'\'\'|"|""")$',
Expand All @@ -17,7 +19,7 @@

class MissingPrefixDetector(_Base):
name = 'use-fstring-prefix'
version = '1.0'
version = __version__
ignore_format = False
off_by_default = True

Expand Down

0 comments on commit 96008d5

Please sign in to comment.