We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
コーディング規約スクリプトで,改行時の演算子が後置であることをチェックする
チェックに入ってなかった
The text was updated successfully, but these errors were encountered:
def check_binary_operator_before_linebreak_(path: str, code_lines: list) -> bool: ptn = r'^\s*([+\-*/%]|<<|>>|<=|>=|==|!=|&{1,2}|\|{1,2}|\^)\s+' reptn = re.compile(ptn) for idx, line in enumerate(code_lines): if is_in_comment_context_in_multiline_(path, code_lines, idx): continue matched = reptn.match(line) if matched is None: continue print_err_(path, idx, f'LINE {idx} HAS STARTED WITH THE OPERATOR {matched.group(1)}.', line) return False return True
とりあえずこれで行頭が
+
-
*
/,
,
>>
<=
>=
==
!=
&
|
&&
||
^
であるパターンははじけそう.改行時の演算子が前置であるパターンは原則として上記しかないはずで,試しに
if (p_super->interface < 0 || p_super->interface >= IF_LIST_MAX) return
みたいなのを導入したらちゃんとそこだけエラーになった.
Sorry, something went wrong.
Draft PR: #545
tarotene
No branches or pull requests
概要
コーディング規約スクリプトで,改行時の演算子が後置であることをチェックする
close条件
チェックに入ってなかった
The text was updated successfully, but these errors were encountered: