@@ -40,6 +40,15 @@ public static void writeExecutionResultToFile(Integer exitCode, Path executionRe
4040 }
4141 }
4242
43+ /** Writes the stderr output to a file */
44+ public static void writeStderrToFile (String stderrContent , Path stderrOutputPath ) {
45+ try {
46+ Files .write (stderrOutputPath , stderrContent .getBytes (), StandardOpenOption .CREATE );
47+ } catch (IOException e ) {
48+ throw new RuntimeException (e );
49+ }
50+ }
51+
4352 public static boolean isParamsFile (String argument ) {
4453 return argument .startsWith ("@" );
4554 }
@@ -55,14 +64,14 @@ public static List<String> readArgumentsFromFile(Path filePath) {
5564 }
5665 }
5766
58- /**
59- * Retrieves the value associated with the given argument name from the input arguments list.
60- *
61- * @param inputArgs List of input arguments.
62- * @param argName The name of the argument whose value needs to be fetched.
63- * @return The value associated with the given argument name or null if the argument is not found.
64- */
65- public static String getValueForArgumentName (List <String > inputArgs , String argName ) {
67+ /**
68+ * Retrieves the value associated with the given argument name from the input arguments list.
69+ *
70+ * @param inputArgs List of input arguments.
71+ * @param argName The name of the argument whose value needs to be fetched.
72+ * @return The value associated with the given argument name or null if the argument is not found.
73+ */
74+ public static String getValueForArgumentName (List <String > inputArgs , String argName ) {
6675 try {
6776 // Get the index of the argument and return the value at the next index.
6877 int indexOfArgument = inputArgs .indexOf (argName );
@@ -80,7 +89,9 @@ public static String getValueForArgumentName(List<String> inputArgs, String argN
8089 * Sanitizes the Detekt arguments by excluding arguments used solely by the detekt-wrapper
8190 */
8291 public static List <String > sanitizeDetektArguments (List <String > inputArgs ) {
83- Set <String > excludedArgs = new HashSet <>(Arrays .asList ("--execution-result" , "--run-as-test-target" ));
92+ Set <String > excludedArgs =
93+ new HashSet <>(
94+ Arrays .asList ("--execution-result" , "--run-as-test-target" , "--stderr-output" ));
8495 return filterOutArgValuePairs (inputArgs , excludedArgs );
8596 }
8697
0 commit comments