Author |
Topic |
|
GerdH
New Member
USA
7 Posts |
Posted - Mar 12 2018 : 1:25:38 PM
|
We really like your new Code Inspection feature (Modern C++ refactoring).
I'd like to apply some of the Code Inspection Results to our entire code base. Have you thought about allowing me to apply all the code inspection results to the current file, project or even solution?
At the file level you could allow me to multi-select in your "VA Code Inspection Results" dialog and RMB: "Apply All Quick Fixes". |
____ Gerd
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Mar 12 2018 : 1:50:12 PM
|
You can apply code fixes to everything in a file. Just use ctrl+click to select individual items, or shift+click to select a range of items or you can press ctrl+a to select all and then apply the fix to them by selecting "Apply quick fixes" in the context menu.
Regarding expanding the search to project / solution, we are considering to do that at some point:
case=104537 |
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Mar 12 2018 : 1:54:34 PM
|
I've also put in a feature request to put a "Select All" to the context menu to help discoverability:
case=115029 |
|
|
GerdH
New Member
USA
7 Posts |
Posted - Mar 13 2018 : 1:44:25 PM
|
Thank you. Grouping by "Code Inspection" and multi-selecting works well for the current file. (For some reason, Shift+Select didn't work yesterday, but it's working fine now.) |
____ Gerd
|
|
|
pwc
Tomato Guru
138 Posts |
Posted - Mar 14 2018 : 6:00:00 PM
|
A big +1 on supporting CI on projects and the solution. I would probably tend to choose to run a single rule, e.g. 'use range-based for loops', on the whole solution and have them auto-fixed. Then I could review the diffs before committing. |
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Mar 14 2018 : 8:19:35 PM
|
I've added your vote to the case. |
|
|
sean
Whole Tomato Software
USA
2817 Posts |
Posted - May 12 2020 : 7:07:37 PM
|
case=115029 (an Apply All Fixes command) was implemented in build 2353 last November. |
Edited by - sean on May 12 2020 7:08:38 PM |
|
|
GerdH
New Member
USA
7 Posts |
Posted - May 13 2020 : 5:49:46 PM
|
Is implementing Code Inspection for all files in a Project still on your list? It would be a HUGE help for our C++ modernization efforts.
|
____ Gerd
|
|
|
feline
Whole Tomato Software
United Kingdom
19063 Posts |
Posted - May 14 2020 : 11:56:12 AM
|
Yes, we are still looking into this, and hoping to add this feature sooner rather than later. But we need to decide how best to implement this, and present the information for you to consider it before doing a mass modify
case=104537 |
zen is the art of being at one with the two'ness |
|
|
GerdH
New Member
USA
7 Posts |
Posted - May 14 2020 : 1:04:07 PM
|
An expanded version of your "VA Code Inspection Results" dialog would be great.
We're currently using ClangPowerTools for code modernization. It just displays the changes in the VS Output window. That's not great, but let's us do an entire project. (We're doing dozens of modernizations on over 600 project files.) |
____ Gerd
|
|
|
feline
Whole Tomato Software
United Kingdom
19063 Posts |
Posted - May 15 2020 : 08:38:34 AM
|
That is a lot of modernizations! One thought, make sure your code compiles before running the checks. It is rare, but it is possible to get "invalid" corrections from Clang for code that does not compile. |
zen is the art of being at one with the two'ness |
|
|
GerdH
New Member
USA
7 Posts |
Posted - May 15 2020 : 12:12:11 PM
|
Unfortunately, a lot of Windows stuff doesn't build with Clang (like COM type libraries). So, we're seeing some incorrect "corrections" and have to manually validate each change. We don't see these issues with VAX -- that's why I keep hoping you'll implement this feature. Also, your 'range-based for' and 'using' modernizations work much better than the standard Clang-tidy ones. |
____ Gerd
|
|
|
feline
Whole Tomato Software
United Kingdom
19063 Posts |
Posted - May 15 2020 : 12:52:38 PM
|
Interesting, I know we based our Code Inspection on Clang, but I didn't know how much we did to improve things for Windows. Good to know that this is helping and working well.
Running the scan more widely is still something we are looking at, but we want to make sure that the Code Inspections we have are robust and reliable before doing to much on this front. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|