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

Klint succeeds loudly if a file it is fed does not exist #36

Closed
JLLeitschuh opened this issue Mar 6, 2017 · 1 comment
Closed

Klint succeeds loudly if a file it is fed does not exist #36

JLLeitschuh opened this issue Mar 6, 2017 · 1 comment

Comments

@JLLeitschuh
Copy link
Contributor

Ktlint Version: 0.4.0

If I pass in an a file as an argument that doesn't exist for example: /Users/jonathanleitschuh/work/git/plexxicontrol/PlexxiSwagger/ClientBindings/src/test/java/**/*.kt
I get the following very loud dump to standard error but no failure.

:PlexxiSwagger:ClientBindings:ktlintTest
Exception in thread "Thread-0" java.util.concurrent.ExecutionException: java.io.FileNotFoundException: /Users/jonathanleitschuh/work/git/plexxicontrol/PlexxiSwagger/ClientBindings/src/test/java (No such file or directory)
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:192)
        at com.github.shyiko.ktlint.Main$parallel$consumer$1.run(Main.kt:329)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.FileNotFoundException: /Users/jonathanleitschuh/work/git/plexxicontrol/PlexxiSwagger/ClientBindings/src/test/java (No such file or directory)
        at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(FileInputStream.java:195)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at kotlin.io.FilesKt__FileReadWriteKt.readBytes(FileReadWrite.kt:52)
        at kotlin.io.FilesKt__FileReadWriteKt.readText(FileReadWrite.kt:90)
        at kotlin.io.FilesKt__FileReadWriteKt.readText$default(FileReadWrite.kt:90)
        at com.github.shyiko.ktlint.Main$main$6$1$1.call(Main.kt:243)
        at com.github.shyiko.ktlint.Main$main$6$1$1.call(Main.kt:43)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        ... 1 more

I like that there is no failure but I think that this is a bit noisy of an exception to be dumping.

Perhaps a one line message if the file can't be found and then dump the full exception if the --debug or --verbose flag is set?

@shyiko
Copy link
Collaborator

shyiko commented Mar 7, 2017

Thank you, @JLLeitschuh. Fixed in 0.6.1.

@shyiko shyiko closed this as completed Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants