Fix pre-commit hook filter

This commit is contained in:
Kovid Goyal 2025-09-21 06:13:02 +05:30
parent cf725bee8c
commit 89652f81f0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -11,7 +11,7 @@ setup_py = os.path.realpath('./setup.py')
def testfile(file):
def t(f, start, end, exclude_end=None):
return f.startswith(start) and f.endswith(end) and not f.endswith(exclude_end) if exclude_end else True
return f.startswith(start) and f.endswith(end) and not (f.endswith(exclude_end) if exclude_end else False)
if t(file, ('src/odf', 'src/calibre'), '.py', exclude_end='_ui.py'):
return True
if t(file, 'recipes', '.recipe'):