mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-09 04:54:16 +00:00
change path
This commit is contained in:
parent
f66937947c
commit
0e93be09a8
1 changed files with 6 additions and 5 deletions
|
|
@ -14,8 +14,8 @@ def main(argv: Sequence[str] | None = None) -> int:
|
||||||
'--pytest',
|
'--pytest',
|
||||||
dest='pattern',
|
dest='pattern',
|
||||||
action='store_const',
|
action='store_const',
|
||||||
const=r'.*/tests_*\.py',
|
const=r'tests/.*/tests_*\.py',
|
||||||
default=r'.*/tests_*\.py',
|
default=r'tests/.*/tests_*\.py',
|
||||||
help='(the default) ensure tests match %(const)s',
|
help='(the default) ensure tests match %(const)s',
|
||||||
)
|
)
|
||||||
args = parser.parse_args(argv)
|
args = parser.parse_args(argv)
|
||||||
|
|
@ -27,9 +27,10 @@ def main(argv: Sequence[str] | None = None) -> int:
|
||||||
print(base)
|
print(base)
|
||||||
if (
|
if (
|
||||||
not reg.fullmatch(base) and
|
not reg.fullmatch(base) and
|
||||||
not base == '__init__.py' and
|
not base == '.*/__init__.py' and
|
||||||
not base == 'conftest.py' and
|
not base == '.*/conftest.py' and
|
||||||
not base == 'models.py'
|
not base == '.*/models.py'
|
||||||
|
|
||||||
):
|
):
|
||||||
retcode = 1
|
retcode = 1
|
||||||
print(f'{filename} does not match pattern "{args.pattern}"')
|
print(f'{filename} does not match pattern "{args.pattern}"')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue