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

Ignore binary files automatically #109

Open raviqqe opened 5 years ago

raviqqe commented 5 years ago

Is it possible to add an option to ignore binary files automatically rather than exiting?

For example,

codemod --ignore-binary foo bar

Currently, the only way to avoid stopping replacement at binary files is to specify all file extensions known to be text files although it's a kind of tedious. For example, I often do this:

codemod --extension ts,md,js,tsx,jsx,txt,json foo bar

This feature might be related to #105.

fabiomcosta commented 4 years ago

I THINK this commit fixes this issue for python3, but I'm not sure if there has been a new release after that: https://github.com/facebook/codemod/commit/d9f2c24747e1f9cb8d608ef0fcd8afe8063cc870