diff --git a/cpp_linter/clang_tools/patcher.py b/cpp_linter/clang_tools/patcher.py index dc81167d..ef729624 100644 --- a/cpp_linter/clang_tools/patcher.py +++ b/cpp_linter/clang_tools/patcher.py @@ -42,6 +42,27 @@ def serialize_to_github_payload(self) -> Dict[str, Any]: return result +class ExistingSuggestion(Suggestion): + def __init__(self, file_name) -> None: + super().__init__(file_name) + #: The review ID corresponding to this review comment. + self.review_id: str = "" + self.review_is_minimized: bool = False + """Is the review minimized? + This applies to entire review, not the thread or comments within.""" + + +class ExistingThread: + def __init__(self) -> None: + self.comments: List[ExistingSuggestion] = [] + #: Is the review thread resolved? + self.is_resolved: bool = False + #: Is the review thread collapsed? + self.is_collapsed: bool = False + #: The review thread's ``node_id``. + self.id: str = "" + + class ReviewComments: """A data structure to contain PR review comments from a specific clang tool.""" @@ -66,6 +87,12 @@ def __init__(self) -> None: """The full patch of all the suggestions (including those that will not fit within the diff)""" + self.tool_reused: Dict[str, int] = { + "clang-tidy": 0, + "clang-format": 0, + } + """The total number of reused concerns from previous reviews.""" + def merge_similar_suggestion(self, suggestion: Suggestion) -> bool: """Merge a given ``suggestion`` into a similar `Suggestion` @@ -105,10 +132,10 @@ def serialize_to_github_payload( posted_tool_advice = {"clang-tidy": 0, "clang-format": 0} for comment in self.suggestions: comments.append(comment.serialize_to_github_payload()) - if "### clang-format" in comment.comment: - posted_tool_advice["clang-format"] += 1 - if "### clang-tidy" in comment.comment: - posted_tool_advice["clang-tidy"] += 1 + posted_tool_advice["clang-tidy"] += comment.comment.count("### clang-tidy") + posted_tool_advice["clang-format"] += comment.comment.count( + "### clang-format" + ) for tool_name in ("clang-tidy", "clang-format"): tool_version = tidy_version @@ -117,15 +144,18 @@ def serialize_to_github_payload( if tool_version is None or self.tool_total[tool_name] is None: continue # if tool wasn't used summary += f"### Used {tool_name} v{tool_version}\n\n" - if ( - len(comments) - and posted_tool_advice[tool_name] != self.tool_total[tool_name] + if len(comments) and ( + posted_tool_advice[tool_name] != self.tool_total[tool_name] + or self.tool_reused[tool_name] != 0 ): summary += ( f"Only {posted_tool_advice[tool_name]} out of " - + f"{self.tool_total[tool_name]} {tool_name}" - + " concerns fit within this pull request's diff.\n" + + f"{self.tool_total[tool_name]} _new_ {tool_name}" + + " concerns fit within this pull request's diff." ) + if self.tool_reused[tool_name] != 0: + summary += f" {self.tool_reused[tool_name]} concerns were suppressed as duplicates." + summary += "\n" if self.full_patch[tool_name]: summary += ( f"\n
Click here for the full {tool_name} patch" @@ -136,6 +166,30 @@ def serialize_to_github_payload( summary += f"No concerns from {tool_name}.\n" return (summary, comments) + def remove_reused_suggestions(self, existing_review_comments: List[Suggestion]): + """Remove any reused ``Suggestion`` from the internal list and update counts""" + if not existing_review_comments: + return + review_comments_suggestions = self.suggestions + self.suggestions = [] + clang_tidy_comments = 0 + clang_format_comments = 0 + for suggestion in review_comments_suggestions: + if suggestion not in existing_review_comments: + clang_tidy_comments += suggestion.comment.count("### clang-tidy") + clang_format_comments += suggestion.comment.count("### clang-format") + self.suggestions.append(suggestion) + if clang_tidy_comments > 0 and self.tool_total["clang-tidy"] is not None: + self.tool_reused["clang-tidy"] = ( + self.tool_total["clang-tidy"] - clang_tidy_comments + ) + self.tool_total["clang-tidy"] = clang_tidy_comments + if clang_format_comments > 0 and self.tool_total["clang-format"] is not None: + self.tool_reused["clang-format"] = ( + self.tool_total["clang-format"] - clang_format_comments + ) + self.tool_total["clang-format"] = clang_format_comments + class PatchMixin(ABC): """An abstract mixin that unified parsing of the suggestions into diff --git a/cpp_linter/cli.py b/cpp_linter/cli.py index f95d4225..3432504f 100644 --- a/cpp_linter/cli.py +++ b/cpp_linter/cli.py @@ -69,6 +69,8 @@ class Args(UserDict): ignore_format: str = "" #: See :std:option:`--passive-reviews`. passive_reviews: bool = False + #: See :std:option:`--delete-review-comments`. + delete_review_comments: bool = False _parser_args: Dict[Sequence[str], Any] = {} @@ -358,6 +360,16 @@ class Args(UserDict): help="""Set to ``true`` to prevent Pull Request reviews from requesting or approving changes.""", ) +_parser_args[("-C", "--delete-review-comments")] = dict( + default="false", + type=lambda input: input.lower() == "true", + help="""Set to ``true`` to delete existing outdated/unused +Pull request review comments, ``false`` to just set them to resolved. +This only affects review comments made when either +:std:option:`--tidy-review` or :std:option:`--format-review` is enabled. + +Defaults to ``%(default)s``.""", +) def _parse_jobs(val: str) -> Optional[int]: diff --git a/cpp_linter/rest_api/github_api.py b/cpp_linter/rest_api/github_api.py index 6031bc83..20a7d2d2 100644 --- a/cpp_linter/rest_api/github_api.py +++ b/cpp_linter/rest_api/github_api.py @@ -15,7 +15,7 @@ from pathlib import Path import urllib.parse import sys -from typing import Dict, List, Any, cast, Optional +from typing import Dict, List, Any, cast, Optional, Union, NamedTuple from ..common_fs import FileObj, CACHE_PATH from ..common_fs.file_filter import FileFilter @@ -24,7 +24,12 @@ tally_format_advice, ) from ..clang_tools.clang_tidy import tally_tidy_advice -from ..clang_tools.patcher import ReviewComments, PatchMixin +from ..clang_tools.patcher import ( + ReviewComments, + PatchMixin, + ExistingSuggestion, + ExistingThread, +) from ..clang_tools import ClangVersions from ..cli import Args from ..loggers import logger, log_commander @@ -37,6 +42,69 @@ retry="retry-after", ) +GRAPHQL_PAGE_INFO = Dict[str, Union[str, bool]] + +QUERY_REVIEW_COMMENTS = """query($owner: String!, $name: String!, $number: Int!, $afterThread: String, $afterComment: String) { + repository(owner: $owner, name: $name) { + pullRequest(number: $number) { + reviewThreads(last: 100, after: $afterThread) { + nodes { + id + isResolved + isCollapsed + comments(first: 100, after: $afterComment) { + nodes { + id + body + path + line + startLine + originalLine + originalStartLine + pullRequestReview { + id + isMinimized + } + } + pageInfo { + endCursor + hasNextPage + } + } + } + pageInfo { + endCursor + hasNextPage + } + } + } + } +}""" + +RESOLVE_REVIEW_COMMENT = """mutation($id: ID!) { + resolveReviewThread(input: {threadId: $id, clientMutationId: "github-actions"}) { + thread { + id + } + } +}""" + +DELETE_REVIEW_COMMENT = """mutation($id: ID!) { + deletePullRequestReviewComment(input: {id: $id, clientMutationId: "github-actions"}) { + pullRequestReviewComment { + id + } + } +}""" + +HIDE_REVIEW_COMMENT = """mutation($subjectId: ID!) { + minimizeComment(input: {classifier:OUTDATED, subjectId: $subjectId, clientMutationId: "github-actions"}) { + minimizedComment { + isMinimized + } + } +}""" + class GithubApiClient(RestApiClient): """A class that describes the API used to interact with Github's REST API.""" @@ -279,6 +347,7 @@ def post_feedback( no_lgtm=args.no_lgtm, passive_reviews=args.passive_reviews, clang_versions=clang_versions, + delete_review_comments=args.delete_review_comments, ) def make_annotations( @@ -415,6 +484,7 @@ def post_review( no_lgtm: bool, passive_reviews: bool, clang_versions: ClangVersions, + delete_review_comments: bool = True, ): url = f"{self.api_url}/repos/{self.repo}/pulls/{self.pull_request}" response = self.api_request(url=url) @@ -425,10 +495,11 @@ def post_review( if "GITHUB_TOKEN" not in environ: logger.error("A GITHUB_TOKEN env var is required to post review comments") sys.exit(1) - self._dismiss_stale_reviews(url) if is_draft or not is_open: # is PR open and ready for review + self._dismiss_stale_reviews(url) return # don't post reviews - body = f"{COMMENT_MARKER}## Cpp-linter Review\n" + + body = f"{COMMENT_MARKER}## Cpp-Linter Review\n" payload_comments = [] summary_only = environ.get( "CPP_LINTER_PR_REVIEW_SUMMARY_ONLY", "false" @@ -446,6 +517,18 @@ def post_review( summary_only=summary_only, review_comments=review_comments, ) + + ignored_reviews = [] + if not summary_only: + ignored_reviews = self._check_reused_comments( + delete_review_comments=delete_review_comments, + review_comments=review_comments, + ) + self._hide_stale_reviews(url=url, ignored_reviews=ignored_reviews) + if len(review_comments.suggestions) == 0 and len(ignored_reviews) > 0: + logger.info("Using previous review as nothing new was found") + return + self._dismiss_stale_reviews(url, ignored_reviews=ignored_reviews) (summary, comments) = review_comments.serialize_to_github_payload( # avoid circular imports by passing primitive types tidy_version=clang_versions.tidy, @@ -472,6 +555,62 @@ def post_review( } self.api_request(url=url, data=json.dumps(payload), strict=False) + def _check_reused_comments( + self, + delete_review_comments: bool, + review_comments: ReviewComments, + ) -> List[str]: + """This will sort through the threads of PR reviews and return a list of + bot comments' IDs to be kept. + + This will also resolve (or delete if ``delete_review_comments`` is `True`) + any outdated unresolved comment.""" + ignored_reviews: List[str] = [] + found_threads = self._get_existing_review_comments( + no_dismissed=not delete_review_comments + ) + if not found_threads: + return ignored_reviews + + # Keep already posted comments if they match new ones + existing_review_comments = [] + for thread in found_threads: + for comment in thread.comments: + for suggestion in review_comments.suggestions: + if ( + suggestion.file_name == comment.file_name + and ( + suggestion.line_start in [-1, comment.line_end] + or suggestion.line_start == comment.line_start + ) + and suggestion.line_end == comment.line_end + and f"{COMMENT_MARKER}{suggestion.comment}" == comment.comment + and suggestion not in existing_review_comments + and not thread.is_resolved + and not thread.is_collapsed + and not comment.review_is_minimized + ): + logger.info( + "Using existing review comment: path='%s', line_start='%s', line_end='%s'", + comment.file_name, + comment.line_start, + comment.line_end, + ) + ignored_reviews.append(comment.review_id) + existing_review_comments.append(suggestion) + break + else: + self._close_review_comment( + node_id=comment.review_id + if delete_review_comments + else thread.id, + delete=delete_review_comments, + ) + review_comments.remove_reused_suggestions( + existing_review_comments=existing_review_comments + ) + return ignored_reviews + @staticmethod def create_review_comments( files: List[FileObj], @@ -502,8 +641,15 @@ def create_review_comments( file_obj, summary_only, review_comments ) - def _dismiss_stale_reviews(self, url: str): - """Dismiss all reviews that were previously created by cpp-linter""" + def _dismiss_stale_reviews( + self, url: str, ignored_reviews: Optional[List[str]] = None + ): + """Dismiss reviews that were previously created by cpp-linter. + + Use ``ignored_reviews`` to only dismiss the reviews not specified in + the given list. If ``ignored_reviews`` is `None`, then dismiss all + reviews. + """ next_page: Optional[str] = url + "?page=1&per_page=100" while next_page: response = self.api_request(url=next_page) @@ -516,13 +662,198 @@ def _dismiss_stale_reviews(self, url: str): and cast(str, review["body"]).startswith(COMMENT_MARKER) and "state" in review and review["state"] not in ["PENDING", "DISMISSED"] + and ( + ignored_reviews is None + or ( + "node_id" in review + and review["node_id"] not in ignored_reviews + ) + ) ): assert "id" in review self.api_request( url=f"{url}/{review['id']}/dismissals", method="PUT", data=json.dumps( - {"message": "outdated suggestion", "event": "DISMISS"} + {"message": "Outdated review", "event": "DISMISS"} ), strict=False, ) + + def _get_existing_review_comments(self, no_dismissed: bool = True): + """Creates the list existing review thread comments to close. + + :param no_dismissed: `True` to ignore any already dismissed comments. + """ + + class ThreadInfo(NamedTuple): + id: str + is_resolved: bool + is_collapsed: bool + + # aggregate threads into map of reviews' ID corresponding to + found_threads: Dict[ThreadInfo, List[ExistingSuggestion]] = {} + repo_owner, repo_name = self.repo.split("/") + after_thread: Optional[str] = None + after_comment: Optional[str] = None + has_next_pg = True + default_pg_info: GRAPHQL_PAGE_INFO = {"hasNextPage": False, "endCursor": ""} + while has_next_pg: + variables = { + "owner": repo_owner, + "name": repo_name, + "number": self.pull_request, + "afterThread": after_thread, + "afterComment": after_comment, + } + response = self.api_request( + url=f"{self.api_url}/graphql", + method="POST", + data=json.dumps( + {"query": QUERY_REVIEW_COMMENTS, "variables": variables} + ), + strict=False, + ) + if response.status_code != 200: + logger.error("Could not get existing review thread comments.") + break + data = response.json() + try: + threads = cast( + Dict[str, Any], + data["data"]["repository"]["pullRequest"]["reviewThreads"], + ) + except KeyError as exc: # pragma: no cover + logger.error( + "Malformed GraphQL response: Field %s not found", exc.args[0] + ) + break + thread_pg_info = cast( + GRAPHQL_PAGE_INFO, threads.pop("pageInfo", default_pg_info) + ) + for thread in cast(List[Dict[str, Any]], threads.get("nodes", [])): + comment_data = cast(Dict[str, Any], thread["comments"]) + comment_pg_info = cast( + GRAPHQL_PAGE_INFO, comment_data.pop("pageInfo", default_pg_info) + ) + thread_info = ThreadInfo( + id=thread["id"], + is_resolved=thread.get("isResolved", False), + is_collapsed=thread.get("isCollapsed", False), + ) + for comment in cast(List[Dict[str, Any]], thread.get("nodes", [])): + if ( + "id" in comment + and "path" in comment + and "originalLine" in comment + and "pullRequestReview" in comment + and "id" in comment["pullRequestReview"] + and ( + not no_dismissed + or ( + not thread.get("isResolved", False) + and not thread.get("isCollapsed", False) + ) + ) + and "body" in comment + and cast(str, comment["body"]).startswith(COMMENT_MARKER) + ): + suggestion = ExistingSuggestion(comment["path"]) + suggestion.line_end = ( + comment.get("line", None) or comment["originalLine"] + ) + suggestion.line_start = ( + comment.get("startLine", None) + or comment.get("originalStartLine", None) + or suggestion.line_end + ) + suggestion.comment = comment["body"] + review_info = cast( + Dict[str, Union[str, bool]], comment["pullRequestReview"] + ) + suggestion.review_id = cast(str, review_info["id"]) + suggestion.review_is_minimized = cast( + bool, review_info.get("isMinimized", False) + ) + if thread_info not in found_threads: + found_threads[thread_info] = [suggestion] + elif suggestion not in found_threads[thread_info]: + found_threads[thread_info].append(suggestion) + if comment_pg_info.get("hasNextPage", False) is True: + after_comment = cast(str, comment_pg_info.get("endCursor")) + else: + after_comment = None + if after_comment is None: + if thread_pg_info.get("hasNextPage", False) is False: + has_next_pg = False + else: + after_thread = cast(str, thread_pg_info.get("endCursor")) + # serialize threads into data structure for further processing + result: List[ExistingThread] = [] + for thread_info, comments in found_threads.items(): + review_thread = ExistingThread() + review_thread.id = thread_info.id + review_thread.is_resolved = thread_info.is_resolved + review_thread.is_collapsed = thread_info.is_collapsed + review_thread.comments = comments + result.append(review_thread) + return result + + def _close_review_comment(self, node_id: str, delete: bool): + """Resolve or Delete an existing review thread comment. + + :param node_id: This string shall be either + + - the Thread ID for the conversation to close + (only if ``delete`` is passed `False`). + - the comment ID of the comment within the requested thread to close + (only if ``delete`` is passed `True`). + :param delete: `True` to delete the review comment, `False` to set it as resolved. + """ + mutation = DELETE_REVIEW_COMMENT if delete else RESOLVE_REVIEW_COMMENT + variables = {"id": node_id} + response = self.api_request( + url=f"{self.api_url}/graphql", + method="POST", + data=json.dumps({"query": mutation, "variables": variables}), + strict=False, + ) + logger.debug( + "%s review comment %s (%s: %s)", + "Delete" if delete else "Resolve", + "failed" if response.status_code != 200 else "succeeded", + "comment_id" if delete else "thread_id", + node_id, + ) + + def _hide_stale_reviews(self, url: str, ignored_reviews: List[str]): + """Hide all review comments that were previously created by cpp-linter + + :param ignored_reviews: List of review comments to keep displayed. + """ + next_page: Optional[str] = url + "?page=1&per_page=100" + while next_page: + response = self.api_request(url=next_page) + next_page = self.has_more_pages(response) + reviews: List[Dict[str, Any]] = response.json() + for review in reviews: + if ( + "body" in review + and cast(str, review["body"]).startswith(COMMENT_MARKER) + and review["node_id"] not in ignored_reviews + ): + mutation = HIDE_REVIEW_COMMENT + variables = { + "subjectId": review["node_id"], + } + response = self.api_request( + url=f"{self.api_url}/graphql", + method="POST", + data=json.dumps({"query": mutation, "variables": variables}), + strict=False, + ) + logger.debug( + "Minimized review comment: %s (node_id: %s)", + repr(response.status_code == 200).lower(), + review["node_id"], + ) diff --git a/tests/reviews/pr_review_comments.json b/tests/reviews/pr_review_comments.json index 4ca723bc..647c5ccc 100644 --- a/tests/reviews/pr_review_comments.json +++ b/tests/reviews/pr_review_comments.json @@ -6,7 +6,7 @@ "node_id": "PRRC_kwDOFY2uzM5WD6gj", "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include \n \n-// using size_t from cstddef\n-size_t dummyFunc(size_t i) { return i; }\n \n-int main()\n-{\n- for (;;)\n- break;\n+\n+\n+int main(){\n+\n+ for (;;) break;\n+\n \n printf(\"Hello world!\\n\");", "path": "src/demo.cpp", - "commit_id": "a09a2032511f6a61f9216b24d2cd480c923d333f", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", "original_commit_id": "a09a2032511f6a61f9216b24d2cd480c923d333f", "user": { "login": "github-actions[bot]", @@ -26,6 +26,7 @@ "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", "type": "Bot", + "user_view_type": "public", "site_admin": false }, "body": "### clang-format suggestions\n\n```suggestion\n\r\nint main()\r\n{\r\n\r\n for (;;)\r\n break;\r\n\r\n```", @@ -74,7 +75,7 @@ "node_id": "PRRC_kwDOFY2uzM5WD6gk", "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include \n \n-// using size_t from cstddef\n-size_t dummyFunc(size_t i) { return i; }\n \n-int main()\n-{\n- for (;;)\n- break;\n+\n+\n+int main(){\n+\n+ for (;;) break;\n+\n \n printf(\"Hello world!\\n\");", "path": "src/demo.cpp", - "commit_id": "a09a2032511f6a61f9216b24d2cd480c923d333f", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", "original_commit_id": "a09a2032511f6a61f9216b24d2cd480c923d333f", "user": { "login": "github-actions[bot]", @@ -94,6 +95,7 @@ "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", "type": "Bot", + "user_view_type": "public", "site_admin": false }, "body": "### clang-tidy diagnostics\n- inclusion of deprecated C++ header 'stdio.h'; consider using 'cstdio' instead [[modernize-deprecated-headers](https://clang.llvm.org/extra/clang-tidy/checks/modernize/deprecated-headers.html)]\n- use a trailing return type for this function [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)]\n- statement should be inside braces [[readability-braces-around-statements](https://clang.llvm.org/extra/clang-tidy/checks/readability/braces-around-statements.html)]\n\n```suggestion\n#include \"demo.hpp\"\r\n#include \r\n\r\nauto main() -> int\r\n{\r\n\r\n for (;;) {\r\n break;\r\n }\r\n\r\n```", @@ -142,7 +144,7 @@ "node_id": "PRRC_kwDOFY2uzM5WD6gm", "diff_hunk": "@@ -5,12 +5,10 @@\n class Dummy {\n char* useless;\n int numb;\n+ Dummy() :numb(0), useless(\"\\0\"){}\n \n public:\n- void *not_usefull(char *str){\n- useless = str;\n- return 0;\n- }\n+ void *not_useful(char *str){useless = str;}\n };\n ", "path": "src/demo.hpp", - "commit_id": "a09a2032511f6a61f9216b24d2cd480c923d333f", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", "original_commit_id": "a09a2032511f6a61f9216b24d2cd480c923d333f", "user": { "login": "github-actions[bot]", @@ -162,6 +164,7 @@ "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", "type": "Bot", + "user_view_type": "public", "site_admin": false }, "body": "### clang-tidy diagnostics\n- use a trailing return type for this function [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)]\n\n```suggestion\n public:\r\n auto not_useful(char* str) -> void* { useless = str; }\r\n};\r\n```", @@ -202,5 +205,1874 @@ "original_position": 13, "position": 13, "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444063536", + "pull_request_review_id": 1807862968, + "id": 1444063536, + "node_id": "PRRC_kwDOFY2uzM5WEqkw", + "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include \n \n-// using size_t from cstddef\n-size_t dummyFunc(size_t i) { return i; }\n \n-int main()\n-{\n- for (;;)\n- break;\n+\n+\n+int main(){\n+\n+ for (;;) break;\n+\n \n printf(\"Hello world!\\n\");", + "path": "src/demo.cpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "a09a2032511f6a61f9216b24d2cd480c923d333f", + "user": { + "login": "2bndy5", + "id": 14963867, + "node_id": "MDQ6VXNlcjE0OTYzODY3", + "avatar_url": "https://avatars.githubusercontent.com/u/14963867?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/2bndy5", + "html_url": "https://github.com/2bndy5", + "followers_url": "https://api.github.com/users/2bndy5/followers", + "following_url": "https://api.github.com/users/2bndy5/following{/other_user}", + "gists_url": "https://api.github.com/users/2bndy5/gists{/gist_id}", + "starred_url": "https://api.github.com/users/2bndy5/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/2bndy5/subscriptions", + "organizations_url": "https://api.github.com/users/2bndy5/orgs", + "repos_url": "https://api.github.com/users/2bndy5/repos", + "events_url": "https://api.github.com/users/2bndy5/events{/privacy}", + "received_events_url": "https://api.github.com/users/2bndy5/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "body": "The `printf()`seems to be getting dropped in this suggestion.", + "created_at": "2024-01-07T19:58:56Z", + "updated_at": "2024-01-07T19:58:56Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444063536", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "MEMBER", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444063536" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444063536" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444063536/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": 4, + "original_start_line": 4, + "start_side": "RIGHT", + "line": 13, + "original_line": 13, + "side": "RIGHT", + "in_reply_to_id": 1443866659, + "original_position": 21, + "position": 21, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444063600", + "pull_request_review_id": 1807863072, + "id": 1444063600, + "node_id": "PRRC_kwDOFY2uzM5WEqlw", + "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include \n \n-// using size_t from cstddef\n-size_t dummyFunc(size_t i) { return i; }\n \n-int main()\n-{\n- for (;;)\n- break;\n+\n+\n+int main(){\n+\n+ for (;;) break;\n+\n \n printf(\"Hello world!\\n\");", + "path": "src/demo.cpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "a09a2032511f6a61f9216b24d2cd480c923d333f", + "user": { + "login": "2bndy5", + "id": 14963867, + "node_id": "MDQ6VXNlcjE0OTYzODY3", + "avatar_url": "https://avatars.githubusercontent.com/u/14963867?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/2bndy5", + "html_url": "https://github.com/2bndy5", + "followers_url": "https://api.github.com/users/2bndy5/followers", + "following_url": "https://api.github.com/users/2bndy5/following{/other_user}", + "gists_url": "https://api.github.com/users/2bndy5/gists{/gist_id}", + "starred_url": "https://api.github.com/users/2bndy5/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/2bndy5/subscriptions", + "organizations_url": "https://api.github.com/users/2bndy5/orgs", + "repos_url": "https://api.github.com/users/2bndy5/repos", + "events_url": "https://api.github.com/users/2bndy5/events{/privacy}", + "received_events_url": "https://api.github.com/users/2bndy5/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "body": "Again, the `printf()` call is getting dropped in this suggestion.", + "created_at": "2024-01-07T19:59:26Z", + "updated_at": "2024-01-07T19:59:26Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444063600", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "MEMBER", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444063600" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444063600" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444063600/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": 2, + "original_start_line": 2, + "start_side": "RIGHT", + "line": 13, + "original_line": 13, + "side": "RIGHT", + "in_reply_to_id": 1443866660, + "original_position": 21, + "position": 21, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103278", + "pull_request_review_id": 1807918342, + "id": 1444103278, + "node_id": "PRRC_kwDOFY2uzM5WE0Ru", + "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include \n \n-// using size_t from cstddef\n-size_t dummyFunc(size_t i) { return i; }\n ", + "path": "src/demo.cpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\nint main()\r\n{\r\n```", + "created_at": "2024-01-08T00:26:51Z", + "updated_at": "2024-12-11T16:02:11Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103278", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103278" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103278" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103278/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": null, + "original_start_line": null, + "start_side": null, + "line": 5, + "original_line": 5, + "side": "RIGHT", + "original_position": 9, + "position": 9, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103279", + "pull_request_review_id": 1807918342, + "id": 1444103279, + "node_id": "PRRC_kwDOFY2uzM5WE0Rv", + "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include \n \n-// using size_t from cstddef\n-size_t dummyFunc(size_t i) { return i; }\n \n-int main()\n-{\n- for (;;)\n- break;\n+\n+\n+int main(){\n+\n+ for (;;) break;\n+", + "path": "src/demo.cpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\n for (;;)\r\n break;\r\n```", + "created_at": "2024-01-08T00:26:51Z", + "updated_at": "2024-12-11T16:02:22Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103279", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103279" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103279" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103279/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": 6, + "original_start_line": 6, + "start_side": "RIGHT", + "line": 11, + "original_line": 11, + "side": "RIGHT", + "original_position": 19, + "position": 19, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103280", + "pull_request_review_id": 1807918342, + "id": 1444103280, + "node_id": "PRRC_kwDOFY2uzM5WE0Rw", + "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include \n \n-// using size_t from cstddef\n-size_t dummyFunc(size_t i) { return i; }\n \n-int main()\n-{\n- for (;;)\n- break;\n+\n+\n+int main(){\n+\n+ for (;;) break;\n+\n \n printf(\"Hello world!\\n\");\n \n- return 0;\n-}\n+\n+\n+\n+ return 0;}", + "path": "src/demo.cpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\n return 0;\r\n}\r\n```", + "created_at": "2024-01-08T00:26:51Z", + "updated_at": "2024-12-11T16:02:34Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103280", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103280" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103280" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103280/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": 15, + "original_start_line": 15, + "start_side": "RIGHT", + "line": 18, + "original_line": 18, + "side": "RIGHT", + "original_position": 28, + "position": 28, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103281", + "pull_request_review_id": 1807918342, + "id": 1444103281, + "node_id": "PRRC_kwDOFY2uzM5WE0Rx", + "diff_hunk": "@@ -5,12 +5,10 @@\n class Dummy {\n char* useless;\n int numb;\n+ Dummy() :numb(0), useless(\"\\0\"){}\n \n public:\n- void *not_usefull(char *str){\n- useless = str;\n- return 0;\n- }\n+ void *not_useful(char *str){useless = str;}", + "path": "src/demo.hpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\n Dummy()\r\n : numb(0)\r\n , useless(\"\\0\")\r\n {\r\n }\r\n\r\npublic:\r\n void* not_useful(char* str) { useless = str; }\r\n```", + "created_at": "2024-01-08T00:26:51Z", + "updated_at": "2024-12-11T16:02:57Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103281", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103281" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103281" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103281/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": 8, + "original_start_line": 8, + "start_side": "RIGHT", + "line": 11, + "original_line": 11, + "side": "RIGHT", + "original_position": 11, + "position": 11, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103282", + "pull_request_review_id": 1807918342, + "id": 1444103282, + "node_id": "PRRC_kwDOFY2uzM5WE0Ry", + "diff_hunk": "@@ -28,14 +26,11 @@ class Dummy {\n \n \n \n-\n-\n-\n-\n \n \n struct LongDiff\n {\n+\n long diff;\n ", + "path": "src/demo.hpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-format suggestions\r\n\r\nPlease remove this line(s).", + "created_at": "2024-01-08T00:26:51Z", + "updated_at": "2024-12-11T16:03:09Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103282", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103282" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103282" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103282/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": null, + "original_start_line": null, + "start_side": null, + "line": 35, + "original_line": 35, + "side": "RIGHT", + "original_position": 29, + "position": 29, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103283", + "pull_request_review_id": 1807918342, + "id": 1444103283, + "node_id": "PRRC_kwDOFY2uzM5WE0Rz", + "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include ", + "path": "src/demo.cpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-tidy diagnostics\r\n\r\n```suggestion\r\n#include \r\n```", + "created_at": "2024-01-08T00:26:52Z", + "updated_at": "2024-12-11T16:03:21Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103283", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103283" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103283" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103283/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": null, + "original_start_line": null, + "start_side": null, + "line": 3, + "original_line": 3, + "side": "RIGHT", + "original_position": 5, + "position": 5, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103284", + "pull_request_review_id": 1807918342, + "id": 1444103284, + "node_id": "PRRC_kwDOFY2uzM5WE0R0", + "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include \n \n-// using size_t from cstddef\n-size_t dummyFunc(size_t i) { return i; }\n ", + "path": "src/demo.cpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-tidy diagnostics\r\n\r\n```suggestion\r\nauto main() -> int\r\n{\r\n```", + "created_at": "2024-01-08T00:26:52Z", + "updated_at": "2024-12-11T16:03:31Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103284", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103284" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103284" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103284/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": null, + "original_start_line": null, + "start_side": null, + "line": 5, + "original_line": 5, + "side": "RIGHT", + "original_position": 9, + "position": 9, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103285", + "pull_request_review_id": 1807918342, + "id": 1444103285, + "node_id": "PRRC_kwDOFY2uzM5WE0R1", + "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include \n \n-// using size_t from cstddef\n-size_t dummyFunc(size_t i) { return i; }\n \n-int main()\n-{\n- for (;;)\n- break;\n+\n+\n+int main(){\n+\n+ for (;;) break;\n+", + "path": "src/demo.cpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-tidy diagnostics\r\n- use a trailing return type for this function [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)]\r\n- statement should be inside braces [[readability-braces-around-statements](https://clang.llvm.org/extra/clang-tidy/checks/readability/braces-around-statements.html)]\r\n\r\n```suggestion\r\n for (;;) {\r\n break;\r\n }\r\n```", + "created_at": "2024-01-08T00:26:52Z", + "updated_at": "2024-12-11T16:03:46Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103285", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103285" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103285" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103285/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": 6, + "original_start_line": 6, + "start_side": "RIGHT", + "line": 11, + "original_line": 11, + "side": "RIGHT", + "original_position": 19, + "position": 19, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103286", + "pull_request_review_id": 1807918342, + "id": 1444103286, + "node_id": "PRRC_kwDOFY2uzM5WE0R2", + "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include \n \n-// using size_t from cstddef\n-size_t dummyFunc(size_t i) { return i; }\n \n-int main()\n-{\n- for (;;)\n- break;\n+\n+\n+int main(){\n+\n+ for (;;) break;\n+\n \n printf(\"Hello world!\\n\");\n \n- return 0;\n-}\n+\n+\n+\n+ return 0;}", + "path": "src/demo.cpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-tidy diagnostics\r\n\r\n```suggestion\r\n return 0;\r\n}\r\n```", + "created_at": "2024-01-08T00:26:52Z", + "updated_at": "2024-12-11T16:04:03Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103286", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103286" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103286" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103286/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": null, + "original_start_line": null, + "start_side": null, + "line": 18, + "original_line": 18, + "side": "RIGHT", + "original_position": 28, + "position": 28, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103288", + "pull_request_review_id": 1807918342, + "id": 1444103288, + "node_id": "PRRC_kwDOFY2uzM5WE0R4", + "diff_hunk": "@@ -5,12 +5,10 @@\n class Dummy {\n char* useless;\n int numb;\n+ Dummy() :numb(0), useless(\"\\0\"){}", + "path": "src/demo.hpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-tidy diagnostics\r\n- use default member initializer for 'useless' [[modernize-use-default-member-init](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html)]\r\n- use default member initializer for 'numb' [[modernize-use-default-member-init](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html)]\r\n\r\n```suggestion\r\n char* useless { \"\\0\" };\r\n int numb { 0 };\r\n Dummy() { }\r\n```", + "created_at": "2024-01-08T00:26:52Z", + "updated_at": "2024-12-11T16:04:13Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103288", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103288" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103288" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103288/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": 6, + "original_start_line": 6, + "start_side": "RIGHT", + "line": 8, + "original_line": 8, + "side": "RIGHT", + "original_position": 4, + "position": 4, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103289", + "pull_request_review_id": 1807918342, + "id": 1444103289, + "node_id": "PRRC_kwDOFY2uzM5WE0R5", + "diff_hunk": "@@ -5,12 +5,10 @@\n class Dummy {\n char* useless;\n int numb;\n+ Dummy() :numb(0), useless(\"\\0\"){}\n \n public:\n- void *not_usefull(char *str){\n- useless = str;\n- return 0;\n- }\n+ void *not_useful(char *str){useless = str;}", + "path": "src/demo.hpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-tidy diagnostics\r\n\r\n```suggestion\r\npublic:\r\n auto not_useful(char* str) -> void* { useless = str; }\r\n```", + "created_at": "2024-01-08T00:26:52Z", + "updated_at": "2024-12-11T16:04:22Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103289", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103289" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444103289" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444103289/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": 10, + "original_start_line": 10, + "start_side": "RIGHT", + "line": 11, + "original_line": 11, + "side": "RIGHT", + "original_position": 11, + "position": 11, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444106069", + "pull_request_review_id": 1807922252, + "id": 1444106069, + "node_id": "PRRC_kwDOFY2uzM5WE09V", + "diff_hunk": "@@ -28,14 +26,11 @@ class Dummy {\n \n \n \n-\n-\n-\n-\n \n \n struct LongDiff\n {\n+\n long diff;\n ", + "path": "src/demo.hpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "2bndy5", + "id": 14963867, + "node_id": "MDQ6VXNlcjE0OTYzODY3", + "avatar_url": "https://avatars.githubusercontent.com/u/14963867?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/2bndy5", + "html_url": "https://github.com/2bndy5", + "followers_url": "https://api.github.com/users/2bndy5/followers", + "following_url": "https://api.github.com/users/2bndy5/following{/other_user}", + "gists_url": "https://api.github.com/users/2bndy5/gists{/gist_id}", + "starred_url": "https://api.github.com/users/2bndy5/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/2bndy5/subscriptions", + "organizations_url": "https://api.github.com/users/2bndy5/orgs", + "repos_url": "https://api.github.com/users/2bndy5/repos", + "events_url": "https://api.github.com/users/2bndy5/events{/privacy}", + "received_events_url": "https://api.github.com/users/2bndy5/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "body": "More detail please! Which line(s)?", + "created_at": "2024-01-08T00:44:25Z", + "updated_at": "2024-01-08T00:44:25Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444106069", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "MEMBER", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444106069" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444106069" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444106069/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": null, + "original_start_line": null, + "start_side": null, + "line": 35, + "original_line": 35, + "side": "RIGHT", + "in_reply_to_id": 1444103282, + "original_position": 29, + "position": 29, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444108009", + "pull_request_review_id": 1807924854, + "id": 1444108009, + "node_id": "PRRC_kwDOFY2uzM5WE1bp", + "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include ", + "path": "src/demo.cpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "2bndy5", + "id": 14963867, + "node_id": "MDQ6VXNlcjE0OTYzODY3", + "avatar_url": "https://avatars.githubusercontent.com/u/14963867?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/2bndy5", + "html_url": "https://github.com/2bndy5", + "followers_url": "https://api.github.com/users/2bndy5/followers", + "following_url": "https://api.github.com/users/2bndy5/following{/other_user}", + "gists_url": "https://api.github.com/users/2bndy5/gists{/gist_id}", + "starred_url": "https://api.github.com/users/2bndy5/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/2bndy5/subscriptions", + "organizations_url": "https://api.github.com/users/2bndy5/orgs", + "repos_url": "https://api.github.com/users/2bndy5/repos", + "events_url": "https://api.github.com/users/2bndy5/events{/privacy}", + "received_events_url": "https://api.github.com/users/2bndy5/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "body": "clang-tidy diagnostic isn't named here\r\n> src/demo.cpp:3:10: warning: [[modernize-deprecated-headers](https://clang.llvm.org/extra/clang-tidy/checks/modernize/deprecated-headers.html)]\r\n\r\nTry to find out why and fix it.", + "created_at": "2024-01-08T00:55:39Z", + "updated_at": "2024-01-08T00:55:39Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444108009", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "MEMBER", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444108009" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444108009" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444108009/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": null, + "original_start_line": null, + "start_side": null, + "line": 3, + "original_line": 3, + "side": "RIGHT", + "in_reply_to_id": 1444103283, + "original_position": 5, + "position": 5, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444109522", + "pull_request_review_id": 1807926853, + "id": 1444109522, + "node_id": "PRRC_kwDOFY2uzM5WE1zS", + "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include \n \n-// using size_t from cstddef\n-size_t dummyFunc(size_t i) { return i; }\n \n-int main()\n-{\n- for (;;)\n- break;\n+\n+\n+int main(){\n+\n+ for (;;) break;\n+\n \n printf(\"Hello world!\\n\");\n \n- return 0;\n-}\n+\n+\n+\n+ return 0;}", + "path": "src/demo.cpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "2bndy5", + "id": 14963867, + "node_id": "MDQ6VXNlcjE0OTYzODY3", + "avatar_url": "https://avatars.githubusercontent.com/u/14963867?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/2bndy5", + "html_url": "https://github.com/2bndy5", + "followers_url": "https://api.github.com/users/2bndy5/followers", + "following_url": "https://api.github.com/users/2bndy5/following{/other_user}", + "gists_url": "https://api.github.com/users/2bndy5/gists{/gist_id}", + "starred_url": "https://api.github.com/users/2bndy5/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/2bndy5/subscriptions", + "organizations_url": "https://api.github.com/users/2bndy5/orgs", + "repos_url": "https://api.github.com/users/2bndy5/repos", + "events_url": "https://api.github.com/users/2bndy5/events{/privacy}", + "received_events_url": "https://api.github.com/users/2bndy5/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "body": "This change is from code style guidelines (a clang-format thing), thus no clang-tidy diagnostic to name as the cause for the change.\r\n\r\nWe should probably change the wording in this situation:\r\n```diff\r\n-clang-tidy diagnostics\r\n+clang-tidy suggestions\r\n```", + "created_at": "2024-01-08T01:03:46Z", + "updated_at": "2024-01-08T01:03:46Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444109522", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "MEMBER", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444109522" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444109522" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444109522/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": null, + "original_start_line": null, + "start_side": null, + "line": 18, + "original_line": 18, + "side": "RIGHT", + "in_reply_to_id": 1444103286, + "original_position": 28, + "position": 28, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444109977", + "pull_request_review_id": 1807927611, + "id": 1444109977, + "node_id": "PRRC_kwDOFY2uzM5WE16Z", + "diff_hunk": "@@ -5,12 +5,10 @@\n class Dummy {\n char* useless;\n int numb;\n+ Dummy() :numb(0), useless(\"\\0\"){}\n \n public:\n- void *not_usefull(char *str){\n- useless = str;\n- return 0;\n- }\n+ void *not_useful(char *str){useless = str;}", + "path": "src/demo.hpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "2bndy5", + "id": 14963867, + "node_id": "MDQ6VXNlcjE0OTYzODY3", + "avatar_url": "https://avatars.githubusercontent.com/u/14963867?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/2bndy5", + "html_url": "https://github.com/2bndy5", + "followers_url": "https://api.github.com/users/2bndy5/followers", + "following_url": "https://api.github.com/users/2bndy5/following{/other_user}", + "gists_url": "https://api.github.com/users/2bndy5/gists{/gist_id}", + "starred_url": "https://api.github.com/users/2bndy5/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/2bndy5/subscriptions", + "organizations_url": "https://api.github.com/users/2bndy5/orgs", + "repos_url": "https://api.github.com/users/2bndy5/repos", + "events_url": "https://api.github.com/users/2bndy5/events{/privacy}", + "received_events_url": "https://api.github.com/users/2bndy5/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "body": "Again wording seems inadequate here because no clang-tidy diagnostics are named for code style guidelines.", + "created_at": "2024-01-08T01:06:32Z", + "updated_at": "2024-01-08T01:06:32Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444109977", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "MEMBER", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444109977" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444109977" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444109977/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": 10, + "original_start_line": 10, + "start_side": "RIGHT", + "line": 11, + "original_line": 11, + "side": "RIGHT", + "in_reply_to_id": 1444103289, + "original_position": 11, + "position": 11, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111613", + "pull_request_review_id": 1807930152, + "id": 1444111613, + "node_id": "PRRC_kwDOFY2uzM5WE2T9", + "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include \n \n-// using size_t from cstddef\n-size_t dummyFunc(size_t i) { return i; }\n ", + "path": "src/demo.cpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\nint main()\r\n{\r\n```", + "created_at": "2024-01-08T01:15:53Z", + "updated_at": "2024-12-11T16:04:43Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111613", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111613" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111613" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111613/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": null, + "original_start_line": null, + "start_side": null, + "line": 5, + "original_line": 5, + "side": "RIGHT", + "original_position": 9, + "position": 9, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111614", + "pull_request_review_id": 1807930152, + "id": 1444111614, + "node_id": "PRRC_kwDOFY2uzM5WE2T-", + "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include \n \n-// using size_t from cstddef\n-size_t dummyFunc(size_t i) { return i; }\n \n-int main()\n-{\n- for (;;)\n- break;\n+\n+\n+int main(){\n+\n+ for (;;) break;\n+", + "path": "src/demo.cpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\n for (;;)\r\n break;\r\n```", + "created_at": "2024-01-08T01:15:53Z", + "updated_at": "2024-12-11T16:04:52Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111614", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111614" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111614" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111614/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": 6, + "original_start_line": 6, + "start_side": "RIGHT", + "line": 11, + "original_line": 11, + "side": "RIGHT", + "original_position": 19, + "position": 19, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111615", + "pull_request_review_id": 1807930152, + "id": 1444111615, + "node_id": "PRRC_kwDOFY2uzM5WE2T_", + "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include \n \n-// using size_t from cstddef\n-size_t dummyFunc(size_t i) { return i; }\n \n-int main()\n-{\n- for (;;)\n- break;\n+\n+\n+int main(){\n+\n+ for (;;) break;\n+\n \n printf(\"Hello world!\\n\");\n \n- return 0;\n-}\n+\n+\n+\n+ return 0;}", + "path": "src/demo.cpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\n return 0;\r\n}\r\n```", + "created_at": "2024-01-08T01:15:53Z", + "updated_at": "2024-12-11T16:05:03Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111615", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111615" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111615" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111615/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": 15, + "original_start_line": 15, + "start_side": "RIGHT", + "line": 18, + "original_line": 18, + "side": "RIGHT", + "original_position": 28, + "position": 28, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111617", + "pull_request_review_id": 1807930152, + "id": 1444111617, + "node_id": "PRRC_kwDOFY2uzM5WE2UB", + "diff_hunk": "@@ -5,12 +5,10 @@\n class Dummy {\n char* useless;\n int numb;\n+ Dummy() :numb(0), useless(\"\\0\"){}\n \n public:\n- void *not_usefull(char *str){\n- useless = str;\n- return 0;\n- }\n+ void *not_useful(char *str){useless = str;}", + "path": "src/demo.hpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\n Dummy()\r\n : numb(0)\r\n , useless(\"\\0\")\r\n {\r\n }\r\n\r\npublic:\r\n void* not_useful(char* str) { useless = str; }\r\n```", + "created_at": "2024-01-08T01:15:53Z", + "updated_at": "2024-12-11T16:05:12Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111617", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111617" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111617" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111617/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": 8, + "original_start_line": 8, + "start_side": "RIGHT", + "line": 11, + "original_line": 11, + "side": "RIGHT", + "original_position": 11, + "position": 11, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111618", + "pull_request_review_id": 1807930152, + "id": 1444111618, + "node_id": "PRRC_kwDOFY2uzM5WE2UC", + "diff_hunk": "@@ -28,14 +26,11 @@ class Dummy {\n \n \n \n-\n-\n-\n-\n \n \n struct LongDiff\n {\n+\n long diff;\n ", + "path": "src/demo.hpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-format suggestions\r\n\r\nPlease remove the line(s)\r\n- 35", + "created_at": "2024-01-08T01:15:54Z", + "updated_at": "2024-12-11T16:05:22Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111618", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111618" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111618" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111618/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": null, + "original_start_line": null, + "start_side": null, + "line": 35, + "original_line": 35, + "side": "RIGHT", + "original_position": 29, + "position": 29, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111619", + "pull_request_review_id": 1807930152, + "id": 1444111619, + "node_id": "PRRC_kwDOFY2uzM5WE2UD", + "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include ", + "path": "src/demo.cpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-tidy diagnostics\r\n- inclusion of deprecated C++ header 'stdio.h'; consider using 'cstdio' instead [[modernize-deprecated-headers](https://clang.llvm.org/extra/clang-tidy/checks/modernize/deprecated-headers.html)]\r\n\r\n```suggestion\r\n#include \r\n```", + "created_at": "2024-01-08T01:15:54Z", + "updated_at": "2024-12-11T16:05:33Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111619", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111619" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111619" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111619/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": null, + "original_start_line": null, + "start_side": null, + "line": 3, + "original_line": 3, + "side": "RIGHT", + "original_position": 5, + "position": 5, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111620", + "pull_request_review_id": 1807930152, + "id": 1444111620, + "node_id": "PRRC_kwDOFY2uzM5WE2UE", + "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include \n \n-// using size_t from cstddef\n-size_t dummyFunc(size_t i) { return i; }\n ", + "path": "src/demo.cpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-tidy suggestions\r\n\r\n```suggestion\r\nauto main() -> int\r\n{\r\n```", + "created_at": "2024-01-08T01:15:54Z", + "updated_at": "2024-12-11T16:05:58Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111620", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111620" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111620" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111620/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": null, + "original_start_line": null, + "start_side": null, + "line": 5, + "original_line": 5, + "side": "RIGHT", + "original_position": 9, + "position": 9, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111621", + "pull_request_review_id": 1807930152, + "id": 1444111621, + "node_id": "PRRC_kwDOFY2uzM5WE2UF", + "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include \n \n-// using size_t from cstddef\n-size_t dummyFunc(size_t i) { return i; }\n \n-int main()\n-{\n- for (;;)\n- break;\n+\n+\n+int main(){\n+\n+ for (;;) break;\n+", + "path": "src/demo.cpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-tidy diagnostics\r\n- use a trailing return type for this function [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)]\r\n- statement should be inside braces [[readability-braces-around-statements](https://clang.llvm.org/extra/clang-tidy/checks/readability/braces-around-statements.html)]\r\n\r\n```suggestion\r\n for (;;) {\r\n break;\r\n }\r\n```", + "created_at": "2024-01-08T01:15:54Z", + "updated_at": "2024-12-11T16:06:11Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111621", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111621" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111621" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111621/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": 6, + "original_start_line": 6, + "start_side": "RIGHT", + "line": 11, + "original_line": 11, + "side": "RIGHT", + "original_position": 19, + "position": 19, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111622", + "pull_request_review_id": 1807930152, + "id": 1444111622, + "node_id": "PRRC_kwDOFY2uzM5WE2UG", + "diff_hunk": "@@ -1,17 +1,18 @@\n /** This is a very ugly test code (doomed to fail linting) */\n #include \"demo.hpp\"\n-#include \n-#include \n+#include \n \n-// using size_t from cstddef\n-size_t dummyFunc(size_t i) { return i; }\n \n-int main()\n-{\n- for (;;)\n- break;\n+\n+\n+int main(){\n+\n+ for (;;) break;\n+\n \n printf(\"Hello world!\\n\");\n \n- return 0;\n-}\n+\n+\n+\n+ return 0;}", + "path": "src/demo.cpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-tidy suggestions\r\n\r\n```suggestion\r\n return 0;\r\n}\r\n```", + "created_at": "2024-01-08T01:15:54Z", + "updated_at": "2024-12-11T16:06:22Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111622", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111622" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111622" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111622/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": null, + "original_start_line": null, + "start_side": null, + "line": 18, + "original_line": 18, + "side": "RIGHT", + "original_position": 28, + "position": 28, + "subject_type": "line" + }, + { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111623", + "pull_request_review_id": 1807930152, + "id": 1444111623, + "node_id": "PRRC_kwDOFY2uzM5WE2UH", + "diff_hunk": "@@ -5,12 +5,10 @@\n class Dummy {\n char* useless;\n int numb;\n+ Dummy() :numb(0), useless(\"\\0\"){}", + "path": "src/demo.hpp", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1", + "original_commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n### clang-tidy diagnostics\r\n- use default member initializer for 'useless' [[modernize-use-default-member-init](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html)]\r\n- use default member initializer for 'numb' [[modernize-use-default-member-init](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html)]\r\n\r\n```suggestion\r\n char* useless { \"\\0\" };\r\n int numb { 0 };\r\n Dummy() { }\r\n```", + "created_at": "2024-01-08T01:15:54Z", + "updated_at": "2024-12-11T16:06:34Z", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111623", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "self": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111623" + }, + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#discussion_r1444111623" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "reactions": { + "url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/comments/1444111623/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "start_line": 6, + "original_start_line": 6, + "start_side": "RIGHT", + "line": 8, + "original_line": 8, + "side": "RIGHT", + "original_position": 4, + "position": 4, + "subject_type": "line" } ] diff --git a/tests/reviews/pr_reviews.json b/tests/reviews/pr_reviews.json index 6e6210fa..ebc50a82 100644 --- a/tests/reviews/pr_reviews.json +++ b/tests/reviews/pr_reviews.json @@ -20,10 +20,11 @@ "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", "type": "Bot", + "user_view_type": "public", "site_admin": false }, - "body": "\n## Cpp-linter Review\nOnly 1 out of 4 clang-format suggestions fit within this pull request's diff.\n\n
Click here for the full clang-format patch\n\n\n```diff\ndiff --git a/src/demo.cpp b/src/demo.cpp\nindex fc295c3..c522998 100644\n--- a/src/demo.cpp\n+++ b/src/demo.cpp\n@@ -4,9 +4,7 @@\n \r\n+int main()\r\n+{\r\n \r\n-\r\n-\r\n-int main(){\r\n-\r\n- for (;;) break;\r\n-\r\n+ for (;;)\r\n+ break;\r\n \r\n@@ -14,5 +12,3 @@ int main(){\n \r\n-\r\n-\r\n-\r\n- return 0;}\r\n+ return 0;\r\n+}\r\ndiff --git a/src/demo.hpp b/src/demo.hpp\nindex a429f5c..8f92cac 100644\n--- a/src/demo.hpp\n+++ b/src/demo.hpp\n@@ -7,25 +7,12 @@ class Dummy {\n int numb;\r\n- Dummy() :numb(0), useless(\"\\0\"){}\r\n+ Dummy()\r\n+ : numb(0)\r\n+ , useless(\"\\0\")\r\n+ {\r\n+ }\r\n \r\n public:\r\n- void *not_useful(char *str){useless = str;}\r\n+ void* not_useful(char* str) { useless = str; }\r\n };\r\n \r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n struct LongDiff\r\n@@ -33,4 +20,3 @@ struct LongDiff\n \r\n- long diff;\r\n-\r\n+ long diff;\r\n };\r\n\n```\n\n\n
\n\nOnly 2 out of 3 clang-tidy suggestions fit within this pull request's diff.\n\n
Click here for the full clang-tidy patch\n\n\n```diff\ndiff --git a/src/demo.cpp b/src/demo.cpp\nindex fc295c3..b160609 100644\n--- a/src/demo.cpp\n+++ b/src/demo.cpp\n@@ -2,11 +2,10 @@\n #include \"demo.hpp\"\r\n-#include \r\n+#include \r\n \r\n+auto main() -> int\r\n+{\r\n \r\n-\r\n-\r\n-int main(){\r\n-\r\n- for (;;) break;\r\n-\r\n+ for (;;) {\r\n+ break;\r\n+ }\r\n \r\n@@ -17,2 +16,3 @@ int main(){\n \r\n- return 0;}\r\n+ return 0;\r\n+}\r\ndiff --git a/src/demo.hpp b/src/demo.hpp\nindex a429f5c..2591c48 100644\n--- a/src/demo.hpp\n+++ b/src/demo.hpp\n@@ -10,3 +10,3 @@ class Dummy {\n public:\r\n- void *not_useful(char *str){useless = str;}\r\n+ auto not_useful(char* str) -> void* { useless = str; }\r\n };\r\n\n```\n\n\n
\n\n", - "state": "CHANGES_REQUESTED", + "body": "\n## Cpp-linter Review\nOnly 1 out of 4 clang-format suggestions fit within this pull request's diff.\n\n
Click here for the full clang-format patch\n\n\n```diff\ndiff --git a/src/demo.cpp b/src/demo.cpp\nindex fc295c3..c522998 100644\n--- a/src/demo.cpp\n+++ b/src/demo.cpp\n@@ -4,9 +4,7 @@\n \r\n+int main()\r\n+{\r\n \r\n-\r\n-\r\n-int main(){\r\n-\r\n- for (;;) break;\r\n-\r\n+ for (;;)\r\n+ break;\r\n \r\n@@ -14,5 +12,3 @@ int main(){\n \r\n-\r\n-\r\n-\r\n- return 0;}\r\n+ return 0;\r\n+}\r\ndiff --git a/src/demo.hpp b/src/demo.hpp\nindex a429f5c..8f92cac 100644\n--- a/src/demo.hpp\n+++ b/src/demo.hpp\n@@ -7,25 +7,12 @@ class Dummy {\n int numb;\r\n- Dummy() :numb(0), useless(\"\\0\"){}\r\n+ Dummy()\r\n+ : numb(0)\r\n+ , useless(\"\\0\")\r\n+ {\r\n+ }\r\n \r\n public:\r\n- void *not_useful(char *str){useless = str;}\r\n+ void* not_useful(char* str) { useless = str; }\r\n };\r\n \r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n struct LongDiff\r\n@@ -33,4 +20,3 @@ struct LongDiff\n \r\n- long diff;\r\n-\r\n+ long diff;\r\n };\r\n\n```\n\n\n
\n\nOnly 2 out of 3 clang-tidy suggestions fit within this pull request's diff.\n\n
Click here for the full clang-tidy patch\n\n\n```diff\ndiff --git a/src/demo.cpp b/src/demo.cpp\nindex fc295c3..b160609 100644\n--- a/src/demo.cpp\n+++ b/src/demo.cpp\n@@ -2,11 +2,10 @@\n #include \"demo.hpp\"\r\n-#include \r\n+#include \r\n \r\n+auto main() -> int\r\n+{\r\n \r\n-\r\n-\r\n-int main(){\r\n-\r\n- for (;;) break;\r\n-\r\n+ for (;;) {\r\n+ break;\r\n+ }\r\n \r\n@@ -17,2 +16,3 @@ int main(){\n \r\n- return 0;}\r\n+ return 0;\r\n+}\r\ndiff --git a/src/demo.hpp b/src/demo.hpp\nindex a429f5c..2591c48 100644\n--- a/src/demo.hpp\n+++ b/src/demo.hpp\n@@ -10,3 +10,3 @@ class Dummy {\n public:\r\n- void *not_useful(char *str){useless = str;}\r\n+ auto not_useful(char* str) -> void* { useless = str; }\r\n };\r\n\n```\n\n\n
\n\n", + "state": "DISMISSED", "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1807607546", "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", "author_association": "NONE", @@ -37,5 +38,445 @@ }, "submitted_at": "2024-01-06T22:22:32Z", "commit_id": "a09a2032511f6a61f9216b24d2cd480c923d333f" + }, + { + "id": 1807862968, + "node_id": "PRR_kwDOFY2uzM5rwcy4", + "user": { + "login": "2bndy5", + "id": 14963867, + "node_id": "MDQ6VXNlcjE0OTYzODY3", + "avatar_url": "https://avatars.githubusercontent.com/u/14963867?u=a73fe81ae765fbd53ec950e5b4cde1ab780dfb9f&v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/2bndy5", + "html_url": "https://github.com/2bndy5", + "followers_url": "https://api.github.com/users/2bndy5/followers", + "following_url": "https://api.github.com/users/2bndy5/following{/other_user}", + "gists_url": "https://api.github.com/users/2bndy5/gists{/gist_id}", + "starred_url": "https://api.github.com/users/2bndy5/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/2bndy5/subscriptions", + "organizations_url": "https://api.github.com/users/2bndy5/orgs", + "repos_url": "https://api.github.com/users/2bndy5/repos", + "events_url": "https://api.github.com/users/2bndy5/events{/privacy}", + "received_events_url": "https://api.github.com/users/2bndy5/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "body": "", + "state": "COMMENTED", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1807862968", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "MEMBER", + "_links": { + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1807862968" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "submitted_at": "2024-01-07T19:58:56Z", + "commit_id": "a09a2032511f6a61f9216b24d2cd480c923d333f" + }, + { + "id": 1807863072, + "node_id": "PRR_kwDOFY2uzM5rwc0g", + "user": { + "login": "2bndy5", + "id": 14963867, + "node_id": "MDQ6VXNlcjE0OTYzODY3", + "avatar_url": "https://avatars.githubusercontent.com/u/14963867?u=a73fe81ae765fbd53ec950e5b4cde1ab780dfb9f&v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/2bndy5", + "html_url": "https://github.com/2bndy5", + "followers_url": "https://api.github.com/users/2bndy5/followers", + "following_url": "https://api.github.com/users/2bndy5/following{/other_user}", + "gists_url": "https://api.github.com/users/2bndy5/gists{/gist_id}", + "starred_url": "https://api.github.com/users/2bndy5/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/2bndy5/subscriptions", + "organizations_url": "https://api.github.com/users/2bndy5/orgs", + "repos_url": "https://api.github.com/users/2bndy5/repos", + "events_url": "https://api.github.com/users/2bndy5/events{/privacy}", + "received_events_url": "https://api.github.com/users/2bndy5/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "body": "", + "state": "COMMENTED", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1807863072", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "MEMBER", + "_links": { + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1807863072" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "submitted_at": "2024-01-07T19:59:26Z", + "commit_id": "a09a2032511f6a61f9216b24d2cd480c923d333f" + }, + { + "id": 1807902857, + "node_id": "PRR_kwDOFY2uzM5rwmiJ", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n## Cpp-linter Review\nOnly 0 out of 7 clang-format suggestions fit within this pull request's diff.\n\n
Click here for the full clang-format patch\n\n\n```diff\ndiff --git a/src/demo.cpp b/src/demo.cpp\nindex fc295c3..c522998 100644\n--- a/src/demo.cpp\n+++ b/src/demo.cpp\n@@ -4,0 +5,2 @@\n+int main()\r\n+{\r\n@@ -6,6 +8,2 @@\n-\r\n-\r\n-int main(){\r\n-\r\n- for (;;) break;\r\n-\r\n+ for (;;)\r\n+ break;\r\n@@ -15,4 +13,2 @@ int main(){\n-\r\n-\r\n-\r\n- return 0;}\r\n+ return 0;\r\n+}\r\ndiff --git a/src/demo.hpp b/src/demo.hpp\nindex a429f5c..31566a5 100644\n--- a/src/demo.hpp\n+++ b/src/demo.hpp\n@@ -3,2 +2,0 @@\n-\r\n-\r\n@@ -8,4 +6,8 @@ class Dummy {\n- Dummy() :numb(0), useless(\"\\0\"){}\r\n-\r\n- public:\r\n- void *not_useful(char *str){useless = str;}\r\n+ Dummy()\r\n+ : numb(0)\r\n+ , useless(\"\\0\")\r\n+ {\r\n+ }\r\n+\r\n+public:\r\n+ void* not_useful(char* str) { useless = str; }\r\n@@ -14,19 +16 @@ class Dummy {\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-struct LongDiff\r\n-{\r\n+struct LongDiff {\r\n@@ -35 +18,0 @@ struct LongDiff\n-\r\n\n```\n\n\n
\n\nOnly 0 out of 6 clang-tidy suggestions fit within this pull request's diff.\n\n
Click here for the full clang-tidy patch\n\n\n```diff\ndiff --git a/src/demo.cpp b/src/demo.cpp\nindex fc295c3..b160609 100644\n--- a/src/demo.cpp\n+++ b/src/demo.cpp\n@@ -3 +3 @@\n-#include \r\n+#include \r\n@@ -4,0 +5,2 @@\n+auto main() -> int\r\n+{\r\n@@ -6,6 +8,3 @@\n-\r\n-\r\n-int main(){\r\n-\r\n- for (;;) break;\r\n-\r\n+ for (;;) {\r\n+ break;\r\n+ }\r\n@@ -18 +17,2 @@ int main(){\n- return 0;}\r\n+ return 0;\r\n+}\r\ndiff --git a/src/demo.hpp b/src/demo.hpp\nindex a429f5c..115b0de 100644\n--- a/src/demo.hpp\n+++ b/src/demo.hpp\n@@ -6,3 +6,3 @@ class Dummy {\n- char* useless;\r\n- int numb;\r\n- Dummy() :numb(0), useless(\"\\0\"){}\r\n+ char* useless { \"\\0\" };\r\n+ int numb { 0 };\r\n+ Dummy() { }\r\n@@ -10,2 +10,2 @@ class Dummy {\n- public:\r\n- void *not_useful(char *str){useless = str;}\r\n+public:\r\n+ auto not_useful(char* str) -> void* { useless = str; }\r\n\n```\n\n\n
\n\n", + "state": "DISMISSED", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1807902857", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1807902857" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "submitted_at": "2024-01-07T23:32:04Z", + "commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d" + }, + { + "id": 1807918342, + "node_id": "PRR_kwDOFY2uzM5rwqUG", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n## Cpp-linter Review\nOnly 5 out of 7 clang-format suggestions fit within this pull request's diff.\n\n
Click here for the full clang-format patch\n\n\n```diff\ndiff --git a/src/demo.cpp b/src/demo.cpp\nindex fc295c3..c522998 100644\n--- a/src/demo.cpp\n+++ b/src/demo.cpp\n@@ -4,0 +5,2 @@\n+int main()\r\n+{\r\n@@ -6,6 +8,2 @@\n-\r\n-\r\n-int main(){\r\n-\r\n- for (;;) break;\r\n-\r\n+ for (;;)\r\n+ break;\r\n@@ -15,4 +13,2 @@ int main(){\n-\r\n-\r\n-\r\n- return 0;}\r\n+ return 0;\r\n+}\r\ndiff --git a/src/demo.hpp b/src/demo.hpp\nindex a429f5c..31566a5 100644\n--- a/src/demo.hpp\n+++ b/src/demo.hpp\n@@ -3,2 +2,0 @@\n-\r\n-\r\n@@ -8,4 +6,8 @@ class Dummy {\n- Dummy() :numb(0), useless(\"\\0\"){}\r\n-\r\n- public:\r\n- void *not_useful(char *str){useless = str;}\r\n+ Dummy()\r\n+ : numb(0)\r\n+ , useless(\"\\0\")\r\n+ {\r\n+ }\r\n+\r\n+public:\r\n+ void* not_useful(char* str) { useless = str; }\r\n@@ -14,19 +16 @@ class Dummy {\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-struct LongDiff\r\n-{\r\n+struct LongDiff {\r\n@@ -35 +18,0 @@ struct LongDiff\n-\r\n\n```\n\n\n
\n\n\n
Click here for the full clang-tidy patch\n\n\n```diff\ndiff --git a/src/demo.cpp b/src/demo.cpp\nindex fc295c3..b160609 100644\n--- a/src/demo.cpp\n+++ b/src/demo.cpp\n@@ -3 +3 @@\n-#include \r\n+#include \r\n@@ -4,0 +5,2 @@\n+auto main() -> int\r\n+{\r\n@@ -6,6 +8,3 @@\n-\r\n-\r\n-int main(){\r\n-\r\n- for (;;) break;\r\n-\r\n+ for (;;) {\r\n+ break;\r\n+ }\r\n@@ -18 +17,2 @@ int main(){\n- return 0;}\r\n+ return 0;\r\n+}\r\ndiff --git a/src/demo.hpp b/src/demo.hpp\nindex a429f5c..115b0de 100644\n--- a/src/demo.hpp\n+++ b/src/demo.hpp\n@@ -6,3 +6,3 @@ class Dummy {\n- char* useless;\r\n- int numb;\r\n- Dummy() :numb(0), useless(\"\\0\"){}\r\n+ char* useless { \"\\0\" };\r\n+ int numb { 0 };\r\n+ Dummy() { }\r\n@@ -10,2 +10,2 @@ class Dummy {\n- public:\r\n- void *not_useful(char *str){useless = str;}\r\n+public:\r\n+ auto not_useful(char* str) -> void* { useless = str; }\r\n\n```\n\n\n
\n\n", + "state": "DISMISSED", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1807918342", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1807918342" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "submitted_at": "2024-01-08T00:26:52Z", + "commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d" + }, + { + "id": 1807922252, + "node_id": "PRR_kwDOFY2uzM5rwrRM", + "user": { + "login": "2bndy5", + "id": 14963867, + "node_id": "MDQ6VXNlcjE0OTYzODY3", + "avatar_url": "https://avatars.githubusercontent.com/u/14963867?u=a73fe81ae765fbd53ec950e5b4cde1ab780dfb9f&v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/2bndy5", + "html_url": "https://github.com/2bndy5", + "followers_url": "https://api.github.com/users/2bndy5/followers", + "following_url": "https://api.github.com/users/2bndy5/following{/other_user}", + "gists_url": "https://api.github.com/users/2bndy5/gists{/gist_id}", + "starred_url": "https://api.github.com/users/2bndy5/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/2bndy5/subscriptions", + "organizations_url": "https://api.github.com/users/2bndy5/orgs", + "repos_url": "https://api.github.com/users/2bndy5/repos", + "events_url": "https://api.github.com/users/2bndy5/events{/privacy}", + "received_events_url": "https://api.github.com/users/2bndy5/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "body": "", + "state": "COMMENTED", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1807922252", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "MEMBER", + "_links": { + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1807922252" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "submitted_at": "2024-01-08T00:44:25Z", + "commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d" + }, + { + "id": 1807924854, + "node_id": "PRR_kwDOFY2uzM5rwr52", + "user": { + "login": "2bndy5", + "id": 14963867, + "node_id": "MDQ6VXNlcjE0OTYzODY3", + "avatar_url": "https://avatars.githubusercontent.com/u/14963867?u=a73fe81ae765fbd53ec950e5b4cde1ab780dfb9f&v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/2bndy5", + "html_url": "https://github.com/2bndy5", + "followers_url": "https://api.github.com/users/2bndy5/followers", + "following_url": "https://api.github.com/users/2bndy5/following{/other_user}", + "gists_url": "https://api.github.com/users/2bndy5/gists{/gist_id}", + "starred_url": "https://api.github.com/users/2bndy5/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/2bndy5/subscriptions", + "organizations_url": "https://api.github.com/users/2bndy5/orgs", + "repos_url": "https://api.github.com/users/2bndy5/repos", + "events_url": "https://api.github.com/users/2bndy5/events{/privacy}", + "received_events_url": "https://api.github.com/users/2bndy5/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "body": "", + "state": "COMMENTED", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1807924854", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "MEMBER", + "_links": { + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1807924854" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "submitted_at": "2024-01-08T00:55:39Z", + "commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d" + }, + { + "id": 1807926853, + "node_id": "PRR_kwDOFY2uzM5rwsZF", + "user": { + "login": "2bndy5", + "id": 14963867, + "node_id": "MDQ6VXNlcjE0OTYzODY3", + "avatar_url": "https://avatars.githubusercontent.com/u/14963867?u=a73fe81ae765fbd53ec950e5b4cde1ab780dfb9f&v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/2bndy5", + "html_url": "https://github.com/2bndy5", + "followers_url": "https://api.github.com/users/2bndy5/followers", + "following_url": "https://api.github.com/users/2bndy5/following{/other_user}", + "gists_url": "https://api.github.com/users/2bndy5/gists{/gist_id}", + "starred_url": "https://api.github.com/users/2bndy5/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/2bndy5/subscriptions", + "organizations_url": "https://api.github.com/users/2bndy5/orgs", + "repos_url": "https://api.github.com/users/2bndy5/repos", + "events_url": "https://api.github.com/users/2bndy5/events{/privacy}", + "received_events_url": "https://api.github.com/users/2bndy5/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "body": "", + "state": "COMMENTED", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1807926853", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "MEMBER", + "_links": { + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1807926853" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "submitted_at": "2024-01-08T01:03:46Z", + "commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d" + }, + { + "id": 1807927611, + "node_id": "PRR_kwDOFY2uzM5rwsk7", + "user": { + "login": "2bndy5", + "id": 14963867, + "node_id": "MDQ6VXNlcjE0OTYzODY3", + "avatar_url": "https://avatars.githubusercontent.com/u/14963867?u=a73fe81ae765fbd53ec950e5b4cde1ab780dfb9f&v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/2bndy5", + "html_url": "https://github.com/2bndy5", + "followers_url": "https://api.github.com/users/2bndy5/followers", + "following_url": "https://api.github.com/users/2bndy5/following{/other_user}", + "gists_url": "https://api.github.com/users/2bndy5/gists{/gist_id}", + "starred_url": "https://api.github.com/users/2bndy5/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/2bndy5/subscriptions", + "organizations_url": "https://api.github.com/users/2bndy5/orgs", + "repos_url": "https://api.github.com/users/2bndy5/repos", + "events_url": "https://api.github.com/users/2bndy5/events{/privacy}", + "received_events_url": "https://api.github.com/users/2bndy5/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "body": "", + "state": "COMMENTED", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1807927611", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "MEMBER", + "_links": { + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1807927611" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "submitted_at": "2024-01-08T01:06:32Z", + "commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d" + }, + { + "id": 1807930152, + "node_id": "PRR_kwDOFY2uzM5rwtMo", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n## Cpp-linter Review\nOnly 5 out of 7 clang-format suggestions fit within this pull request's diff.\n\n
Click here for the full clang-format patch\n\n\n```diff\ndiff --git a/src/demo.cpp b/src/demo.cpp\nindex fc295c3..c522998 100644\n--- a/src/demo.cpp\n+++ b/src/demo.cpp\n@@ -4,0 +5,2 @@\n+int main()\r\n+{\r\n@@ -6,6 +8,2 @@\n-\r\n-\r\n-int main(){\r\n-\r\n- for (;;) break;\r\n-\r\n+ for (;;)\r\n+ break;\r\n@@ -15,4 +13,2 @@ int main(){\n-\r\n-\r\n-\r\n- return 0;}\r\n+ return 0;\r\n+}\r\ndiff --git a/src/demo.hpp b/src/demo.hpp\nindex a429f5c..31566a5 100644\n--- a/src/demo.hpp\n+++ b/src/demo.hpp\n@@ -3,2 +2,0 @@\n-\r\n-\r\n@@ -8,4 +6,8 @@ class Dummy {\n- Dummy() :numb(0), useless(\"\\0\"){}\r\n-\r\n- public:\r\n- void *not_useful(char *str){useless = str;}\r\n+ Dummy()\r\n+ : numb(0)\r\n+ , useless(\"\\0\")\r\n+ {\r\n+ }\r\n+\r\n+public:\r\n+ void* not_useful(char* str) { useless = str; }\r\n@@ -14,19 +16 @@ class Dummy {\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-struct LongDiff\r\n-{\r\n+struct LongDiff {\r\n@@ -35 +18,0 @@ struct LongDiff\n-\r\n\n```\n\n\n
\n\n\n
Click here for the full clang-tidy patch\n\n\n```diff\ndiff --git a/src/demo.cpp b/src/demo.cpp\nindex fc295c3..b160609 100644\n--- a/src/demo.cpp\n+++ b/src/demo.cpp\n@@ -3 +3 @@\n-#include \r\n+#include \r\n@@ -4,0 +5,2 @@\n+auto main() -> int\r\n+{\r\n@@ -6,6 +8,3 @@\n-\r\n-\r\n-int main(){\r\n-\r\n- for (;;) break;\r\n-\r\n+ for (;;) {\r\n+ break;\r\n+ }\r\n@@ -18 +17,2 @@ int main(){\n- return 0;}\r\n+ return 0;\r\n+}\r\ndiff --git a/src/demo.hpp b/src/demo.hpp\nindex a429f5c..115b0de 100644\n--- a/src/demo.hpp\n+++ b/src/demo.hpp\n@@ -6,3 +6,3 @@ class Dummy {\n- char* useless;\r\n- int numb;\r\n- Dummy() :numb(0), useless(\"\\0\"){}\r\n+ char* useless { \"\\0\" };\r\n+ int numb { 0 };\r\n+ Dummy() { }\r\n@@ -10,2 +10,2 @@ class Dummy {\n- public:\r\n- void *not_useful(char *str){useless = str;}\r\n+public:\r\n+ auto not_useful(char* str) -> void* { useless = str; }\r\n\n```\n\n\n
\n\n", + "state": "CHANGES_REQUESTED", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1807930152", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1807930152" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "submitted_at": "2024-01-08T01:15:54Z", + "commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d" + }, + { + "id": 1808225893, + "node_id": "PRR_kwDOFY2uzM5rx1Zl", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n## Cpp-linter Review\nOnly 5 out of 7 clang-format suggestions fit within this pull request's diff.\n\n
Click here for the full clang-format patch\n\n\n```diff\ndiff --git a/src/demo.cpp b/src/demo.cpp\nindex fc295c3..c522998 100644\n--- a/src/demo.cpp\n+++ b/src/demo.cpp\n@@ -4,0 +5,2 @@\n+int main()\r\n+{\r\n@@ -6,6 +8,2 @@\n-\r\n-\r\n-int main(){\r\n-\r\n- for (;;) break;\r\n-\r\n+ for (;;)\r\n+ break;\r\n@@ -15,4 +13,2 @@ int main(){\n-\r\n-\r\n-\r\n- return 0;}\r\n+ return 0;\r\n+}\r\ndiff --git a/src/demo.hpp b/src/demo.hpp\nindex a429f5c..31566a5 100644\n--- a/src/demo.hpp\n+++ b/src/demo.hpp\n@@ -3,2 +2,0 @@\n-\r\n-\r\n@@ -8,4 +6,8 @@ class Dummy {\n- Dummy() :numb(0), useless(\"\\0\"){}\r\n-\r\n- public:\r\n- void *not_useful(char *str){useless = str;}\r\n+ Dummy()\r\n+ : numb(0)\r\n+ , useless(\"\\0\")\r\n+ {\r\n+ }\r\n+\r\n+public:\r\n+ void* not_useful(char* str) { useless = str; }\r\n@@ -14,19 +16 @@ class Dummy {\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-\r\n-struct LongDiff\r\n-{\r\n+struct LongDiff {\r\n@@ -35 +18,0 @@ struct LongDiff\n-\r\n\n```\n\n\n
\n\n\n
Click here for the full clang-tidy patch\n\n\n```diff\ndiff --git a/src/demo.cpp b/src/demo.cpp\nindex fc295c3..b160609 100644\n--- a/src/demo.cpp\n+++ b/src/demo.cpp\n@@ -3 +3 @@\n-#include \r\n+#include \r\n@@ -4,0 +5,2 @@\n+auto main() -> int\r\n+{\r\n@@ -6,6 +8,3 @@\n-\r\n-\r\n-int main(){\r\n-\r\n- for (;;) break;\r\n-\r\n+ for (;;) {\r\n+ break;\r\n+ }\r\n@@ -18 +17,2 @@ int main(){\n- return 0;}\r\n+ return 0;\r\n+}\r\ndiff --git a/src/demo.hpp b/src/demo.hpp\nindex a429f5c..115b0de 100644\n--- a/src/demo.hpp\n+++ b/src/demo.hpp\n@@ -6,3 +6,3 @@ class Dummy {\n- char* useless;\r\n- int numb;\r\n- Dummy() :numb(0), useless(\"\\0\"){}\r\n+ char* useless { \"\\0\" };\r\n+ int numb { 0 };\r\n+ Dummy() { }\r\n@@ -10,2 +10,2 @@ class Dummy {\n- public:\r\n- void *not_useful(char *str){useless = str;}\r\n+public:\r\n+ auto not_useful(char* str) -> void* { useless = str; }\r\n\n```\n\n\n
\n\n\n\nHave any feedback or feature suggestions? [Share it here.](https://github.com/cpp-linter/cpp-linter-action/issues)", + "state": "DISMISSED", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1808225893", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1808225893" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "submitted_at": "2024-01-08T07:56:26Z", + "commit_id": "ca8d8e8ad719979c3bfe5f15a09a83abbcec421d" + }, + { + "id": 1812664781, + "node_id": "PRR_kwDOFY2uzM5sCxHN", + "user": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "body": "\n## Cpp-linter Review\nNo objections from clang-format.\nNo objections from clang-tidy.\n\nGreat job!\n\nHave any feedback or feature suggestions? [Share it here.](https://github.com/cpp-linter/cpp-linter-action/issues)", + "state": "APPROVED", + "html_url": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1812664781", + "pull_request_url": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27", + "author_association": "NONE", + "_links": { + "html": { + "href": "https://github.com/cpp-linter/test-cpp-linter-action/pull/27#pullrequestreview-1812664781" + }, + "pull_request": { + "href": "https://api.github.com/repos/cpp-linter/test-cpp-linter-action/pulls/27" + } + }, + "submitted_at": "2024-01-10T08:33:45Z", + "commit_id": "635a9c57bdcca07b99ddef52c2640337c50280b1" } ] diff --git a/tests/reviews/pr_reviews_graphql.json b/tests/reviews/pr_reviews_graphql.json new file mode 100644 index 00000000..00e08e79 --- /dev/null +++ b/tests/reviews/pr_reviews_graphql.json @@ -0,0 +1,883 @@ +{ + "data": { + "repository": { + "pullRequest": { + "id": "PR_kwDOFY2uzM5jZGgl", + "reviewThreads": { + "nodes": [ + { + "id": "PRRT_kwDOFY2uzM42_-w5", + "isResolved": false, + "isCollapsed": false, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WD6gj", + "body": "### clang-format suggestions\n\n```suggestion\n\r\nint main()\r\n{\r\n\r\n for (;;)\r\n break;\r\n\r\n```", + "path": "src/demo.cpp", + "line": 13, + "startLine": 4, + "originalLine": 13, + "originalStartLine": 4, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rveb6", + "isMinimized": true + } + }, + { + "id": "PRRC_kwDOFY2uzM5WEqkw", + "body": "The `printf()`seems to be getting dropped in this suggestion.", + "path": "src/demo.cpp", + "line": 13, + "startLine": 4, + "originalLine": 13, + "originalStartLine": 4, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwcy4", + "isMinimized": false + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM42_-w6", + "isResolved": false, + "isCollapsed": false, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WD6gk", + "body": "### clang-tidy diagnostics\n- inclusion of deprecated C++ header 'stdio.h'; consider using 'cstdio' instead [[modernize-deprecated-headers](https://clang.llvm.org/extra/clang-tidy/checks/modernize/deprecated-headers.html)]\n- use a trailing return type for this function [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)]\n- statement should be inside braces [[readability-braces-around-statements](https://clang.llvm.org/extra/clang-tidy/checks/readability/braces-around-statements.html)]\n\n```suggestion\n#include \"demo.hpp\"\r\n#include \r\n\r\nauto main() -> int\r\n{\r\n\r\n for (;;) {\r\n break;\r\n }\r\n\r\n```", + "path": "src/demo.cpp", + "line": 13, + "startLine": 2, + "originalLine": 13, + "originalStartLine": 2, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rveb6", + "isMinimized": true + } + }, + { + "id": "PRRC_kwDOFY2uzM5WEqlw", + "body": "Again, the `printf()` call is getting dropped in this suggestion.", + "path": "src/demo.cpp", + "line": 13, + "startLine": 2, + "originalLine": 13, + "originalStartLine": 2, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwc0g", + "isMinimized": false + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM42_-w7", + "isResolved": false, + "isCollapsed": false, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WD6gm", + "body": "### clang-tidy diagnostics\n- use a trailing return type for this function [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)]\n\n```suggestion\n public:\r\n auto not_useful(char* str) -> void* { useless = str; }\r\n};\r\n```", + "path": "src/demo.hpp", + "line": 13, + "startLine": 10, + "originalLine": 13, + "originalStartLine": 10, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rveb6", + "isMinimized": true + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43ArmZ", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE0Ru", + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\nint main()\r\n{\r\n```", + "path": "src/demo.cpp", + "line": 5, + "startLine": null, + "originalLine": 5, + "originalStartLine": null, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwqUG", + "isMinimized": true + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43Arma", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE0Rv", + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\n for (;;)\r\n break;\r\n```", + "path": "src/demo.cpp", + "line": 11, + "startLine": 6, + "originalLine": 11, + "originalStartLine": 6, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwqUG", + "isMinimized": true + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43Armb", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE0Rw", + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\n return 0;\r\n}\r\n```", + "path": "src/demo.cpp", + "line": 18, + "startLine": 15, + "originalLine": 18, + "originalStartLine": 15, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwqUG", + "isMinimized": true + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43Armc", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE0Rx", + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\n Dummy()\r\n : numb(0)\r\n , useless(\"\\0\")\r\n {\r\n }\r\n\r\npublic:\r\n void* not_useful(char* str) { useless = str; }\r\n```", + "path": "src/demo.hpp", + "line": 11, + "startLine": 8, + "originalLine": 11, + "originalStartLine": 8, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwqUG", + "isMinimized": true + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43Armd", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE0Ry", + "body": "\n### clang-format suggestions\r\n\r\nPlease remove this line(s).", + "path": "src/demo.hpp", + "line": 35, + "startLine": null, + "originalLine": 35, + "originalStartLine": null, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwqUG", + "isMinimized": true + } + }, + { + "id": "PRRC_kwDOFY2uzM5WE09V", + "body": "More detail please! Which line(s)?", + "path": "src/demo.hpp", + "line": 35, + "startLine": null, + "originalLine": 35, + "originalStartLine": null, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwrRM", + "isMinimized": false + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43Arme", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE0Rz", + "body": "\n### clang-tidy diagnostics\r\n\r\n```suggestion\r\n#include \r\n```", + "path": "src/demo.cpp", + "line": 3, + "startLine": null, + "originalLine": 3, + "originalStartLine": null, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwqUG", + "isMinimized": true + } + }, + { + "id": "PRRC_kwDOFY2uzM5WE1bp", + "body": "clang-tidy diagnostic isn't named here\r\n> src/demo.cpp:3:10: warning: [[modernize-deprecated-headers](https://clang.llvm.org/extra/clang-tidy/checks/modernize/deprecated-headers.html)]\r\n\r\nTry to find out why and fix it.", + "path": "src/demo.cpp", + "line": 3, + "startLine": null, + "originalLine": 3, + "originalStartLine": null, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwr52", + "isMinimized": false + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43Armf", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE0R0", + "body": "\n### clang-tidy diagnostics\r\n\r\n```suggestion\r\nauto main() -> int\r\n{\r\n```", + "path": "src/demo.cpp", + "line": 5, + "startLine": null, + "originalLine": 5, + "originalStartLine": null, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwqUG", + "isMinimized": true + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43Armg", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE0R1", + "body": "\n### clang-tidy diagnostics\r\n- use a trailing return type for this function [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)]\r\n- statement should be inside braces [[readability-braces-around-statements](https://clang.llvm.org/extra/clang-tidy/checks/readability/braces-around-statements.html)]\r\n\r\n```suggestion\r\n for (;;) {\r\n break;\r\n }\r\n```", + "path": "src/demo.cpp", + "line": 11, + "startLine": 6, + "originalLine": 11, + "originalStartLine": 6, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwqUG", + "isMinimized": true + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43Armh", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE0R2", + "body": "\n### clang-tidy diagnostics\r\n\r\n```suggestion\r\n return 0;\r\n}\r\n```", + "path": "src/demo.cpp", + "line": 18, + "startLine": null, + "originalLine": 18, + "originalStartLine": null, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwqUG", + "isMinimized": true + } + }, + { + "id": "PRRC_kwDOFY2uzM5WE1zS", + "body": "This change is from code style guidelines (a clang-format thing), thus no clang-tidy diagnostic to name as the cause for the change.\r\n\r\nWe should probably change the wording in this situation:\r\n```diff\r\n-clang-tidy diagnostics\r\n+clang-tidy suggestions\r\n```", + "path": "src/demo.cpp", + "line": 18, + "startLine": null, + "originalLine": 18, + "originalStartLine": null, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwsZF", + "isMinimized": false + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43Armj", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE0R4", + "body": "\n### clang-tidy diagnostics\r\n- use default member initializer for 'useless' [[modernize-use-default-member-init](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html)]\r\n- use default member initializer for 'numb' [[modernize-use-default-member-init](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html)]\r\n\r\n```suggestion\r\n char* useless { \"\\0\" };\r\n int numb { 0 };\r\n Dummy() { }\r\n```", + "path": "src/demo.hpp", + "line": 8, + "startLine": 6, + "originalLine": 8, + "originalStartLine": 6, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwqUG", + "isMinimized": true + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43Armk", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE0R5", + "body": "\n### clang-tidy diagnostics\r\n\r\n```suggestion\r\npublic:\r\n auto not_useful(char* str) -> void* { useless = str; }\r\n```", + "path": "src/demo.hpp", + "line": 11, + "startLine": 10, + "originalLine": 11, + "originalStartLine": 10, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwqUG", + "isMinimized": true + } + }, + { + "id": "PRRC_kwDOFY2uzM5WE16Z", + "body": "Again wording seems inadequate here because no clang-tidy diagnostics are named for code style guidelines.", + "path": "src/demo.hpp", + "line": 11, + "startLine": 10, + "originalLine": 11, + "originalStartLine": 10, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwsk7", + "isMinimized": false + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43AtGA", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE2T9", + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\nint main()\r\n{\r\n```", + "path": "src/demo.cpp", + "line": 5, + "startLine": null, + "originalLine": 5, + "originalStartLine": null, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwtMo", + "isMinimized": true + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43AtGB", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE2T-", + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\n for (;;)\r\n break;\r\n```", + "path": "src/demo.cpp", + "line": 11, + "startLine": 6, + "originalLine": 11, + "originalStartLine": 6, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwtMo", + "isMinimized": true + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43AtGC", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE2T_", + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\n return 0;\r\n}\r\n```", + "path": "src/demo.cpp", + "line": 18, + "startLine": 15, + "originalLine": 18, + "originalStartLine": 15, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwtMo", + "isMinimized": true + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43AtGE", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE2UB", + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\n Dummy()\r\n : numb(0)\r\n , useless(\"\\0\")\r\n {\r\n }\r\n\r\npublic:\r\n void* not_useful(char* str) { useless = str; }\r\n```", + "path": "src/demo.hpp", + "line": 11, + "startLine": 8, + "originalLine": 11, + "originalStartLine": 8, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwtMo", + "isMinimized": true + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43AtGF", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE2UC", + "body": "\n### clang-format suggestions\r\n\r\nPlease remove the line(s)\r\n- 35", + "path": "src/demo.hpp", + "line": 35, + "startLine": null, + "originalLine": 35, + "originalStartLine": null, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwtMo", + "isMinimized": true + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43AtGG", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE2UD", + "body": "\n### clang-tidy diagnostics\r\n- inclusion of deprecated C++ header 'stdio.h'; consider using 'cstdio' instead [[modernize-deprecated-headers](https://clang.llvm.org/extra/clang-tidy/checks/modernize/deprecated-headers.html)]\r\n\r\n```suggestion\r\n#include \r\n```", + "path": "src/demo.cpp", + "line": 3, + "startLine": null, + "originalLine": 3, + "originalStartLine": null, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwtMo", + "isMinimized": true + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43AtGH", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE2UE", + "body": "\n### clang-tidy suggestions\r\n\r\n```suggestion\r\nauto main() -> int\r\n{\r\n```", + "path": "src/demo.cpp", + "line": 5, + "startLine": null, + "originalLine": 5, + "originalStartLine": null, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwtMo", + "isMinimized": true + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43AtGI", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE2UF", + "body": "\n### clang-tidy diagnostics\r\n- use a trailing return type for this function [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)]\r\n- statement should be inside braces [[readability-braces-around-statements](https://clang.llvm.org/extra/clang-tidy/checks/readability/braces-around-statements.html)]\r\n\r\n```suggestion\r\n for (;;) {\r\n break;\r\n }\r\n```", + "path": "src/demo.cpp", + "line": 11, + "startLine": 6, + "originalLine": 11, + "originalStartLine": 6, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwtMo", + "isMinimized": true + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43AtGJ", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE2UG", + "body": "\n### clang-tidy suggestions\r\n\r\n```suggestion\r\n return 0;\r\n}\r\n```", + "path": "src/demo.cpp", + "line": 18, + "startLine": null, + "originalLine": 18, + "originalStartLine": null, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwtMo", + "isMinimized": true + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43AtGK", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE2UH", + "body": "\n### clang-tidy diagnostics\r\n- use default member initializer for 'useless' [[modernize-use-default-member-init](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html)]\r\n- use default member initializer for 'numb' [[modernize-use-default-member-init](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html)]\r\n\r\n```suggestion\r\n char* useless { \"\\0\" };\r\n int numb { 0 };\r\n Dummy() { }\r\n```", + "path": "src/demo.hpp", + "line": 8, + "startLine": 6, + "originalLine": 8, + "originalStartLine": 6, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwtMo", + "isMinimized": true + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43AtGL", + "isResolved": true, + "isCollapsed": true, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WE2UI", + "body": "\n### clang-tidy diagnostics\r\n- use a trailing return type for this function [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)]\r\n\r\n```suggestion\r\npublic:\r\n auto not_useful(char* str) -> void* { useless = str; }\r\n```", + "path": "src/demo.hpp", + "line": 11, + "startLine": 10, + "originalLine": 11, + "originalStartLine": 10, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rwtMo", + "isMinimized": true + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43BFsh", + "isResolved": false, + "isCollapsed": false, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WFaMx", + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\nint main()\r\n{\r\n```", + "path": "src/demo.cpp", + "line": 5, + "startLine": null, + "originalLine": 5, + "originalStartLine": null, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rx1Zl", + "isMinimized": false + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43BFsl", + "isResolved": false, + "isCollapsed": false, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WFaM0", + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\n for (;;)\r\n break;\r\n```", + "path": "src/demo.cpp", + "line": 11, + "startLine": 6, + "originalLine": 11, + "originalStartLine": 6, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rx1Zl", + "isMinimized": false + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43BFsn", + "isResolved": false, + "isCollapsed": false, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WFaM2", + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\n return 0;\r\n}\r\n```", + "path": "src/demo.cpp", + "line": 18, + "startLine": 15, + "originalLine": 18, + "originalStartLine": 15, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rx1Zl", + "isMinimized": false + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43BFso", + "isResolved": false, + "isCollapsed": false, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WFaM5", + "body": "\n### clang-format suggestions\r\n\r\n```suggestion\r\n Dummy()\r\n : numb(0)\r\n , useless(\"\\0\")\r\n {\r\n }\r\n\r\npublic:\r\n void* not_useful(char* str) { useless = str; }\r\n```", + "path": "src/demo.hpp", + "line": 11, + "startLine": 8, + "originalLine": 11, + "originalStartLine": 8, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rx1Zl", + "isMinimized": false + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43BFsq", + "isResolved": false, + "isCollapsed": false, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WFaM7", + "body": "\n### clang-format suggestions\r\n\r\nPlease remove the line(s)\r\n- 35", + "path": "src/demo.hpp", + "line": 35, + "startLine": null, + "originalLine": 35, + "originalStartLine": null, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rx1Zl", + "isMinimized": false + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43BFsr", + "isResolved": false, + "isCollapsed": false, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WFaM8", + "body": "\n### clang-tidy diagnostics\r\n- inclusion of deprecated C++ header 'stdio.h'; consider using 'cstdio' instead [[modernize-deprecated-headers](https://clang.llvm.org/extra/clang-tidy/checks/modernize/deprecated-headers.html)]\r\n\r\n```suggestion\r\n#include \r\n```", + "path": "src/demo.cpp", + "line": 3, + "startLine": null, + "originalLine": 3, + "originalStartLine": null, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rx1Zl", + "isMinimized": false + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43BFss", + "isResolved": false, + "isCollapsed": false, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WFaM9", + "body": "\n### clang-tidy suggestions\r\n\r\n```suggestion\r\nauto main() -> int\r\n{\r\n```", + "path": "src/demo.cpp", + "line": 5, + "startLine": null, + "originalLine": 5, + "originalStartLine": null, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rx1Zl", + "isMinimized": false + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43BFst", + "isResolved": false, + "isCollapsed": false, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WFaM_", + "body": "\n### clang-tidy diagnostics\r\n- use a trailing return type for this function [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)]\r\n- statement should be inside braces [[readability-braces-around-statements](https://clang.llvm.org/extra/clang-tidy/checks/readability/braces-around-statements.html)]\r\n\r\n```suggestion\r\n for (;;) {\r\n break;\r\n }\r\n```", + "path": "src/demo.cpp", + "line": 11, + "startLine": 6, + "originalLine": 11, + "originalStartLine": 6, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rx1Zl", + "isMinimized": false + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43BFsu", + "isResolved": false, + "isCollapsed": false, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WFaNA", + "body": "\n### clang-tidy suggestions\r\n\r\n```suggestion\r\n return 0;\r\n}\r\n```", + "path": "src/demo.cpp", + "line": 18, + "startLine": null, + "originalLine": 18, + "originalStartLine": null, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rx1Zl", + "isMinimized": false + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43BFsx", + "isResolved": false, + "isCollapsed": false, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WFaNE", + "body": "\n### clang-tidy diagnostics\r\n- use default member initializer for 'useless' [[modernize-use-default-member-init](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html)]\r\n- use default member initializer for 'numb' [[modernize-use-default-member-init](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html)]\r\n\r\n```suggestion\r\n char* useless { \"\\0\" };\r\n int numb { 0 };\r\n Dummy() { }\r\n```", + "path": "src/demo.hpp", + "line": 8, + "startLine": 6, + "originalLine": 8, + "originalStartLine": 6, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rx1Zl", + "isMinimized": false + } + } + ] + } + }, + { + "id": "PRRT_kwDOFY2uzM43BFsz", + "isResolved": false, + "isCollapsed": false, + "comments": { + "nodes": [ + { + "id": "PRRC_kwDOFY2uzM5WFaNG", + "body": "\n### clang-tidy diagnostics\r\n- use a trailing return type for this function [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)]\r\n\r\n```suggestion\r\npublic:\r\n auto not_useful(char* str) -> void* { useless = str; }\r\n```", + "path": "src/demo.hpp", + "line": 11, + "startLine": 10, + "originalLine": 11, + "originalStartLine": 10, + "pullRequestReview": { + "id": "PRR_kwDOFY2uzM5rx1Zl", + "isMinimized": false + } + } + ] + } + } + ] + } + } + } + } +} diff --git a/tests/reviews/test_pr_review.py b/tests/reviews/test_pr_review.py index 1d1aaf19..fc0947b3 100644 --- a/tests/reviews/test_pr_review.py +++ b/tests/reviews/test_pr_review.py @@ -3,8 +3,11 @@ from os import environ from pathlib import Path import shutil +from typing import Dict, Any import requests_mock import pytest +import requests_mock.request +import requests_mock.response from cpp_linter.rest_api.github_api import GithubApiClient from cpp_linter.clang_tools import capture_clang_tools_output @@ -13,6 +16,65 @@ TEST_REPO = "cpp-linter/test-cpp-linter-action" TEST_PR = 27 +DELETE_COMMENT_GRAPHQL = """{ + "data": { + deletePullRequestReviewComment: { + pullRequestReviewComment { + %s + } + } + } +}""" + +RESOLVE_COMMENT_GRAPHQL = """{ + "data": { + resolveReviewThread: { + thread { + %s + } + } + } +}""" + +MINIMIZE_COMMENT_GRAPHQL = """{ + "data": { + "minimizeComment": { + "minimizedComment": { + "isMinimized": true + } + } + } +}""" + +CACHE_PATH = Path(__file__).parent + + +def graphql_callback( + request: requests_mock.request._RequestObjectProxy, + context: requests_mock.response._Context, +): + context.status_code = 200 + req_json = request.json() + query: str = req_json["query"] + variables: Dict[str, Any] = req_json["variables"] + if query.startswith("query"): + # get existing review comments + return (CACHE_PATH / "pr_reviews_graphql.json").read_text(encoding="utf-8") + elif "resolveReviewThread" in query and "id" in variables: + # resolve review + return RESOLVE_COMMENT_GRAPHQL % variables["threadId"] + elif "deletePullRequestReviewComment" in query and "id" in variables: + # delete PR or minimizeComment + return DELETE_COMMENT_GRAPHQL % variables["id"] + elif "minimizeComment" in query: + # minimizeComment + return MINIMIZE_COMMENT_GRAPHQL + else: # pragma: no cover + context.status_code = 403 + return json.dumps( + {"errors": [{"message": "Failed to parse query when mocking a response"}]} + ) + test_parameters = OrderedDict( is_draft=False, @@ -26,6 +88,7 @@ no_lgtm=False, num_workers=None, is_passive=False, + delete_review_comments=False, ) @@ -55,6 +118,7 @@ def mk_param_set(**kwargs) -> OrderedDict: tuple(mk_param_set(tidy_review=True, changes=0).values()), tuple(mk_param_set(tidy_review=True, changes=0, summary_only=True).values()), tuple(mk_param_set(is_passive=True).values()), + tuple(mk_param_set(delete_review_comments=True).values()), ], ids=[ "draft", @@ -69,6 +133,7 @@ def mk_param_set(**kwargs) -> OrderedDict: "all_lines", "summary_only", "passive", + "delete", ], ) def test_post_review( @@ -85,6 +150,7 @@ def test_post_review( no_lgtm: bool, num_workers: int, is_passive: bool, + delete_review_comments: bool, ): """A mock test of posting PR reviews""" # patch env vars @@ -104,12 +170,11 @@ def test_post_review( shutil.copyfile(str(demo_dir / "demo.cpp"), str(tmp_path / "src" / "demo.cpp")) shutil.copyfile(str(demo_dir / "demo.hpp"), str(tmp_path / "src" / "demo.hpp")) shutil.copyfile(str(demo_dir / "demo.cpp"), str(tmp_path / "src" / "demo.c")) - cache_path = Path(__file__).parent shutil.copyfile( - str(cache_path / ".clang-format"), str(tmp_path / "src" / ".clang-format") + str(CACHE_PATH / ".clang-format"), str(tmp_path / "src" / ".clang-format") ) shutil.copyfile( - str(cache_path / ".clang-tidy"), str(tmp_path / "src" / ".clang-tidy") + str(CACHE_PATH / ".clang-tidy"), str(tmp_path / "src" / ".clang-tidy") ) gh_client = GithubApiClient() @@ -122,16 +187,16 @@ def test_post_review( mock.get( base_url, request_headers={"Accept": "application/vnd.github.diff"}, - text=(cache_path / f"pr_{TEST_PR}.diff").read_text(encoding="utf-8"), + text=(CACHE_PATH / f"pr_{TEST_PR}.diff").read_text(encoding="utf-8"), ) - reviews = (cache_path / "pr_reviews.json").read_text(encoding="utf-8") + reviews = (CACHE_PATH / "pr_reviews.json").read_text(encoding="utf-8") mock.get( f"{base_url}/reviews?page=1&per_page=100", text=reviews, ) mock.get( f"{base_url}/comments", - text=(cache_path / "pr_review_comments.json").read_text(encoding="utf-8"), + text=(CACHE_PATH / "pr_review_comments.json").read_text(encoding="utf-8"), ) # acknowledge any PUT and POST requests about specific reviews @@ -139,6 +204,12 @@ def test_post_review( for review_id in [r["id"] for r in json.loads(reviews) if "id" in r]: mock.put(f"{base_url}/reviews/{review_id}/dismissals") extensions = ["cpp", "hpp", "c"] + + # mock graphql requests + graphql_url = f"{gh_client.api_url}/graphql" + + mock.post(graphql_url, text=graphql_callback) + # run the actual test files = gh_client.get_list_of_changed_files( FileFilter(extensions=extensions), @@ -166,6 +237,7 @@ def test_post_review( args.no_lgtm = no_lgtm args.file_annotations = False args.passive_reviews = is_passive + args.delete_review_comments = delete_review_comments clang_versions = capture_clang_tools_output(files, args=args) if not force_approved: @@ -178,7 +250,7 @@ def test_post_review( assert format_advice and len(format_advice) <= len(files) # simulate draft PR by changing the request response - cache_pr_response = (cache_path / f"pr_{TEST_PR}.json").read_text( + cache_pr_response = (CACHE_PATH / f"pr_{TEST_PR}.json").read_text( encoding="utf-8" ) if is_draft: