Files
2025-11-30 08:45:33 +08:00

4.1 KiB

1Fully Qualified Recipe NameRecipe NameDescription
2org.openrewrite.DeleteSourceFilesDelete filesDelete files by source path.
3org.openrewrite.MoveFileMove a fileMove a file to a different directory. The file name will remain the same.
4org.openrewrite.RenameFileRename a fileRename a file while keeping it in the same directory.
5org.openrewrite.text.AppendToTextFileAppend to text fileAppends or replaces content of an existing plain text file or creates a new one if it doesn't already exist. Please note that this recipes requires existing plain text files' format to be successfully parsable by OpenRewrite. If a file is left unchanged it might be parsed as a `Quark` rather than plain text. In such case use the `plainTextMask` option. See the [Gradle](https://docs.openrewrite.org/reference/gradle-plugin-configuration#configuring-the-rewrite-dsl) or [Maven](https://openrewrite.github.io/rewrite-maven-plugin/run-mojo.html#plainTextMasks) plugin configuration page.
6org.openrewrite.text.ChangeTextChange textCompletely replaces the contents of the text file with other text. Use together with a `FindSourceFiles` precondition to limit which files are changed.
7org.openrewrite.text.CreateTextFileCreate text fileCreates a new plain text file.
8org.openrewrite.text.EndOfLineAtEndOfFileEnd of Line @ End of File (EOL @ EOF)Ensure that the file ends with the newline character. *Note*: If this recipe modifies a file it converts the file into plain text. As such this recipe should be run after any recipe that modifies the language-specific LST.
9org.openrewrite.text.FindFind textTextual search optionally using Regular Expression (regex) to query.
10org.openrewrite.text.FindAndReplaceFind and replaceTextual find and replace optionally interpreting the search query as a Regular Expression (regex). When operating on source files that are language-specific Lossless Semantic Tree such as Java or XML this operation converts the source file to plain text for the rest of the recipe run. So if you are combining this recipe with language-specific recipes in a single recipe run put all the language-specific recipes before this recipe.
11org.openrewrite.text.FindMultiselectExperimental find text with multiselectSearch for text treating all textual sources as plain text. This version of the recipe exists to experiment with multiselect recipe options.
12org.openrewrite.hcl.search.FindAndReplaceLiteralFind and replace literals in HCL filesFind and replace literal values in HCL files. This recipe parses the source files on which it runs as HCL meaning you can execute HCL language-specific recipes before and after this recipe in a single recipe run.
13org.openrewrite.text.FindHardcodedLoopbackAddressesFind hard-coded loopback IPv4 addressesLocates mentions of hard-coded IPv4 addresses from the loopback IP range. The loopback IP range includes `127.0.0.0` to `127.255.255.255`. This detects the entire localhost/loopback subnet range not just the commonly used `127.0.0.1`.
14org.openrewrite.text.FindHardcodedPrivateIPAddressesFind hard-coded private IPv4 addressesLocates mentions of hard-coded IPv4 addresses from private IP ranges. Private IP ranges include: * `192.168.0.0` to `192.168.255.255` * `10.0.0.0` to `10.255.255.255` * `172.16.0.0` to `172.31.255.255` It is not detecting the localhost subnet `127.0.0.0` to `127.255.255.255`.
15org.openrewrite.text.RemoveHardcodedIPAddressesFromCommentsRemove hard-coded IP addresses from commentsRemoves hard-coded IPv4 addresses from comments when they match private IP ranges or loopback addresses. This targets IP addresses that are commented out in various comment formats: **Private IP ranges:** * `192.168.0.0` to `192.168.255.255` * `10.0.0.0` to `10.255.255.255` * `172.16.0.0` to `172.31.255.255` **Loopback IP range:** * `127.0.0.0` to `127.255.255.255` **Supported comment formats:** * C-style line comments (`//`) * C-style block comments (`/* */`) * Shell/Python style comments (`#`) * XML comments (`<!-- -->`) * YAML comments (`#`) * Properties file comments (`#` or `!`) For line comments the entire line is removed. For block comments only the IP address is removed.