Flake8RulesDefinition implements RulesDefinition { @Override public void define(RulesDefinition.Context context) { RULE_LOADER.createExternalRuleRepository(context); }  @Override void define(RulesDefinition.Context context);  }
@Test public void flake8_external_repository() { RulesDefinition.Context context = new RulesDefinition.Context(); Flake8RulesDefinition rulesDefinition = new Flake8RulesDefinition(); rulesDefinition.define(context); assertThat(context.repositories()).hasSize(1); RulesDefinition.Repository repository = context.repository("external_flake8"); assertThat(repository).isNotNull(); assertThat(repository.name()).isEqualTo("Flake8"); assertThat(repository.language()).isEqualTo("py"); assertThat(repository.isExternal()).isEqualTo(true); assertThat(repository.rules().size()).isEqualTo(116); RulesDefinition.Rule rule = repository.rule("F405"); assertThat(rule).isNotNull(); assertThat(rule.name()).isEqualTo("name may be undefined, or defined from star imports: module"); assertThat(rule.htmlDescription()).isEqualTo("See description of Flake8 rule <code>F405</code> at" + " the <a href=\"https: assertThat(rule.tags()).isEmpty(); }