Removes custom rules from the registry of available rules. Use the -p|--path parameter to specify one or more paths to remove. If you don’t specify any parameters, the command lists all valid custom paths but doesn’t remove any.
Examples
Review these examples for some ideas on how to run scanner rule remove.
Registered Custom Paths
This example runs the command without arguments to see a list of registered custom paths.
1$ sf scanner rule remove
Deregister Rules
This example uses the --path parameter to deregister the rules defined in somerules.jar and myrules.xml, and all JARs/XMLs contained in the rules folder.
1$ sf scanner rule remove --path "~/path/to/somerules.jar,~/path/to/category/apex/myrules.xml,~/path/to/folder/containing/rules"
Replace this value:
~/path/to/somerules.jar,~/path/to/category/apex/myrules.xml,~/path/to/folder/containing/rule: One or more paths to remove.
Remove All Rules
This example uses the --force flag to bypass the confirmation prompt, removing all rules defined in somerules.jar. By default, a list of all the rules that are deregistered is displayed, and the action must be confirmed. To bypass that confirmation, use the --force flag.
1$ sf scanner rule remove --force --path ~/path/to/somerules.jar
Replace this value:
~/path/to/somerules.jar: One or more paths to remove.
Usage
sf scanner rule remove
[-f]
[-p PATH_LIST]
[--json]
[--verbose]
Flags
-f|--force
Optional
Bypasses the confirmation prompt and immediately removes the rules.
Type: boolean
-p|--path PATH_LIST
Optional
One or more paths to remove. Specify multiple values with a comma-separated list.
Type: option
--json
Optional
Format output as JSON.
Type: boolean
--verbose
Optional
Emit additional command output to stdout.
Type: boolean
Retired
As of August 2025, Salesforce Code Analyzer v4 is retired and no longer supported. Use Code Analyzer v5 instead.