diff --git a/go.mod b/go.mod index f60b9581..a6d4d964 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,6 @@ require ( github.com/errata-ai/ini v1.63.0 github.com/errata-ai/regexp2 v1.7.0 github.com/gobwas/glob v0.2.3 - github.com/jdkato/go-tree-sitter-julia v0.0.0-20240531060609-b738d045ba2d github.com/jdkato/twine v0.10.1 github.com/karrick/godirwalk v1.16.1 github.com/mholt/archiver/v3 v3.5.1 @@ -45,6 +44,7 @@ require ( github.com/gookit/color v1.5.4 // indirect github.com/huandu/xstrings v1.3.3 // indirect github.com/imdario/mergo v0.3.11 // indirect + github.com/jdkato/go-tree-sitter-julia v0.1.0 // indirect github.com/klauspost/compress v1.11.4 // indirect github.com/klauspost/pgzip v1.2.5 // indirect github.com/kr/pretty v0.3.0 // indirect diff --git a/go.sum b/go.sum index a6e3df18..f284f1bb 100644 --- a/go.sum +++ b/go.sum @@ -65,6 +65,8 @@ github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/jdkato/go-tree-sitter-julia v0.0.0-20240531060609-b738d045ba2d h1:nc/Dgjp4Zr3drV44bz2+fUaCb1ZZvFtNnudyuaWL7uQ= github.com/jdkato/go-tree-sitter-julia v0.0.0-20240531060609-b738d045ba2d/go.mod h1:lXNEZorcvU63DcANEklLMbDRjwam4VQ44MIV1Cck0w8= +github.com/jdkato/go-tree-sitter-julia v0.1.0 h1:z+6zTbd6PHMKAge7GJx9QIwPQX2NOKb4Pj5jteJvaYY= +github.com/jdkato/go-tree-sitter-julia v0.1.0/go.mod h1:lXNEZorcvU63DcANEklLMbDRjwam4VQ44MIV1Cck0w8= github.com/jdkato/twine v0.10.1 h1:Jexy1dua9nRyr45AQ3Bml1nCVYq3VIi9g09MOkg2Wwk= github.com/jdkato/twine v0.10.1/go.mod h1:bYejIksa/MD4jxI5/o+DFxMb7Bw7JcGZDoA6ib4j+dg= github.com/karrick/godirwalk v1.16.1 h1:DynhcF+bztK8gooS0+NDJFrdNZjJ3gzVzC545UNA9iw= diff --git a/internal/core/format.go b/internal/core/format.go index 5f4069ac..c3fd2beb 100755 --- a/internal/core/format.go +++ b/internal/core/format.go @@ -53,11 +53,6 @@ var CommentsByNormedExt = map[string]map[string]string{ "blockStart": `(\{-.*)`, "blockEnd": `(.*-\})`, }, - ".jl": { - "inline": `(# .+)`, - "blockStart": `(^#=)|(^(?:@doc )?(?:raw)?["']{3}.*)`, - "blockEnd": `(^=#)|(.*["']{3})`, - }, } // FormatByExtension associates a file extension with its "normed" extension diff --git a/internal/lint/code/jl.go b/internal/lint/code/jl.go index 07adc71e..ab2c3d41 100644 --- a/internal/lint/code/jl.go +++ b/internal/lint/code/jl.go @@ -8,9 +8,12 @@ import ( func Julia() *Language { return &Language{ - Delims: regexp.MustCompile(`#|#=|=#`), - Parser: julia.GetLanguage(), - Queries: []string{`(comment)+ @comment`}, + Delims: regexp.MustCompile(`#|#=|=#`), + Parser: julia.GetLanguage(), + Queries: []string{ + `(line_comment)+ @comment`, + `(block_comment)+ @comment`, + }, Padding: func(s string) int { return computePadding(s, []string{"#", `#=`, `=#`}) }, diff --git a/testdata/features/lint.feature b/testdata/features/lint.feature index a01fa3d8..06b90ce0 100755 --- a/testdata/features/lint.feature +++ b/testdata/features/lint.feature @@ -30,11 +30,7 @@ Feature: Lint test.jl:1:3:vale.Annotations:'NOTE' left in text test.jl:4:3:vale.Annotations:'NOTE' left in text test.jl:9:7:vale.Annotations:'NOTE' left in text - test.jl:16:51:vale.Annotations:'TODO' left in text - test.jl:19:1:vale.Annotations:'TODO' left in text test.jl:21:17:vale.Annotations:'NOTE' left in text - test.jl:29:1:vale.Annotations:'XXX' left in text - test.jl:41:1:vale.Annotations:'NOTE' left in text test.jl:47:3:vale.Annotations:'XXX' left in text """