diff --git a/docs/manual/developer/05_tools_and_utilities.md b/docs/manual/developer/05_tools_and_utilities.md index 7c6817b7594..a2512612a25 100644 --- a/docs/manual/developer/05_tools_and_utilities.md +++ b/docs/manual/developer/05_tools_and_utilities.md @@ -743,3 +743,24 @@ An example of how to execute the script to generate roles locally: $ ./build_product rhel9 $ ./utils/ansible_playbook_to_role.py --dry-run output ``` + +### `utils/find_unused_rules.py` – List Rules That Are Not Used In Any Datastream + +This script will output rules are not in any datastreams. +To prevent false positives the script will not run if the number of build datastreams less than the total number of products in the project. +The script assumes that `./build_project --derivatives` will be ran before the script is used. +This script does require that `./utils/rule_dir_json.py` be run before this script is used as well. + +This script works by comparing rules in the datastreams to the rules in the `rule_dirs.json` file. +The script works by adding off the rule ids from the data streams to a `set`. +Then the script converts the keys of `rule_dirs.json` to a set. +The set of rules in the data stream is subtraced to from the set of rules in `rule_dirs.json`. +The differnce is then output to the user. + +Example useage: + +```bash +$ ./build_project --derivatives +$ ./utils/rule_dir_json.py +$ ./utils/find_unused_rules.py +```