Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 9179526

Browse files
Merge pull request #241 from Trivadis/bugfix/issue-240-sqlcl-22.3.0-compatibility
Update settings to make them compatible with SQLcl 22.3.0
2 parents 10bcb00 + 1deed9c commit 9179526

7 files changed

Lines changed: 17 additions & 17 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ This repository provides formatter settings for the [coding style rules](https:/
66

77
Settings are primarily provided for
88

9-
- [Oracle SQLcl, Version 22.2.1](https://www.oracle.com/tools/downloads/sqlcl-downloads.html)
10-
- [Oracle SQL Developer, Version 22.2.1](https://www.oracle.com/tools/downloads/sqldev-downloads.html)
9+
- [Oracle SQLcl, Version 22.3.0](https://www.oracle.com/tools/downloads/sqlcl-downloads.html)
10+
- [Oracle SQL Developer, Version 22.2.1](https://www.oracle.com/tools/downloads/sqldev-downloads.html) (requires `dbtools-common.jar` from SQLcl 22.3.0)
1111

1212
These settings have been defined and tested with the product versions mentioned above. They might not work in other versions.
1313

settings/sql_developer/trivadis_custom_format.arbori

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
include "std.arbori"
1818

1919
/**
20-
* Lightweight Formatter for SQL Developer and SQLcl, version 22.2.2-SNAPSHOT
20+
* Lightweight Formatter for SQL Developer and SQLcl, version 22.3.0-SNAPSHOT
2121
* The idea is to keep the code formatted "as is" and apply chosen formatting rules only.
2222
*
2323
* The Arbori program is processed from top to bottom.
@@ -2902,7 +2902,7 @@ r2_common:
29022902
| [node) xmltable
29032903
| [node) json_table
29042904
| [node) JSON_columns_clause
2905-
| [node) expr & [node-1) '(' & [node^) query_table_expression
2905+
| [node) expr & [node-1) '(' & [node^) query_table_expression & ![node-2) 'XMLTABLE'
29062906
| [node) pls_expr & [node-1) '(' & ![node^) paren_expr_list
29072907
| [node) compound_condition & [node-1) '('
29082908
| [node^) function

sqlcl/format.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var javaSqlEarley = Java.type("oracle.dbtools.parser.plsql.SqlEarley");
5151
var javaProgram = Java.type("oracle.dbtools.arbori.Program");
5252

5353
var getVersion = function() {
54-
return "22.2.2-SNAPSHOT";
54+
return "22.3.0-SNAPSHOT";
5555
}
5656

5757
var getFiles = function (rootPath, extensions, ignoreMatcher) {

standalone/install_sqlcl_libs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if ! test -f "${SQLCL_LIBDIR}/dbtools-common.jar"; then
1515
fi
1616

1717
# define common Maven properties
18-
SQLCL_VERSION="22.2.1"
18+
SQLCL_VERSION="22.3.0"
1919

2020
# install JAR files in local Maven repository, these libs are not available in public Maven repositories
2121
mvn install:install-file -Dfile=$SQLCL_LIBDIR/dbtools-common.jar \

standalone/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
<!-- The Basics -->
77
<groupId>com.trivadis.plsql.formatter</groupId>
88
<artifactId>tvdformat</artifactId>
9-
<version>22.2.2-SNAPSHOT</version>
9+
<version>22.3.0-SNAPSHOT</version>
1010
<packaging>jar</packaging>
1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1313
<jdk.version>11</jdk.version>
1414
<jdk.test.version>17</jdk.test.version>
15-
<sqlcl.version>22.2.1</sqlcl.version>
15+
<sqlcl.version>22.3.0</sqlcl.version>
1616
<graalvm.version>22.2.0</graalvm.version>
1717
<native.maven.plugin.version>0.9.13</native.maven.plugin.version>
1818
<reflections.version>0.10.2</reflections.version>

standalone/src/test/java/com/trivadis/plsql/formatter/settings/tests/grammar/plsql/While_loop_statement.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,20 @@ public void example_14_47_tokenized() throws IOException {
5757
var actual = getFormatter().format(input);
5858
var expected = """
5959
declare
60-
done boolean := FALSE;
60+
done boolean := false;
6161
begin
6262
while done
6363
loop
6464
DBMS_OUTPUT.PUT_LINE('This line does not print.');
6565
done :=
66-
TRUE; -- This assignment is not made.
66+
true; -- This assignment is not made.
6767
end loop;
6868
6969
while not done
7070
loop
7171
DBMS_OUTPUT.PUT_LINE('Hello, world!');
7272
done :=
73-
TRUE;
73+
true;
7474
end loop;
7575
end;
7676
/

standalone/src/test/java/com/trivadis/plsql/formatter/sqlcl/tests/AbstractFormatTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public void process_dir(final RunType runType) {
2222
for r in /*(*/ select x.* from x join y on y.a = x.a)
2323
^^^
2424
25-
Expected: constraint,':',"aggr_name",'COUNT','-','(','JSON_T... skipped.
25+
Expected: constraint,':',"aggr_name",'COUNT','FALSE','-','('... skipped.
2626
""".replace("#TEMP_DIR#", getTempDir());
2727
var actual = run(runType, getTempDir(), "mext=");
2828
assertEquals(expected, actual);
@@ -552,7 +552,7 @@ public void process_config_dir_array(final RunType runType) throws IOException {
552552
for r in /*(*/ select x.* from x join y on y.a = x.a)
553553
^^^
554554
555-
Expected: constraint,':',"aggr_name",'COUNT','-','(','JSON_T... skipped.
555+
Expected: constraint,':',"aggr_name",'COUNT','FALSE','-','('... skipped.
556556
""".replace("#TEMP_DIR#", getTempDir());
557557
var configFileContent = """
558558
[
@@ -611,7 +611,7 @@ public void process_dir_all_errors(final RunType runType) {
611611
for r in /*(*/ select x.* from x join y on y.a = x.a)
612612
^^^
613613
614-
Expected: constraint,':',"aggr_name",'COUNT','-','(','JSON_T... skipped... #3... done... done.
614+
Expected: constraint,':',"aggr_name",'COUNT','FALSE','-','('... skipped... #3... done... done.
615615
Formatting file 2 of 4: #TEMP_DIR#/package_body.pkb... done.
616616
Formatting file 3 of 4: #TEMP_DIR#/query.sql... done.
617617
Formatting file 4 of 4: #TEMP_DIR#/syntax_error.sql... Syntax Error at line 6, column 12
@@ -620,7 +620,7 @@ public void process_dir_all_errors(final RunType runType) {
620620
for r in /*(*/ select x.* from x join y on y.a = x.a)
621621
^^^
622622
623-
Expected: constraint,':',"aggr_name",'COUNT','-','(','JSON_T... skipped.
623+
Expected: constraint,':',"aggr_name",'COUNT','FALSE','-','('... skipped.
624624
""".replace("#TEMP_DIR#", getTempDir());
625625
var actual = run(runType, getTempDir());
626626
assertEquals(expected, actual);
@@ -636,7 +636,7 @@ public void process_dir_mext_errors(final RunType runType) {
636636
for r in /*(*/ select x.* from x join y on y.a = x.a)
637637
^^^
638638
639-
Expected: constraint,':',"aggr_name",'COUNT','-','(','JSON_T... skipped... #3... done... done.
639+
Expected: constraint,':',"aggr_name",'COUNT','FALSE','-','('... skipped... #3... done... done.
640640
Formatting file 2 of 4: #TEMP_DIR#/package_body.pkb... done.
641641
Formatting file 3 of 4: #TEMP_DIR#/query.sql... done.
642642
Formatting file 4 of 4: #TEMP_DIR#/syntax_error.sql... skipped.
@@ -658,7 +658,7 @@ public void process_dir_ext_errors(final RunType runType) {
658658
for r in /*(*/ select x.* from x join y on y.a = x.a)
659659
^^^
660660
661-
Expected: constraint,':',"aggr_name",'COUNT','-','(','JSON_T... skipped.
661+
Expected: constraint,':',"aggr_name",'COUNT','FALSE','-','('... skipped.
662662
""".replace("#TEMP_DIR#", getTempDir());
663663
var actual = run(runType, getTempDir(), "serr=ext");
664664
assertEquals(expected, actual);

0 commit comments

Comments
 (0)