Skip to content

Commit 955bd8b

Browse files
Simplify argument options passed to sonar as we override what is needed using config.json
1 parent 057f286 commit 955bd8b

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/main/java/cc/App.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@ public class App {
2121
static final int ERROR = 1;
2222

2323
public static void main(String[] args) {
24-
execute(args, System2.INSTANCE);
24+
execute(System2.INSTANCE);
2525
}
2626

27-
public static void execute(String[] args, System2 system) {
27+
public static void execute(System2 system) {
2828
try {
2929
Config config = Config.from(system.getProperty("config"));
30-
Options parsedOpts = Options.parse(args);
3130
Charset charset = config.getCharset();
3231

3332
InputFileFinder fileFinder = new Finder(config.getIncludePaths(), config.getTestsPatterns(), charset);
@@ -36,7 +35,7 @@ public static void execute(String[] args, System2 system) {
3635
SonarLintFactory sonarLintFactory = new SonarLintFactory(reader);
3736
Path projectHome = getProjectHome(system);
3837

39-
int exitCode = new CustomMain(parsedOpts, sonarLintFactory, reportFactory, fileFinder, projectHome).run();
38+
int exitCode = new CustomMain(new Options(), sonarLintFactory, reportFactory, fileFinder, projectHome).run();
4039
system.exit(exitCode);
4140
} catch (Exception e) {
4241
LOGGER.error(e.getMessage(), e);

src/test/java/integration/ConfigurationOptionsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void setUp() throws Exception {
3939
public void limit_path_included_within_analysis() throws Exception {
4040
system.setProperty("config", "fixtures/multiple_paths/config.json");
4141

42-
App.execute(new String[]{}, system);
42+
App.execute(system);
4343

4444
String output = stdout.toString();
4545
assertThat(output).contains("issue", "fixtures/multiple_paths/src/included/java/pkg1/HasIssue.java");
@@ -48,7 +48,7 @@ public void limit_path_included_within_analysis() throws Exception {
4848

4949
@Test
5050
public void include_all_files_by_default() throws Exception {
51-
App.execute(new String[]{}, system);
51+
App.execute(system);
5252

5353
String output = stdout.toString();
5454
assertThat(output).contains(

0 commit comments

Comments
 (0)