[英]Using custom checkstyle.xml file to check java codes
For our java code base, we tried to implement checkstyle github action for our needs but I couldn't figure out how to implement custom needs.对于我们的 java 代码库,我们尝试根据需要实现 checkstyle github 操作,但我不知道如何实现自定义需求。
Here is the repo I want to use it.这是我想使用它的回购协议。 Checker
检查器
And my yml file to use it.和我的 yml 文件来使用它。
on: pull_request
jobs:
checkstyle_job:
runs-on: ubuntu-latest
name: Checkstyle job
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run check style
uses: efeozsoy/checkstyle-java-commenter@0.1.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: 'github-pr-check'
tool_name: 'checkstyle-java'
This is the output of the default xml I need to change max lines and indentation rules这是默认xml的output我需要更改最大行数和缩进规则
You can set the config location using option checkstyle_config
, in the same way as tool_name
.您可以使用选项
checkstyle_config
设置配置位置,方法与tool_name
相同。 The value can be a file in your local repository, or a link to a different configuration file.该值可以是本地存储库中的文件,也可以是指向不同配置文件的链接。 For example:
例如:
checkstyle_config: https://raw.githubusercontent.com/efeozsoy/checkstyle-java-commenter/master/custom_checker.xml
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.