Skip to content

Print number of excludes#122

Merged
cbachhuber merged 6 commits into
masterfrom
print-number-of-excludes
Jul 14, 2025
Merged

Print number of excludes#122
cbachhuber merged 6 commits into
masterfrom
print-number-of-excludes

Conversation

@hofbi
Copy link
Copy Markdown
Collaborator

@hofbi hofbi commented Jul 14, 2025

For metrics it is helpful to get an overview of how many files are actually excluded.

I am also adding a CI check to demonstrate how this works: https://github.com/luminartech/dev-tools/actions/runs/16270610957/job/45937021382?pr=122

@hofbi hofbi requested a review from cbachhuber July 14, 2025 15:08
Comment thread dev_tools/check_useless_exclude_paths_hooks.py Outdated
total_excluded = sum(hook.count_excluded_files() for hook in hooks_list)
print(f"Total number of excluded files: {total_excluded}")

for hook in hooks_list:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not necessarily sorted alphabetically by hook name, right? Shall we sort to get a stable output?

Copy link
Copy Markdown
Collaborator Author

@hofbi hofbi Jul 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order is based on the pre-commit config. To me this sounds like a valid approach and might be helpful to find the hooks in the config. The output is as stable as your config file.

Co-authored-by: Chris Bachhuber <cbachhuber89@gmail.com>
Comment thread dev_tools/check_useless_exclude_paths_hooks.py Outdated
Comment thread .github/workflows/check.yaml Outdated
@cbachhuber cbachhuber merged commit 082eddd into master Jul 14, 2025
8 checks passed
@cbachhuber cbachhuber deleted the print-number-of-excludes branch July 14, 2025 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants