-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Adding Groovy Linter to Github Super-Linter #69
Comments
Tried to get it working a different way and it just doesn't show output for the second file... bash-5.0# npm-groovy-lint --path "./test" --files "**/*.groovy" --verbose
/test/good.groovy
2 warning Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic CompileStatic
npm-groovy-lint results in 2 linted files:
┌─────────┬───────────┬─────────────┐
│ (index) │ Severity │ Total found │
├─────────┼───────────┼─────────────┤
│ 0 │ 'Error' │ 0 │
│ 1 │ 'Warning' │ 1 │
│ 2 │ 'Info' │ 0 │ As from above, I have a /* Hello World in Groovy */
pr ('some dank") Does it seem to just skip it in output? |
I think that if you want to analyze the results of several groovy files, you should use --output json :) |
@nvuillam Can you help me understand why it's not showing data for the second file with the bad data? Is my command incorrect or am I looking at this wrong? Any help is much appreciated |
Plz can you fork the repo , add your test case in errors.test.js and send me the link, so I can reproduce the issue ? |
Hey @nvuillam sorry got sidetracked and didn't have a ton of time...
class Example {
static void main(String[] args) {
File file = new File("E:/Example.txt")
println "The file ${file.absolutePath} has ${file.length()} bytes"
}
}
class Example{
some noise here
}
bash-5.0# npm-groovy-lint --failon error --path "./test" --files "**/bad.groovy"
npm-groovy-lint results in 1 linted files:
┌─────────┬───────────┬─────────────┐
│ (index) │ Severity │ Total found │
├─────────┼───────────┼─────────────┤
│ 0 │ 'Error' │ 0 │
│ 1 │ 'Warning' │ 0 │
│ 2 │ 'Info' │ 0 │
└─────────┴───────────┴─────────────┘
bash-5.0# echo $?
0 As you can see, it shows 1 linted file, but none of the output, and error code is Can you help me understand what i may be doing wrong? Working caseIf I point it to a file with decent data, it works as expected Example of good.groovy: class Example {
static void main(String[] args) {
File file = new File("E:/Example.txt")
println "The file ${file.absolutePath} has ${file.length()} bytes"
}
} Outputbash-5.0# npm-groovy-lint --failon error --path "./test" --files "**/good.groovy"
/tests/good.groovy
1 warning Class `Example` is the only class in `good.groovy`. In such a case the file and the class should have the same name. ClassNameSameAsFilename
1 warning Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic CompileStatic
2 info Class does not start with a blank line after the opening brace ClassStartsWithBlankLine
2 info The method main in class Example is at the incorrect indent level: Expected column 5 but was 4 Indentation
3 info The statement on line 3 in class Example is at the incorrect indent level: Expected column 9 but was 7 Indentation
3 warning The use of java.io.File violates the Enterprise Java Bean specification JavaIoPackageAccess
3 info The String 'E:/Example.txt' can be wrapped in single quotes instead of double quotes UnnecessaryGString
4 info The statement on line 4 in class Example is at the incorrect indent level: Expected column 9 but was 7 Indentation
5 info Line ends with whitespace characters TrailingWhitespace
6 info Class does not end with a blank line before the closing brace ClassEndsWithBlankLine
npm-groovy-lint results in 1 linted files:
┌─────────┬───────────┬─────────────┐
│ (index) │ Severity │ Total found │
├─────────┼───────────┼─────────────┤
│ 0 │ 'Error' │ 0 │
│ 1 │ 'Warning' │ 3 │
│ 2 │ 'Info' │ 7 │
└─────────┴───────────┴─────────────┘
bash-5.0# |
Working on the solution... I'll keep you informed :) |
@nvuillam awesome. Even if it just marked the file as failed to parse and exited with error, that would achieve the main goal |
@admiralAwkbar please can you check with latest version ? (v5.7.0) I had to embed Ant in the package, but now every file is parsed before being sent to CodeNarc, so all parsing errors are returned Please reopen if you still see any problem :) |
Hey!
I'm working on adding the npm-groovy-linter to the GitHub Super-Linter
But I'm getting some odd behavior when testing the system, and getting bad results...
Any Idea why it's not understanding the test case?
Contents of
bad.groovy
:The text was updated successfully, but these errors were encountered: