File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212When run without any arguments, the script iterates through each of the rule package description
1313files stored in the `rule_packages` directory, and identifies which rules are supported by one or
1414more queries.
15-
16- This script needs to be run with the codeql-coding-standards git repository as the current working
17- directory.
1815"""
1916
2017if (len (sys .argv ) == 2 and sys .argv [1 ] == "--help" ):
Original file line number Diff line number Diff line change 11import re
22import yaml
3+ from pathlib import Path
34
45def get_query_short_names (rule_dict ):
56 """Gets a list of the query "short_name" properties for the given rule"""
@@ -18,7 +19,9 @@ def split_rule_id(rule_id):
1819
1920def get_standard_version (standard ):
2021 """Gets the qlpack version for the given standard."""
21- qlpack_path = "cpp/" + standard .split ("-" )[0 ].lower () + "/src/qlpack.yml"
22+ module_path = Path (__file__ )
23+ repo_root = module_path .parent .parent .parent
24+ qlpack_path = repo_root / "cpp" / standard .split ("-" )[0 ].lower () / "src" / "qlpack.yml"
2225 with open (qlpack_path , 'r' ) as qlpack_file :
2326 try :
2427 qlpack = yaml .safe_load (qlpack_file )
You can’t perform that action at this time.
0 commit comments