From 3044ff79cbbb3a95339658658afd4338cc47fd5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20=C3=9Clgen?= Date: Mon, 12 Feb 2024 12:53:35 +0000 Subject: [PATCH] Linter Test 13 --- .github/code_analysis.py | 18 ++++++++---------- niftyreg_build_version.txt | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/code_analysis.py b/.github/code_analysis.py index ca7af737..f203f073 100644 --- a/.github/code_analysis.py +++ b/.github/code_analysis.py @@ -238,7 +238,7 @@ def generate_description(is_note, was_note, file_line_start, issue_description, is_note -- is the current issue a Note: or not was_note -- was the previous issue a Note: or not file_line_start -- line to which the issue corresponds - issue_description -- the description from cppcheck/clang-tidy + issue_description -- the description from cppcheck output_string -- entire description (can be altered if the current/previous issue is/was Note:) """ global CURRENT_COMMENT_LENGTH @@ -496,23 +496,21 @@ def create_comment_for_output(tool_output, prefix, files_changed_in_pr, output_t def read_files_and_parse_results(): - """Reads the output files generated by cppcheck and clang-tidy and creates comments + """Reads the output files generated by cppcheck and creates comments for the pull request, based on the issues found. The comments can be output to console and/or added to the pull request. Returns a tuple with the comments generated for - cppcheck and clang-tidy, and boolean values indicating whether issues were found by - each tool, whether output was generated to the console, and whether the actual code + cppcheck, and boolean values indicating whether issues were found by each tool, + whether output was generated to the console, and whether the actual code is in the 'pr_tree' directory. Returns: A tuple with the following values: - cppcheck_comment (str): The comment generated for cppcheck, if any issues were found. - - clang_tidy_comment (str): The comment generated for clang-tidy, if any issues were found. - cppcheck_issues_found (bool): Whether issues were found by cppcheck. - - clang_tidy_issues_found (bool): Whether issues were found by clang-tidy. - output_to_console (bool): Whether output was generated to the console. """ - # Get cppcheck and clang-tidy files + # Get cppcheck files parser = create_common_input_vars_parser() parser.add_argument("-cc", "--cppcheck", help="Output file name for cppcheck", required=True) @@ -554,7 +552,7 @@ def read_files_and_parse_results(): def prepare_comment_body(cppcheck_comment, cppcheck_issues_found): """ - Generates a comment body based on the results of the cppcheck and clang-tidy analysis. + Generates a comment body based on the results of the cppcheck analysis. Args: cppcheck_comment (str): The comment body generated for the cppcheck analysis. @@ -593,5 +591,5 @@ def prepare_comment_body(cppcheck_comment, cppcheck_issues_found): if not output_to_console_in: comment_body_in = prepare_comment_body(cppcheck_comment_in, cppcheck_issues_found_in) create_or_edit_comment(comment_body_in) - - sys.exit(cppcheck_issues_found_in) + else: + sys.exit(cppcheck_issues_found_in) diff --git a/niftyreg_build_version.txt b/niftyreg_build_version.txt index 5910394b..246662b5 100644 --- a/niftyreg_build_version.txt +++ b/niftyreg_build_version.txt @@ -1 +1 @@ -435 +436