forked from python-formate/flake8_strftime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update plugin code for flake8 v5 compatibility
Fixes python-formate#47
- Loading branch information
Showing
6 changed files
with
26 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,8 @@ Flake8 codes | |
|
||
.. flake8-codes:: flake8_strftime | ||
|
||
STRFTIME001 | ||
STRFTIME002 | ||
SFT001 | ||
SFT002 | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,16 +40,16 @@ | |
# 3rd party | ||
import flake8_helper | ||
|
||
__all__ = ("Visitor", "Plugin", "STRFTIME001", "STRFTIME002") | ||
__all__ = ("Visitor", "Plugin", "SFT001", "SFT002") | ||
|
||
__author__ = "Dominic Davis-Foster" | ||
__copyright__ = "2020-2021 Dominic Davis-Foster" | ||
__license__ = "MIT" | ||
__version__ = "0.3.1" | ||
__email__ = "[email protected]" | ||
|
||
STRFTIME001 = "STRFTIME001 Linux-specific strftime code used." | ||
STRFTIME002 = "STRFTIME002 Windows-specific strftime code used." | ||
SFT001 = "SFT001 Linux-specific strftime code used." | ||
SFT002 = "SFT002 Windows-specific strftime code used." | ||
|
||
|
||
class Visitor(flake8_helper.Visitor): | ||
|
@@ -102,7 +102,7 @@ def _check_linux(self, node: Union[ast.Str, ast.Constant]) -> None: | |
self.errors.append(( | ||
node.lineno, | ||
node.col_offset + match.span()[0], | ||
STRFTIME001, # pylint: disable=loop-global-usage | ||
SFT001, # pylint: disable=loop-global-usage | ||
)) | ||
|
||
def _check_windows(self, node: Union[ast.Str, ast.Constant]) -> None: | ||
|
@@ -116,7 +116,7 @@ def _check_windows(self, node: Union[ast.Str, ast.Constant]) -> None: | |
self.errors.append(( | ||
node.lineno, | ||
node.col_offset + match.span()[0], | ||
STRFTIME002, # pylint: disable=loop-global-usage | ||
SFT002, # pylint: disable=loop-global-usage | ||
)) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters