3 ms·
One that I've found pretty helpful is comby: https://comby.dev/ https://comby.dev/ It's a code-syntax aware large-scale search-and-replace tool. E.g., com
by yawaramin 4y ago
One that I've found pretty helpful is comby: https://comby.dev/ https://comby.dev/
It's a code-syntax aware large-scale search-and-replace tool. E.g.,
comby -matcher .scala -review 'foo(:[x], :[y])' 'foo(:[x])'
This will search in the current directory tree for all files that contain the code pattern 'foo(x, y)' and replace it with 'foo(x)', using Scala syntax rules. It's super convenient for doing large-scale codemods. E.g. https://github.com/tinymce/rescript-webapi/pull/40 https://github.com/tinymce/rescript-webapi/pull/40