builder:DefaultReadmeIndexBuilder: move table header to README-template.md

This commit is contained in:
Paul Campbell 2017-01-07 11:27:38 +00:00
parent 9f979955f8
commit 4989f21331
2 changed files with 7 additions and 9 deletions

View file

@ -44,21 +44,17 @@ public class DefaultReadmeIndexBuilder implements ReadmeIndexBuilder {
private static final String NEWLINE = "\n"; private static final String NEWLINE = "\n";
private static final String HEADERROW = "Rule|Level|Source|Enabled|Suppressable\n";
private static final String SEPARATOR = "----|-----|------|-------|------------\n";
private static final Locale LOCALE = Locale.ENGLISH; private static final Locale LOCALE = Locale.ENGLISH;
private final RulesProperties rulesProperties; private final RulesProperties rulesProperties;
@Override @Override
public final String build() { public final String build() {
return HEADERROW + SEPARATOR + rulesProperties.getRules() return rulesProperties.getRules()
.stream() .stream()
.sorted(Comparator.comparing(lowerCaseRuleName())) .sorted(Comparator.comparing(lowerCaseRuleName()))
.map(this::formatRuleRow) .map(this::formatRuleRow)
.collect(Collectors.joining(NEWLINE)); .collect(Collectors.joining(NEWLINE));
} }
private Function<Rule, String> lowerCaseRuleName() { private Function<Rule, String> lowerCaseRuleName() {

View file

@ -102,6 +102,8 @@ from the previous.
## All Checks ## All Checks
Rule|Level|Source|Enabled|Suppressable
----|-----|------|-------|------------
%s %s
## Enabled Checks ## Enabled Checks