Skip to content
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

Allow specifiying relative paths in the --file option without * #4180

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

vodorok
Copy link
Collaborator

@vodorok vodorok commented Mar 4, 2024

With this modification, the --file option would allow passing paths with folder prefixes.

Consider a compilation json that contains a . in the directory fields, with the following example directory layout:

.                            
├── compile_commnands.json
├── include                                
│   └── lib.h                    
├── lib                                                                               
│   └── lib.cpp                                                                       
├── Makefile                                                                          
└── src                                                                               
    ├── a.cpp            
    └── b.cpp  

Before this patch, you could only specify path to source files with the --file option, that were not absolute is to add a * before the directory name.
CodeChecker analyze ./compile_commnands.json -o ./reports --file "*src/b.cpp"

After this patch the following two methods will also work:
CodeChecker analyze ./compile_commnands.json -o ./reports --file "./src/b.cpp"
CodeChecker analyze ./compile_commnands.json -o ./reports --file "src/b.cpp"

TBD.:

  • Documentation changes

@vodorok vodorok requested a review from bruntib as a code owner March 4, 2024 14:33
@vodorok vodorok marked this pull request as draft March 4, 2024 14:34
@vodorok vodorok force-pushed the skipfix_match_anywhere branch 5 times, most recently from 96d53e5 to 76e016b Compare March 14, 2024 15:48
@vodorok vodorok force-pushed the skipfix_match_anywhere branch 4 times, most recently from 031e7c6 to f20e8b0 Compare March 18, 2024 14:41
@vodorok vodorok changed the title Regex match skip entries anywhere along the path Allow specifiying relative paths in the --file option without * Mar 19, 2024
@whisperity whisperity added this to the release 6.24.0 milestone Mar 21, 2024
@whisperity whisperity changed the title Allow specifiying relative paths in the --file option without * Allow specifiying relative paths in the --file option without * Mar 21, 2024
@whisperity whisperity added enhancement 🌟 analyzer 📈 Related to the analyze commands (analysis driver) labels Mar 21, 2024
@vodorok vodorok force-pushed the skipfix_match_anywhere branch 7 times, most recently from 533a5e2 to 5b44100 Compare April 9, 2024 11:36
Under the hood the pathlib module is used

Also added a bunch of test cases to test the new logic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer 📈 Related to the analyze commands (analysis driver) enhancement 🌟
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants