The rename_file
fix block in the grept
tool is used to rename a local file. This can be used to enforce certain file naming rules.
rule_ids
: The ID list of the rules this fix is associated with. Any rule check failure would trigger this fix.old_name
: The current name of the file to be renamed.new_name
: The new name for the file.
The rename_file
fix block does not export any attributes.
Here's an example of how to use the rename_file
fix block in your configuration file:
fix "rename_file" "example" {
rule_ids = ["example_rule"]
old_name = "/path/to/old_file"
new_name = "/path/to/new_file"
}
This will rename the file at /path/to/old_file
to /path/to/new_file
if the rule with ID example_rule
fails.