facebookarchive / codemod

Codemod is a tool/library to assist you with large-scale codebase refactors that can be partially automated but still require human oversight and occasional intervention. Codemod was developed at Facebook and released as open source.
Apache License 2.0
4.11k stars 198 forks source link

Extension groups? #55

Open modocache opened 9 years ago

modocache commented 9 years ago

Sometimes I want to modify all instances of a particular string in an Objective-C/Swift codebase. At Facebook, that means --extensions=h,m,mm,swift,BUCK,plist.

Typing those out is a pain--instead, it might be cool to have "extension groups", or aliases for a list of extensions. For example, if we defined a group called ios, these two would be equivalent:

--extensions=h,m,mm,swift,BUCK,DEFS,plist
--extensions=ios

Since ios means different things to different teams, maybe one should be able to register their own custom groups, instead of codemod making a decision as to what ios means for everyone.

Not sure if this is a good idea, as it might just be adding a complex feature without a great need to--thoughts? :raised_hands:

ghost commented 9 years ago

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

keyan commented 8 years ago

I don't personally have a use for this feature, but I could see it being useful. Overall I think it's too much complexity for a niche use-case. Anyone else think this could be helpful?

rochacbruno commented 8 years ago

To implement that we should add ~/.codemodrc file and

[extension_groups]
ios=h,m,mm,swift,BUCK,DEFS,plist

Not a good idea to hardcode the list