Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Prabhu Subramanian committed Jul 9, 2020
1 parent 49f1ff2 commit c889b56
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
4 changes: 3 additions & 1 deletion lib/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ def kotlin_build(src, reports_dir, lang_tools):
return android_build(src, reports_dir, lang_tools)
if gradle_kts_files:
cmd_args = get_gradle_cmd(src, lang_tools.get("gradle"))
cp = exec_tool("auto-build", cmd_args, src, env=env, stdout=subprocess.PIPE)
cp = exec_tool(
"auto-build", cmd_args, src, env=get_env(), stdout=subprocess.PIPE
)
if cp:
LOG.debug(cp.stdout)
return cp.returncode == 0
Expand Down
3 changes: 1 addition & 2 deletions lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import json
import os
import sys
from pathlib import Path

runtimeValues = {}

Expand Down Expand Up @@ -543,7 +542,7 @@ def set(configName, value):
"gradle": [get("GRADLE_CMD"), "compileJava"],
"sbt": ["sbt", "compile"],
},
"android": {"gradle": [get("GRADLE_CMD"), "compileDebugSources"],},
"android": {"gradle": [get("GRADLE_CMD"), "compileDebugSources"]},
"kotlin": {
"maven": [get("MVN_CMD"), "compile"],
"gradle": [get("GRADLE_CMD"), "build"],
Expand Down
1 change: 0 additions & 1 deletion lib/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def convert_dataflow(working_dir, tool_args, dataflows):
return None
file_name_prefix = ""
location_list = []
is_ts = "--ts" in tool_args
for flow in dataflows:
fn = flow["location"].get("fileName")
if not fn or fn == "N/A":
Expand Down
4 changes: 2 additions & 2 deletions lib/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def should_convert(convert, tool_name, command, report_fname):
"""
if (
convert
and not "init" in tool_name
and "init" not in tool_name
and (
config.tool_purpose_message.get(command)
or "audit" in tool_name
Expand Down Expand Up @@ -194,7 +194,7 @@ def execute_default_cmd(
stdout = None
if LOG.isEnabledFor(DEBUG):
stdout = None
if reports_dir and not report_fname_prefix in default_cmd:
if reports_dir and report_fname_prefix not in default_cmd:
report_fname = report_fname_prefix + outext
stdout = io.open(report_fname, "w")
LOG.debug("Output will be written to {}".format(report_fname))
Expand Down
4 changes: 0 additions & 4 deletions test/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,10 +923,6 @@ def test_phptaint_extract_issue():
with tempfile.NamedTemporaryFile(mode="w", encoding="utf-8", delete=True) as cfile:
data = convertLib.report("taint-php", [], ".", {}, {}, issues, cfile.name,)
jsondata = json.loads(data)
assert (
jsondata["runs"][0]["results"][0]["message"]["text"]
== "Detected tainted shell: call to App\Request::__construct\\nApp\Request::__construct#1\\nApp\Request::$rawValues\\nApp\Request::$rawValues\\n$this->rawValues[$key]\\ncall to App\Purifier::purifyByType\\nApp\Purifier::purifyByType#1\\n$value\\nApp\Purifier::purifyByType\\nApp\Request::getByType\\n$moduleName\\nApp\Request::getModule\\ncall to App\ConfigFile::__construct\\nApp\ConfigFile::__construct#2\\nconcat\\nconcat\\nApp\ConfigFile::$path\\nApp\ConfigFile::$path\\ncall to file_put_contents."
)
assert jsondata["runs"][0]["properties"]["metrics"] == {
"critical": 130,
"total": 130,
Expand Down

0 comments on commit c889b56

Please sign in to comment.