@Test public void test() { LuaRulesDefinition rulesDefinition = new LuaRulesDefinition(); RulesDefinition.Context context = new RulesDefinition.Context(); rulesDefinition.define(context); RulesDefinition.Repository repository = context.repository("lua"); assertThat(repository.name()).isEqualTo("SonarQube"); assertThat(repository.language()).isEqualTo("lua"); assertThat(repository.rules()).hasSize(CheckList.getChecks().size()); for (RulesDefinition.Rule rule : repository.rules()) { for (RulesDefinition.Param param : rule.params()) { assertThat(param.description()).as("description for " + param.key() + " of " + rule.key()).isNotEmpty(); } } }
@Override public void define(Context context) { NewRepository repository = context .createRepository(CheckList.REPOSITORY_KEY, "lua") .setName(REPOSITORY_NAME); new AnnotationBasedRulesDefinition(repository, "lua").addRuleClasses(false, CheckList.getChecks()); repository.done(); }
LuaRulesDefinition implements RulesDefinition { @Override public void define(Context context) { NewRepository repository = context .createRepository(CheckList.REPOSITORY_KEY, "lua") .setName(REPOSITORY_NAME); new AnnotationBasedRulesDefinition(repository, "lua").addRuleClasses(false, CheckList.getChecks()); repository.done(); } }
LuaRulesDefinition implements RulesDefinition { @Override public void define(Context context) { NewRepository repository = context .createRepository(CheckList.REPOSITORY_KEY, "lua") .setName(REPOSITORY_NAME); new AnnotationBasedRulesDefinition(repository, "lua").addRuleClasses(false, CheckList.getChecks()); repository.done(); }  }
LuaRulesDefinition implements RulesDefinition { @Override public void define(Context context) { NewRepository repository = context .createRepository(CheckList.REPOSITORY_KEY, "lua") .setName(REPOSITORY_NAME); new AnnotationBasedRulesDefinition(repository, "lua").addRuleClasses(false, CheckList.getChecks()); repository.done(); }  @Override void define(Context context); }
LuaRulesDefinition implements RulesDefinition { @Override public void define(Context context) { NewRepository repository = context .createRepository(CheckList.REPOSITORY_KEY, "lua") .setName(REPOSITORY_NAME); new AnnotationBasedRulesDefinition(repository, "lua").addRuleClasses(false, CheckList.getChecks()); repository.done(); }  @Override void define(Context context);  }