Git Product home page Git Product logo

Comments (5)

plamen-ppv avatar plamen-ppv commented on July 4, 2024 1

Hi Philipp,

You are right - it works when you just have one argument. I only used it together with ignore:

SQL> tvdformat C:/temp/test.sql ignore=C:/temp/ignore_format.txt
2023-03-21 14:19:43.536 SEVERE oracle.dbtools.raptor.newscriptrunner.ScriptExecutor run java.base/java.lang.Class.cast(Class.java:3605)
java.lang.ClassCastException: Cannot cast java.lang.String to java.nio.file.Path
        at java.base/java.lang.Class.cast(Class.java:3605)
        at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$127$3280AAA$\^eval\_.isRelevantFile(<eval>:77)
        at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$130$2444AAA$\^eval\_.getFiles(<eval>:61)
        at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$131$28965A$\^eval\_.run(<eval>:685)
        at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$60$31631AAA$\^eval\_.registerTvdFormat#handleEvent(<eval>:722)
        at jdk.nashorn.javaadapters.oracle_dbtools_raptor_newscriptrunner_CommandListener.handleEvent(Unknown Source)
        at oracle.dbtools.raptor.newscriptrunner.CommandRegistry.fireListeners(CommandRegistry.java:439)
        at oracle.dbtools.raptor.newscriptrunner.ScriptRunner.run(ScriptRunner.java:237)
        at oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:356)
        at oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:239)
        at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.processLine(SqlCli.java:1150)
        at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.runSqlcl(SqlCli.java:1331)
        at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.main(SqlCli.java:339)

The offending line is 76 where "file" as string is passed to ignoreMatcher.matches(file)

Cheers,
Plamen

from plsql-formatter-settings.

PhilippSalvisberg avatar PhilippSalvisberg commented on July 4, 2024

Hi @plamen-ppv

Thanks for reporting this. I was not able to reproduce it on my MacBook.

SQLcl: Release 22.4 Production on Tue Mar 21 12:24:16 2023

Copyright (c) 1982, 2023, Oracle.  All rights reserved.

SQL> tvdformat /tmp/test.sql

Formatting file 1 of 1: /tmp/test.sql... done.
SQL> 

Maybe it is platform specific. I have to test it on Windows.

from plsql-formatter-settings.

PhilippSalvisberg avatar PhilippSalvisberg commented on July 4, 2024

I tried tvdformat.jar on Windows 11 with Java17. Works as well:

java -jar tvdformat.jar c:\temp\test.sql xml=embedded arbori=default

Formatting file 1 of 1: c:\temp\test.sql... done.

from plsql-formatter-settings.

PhilippSalvisberg avatar PhilippSalvisberg commented on July 4, 2024

I tested it on Windows 10 with Java 11 and the latest SQLcl:

SQL> tvdformat c:\temp\test.sql

Formatting file 1 of 1: c:\temp\test.sql... done.
SQL> script format.js c:\temp\test.sql

Formatting file 1 of 1: c:\temp\test.sql... done.
SQL>

@plamen-ppv I cannot reproduce the problem. Could you please provide some details about your environment to make it reproducible?

from plsql-formatter-settings.

PhilippSalvisberg avatar PhilippSalvisberg commented on July 4, 2024

Thanks @plamen-ppv . I can reproduce it.

from plsql-formatter-settings.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.