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

Commit be78c82

Browse files
Merge pull request #245 from Trivadis/bugfix/issue-243-class-cast-exception
Bugfix/issue 243 class cast exception
2 parents 3c5089c + 65dbc79 commit be78c82

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

sqlcl/format.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ var getVersion = function() {
5757
var getFiles = function (rootPath, extensions, ignoreMatcher) {
5858
var files;
5959
if (existsFile(rootPath)) {
60-
if (isRelevantFile(rootPath, extensions, ignoreMatcher)) {
60+
if (isRelevantFile(javaPaths.get(rootPath.toString()), extensions, ignoreMatcher)) {
6161
files = javaArrays.asList(javaPaths.get(rootPath.toString()));
6262
} else {
6363
files = [];

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ public void ignore_in_json_object_file_does_not_exist() throws IOException {
3737
Assertions.assertTrue(actual.contains("Ignore file does_not_exist.txt does not exist."));
3838
}
3939

40+
@Test
41+
public void ignore_file_and_single_file_to_format() throws IOException {
42+
// issue 243
43+
var ignoreFileContent = """
44+
# Ignore files with syntax errors
45+
**/*syntax*
46+
""";
47+
final Path ignoreFile = Paths.get(getTempDir() + "/ignore.txt");
48+
Files.write(ignoreFile, ignoreFileContent.getBytes());
49+
var actual = runCommand( "tvdformat " + getTempDir()+"/query.sql" + " ignore=" + getTempDir() + "/ignore.txt");
50+
Assertions.assertTrue(actual.contains("1 of 1"));
51+
}
52+
53+
4054
@Test
4155
public void ignore_two_files() throws IOException {
4256
var ignoreFileContent = """

0 commit comments

Comments
 (0)