Repository navigation
fix: refuse a quoted "false" for a true/false setting - #636
Conversation
conventional_commits = "false" is a non-empty string, so the rule it meant to turn off stayed on and the commit was rejected (exit 1). A boolean setting given anything but true or false is now a config error (exit 2) that names the setting.
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 2
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #636 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 14 14
Lines 2417 2429 +12
=========================================
+ Hits 2417 2429 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will not alter performance
|



Before: a true/false setting written as a string is read as truthy, so
conventional_commits = "false"leaves the rule on and rejects the commit.After: it is a config error that names the setting, under exit code 2, like the other wrong-type values the README lists.
cchk.tomlwip bad msg, beforeconventional_commits = falseconventional_commits = "false"Error: [commit] conventional_commits must be true or false, got 'false'How:
RuleBuilderchecks every setting whose default is a boolean (taken fromget_default_config(), so new switches are covered) and refuses any other type. CLI flags andCCHK_*variables already go throughparse_bool, so only file values can reach the new error. One parametrized test covers a quoted string, an integer and a word in[commit]and[branch].