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 d9a3eff
Show file tree
Hide file tree
Showing 3 changed files with 6 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
1 change: 1 addition & 0 deletions base/METADATA
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ third_party {
day: 23
}
}
break this this too
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 d9a3eff

Please sign in to comment.