Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:45:33 +08:00
commit 480d09eec9
27 changed files with 8336 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
Fully Qualified Recipe Name,Recipe Name,Description
org.openrewrite.DeleteSourceFiles,Delete files,Delete files by source path.
org.openrewrite.MoveFile,Move a file,Move a file to a different directory. The file name will remain the same.
org.openrewrite.RenameFile,Rename a file,Rename a file while keeping it in the same directory.
org.openrewrite.text.AppendToTextFile,Append to text file,Appends 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.
org.openrewrite.text.ChangeText,Change text,Completely replaces the contents of the text file with other text. Use together with a `FindSourceFiles` precondition to limit which files are changed.
org.openrewrite.text.CreateTextFile,Create text file,Creates a new plain text file.
org.openrewrite.text.EndOfLineAtEndOfFile,End 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.
org.openrewrite.text.Find,Find text,Textual search optionally using Regular Expression (regex) to query.
org.openrewrite.text.FindAndReplace,Find and replace,Textual 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.
org.openrewrite.text.FindMultiselect,Experimental find text with multiselect,Search for text treating all textual sources as plain text. This version of the recipe exists to experiment with multiselect recipe options.
org.openrewrite.hcl.search.FindAndReplaceLiteral,Find and replace literals in HCL files,Find 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.
org.openrewrite.text.FindHardcodedLoopbackAddresses,Find hard-coded loopback IPv4 addresses,Locates 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`.
org.openrewrite.text.FindHardcodedPrivateIPAddresses,Find hard-coded private IPv4 addresses,Locates 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`.
org.openrewrite.text.RemoveHardcodedIPAddressesFromComments,Remove hard-coded IP addresses from comments,Removes 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.
1 Fully Qualified Recipe Name Recipe Name Description
2 org.openrewrite.DeleteSourceFiles Delete files Delete files by source path.
3 org.openrewrite.MoveFile Move a file Move a file to a different directory. The file name will remain the same.
4 org.openrewrite.RenameFile Rename a file Rename a file while keeping it in the same directory.
5 org.openrewrite.text.AppendToTextFile Append to text file Appends 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.
6 org.openrewrite.text.ChangeText Change text Completely replaces the contents of the text file with other text. Use together with a `FindSourceFiles` precondition to limit which files are changed.
7 org.openrewrite.text.CreateTextFile Create text file Creates a new plain text file.
8 org.openrewrite.text.EndOfLineAtEndOfFile End 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.
9 org.openrewrite.text.Find Find text Textual search optionally using Regular Expression (regex) to query.
10 org.openrewrite.text.FindAndReplace Find and replace Textual 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.
11 org.openrewrite.text.FindMultiselect Experimental find text with multiselect Search for text treating all textual sources as plain text. This version of the recipe exists to experiment with multiselect recipe options.
12 org.openrewrite.hcl.search.FindAndReplaceLiteral Find and replace literals in HCL files Find 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.
13 org.openrewrite.text.FindHardcodedLoopbackAddresses Find hard-coded loopback IPv4 addresses Locates 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`.
14 org.openrewrite.text.FindHardcodedPrivateIPAddresses Find hard-coded private IPv4 addresses Locates 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`.
15 org.openrewrite.text.RemoveHardcodedIPAddressesFromComments Remove hard-coded IP addresses from comments Removes 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.