Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix path passing for pre-commit #2158

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
kaidokert marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ exclude: |
# Ignore everything under tools/metrics _except_ Cobalt files. We
# need those validated to keep the telemetry/metrics pipeline working.
tools/metrics/((?!cobalt\/).)*$|
.*_pb2\.py |
.*_pb2\.py$ |
.*\.pb\.cc$ |
.*\.pb\.h$ |
.*\.patch$ |
Expand Down 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