-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from arkedge/feature/refactor-check-coding-rul…
…e-path Move check coding rule setting file to C2A user top
- Loading branch information
Showing
5 changed files
with
70 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,63 +8,17 @@ on: | |
pull_request: | ||
|
||
jobs: | ||
check_coding_rule: | ||
runs-on: ubuntu-latest | ||
check_coding_rule_v4: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
example: | ||
user: | ||
- mobc | ||
- subobc | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version-file: .github/workflows/.python-version | ||
architecture: 'x64' | ||
- name: setup | ||
shell: bash | ||
run: ./setup.sh | ||
- name: check coding rule | ||
id: check | ||
shell: bash -e {0} | ||
continue-on-error: true | ||
working-directory: ./examples/${{ matrix.example }}/src | ||
run: | | ||
python ./src_core/script/ci/check_coding_rule.py ./src_core/script/ci/check_coding_rule.json | tee /tmp/coding-rule.log | ||
status="${PIPESTATUS[0]}" | ||
echo "status: ${status}" | ||
echo "status=${status}" >> "$GITHUB_OUTPUT" | ||
exit "${status}" | ||
- name: install reviewdog | ||
uses: reviewdog/[email protected] | ||
|
||
- name: fix error log source file path | ||
run: | | ||
sed 's/.\/src_core\///g' < /tmp/coding-rule.log \ | ||
| > ./coding-rule.log \ | ||
sed 's/.\/src_user/examples\/${{ matrix.example }}\/src\/src_user/g' | ||
cat ./coding-rule.log | ||
- name: reviewdog(github-pr-review) | ||
env: | ||
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
reviewdog \ | ||
-name 'check_coding_rule' \ | ||
-level error \ | ||
-fail-on-error=true \ | ||
-filter-mode=added \ | ||
-diff="git diff FETCH_HEAD" \ | ||
-reporter=github-pr-review \ | ||
-efm="%-GThe above files are invalid coding rule." \ | ||
-efm="%E%f: %l: %m" \ | ||
-efm="%Z%s" \ | ||
< coding-rule.log | ||
- name: exit | ||
shell: bash | ||
run: | | ||
exit $(( "${{ steps.check.outputs.status }}" )) | ||
uses: arkedge/workflows-c2a/.github/workflows/[email protected] | ||
with: | ||
c2a_dir: examples/${{ matrix.user }} | ||
c2a_custom_setup: | | ||
cd ../.. | ||
pwd | ||
./setup.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 6 additions & 7 deletions
13
script/ci/check_coding_rule.json → examples/mobc/check_coding_rule.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"input_file_encoding" : "utf-8", | ||
"target_dirs" : [ | ||
"src/src_core/", | ||
"src/src_user/" | ||
], | ||
"ignore_dirs" : [ | ||
"src/src_core/examples", | ||
"src/src_core/docs", | ||
"src/src_core/script" | ||
], | ||
"ignore_files" : [ | ||
"src/src_user/tlm_cmd/telemetry_definitions.c" | ||
], | ||
"ignore_rules" : [ | ||
], | ||
"comment_ignore_rules" : [ | ||
"以下を指定すると,該当ルールが無視される", | ||
"comment", | ||
"newline", | ||
"eof", | ||
"space", | ||
"operator_space", | ||
"preprocessor", | ||
"include_guard" | ||
], | ||
"additional_type" : [ | ||
"TCP", | ||
"CommonTlmCmdPacket", | ||
"CommonTlmPacket", | ||
"CommonCmdPacket", | ||
"SpacePacket", | ||
"TlmSpacePacket", | ||
"CmdSpacePacket" | ||
], | ||
"comment_additional_type" : [ | ||
"FIXME: TCP はもう存在しないはずなので,どこかで消す", | ||
"FIXME: CTCP, CTP, CCP については,整理が終わり次第,消して大丈夫になるはず" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters