-
Notifications
You must be signed in to change notification settings - Fork 503
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
Allow ktlint invocations without matching sources #1624
Comments
This is a regression bug. The warning will stay after the fix but it should just exit with status code zero. |
Could we please add a flag to not warn about it? We'd really like to avoid polluting stdout. |
I do not want to introduce a flag to surpress this specific warning. Ktlint already has to many obscure flags and options which do hinder development. I will think about a possibility to suppress all warnings. Currently it is already possibly to influence the log level by setting flag |
Print an error message and return with non-zero exit code when no files are found that match with the globs Closes #629
…n with exit code 0 Closes pinterest#1624
Closes pinterest#1624
Expected Behavior
We use Gradle to invoke ktlint via a custom task. We pass in
src/**/*.kt !src/**/test-data/**/*.kt !src/**/external/**/*.kt
for what files we want to analyze. We create these tasks regardless if there is a matching kt file in the project, so that we don't have to do I/O during Gradle configuration. We have some project that have no matching files. 0.46 and older versions of ktlint, these invocations would just work.example full command
Observed Behavior
Starting with ktlint 0.47, it just exits with
Steps to Reproduce
Call ktlint with arguments that have no matching files.
Your Environment
If we do not want this behavior by default, ideally there is a flag to tell ktlint to skip running if there are no matching files.
The text was updated successfully, but these errors were encountered: