Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

field testing revealed various bugs #30

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
shenxianpeng merged 23 commits into cpp-linter:master from 2bndy5:main
Oct 20, 2021
Merged

Conversation

@2bndy5
Copy link
Collaborator

@2bndy5 2bndy5 commented Oct 20, 2021
edited
Loading

I added this action to a project I'm helping develop, and I ran into some unforeseen problems. This resolves #29 , but I'll summarize the solutions here

  1. Allow skipping clang-tidy when setting the option
     tidy-checks: '-*'
  2. Skip fetching data from the workflow runner's event payload when setting the option
     files-changed-only: false
    This helps run the python pkg locally as a CLI tool instead of only as a Github action.
  3. Ignore hidden directories that aren't in the repo's root directory. For exmaple, .github was being ignored, but a sub-directory like src/.hidden was not being ignored.
  4. Augment get_line_cnt_from_cols() to better support CRLF & LF line endings by opening the source file as a binary file. This might also address different encoded source files (anything that isn't utf-8).
  5. Prevent creating a bogus clang-format notification when clang-format did not report any problems or fixes. Previously, XML metadata was triggering a clang-format notification when there was no actual fixes from clang-format.
  6. Enhance parsing clang-tidy notifications using pure regexp matching. Previously, a crashing error would occur when the notification contained : in the description. For example:
    /src/main.cpp:221:1: warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays]
    bool FailSafeChannel[17];
    ^
    
    The phrase std::array would previously cause a parsing error because I was using str.split(":") to parse the notification.

This can now be run as a standalone CLI tool

For better usage as a CLI tool, I've renamed the python pkg from python_action to cpp_linter. Once installed, it can be executed anywhere by running

cpp-linter -h

Furthermore, I changed some of the default values for the CLI args to check all files in the current working directory and disabling thread comments. These changes are overridden by the default values for options in the action.yml, so behaviorally, there are no changes to defaults when executing cpp-linter as a github action.

Also, I added pyyaml back in as dependency when installing locally. This should not slow down the setup time as pyyaml is already installed in the docker image we use as an action, but pyyaml may not be installed locally when used as a CLI tool.

shenxianpeng reacted with thumbs up emoji
2bndy5 added 23 commits August 22, 2021 01:01
Copy link
Collaborator

@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.

Look good to me.

@shenxianpeng shenxianpeng merged commit b4e9991 into cpp-linter:master Oct 20, 2021
@shenxianpeng shenxianpeng added the bug Something isn't working label Oct 20, 2021
shenxianpeng pushed a commit that referenced this pull request Oct 21, 2021
* upload new demo image
* Revert "upload new demo image"
This reverts commit 1aff6c7.
* update readme & upload new demo pic
* avoids duplicated checks on commits to open PR
* fix workflow from last commit
* Revert "fix workflow from last commit"
This reverts commit 778e10d.
* rename py pkg; allow no clang-tidy & no event.json
* pleasing pylint
* various bug fixes
* pleasing pylint
* update README about `tidy-checks=-*`
* increase indent in last change
* increase indent again (I don't like mkdocs)
* update docs
* avoid nesting log groups
* switch pylint to my check-python-sources action
* trigger pylint action
* Revert "switch pylint to my check-python-sources action"
This reverts commit 1733c4f.
* fix regressions from last update
* break out parsing ignore option from main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@shenxianpeng shenxianpeng shenxianpeng approved these changes

Assignees

No one assigned

Labels

bug Something isn't working

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

tidy-checks=-* triggers false-positive

AltStyle によって変換されたページ (->オリジナル) /