Skip to content

resolve #34 #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Nov 9, 2023
Merged

resolve #34 #35

merged 15 commits into from
Nov 9, 2023

Conversation

2bndy5
Copy link
Contributor

@2bndy5 2bndy5 commented Sep 2, 2023

This still needs testing.

Also updated the pre-commit hooks. I replaced pylint with ruff for better speed and because we already get type-checking from mypy; we don't need the extra type-checking from pylint.

Removed some dead code from run.py. I have some other optimizations I'd like to add from the deep-dive code review I did when porting this pkg to dart. But that can happen in another PR.

I found and fixed a couple bugs in make_annotations():

  1. If file-annotations is false, then clang-tidy annotations were still posted.
  2. If file-annotations is false, then clang-format advice was not counted.

I also modified the log output to show the count of possible annotations which directly corresponds to the checks-failed output.

@codecov
Copy link

codecov bot commented Sep 2, 2023

Codecov Report

Merging #35 (2103998) into main (977eb16) will increase coverage by 3.02%.
The diff coverage is 31.81%.

@@            Coverage Diff             @@
##             main      #35      +/-   ##
==========================================
+ Coverage   81.34%   84.37%   +3.02%     
==========================================
  Files           8        8              
  Lines         713      691      -22     
==========================================
+ Hits          580      583       +3     
+ Misses        133      108      -25     
Files Coverage Δ
cpp_linter/__init__.py 91.54% <100.00%> (ø)
cpp_linter/cli.py 100.00% <100.00%> (ø)
cpp_linter/run.py 90.07% <58.62%> (+13.52%) ⬆️
cpp_linter/thread_comments.py 58.46% <5.71%> (-10.99%) ⬇️

@2bndy5
Copy link
Contributor Author

2bndy5 commented Sep 2, 2023

Codecov CI is complaining about lines that changed in this PR but are not covered with unit tests.

Honestly, we don't have an adequate way to test anything involving Github's REST API usage (not without hitting the REST API's usage rate limit). So, the codecov complaints are null because the functionality wasn't unit tested before anyway.

@stale
Copy link

stale bot commented Oct 2, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Oct 2, 2023
@2bndy5
Copy link
Contributor Author

2bndy5 commented Oct 2, 2023

The overall coverage went up, but the diff coverage is below some target that codecov seems to have set (81.48%).

@stale stale bot removed the wontfix This will not be worked on label Oct 2, 2023
@2bndy5 2bndy5 force-pushed the resolve-34 branch 5 times, most recently from 8a48cb1 to 423dbed Compare October 27, 2023 03:50
@2bndy5 2bndy5 linked an issue Oct 27, 2023 that may be closed by this pull request
2 tasks
@2bndy5
Copy link
Contributor Author

2bndy5 commented Oct 27, 2023

So far, I've tested the following configs:

        with:
          files-changed-only: true | false
          thread-comments: update
          no-lgtm: false
        with:
          files-changed-only: true | false
          thread-comments: true
          no-lgtm: false

Now, I have to test the same thread-comments inputs with no-lgtm: true.

@2bndy5 2bndy5 marked this pull request as ready for review October 28, 2023 05:45
Copy link
Contributor

@shenxianpeng shenxianpeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. nice work!

@shenxianpeng shenxianpeng added the enhancement New feature or request label Oct 30, 2023
@2bndy5
Copy link
Contributor Author

2bndy5 commented Oct 30, 2023

Code coverage is missing some lines in make_annotations() now. I'd like to add a unit test to get those lines tested properly. Other lines in these changes can't be covered without using the GitHub REST API, so I won't worry about any of that as long as everything checks out on the test repo.

@2bndy5
Copy link
Contributor Author

2bndy5 commented Nov 4, 2023

Code coverage is missing some lines in make_annotations() now. I'd like to add a unit test to get those lines tested properly.

TL;DR I need to find a better commit for the test_tidy_annotations()

After playing around with test_tidy_annotations() (which should cover these changes), I found that the commit we're using doesn't generate tidy advice for every condition (all values of lines_changed_only and tidy_checks using either config file or action defaults).

also adjust unit test to use a src that triggers tidy annotations
@2bndy5
Copy link
Contributor Author

2bndy5 commented Nov 6, 2023

I also found that the filename matching was flawed in make_annotations(). So, I fixed it and updated the unit test... Should be done now.

Copy link

sonarqubecloud bot commented Nov 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@2bndy5
Copy link
Contributor Author

2bndy5 commented Nov 9, 2023

Everything passed on the second round of tests in cpp-linter/test-cpp-linter-action#22. I'm now confident enough to merge this! @shenxianpeng Thanks for your patience.

@2bndy5 2bndy5 merged commit 99aa469 into main Nov 9, 2023
@2bndy5 2bndy5 deleted the resolve-34 branch November 9, 2023 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New inputs to provide finite control of thread-comments
2 participants