Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print an error message and return with non-zero exit code when no files are found that match with the globs Closes #629
- Loading branch information
1 parent
7abe7da
commit 07ce058
Showing
4 changed files
with
35 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -211,6 +211,13 @@ internal class KtlintCommandLine { | |
|
||
failOnOldRulesetProviderUsage() | ||
|
||
// Set default value to patterns only after the logger has been configured to avoid a warning about initializing | ||
// the logger multiple times | ||
if (patterns.isEmpty()) { | ||
logger.info { "Enable default patterns $defaultPatterns" } | ||
patterns = ArrayList(defaultPatterns) | ||
} | ||
|
||
val start = System.currentTimeMillis() | ||
|
||
val baselineResults = loadBaseline(baseline) | ||
|
@@ -242,6 +249,10 @@ internal class KtlintCommandLine { | |
) | ||
} | ||
reporter.afterAll() | ||
if (fileNumber.get() == 0) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
baylrock
|
||
logger.error { "No files matched $patterns" } | ||
exitProcess(1) | ||
} | ||
logger.debug { "${System.currentTimeMillis() - start}ms / $fileNumber file(s) / $errorNumber error(s)" } | ||
if (tripped.get()) { | ||
exitProcess(1) | ||
|
@@ -281,8 +292,7 @@ internal class KtlintCommandLine { | |
ruleSets | ||
) | ||
} | ||
} | ||
.parallel({ (file, errList) -> report(file.location(relative), errList, reporter) }) | ||
}.parallel({ (file, errList) -> report(file.location(relative), errList, reporter) }) | ||
} | ||
|
||
private fun lintStdin( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was quite a surprise when all non-kotlin maven pom submodules that inherit parent plugin configuration started failing because of this check... And apparently, there is no way to ignore this check?!