{"repo":"facebookincubator/fastmod","free":true,"listed":false,"github":"https://github.com/facebookincubator/fastmod","clone":"git clone https://github.com/facebookincubator/fastmod.git","description":"A fast partial replacement for the codemod tool. Assists with large-scale codebase refactors via regex-based find and replace with human oversight and occasional intervention.","language":"Rust","stars":1925,"topics":["cli","command-line","command-line-tool","find-and-replace","rust","replace"],"license":"Apache-2.0","category":"cli-tools","readme_excerpt":"fastmod fastmod is a fast partial replacement for codemod. Like codemod , it is a tool to assist you with large-scale codebase refactors, and it supports most of codemod 's options. fastmod 's major philosophical difference from codemod is that it is focused on improving the use case \"I want to use interactive mode to make sure my regex is correct, and then I want to apply the regex everywhere\". For this use case, it offers much better performance than codemod . Accordingly, fastmod does not support codemod 's --start , --end , or --count options, nor does it support anything like codemod 's Python API. Examples Let's say you're deprecating your use of the tag. From the command line, you might make progress by running: For each match of the regex, you'll be shown a colored diff and asked if you want to accept the change (the replacement of the tag with a tag), reject it, or edit the line in question in your $EDITOR of choice. NOTE: Whereas codemod uses Python regexes, fastmod uses the Rust regex crate, which supports a slightly different regex syntax and does not support look around or backreferences. In particular, use ${1} instead of \\1 to get the contents of the first capture group, and use $$ to write a literal $ in the replacement string. See the regex crate's documentation for details. A consequence of this syntax is that the use of single quotes instead of double quotes around the replacement text is important, because the bash shell itself cares about the $ character ","default_branch":null,"files":null,"tree":[],"storefront":"/r/facebookincubator","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/facebookincubator/fastmod/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}