Skip to content

Commit

Permalink
Address code review comments from #12110
Browse files Browse the repository at this point in the history
  • Loading branch information
Mab879 committed Jul 8, 2024
1 parent 5d14c90 commit d8274c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions docs/manual/developer/05_tools_and_utilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -746,21 +746,21 @@ $ ./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.
This script will output rules are not in any data streams.
To prevent false positives the script will not run if the number of build datas treams 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.
This script works by comparing rules in the data streams 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 set of rules in the data stream is subtracted to from the set of rules in `rule_dirs.json`.
The differnce is then output to the user.
Example useage:
```bash
$ ./build_project --derivatives
$ ./build_products --derivatives
$ ./utils/rule_dir_json.py
$ ./utils/find_unused_rules.py
```
2 changes: 1 addition & 1 deletion utils/find_unused_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def main() -> int:
if not disuse_rules:
print("All rules are used in the datastream files.")
return 0
print("The following rules are not used in ANY of the provided the datastream files:")
print("The following rules are not used in ANY of the provided data stream files:")
print("\n".join(disuse_rules))
return 1

Expand Down

0 comments on commit d8274c9

Please sign in to comment.