-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff0b850
commit 86b47df
Showing
1 changed file
with
135 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
# Configuration for lintrunner https://github.com/suo/lintrunner | ||
|
||
[[linter]] | ||
code = 'FLAKE8' | ||
include_patterns = [ | ||
'**/*.py', | ||
'**/*.pyi', | ||
] | ||
exclude_patterns = [] | ||
command = [ | ||
'python3', | ||
'adapters/pytorch/flake8_linter.py', | ||
'--', | ||
'@{{PATHSFILE}}' | ||
] | ||
init_command = [ | ||
'python3', | ||
'adapters/pytorch/pip_init.py', | ||
'--dry-run={{DRYRUN}}', | ||
'flake8==5.0.4', | ||
'flake8-bugbear==22.10.27', | ||
'flake8-pyi==22.10.0', | ||
'dlint==0.13.0', | ||
'toml==0.10.2', # Needed for pydocstrings to parse pyproject.toml | ||
'flake8-docstrings==1.6.0', | ||
] | ||
|
||
# [[linter]] | ||
# code = 'MYPY' | ||
# include_patterns = [ | ||
# ] | ||
# exclude_patterns = [ | ||
# ] | ||
# command = [ | ||
# 'python3', | ||
# 'adapters/pytorch/mypy_linter.py', | ||
# '--config=pyproject.toml', | ||
# '--', | ||
# '@{{PATHSFILE}}' | ||
# ] | ||
# init_command = [ | ||
# 'python3', | ||
# 'adapters/pytorch/pip_init.py', | ||
# '--dry-run={{DRYRUN}}', | ||
# ] | ||
|
||
[[linter]] | ||
code = 'NOQA' | ||
include_patterns = ['**/*.py', '**/*.pyi'] | ||
exclude_patterns = [] | ||
command = [ | ||
'python3', | ||
'adapters/pytorch/grep_linter.py', | ||
'--pattern=# noqa([^:]|$)', | ||
'--linter-name=NOQA', | ||
'--error-name=unqualified noqa', | ||
"""--error-description=\ | ||
This line has an unqualified `noqa`; \ | ||
please convert it to `noqa: XXXX`\ | ||
""", | ||
'--', | ||
'@{{PATHSFILE}}' | ||
] | ||
|
||
[[linter]] | ||
code = 'NEWLINE' | ||
include_patterns=['**'] | ||
exclude_patterns=[] | ||
command = [ | ||
'python3', | ||
'adapters/pytorch/newlines_linter.py', | ||
'--', | ||
'@{{PATHSFILE}}', | ||
] | ||
is_formatter = true | ||
|
||
[[linter]] | ||
code = 'SPACES' | ||
include_patterns = ['**'] | ||
exclude_patterns = [] | ||
command = [ | ||
'python3', | ||
'adapters/pytorch/grep_linter.py', | ||
'--pattern=[[:blank:]]$', | ||
'--linter-name=SPACES', | ||
'--error-name=trailing spaces', | ||
'--replace-pattern=s/[[:blank:]]+$//', | ||
"""--error-description=\ | ||
This line has trailing spaces; please remove them.\ | ||
""", | ||
'--', | ||
'@{{PATHSFILE}}' | ||
] | ||
|
||
[[linter]] | ||
code = 'TABS' | ||
include_patterns = ['**'] | ||
exclude_patterns = [ | ||
'adapters/pytorch.toml', | ||
] | ||
command = [ | ||
'python3', | ||
'adapters/pytorch/grep_linter.py', | ||
# @lint-ignore TXT2 | ||
'--pattern= ', | ||
'--linter-name=TABS', | ||
'--error-name=saw some tabs', | ||
'--replace-pattern=s/\t/ /', | ||
"""--error-description=\ | ||
This line has tabs; please replace them with spaces.\ | ||
""", | ||
'--', | ||
'@{{PATHSFILE}}' | ||
] | ||
|
||
[[linter]] | ||
code = 'BLACK-ISORT' | ||
include_patterns = [ | ||
'**/*.py', | ||
] | ||
exclude_patterns = [] | ||
command = [ | ||
'python3', | ||
'adapters/pytorch/black_isort_linter.py', | ||
'--', | ||
'@{{PATHSFILE}}' | ||
] | ||
init_command = [ | ||
'python3', | ||
'adapters/pytorch/pip_init.py', | ||
'--dry-run={{DRYRUN}}', | ||
'black==22.10.0', | ||
'isort==5.10.1', | ||
] | ||
is_formatter = true |