Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Commit

Permalink
fix export
Browse files Browse the repository at this point in the history
  • Loading branch information
juli1 committed Mar 29, 2023
1 parent b1d733a commit f860c8e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions codiga/export_ruleset.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ def main(argv=None):
if not ruleset_names:
log.info('Please specify a ruleset name (or multiple separated by a comma)!')
sys.exit(1)

rules = []
for ruleset_name in ruleset_names.split(","):
ruleset = graphql_get_ruleset(api_token, ruleset_name)
if ruleset is None:
continue
rules = []

for r in ruleset['rules']:
new_object = {
"name": f"{ruleset_name}/{r['name']}",
Expand Down
10 changes: 9 additions & 1 deletion codiga/rosie/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import logging
import os
import time

import requests
import requests.exceptions
from typing import List
Expand Down Expand Up @@ -35,9 +37,15 @@ def analyze_rosie(filename: str, language: str, file_encoding: str,
"fileEncoding": file_encoding,
"codeBase64": code_base64,
"rules": list(map(lambda x: x.to_json(), rules)),
"logOutput": False
"logOutput": False,
"options": {
"useTreeSitter": True,
"logOutput": False
}
}
start_ts = time.time()
response = requests.post(server_url, json=payload, headers={'Content-type': 'application/json'}, timeout=10)
stop_ts = time.time()
try:
response_json = response.json()
for rule_response in response_json['ruleResponses']:
Expand Down

0 comments on commit f860c8e

Please sign in to comment.