hrzndhrn / recode

A linter with autocorrection and a refactoring tool.
MIT License
283 stars 15 forks source link

Feature: Operate on a subset of files #30

Closed tensiondriven closed 1 year ago

tensiondriven commented 1 year ago

I have a situation where i am merging a large branch into a large project, and i need to use Recode to clean up the branch being merged.

Currently, if i run Recode I'll get hundreds of files changed, where I only want to operate on about a dozen.

Let's say Recode will affect 400 files in the project, and the branch changes 10 files.

I can run recode on the branch, resulting in 400 changed files, and then somehow manually pick/stash the 10 files i need, then reset the branch and copy the recode-ed files over the 10 that will be merged, but this is a manual process.

If I could pass a list of files or file glob to Recode, that would allow me to run recode on a subset of files.

tensiondriven commented 1 year ago

I see that this can be configured in .recode.exs, this is great! I'll use this for now. Perhaps being able to override the inputs parameter on the command line would be an easy future addition

NickNeck commented 1 year ago

Good point, I will include that in one of the next versions.

NickNeck commented 1 year ago

Perhaps being able to override the inputs parameter on the command line would be an easy future addition

That is already implemented. You can call mix recode "lib/my_app/**/*.ex".