Codemod是一个工具/库,它可以帮你处理那些只有部分自动化功能,部分场合还需人工干预的大规模代码库。示例代码:
-m Have regex work over multiple lies (e.g. have dot match ewlies). By default, codemod applies the regex oe lie at a time.-d The path whose acestor files are to be explored. Defaults to curret dir.--start A path:lie_umber-formatted positio somewhere i the hierarchy from which to beig explorig, or a percetage (e.g. "--start 25%") of the way through to start. Useful if you're divvyig up the substitutio task across multiple people.--ed A path:lie_umber-formatted positio somewhere i the hierarchy just *before* which we should stop explorig, or a percetage of the way through, just before which to ed.--extesios A comma-delimited list of file extesios to process.--iclude-extesioless If set, this will check files without a extesio, alog with ay matchig file extesios passed i --extesios--accept-all Automatically accept all chages (use with cautio)--editor Specify a editor, e.g. "vim" or "emacs". If omitted, defaults to $EDITOR eviromet variable.--cout Do't ru ormally. Istead, just prit out umber of times places i the codebase where the 'query' matches.--test Do't ru ormally. Istead, just ru the uit tests embedded i the codemod library.点击空白处退出提示










评论