[Codenarc-user] What do you think of merging rulesets?
Brought to you by:
chrismair
From: Evgeny G. <ev...@gm...> - 2011-08-07 21:42:43
|
Hi, Today, I keep a copy of StarterRuleSet-AllRulesByCategory.groovy.txt<http://codenarc.sourceforge.net/StarterRuleSet-AllRulesByCategory.groovy.txt> in each project with some modifications where rules are disabled or tuned to match project preferences. It's not very convenient since I need to update this large file for every new CodeNarc version, merging new rules added by CodeNarc and existing rules configured locally. Would it better if one could reference to: 1. Default (probably remote) set of all rules like the one available on the Web today. If one decided to reference the default ruleset on CodeNarc site then he should be aware of a need to upgrade CodeNarc version immediately when a newer version is released as the default ruleset contains new rules, not recognized by older CodeNarc (or we can ask CodeNarc not to fail on unknown rules - this will make it more friendly and "forward compatible"). 2. Local set of rules, overriding the default set for any collision by commenting out rules, disabling them (see below) or changing their configuration. I understand that when rule is commented out in the second set, then it simply doesn't exist and if it's defined in the first set then it's enabled. But .. it would be nice if CodeNarc could see the rule is actually "disabled" in the second set. May be some new syntax for disabling rules can be added if commenting them out makes it harder. Like a general "enabled" property for all rules and then one could write *"BracesForClass { enabled = false }"* in the second local set. I also see with 0.15 if first ruleset contains *"LineLength { length = 120 }"* and second *"LineLength { length = 160 }"* then first value (120) is still used by CodeNarc. So .. what do you think of merging rulesets? Warm regards, Evgeny evgeny-goldin.com |