nikitasavinov / checkstyle-action

Run Java checkstyle with reviewdog in github actions
MIT License
59 stars 37 forks source link

Issue setting version #21

Closed KenwoodFox closed 3 years ago

KenwoodFox commented 3 years ago

Can somebody help confirm to me that checkstyle_version works? I've set it to checkstyle_version: '8.18' witch is the version running on my machine, I get no errors checking and using my XML but when it runs on github it fails just like it would if it were running a higher version.


com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - TreeWalker is not allowed as a parent of LineLength Please review 'Parent Module' section for this Check in web documentation if Check is standard.
    at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:482)
    at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:201)
    at com.puppycrawl.tools.checkstyle.Main.runCheckstyle(Main.java:404)
    at com.puppycrawl.tools.checkstyle.Main.runCli(Main.java:331)
    at com.puppycrawl.tools.checkstyle.Main.execute(Main.java:190)
    at com.puppycrawl.tools.checkstyle.Main.main(Main.java:125)
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: TreeWalker is not allowed as a parent of LineLength Please review 'Parent Module' section for this Check in web documentation if Check is standard.
    at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:137)
    at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:201)
    at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:477)
    ... 5 more
Checkstyle ends with 1 errors.
reviewdog: EOF``` Any ideas?
KenwoodFox commented 3 years ago

Heres some more verbose output. Run nikitasavinov/checkstyle-action@master with: github_token: *** reporter: github-pr-check filter_mode: nofilter fail_on_error: true checkstyle_config: checkstyle/1721_checks.xml checkstyle_version: 8.18 level: info workdir: . tool_name: reviewdog /usr/bin/docker run --name e4a8250629659a4cdc847b7a06338c3b00_5b5a77 --label 5588e4 --workdir /github/workspace --rm -e INPUT_GITHUB_TOKEN -e INPUT_REPORTER -e INPUT_FILTER_MODE -e INPUT_FAIL_ON_ERROR -e INPUT_CHECKSTYLE_CONFIG -e INPUT_CHECKSTYLE_VERSION -e INPUT_LEVEL -e INPUT_WORKDIR -e INPUT_TOOL_NAME -e INPUT_PROPERTIES_FILE -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/1721-InfiniteRecharge/1721-InfiniteRecharge":"/github/workspace" 5588e4:a8250629659a4cdc847b7a06338c3b00 Running check com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - TreeWalker is not allowed as a parent of LineLength Please review 'Parent Module' section for this Check in web documentation if Check is standard. at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:482) at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:201) at com.puppycrawl.tools.checkstyle.Main.runCheckstyle(Main.java:404) at com.puppycrawl.tools.checkstyle.Main.runCli(Main.java:331) at com.puppycrawl.tools.checkstyle.Main.execute(Main.java:190) at com.puppycrawl.tools.checkstyle.Main.main(Main.java:125) Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: TreeWalker is not allowed as a parent of LineLength Please review 'Parent Module' section for this Check in web documentation if Check is standard. at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:137) at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:201) at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:477) ... 5 more Checkstyle ends with 1 errors. reviewdog: EOF

And here's my XML https://github.com/FRC-1721/1721-InfiniteRecharge/blob/checkstyle/checkstyle/1721_checks.xml

dbelyaev commented 3 years ago

There is a bug in action which will always override checkstyle version submitted by user with the one defined in the Dockerfile: https://github.com/nikitasavinov/checkstyle-action/blob/f32cff6e94c41d159e6457624e07ee0022cbad4f/Dockerfile#L4

nikitasavinov commented 3 years ago

Hey @dbelyaev, thank you for your message! I somehow missed the notification about the bug