Skip to content

Commit

Permalink
fix check coding rule ci
Browse files Browse the repository at this point in the history
  • Loading branch information
meltingrabbit committed Dec 10, 2021
1 parent 014a8b3 commit cb2caa2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check_coding_rule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
shell: bash
run: ./setup.sh
- name: check_coding_rule
run: python check_coding_rule.py check_coding_rule.json
working-directory: ./Examples/minimum_user_for_s2e/src/src_core/Script/CI
run: python ./src_core/Script/CI/check_coding_rule.py ./src_core/Script/CI/check_coding_rule.json
working-directory: ./Examples/minimum_user_for_s2e/src
2 changes: 1 addition & 1 deletion Script/CI/check_coding_rule.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"c2a_root_dir" : "../../../",
"c2a_root_dir" : "./",
"target_dirs" : [
"src_core/",
"src_user/"
Expand Down
6 changes: 5 additions & 1 deletion Script/CI/check_coding_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ def check_operator_space_(path: str, code_lines: list) -> int:

targets = ["<", ">", "=", "&", "|", "^", "~", "=", "?", ":", "!", "+", "-", "*", "/", "%"]
for target in targets:
ptn_before = "(\w+)(" + "[" + re.escape("<>=&|^~=?:!+-*/&") + "]*" + re.escape(target) + "[" + re.escape("<>=&|^~=?:!+-*/&") + "]*)"
ptn_before = "(\w+)(" + "[" + re.escape("<>=&|^~=?:!+-*/&") + "]*" + re.escape(target) + "[" + re.escape("<>=&|^~=?:!+-*/&") + "]*)(.*)"
reptn_before = re.compile(ptn_before)
ptn_after = "(" + "[" + re.escape("<>=&|^~=?:!+-*/&") + "]*" + re.escape(target) + "[" + re.escape("<>=&|^~=?:!+-*/&") + "]*)(\w+)"
reptn_after = re.compile(ptn_after)
Expand Down Expand Up @@ -558,6 +558,10 @@ def check_operator_space_(path: str, code_lines: list) -> int:
continue
if match.group(2) in ["*", "&"] and match.group(1) in g_type_set:
continue
if match.group(2) == "*" and match.group(3) != "":
if match.group(3)[0] == ")":
continue
# common_tlm_cmd_packet_util.h の `(*((type*)( \` が引っかからないように
# print(line)
# print(match)
# print("#" + match.group(1) + "#")
Expand Down

0 comments on commit cb2caa2

Please sign in to comment.