Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create input parameter via MainsLauncherTest.java #42

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions extractor/src/main/java/com/example/extractor/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ public class Main {
private static final Path PROJECT_ROOT = Paths.get("").toAbsolutePath().getParent();

public static void main(String[] args) throws Exception {
System.out.println("Current working directory: " + Paths.get("").toAbsolutePath().toString());
if (args.length < 1) {
throw new IllegalArgumentException("Path in repo must be provided as the first argument.");
}

// Get the path in repo from the command-line arguments
String pathInRepo = args[0];
System.out.println("Using path in repo: " + pathInRepo);

// Path to Checkstyle repo
String checkstyleRepoPath = ".ci-temp/checkstyle";

// Path in repo
String pathInRepo = "src/xdocs-examples/resources/com/puppycrawl/tools/checkstyle/checks/naming/abbreviationaswordinname";

// Input and output directories
String inputDirectory = checkstyleRepoPath + "/" + pathInRepo;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ public class MainsLauncherTest {

@Test
public void testMain() throws Exception {
Main.main(new String[]{});
}
}
// Define the path in repo you want to test
String pathInRepo = "src/xdocs-examples/resources/com/puppycrawl/tools/checkstyle/checks/naming/abbreviationaswordinname";

// Pass the path as an argument
Main.main(new String[]{pathInRepo});
}
}
Loading