-
Notifications
You must be signed in to change notification settings - Fork 46
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
bug when using format.js with a single file #243
Comments
Hi @plamen-ppv Thanks for reporting this. I was not able to reproduce it on my MacBook.
Maybe it is platform specific. I have to test it on Windows. |
I tried tvdformat.jar on Windows 11 with Java17. Works as well:
|
I tested it on Windows 10 with Java 11 and the latest SQLcl:
@plamen-ppv I cannot reproduce the problem. Could you please provide some details about your environment to make it reproducible? |
Hi Philipp, You are right - it works when you just have one argument. I only used it together with ignore:
The offending line is 76 where "file" as string is passed to ignoreMatcher.matches(file) Cheers, |
Thanks @plamen-ppv . I can reproduce it. |
Hi Philip!
Thanks for providing such a nice tool for formatting SQL from within SQLcl!
I've been using it n SQLcl 22.4 and it works fine.
... but I found one bug:
if you run it with a single file instead of directory, i.e.
tvdformat c:\temp\x.sql xml=....
then the call from
getFiles()
toisRelevantFile()
fails with Java type cast error - line 60 in format.js.It's a very easy fix:
from
if (isRelevantFile(rootPath, extensions, ignoreMatcher)) {
to
if (isRelevantFile(javaPaths.get(rootPath), extensions, ignoreMatcher)) {
Best regards,
Plamen
The text was updated successfully, but these errors were encountered: