Skip to content

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

Closed
vodorok wants to merge 3 commits into
Ericsson:masterfrom
vodorok:skipfix_match_anywhere
Closed

Allow specifiying relative paths in the --file option without *#4180
vodorok wants to merge 3 commits into
Ericsson:masterfrom
vodorok:skipfix_match_anywhere

Conversation

@vodorok
Copy link
Copy Markdown
Contributor

@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.
@vodorok vodorok force-pushed the skipfix_match_anywhere branch from 5b44100 to 7add70a Compare April 9, 2024 11:39
@dkrupp
Copy link
Copy Markdown
Member

dkrupp commented Jun 13, 2024

Implemented by #4250

@dkrupp dkrupp closed this Jun 13, 2024
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.

3 participants