Skip to content

Commit

Permalink
Make indepenent of the current working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
rvermeulen committed Sep 18, 2023
1 parent b291a44 commit be3076d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 0 additions & 3 deletions scripts/release/create_supported_rules_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
When run without any arguments, the script iterates through each of the rule package description
files stored in the `rule_packages` directory, and identifies which rules are supported by one or
more queries.
This script needs to be run with the codeql-coding-standards git repository as the current working
directory.
"""

if (len(sys.argv) == 2 and sys.argv[1] == "--help"):
Expand Down
5 changes: 4 additions & 1 deletion scripts/release/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import re
import yaml
from pathlib import Path

def get_query_short_names(rule_dict):
"""Gets a list of the query "short_name" properties for the given rule"""
Expand All @@ -18,7 +19,9 @@ def split_rule_id(rule_id):

def get_standard_version(standard):
"""Gets the qlpack version for the given standard."""
qlpack_path = "cpp/" + standard.split("-")[0].lower() + "/src/qlpack.yml"
module_path = Path(__file__)
repo_root = module_path.parent.parent.parent
qlpack_path = repo_root / "cpp" / standard.split("-")[0].lower() /"src" / "qlpack.yml"
with open(qlpack_path, 'r') as qlpack_file:
try:
qlpack = yaml.safe_load(qlpack_file)
Expand Down

0 comments on commit be3076d

Please sign in to comment.