mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-30 10:16:54 +00:00
change path
This commit is contained in:
parent
d75d74b41e
commit
f66937947c
1 changed files with 3 additions and 16 deletions
|
|
@ -14,30 +14,17 @@ def main(argv: Sequence[str] | None = None) -> int:
|
|||
'--pytest',
|
||||
dest='pattern',
|
||||
action='store_const',
|
||||
const=r'tests_*\.py',
|
||||
default=r'tests_*\.py',
|
||||
const=r'.*/tests_*\.py',
|
||||
default=r'.*/tests_*\.py',
|
||||
help='(the default) ensure tests match %(const)s',
|
||||
)
|
||||
mutex.add_argument(
|
||||
'--pytest-test-first',
|
||||
dest='pattern',
|
||||
action='store_const',
|
||||
const=r'test_.*\.py',
|
||||
help='ensure tests match %(const)s',
|
||||
)
|
||||
mutex.add_argument(
|
||||
'--django', '--unittest',
|
||||
dest='pattern',
|
||||
action='store_const',
|
||||
const=r'test.*\.py',
|
||||
help='ensure tests match %(const)s',
|
||||
)
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
retcode = 0
|
||||
reg = re.compile(args.pattern)
|
||||
for filename in args.filenames:
|
||||
base = os.path.basename(filename)
|
||||
print(base)
|
||||
if (
|
||||
not reg.fullmatch(base) and
|
||||
not base == '__init__.py' and
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue