@Test public void should_create_sonar_way_profile() { ValidationMessages validation = ValidationMessages.create(); BuiltInQualityProfilesDefinition.Context context = new BuiltInQualityProfilesDefinition.Context(); new GoProfileDefinition().define(context); assertThat(context.profilesByLanguageAndName()).hasSize(1); BuiltInQualityProfilesDefinition.BuiltInQualityProfile profile = context.profile("go", "Sonar way"); assertThat(profile.language()).isEqualTo("go"); assertThat(profile.name()).isEqualTo("Sonar way"); assertThat(profile.rules()).hasSize(25); assertThat(validation.hasErrors()).isFalse(); }
@Override public void define(Context context) { NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile("Sonar way", GoLanguage.KEY); BuiltInQualityProfileJsonLoader.load(profile, GoRulesDefinition.REPOSITORY_KEY, "org/sonar/l10n/go/rules/go/Sonar_way_profile.json"); profile.setDefault(true); profile.done(); }
GoProfileDefinition implements BuiltInQualityProfilesDefinition { @Override public void define(Context context) { NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile("Sonar way", GoLanguage.KEY); BuiltInQualityProfileJsonLoader.load(profile, GoRulesDefinition.REPOSITORY_KEY, "org/sonar/l10n/go/rules/go/Sonar_way_profile.json"); profile.setDefault(true); profile.done(); } }
GoProfileDefinition implements BuiltInQualityProfilesDefinition { @Override public void define(Context context) { NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile("Sonar way", GoLanguage.KEY); BuiltInQualityProfileJsonLoader.load(profile, GoRulesDefinition.REPOSITORY_KEY, "org/sonar/l10n/go/rules/go/Sonar_way_profile.json"); profile.setDefault(true); profile.done(); }  }
GoProfileDefinition implements BuiltInQualityProfilesDefinition { @Override public void define(Context context) { NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile("Sonar way", GoLanguage.KEY); BuiltInQualityProfileJsonLoader.load(profile, GoRulesDefinition.REPOSITORY_KEY, "org/sonar/l10n/go/rules/go/Sonar_way_profile.json"); profile.setDefault(true); profile.done(); }  @Override void define(Context context); }
GoProfileDefinition implements BuiltInQualityProfilesDefinition { @Override public void define(Context context) { NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile("Sonar way", GoLanguage.KEY); BuiltInQualityProfileJsonLoader.load(profile, GoRulesDefinition.REPOSITORY_KEY, "org/sonar/l10n/go/rules/go/Sonar_way_profile.json"); profile.setDefault(true); profile.done(); }  @Override void define(Context context);  }