Adding support for checkstyle rules to enforce naming conventions#66
Conversation
sfc-gh-dchaffelson
left a comment
There was a problem hiding this comment.
Thanks for this, Pierre — had a proper read through the checkstyle naming rules. The AbstractNamingRule factoring is clean: centralising pattern / per-flow-override / component-exclusion resolution keeps each concrete rule tight, and the no-op-when-unconfigured behaviour means they're safe to leave in include: by default.
A few small things before it goes in:
- Rebase + CI re-run. The branch is a few months behind
mainnow and CI last ran against the old base. Therules/parameter/package move and theDefaultCheckstyleRulesenum look like the likely conflict points, so worth a fresh rebase + green run. - Cover the nested-process-group path.
flow_v7_naming.jsonhasprocessGroups: [], so the recursive descent into child groups (ProcessorNamingRule/ControllerServiceNamingRule) isn't exercised. Since nested groups are the norm in real flows, a fixture with a processor + controller service inside a child group would lock that behaviour in. - (Optional) Guard the
patternscast. InAbstractNamingRule.getPatterns()thepatternsvalue is cast straight toMap. If it's mistyped as a scalar in YAML it throws aClassCastExceptionthat surfaces as an action crash with no comment posted, rather than a clear config error — aninstanceofcheck with a "'patterns' must be a map" message would make misconfig friendlier. Non-blocking.
Two doc nits if you're in there anyway: a line noting patterns use String.matches() full-match semantics (so .*_SUFFIX$ rather than _SUFFIX$), and that a per-flow override replaces the whole patterns map rather than merging.
Overall looks good — happy to see it merge once rebased.
82d224c to
1b345e6
Compare
|
Thanks @sfc-gh-dchaffelson - pushed a commit to address your feedback |
sfc-gh-dchaffelson
left a comment
There was a problem hiding this comment.
Approving — to be clear, the two items in my review comment (a rebase + CI re-run, and a nested-process-group test fixture) are worth doing but I'm treating them as non-blocking follow-ups rather than gating this. Nice work on the rule framework.
No description provided.