feat: add lint.exclude_paths and secrets.allowlist config#8
Merged
Conversation
Adds two new config fields that let consuming repos control which paths are checked by the governance report: - lint.exclude_paths: path prefixes excluded from file-length checks (e.g. docs directories, generated files, vendored code) - secrets.allowlist: path prefixes excluded from credential scanning (e.g. files with known-safe localhost dev database URLs) Also adds --config=<path> CLI flag to governance-report.js and a config input to action.yml so repos can provide their own codewarden.json without modifying the skill installation. All 32 existing tests pass unchanged. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
lint.exclude_pathsconfig field — path prefixes excluded from file-length checkssecrets.allowlistconfig field — path prefixes excluded from credential scanning--config=<path>CLI flag togovernance-report.jsfor external config filesconfiginput toaction.ymlso consuming repos can provide their owncodewarden.jsonMotivation
When running Code-Warden as a CI gate on real repos, the governance report fails on:
Without exclude support, repos must either weaken global thresholds or accept permanent CI failures on known-safe paths.
Usage
{ "thresholds": { "max_file_length": 400 }, "lint": { "exclude_paths": ["Documents/", "Documents/Obsolete/"] }, "secrets": { "allowlist": ["scripts/indexer.config.toml", "indexer/src/api_auth.rs"] } }In GitHub Actions:
Test plan
/normalization🤖 Generated with Claude Code