Skip to content

Commit

Permalink
Fix path passing for pre-commit.
Browse files Browse the repository at this point in the history
Also fix filename separators on Windows.

b/150775273
  • Loading branch information
kaidokert committed Jan 4, 2024
1 parent 7ae5706 commit 9a9148f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ repos:
files: '.*\.gni?$'
- id: meta-validate
name: Validate METADATA files
entry: python tools/metadata/validate.py
entry: python -m tools.metadata.validate
language: python
additional_dependencies:
- "protobuf"
always_run: true
pass_filenames: true
pass_filenames: false
6 changes: 3 additions & 3 deletions tools/metadata/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ def update_proto():


def filter_files(path):
if not path.endswith('/METADATA'):
if not path.endswith(os.path.sep + 'METADATA'):
return False
if '.dist-info/' in path:
if '.dist-info' in path:
return False # Python packaging files
if 'skia/site' in path:
if os.path.join('skia', 'site') in path:
return False # Different upstream files
return True

Expand Down

0 comments on commit 9a9148f

Please sign in to comment.