Skip to content

Commit

Permalink
Linter Test 13
Browse files Browse the repository at this point in the history
  • Loading branch information
onurulgen committed Feb 12, 2024
1 parent 7eface0 commit 3044ff7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 8 additions & 10 deletions .github/code_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion niftyreg_build_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
435
436

0 comments on commit 3044ff7

Please sign in to comment.