Remove hard-coded IP addresses from comments
ProprietaryRemoves 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.0to192.168.255.25510.0.0.0to10.255.255.255172.16.0.0to172.31.255.255
Loopback IP range:
127.0.0.0to127.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.
org. openrewrite. text. RemoveHardcodedIPAddressesFromCommentsOptional
If specified, replaces hard-coded IP addresses with this value. Default is 'IP_ADDRESS_REPLACED'
mod run . --recipe= org. openrewrite. text. RemoveHardcodedIPAddressesFromCommentsInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.