feat: pre-commit hook to detect absolute paths in files#147
Merged
kelly-sovacool merged 18 commits intomainfrom Feb 26, 2026
Merged
feat: pre-commit hook to detect absolute paths in files#147kelly-sovacool merged 18 commits intomainfrom
kelly-sovacool merged 18 commits intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #147 +/- ##
=======================================
Coverage ? 72.35%
=======================================
Files ? 27
Lines ? 1841
Branches ? 0
=======================================
Hits ? 1332
Misses ? 509
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Followed this guide for creating the hook https://stefaniemolin.com/articles/devx/pre-commit/hook-creation-guide/
New CLI interface for pre-commit hooks:
ccbr-hooks [command]New hook: Detect absolute file paths
ccbr-hook detect-absolute-paths [files]Any instances of absolute paths (i.e. paths starting with "/") in the given files will be detected and printed to the console, and an error will be raised at the end if any are found.
Usage with pre-commit
Add this to your
.pre-commit-config.yamlfile:Ignoring specific lines
You can ignore specific lines by including the string "abs-path:ignore" in the line, e.g.:
Issues
NA
PR Checklist
(
Strikethroughany points that are not applicable.)CHANGELOG.mdwith a short description of any user-facing changes and reference the PR number. Guidelines: https://keepachangelog.com/en/1.1.0/