This allows using configurable strings in fixits, such as user name or
email in TODO() comments in certain styles.
Details
- Reviewers
bkramer
Diff Detail
Event Timeline
I am not 100% sure the additional code and maintenance costs here pay for the added benefit. Some random thoughts:
- Simply replacing predefined variables is powerful in some ways, but might be insufficient for other configurations things we might want to do. Maybe we should instead consider adapting the system that creates/formats Clang's diagnostics.
- Added the right username in a TODO comment seems to be a really special case. First, it seems the only thing I can come up with that cannot be easily determine when the actual check is executed. Second, the value of adding the right user name (or of this check having an automated fix at all) seems relatively small.
I'd like to think some more (and maybe get additional impact), before going forward with this patch as implemented.
My expectation would have been to add the user name to the config, and have a method to get the user name accessible from checks; if somebody then wants to insert a unique token for the username (such as <<<USERNAME>>>) and resolve that later, that's fine - and it can be resolved by the outer layer (which needs to exist anyway in that case) running sed over the changed files.
We probably don't need this solution until we have at least one more use case for the delayed substitution. I've sent an alternative patch: D5440.