This is an archive of the discontinued LLVM Phabricator instance.

Implement substitutions of placeholders in the replacement text of the fixits.
AbandonedPublic

Authored by alexfh on Sep 19 2014, 4:04 AM.

Details

Reviewers
bkramer
Summary

This allows using configurable strings in fixits, such as user name or
email in TODO() comments in certain styles.

Diff Detail

Event Timeline

alexfh updated this revision to Diff 13860.Sep 19 2014, 4:04 AM
alexfh retitled this revision from to Implement substitutions of placeholders in the replacement text of the fixits..
alexfh updated this object.
alexfh edited the test plan for this revision. (Show Details)
alexfh added reviewers: djasper, bkramer.
alexfh added a subscriber: Unknown Object (MLST).
djasper edited edge metadata.Sep 19 2014, 5:02 AM

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.

klimek added a subscriber: klimek.Sep 22 2014, 7:23 AM

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.

djasper resigned from this revision.Apr 12 2015, 1:21 AM
djasper removed a reviewer: djasper.
alexfh abandoned this revision.Apr 4 2016, 6:39 AM