builder:Application: list rules on startup
This commit is contained in:
parent
81bb3c02c4
commit
d52b630db5
1 changed files with 11 additions and 0 deletions
|
@ -1,8 +1,10 @@
|
|||
package net.kemitix.checkstyle.ruleset.builder;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
/**
|
||||
* Creates the checkstyle ruleset files.
|
||||
|
@ -19,4 +21,13 @@ public class CheckstyleRulesetBuilderApplication {
|
|||
public static void main(final String[] args) {
|
||||
SpringApplication.run(CheckstyleRulesetBuilderApplication.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CommandLineRunner listRules(final RulesProperties rulesProperties) {
|
||||
return args -> rulesProperties.getRules()
|
||||
.stream()
|
||||
.map(Rule::getName)
|
||||
.map(name -> String.format("- %s", name))
|
||||
.forEach(System.out::println);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue