Skip to content

Conversation

@2bndy5
Copy link
Contributor

@2bndy5 2bndy5 commented Apr 24, 2024

satisfy ideas stated in cpp-linter/cpp-linter-action#233

This basically allows better reuse of code for filtering files. We can now filter all files (globally) and further filter files based on tool-specific patterns given by the new --ignore-tidy and/or --ignore-format options.

Any generated advice from clang tools is now stored in FileObj attributes. This allows better handling of advice per file. Previously, clang-tidy and clang-format were expected to run on all files, but this is not guaranteed now.

The collection of parsed CLI args is passed around instead of passing only relevant argument values. This keeps

  • functions' parameter counts down (less complexity)
  • functions signatures easier to maintain
  • less duplicated doc strings

@2bndy5 2bndy5 added enhancement New feature or request minor A minor version bump labels Apr 24, 2024
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Apr 24, 2024
@codecov
Copy link

codecov bot commented Apr 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (df1c01a) to head (fba342b).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main      #103    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           21        22     +1     
  Lines         1506      1648   +142     
==========================================
+ Hits          1506      1648   +142     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@2bndy5 2bndy5 force-pushed the glob-ignores branch 2 times, most recently from f637f79 to 1d32faf Compare April 24, 2024 21:38
@2bndy5 2bndy5 marked this pull request as ready for review April 24, 2024 21:50
@shenxianpeng shenxianpeng removed the documentation Improvements or additions to documentation label Apr 25, 2024
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Apr 25, 2024
@2bndy5 2bndy5 force-pushed the glob-ignores branch 3 times, most recently from 92e38c6 to d303b8d Compare April 26, 2024 00:40
Results are added accordingly to the `ignored` and `not_ignored` attributes.
"""
if paths:
for path in paths.split("|"):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have to make sure that | is not a part of the Unix glob style syntax. If it is, then we'll have to change the pattern here (|) to something that isn't part of the glob style syntax (maybe like ;|).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

2bndy5 added 3 commits April 27, 2024 10:10
fix version

remove unused import

use the file filter class instance better
- allow specifying `./` as pattern in CLI positional args
- improve memory footprint on FileFilter objects
- derive from UserDict to keep instances of Args unique
- remove obsolete test
Now, each FileObj gets its own tidy_advice and format_advice attributes.
No more passing around advice arrays and expecting to match them to a file.
@2bndy5
Copy link
Contributor Author

2bndy5 commented Apr 30, 2024

I know this one got a little out of control. One small refactor led to another and another... With the goal of cpp-linter/cpp-linter-action#233 accomplished, I'm ready to do a second round of testing and then begin merging this upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request minor A minor version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants