|
19 | 19 | import os
|
20 | 20 | import shutil
|
21 | 21 | from collections import Counter
|
22 |
| -from os.path import dirname, isfile |
23 | 22 | from time import time
|
24 | 23 |
|
25 | 24 | import click
|
@@ -77,7 +76,7 @@ def cli( # pylint: disable=too-many-positional-arguments
|
77 | 76 | app.set_session_var("custom_project_conf", project_conf)
|
78 | 77 |
|
79 | 78 | # find project directory on upper level
|
80 |
| - if isfile(project_dir): |
| 79 | + if os.path.isfile(project_dir): |
81 | 80 | project_dir = find_project_dir_above(project_dir)
|
82 | 81 |
|
83 | 82 | results = []
|
@@ -150,7 +149,7 @@ def cli( # pylint: disable=too-many-positional-arguments
|
150 | 149 | print_processing_header(tool, envname, env_dump)
|
151 | 150 |
|
152 | 151 | ct = CheckToolFactory.new(
|
153 |
| - tool, project_dir, config, envname, tool_options |
| 152 | + tool, os.getcwd(), config, envname, tool_options |
154 | 153 | )
|
155 | 154 |
|
156 | 155 | result = {"env": envname, "tool": tool, "duration": time()}
|
@@ -250,12 +249,12 @@ def _append_defect(component, defect):
|
250 | 249 | components[component].update({DefectItem.SEVERITY_LABELS[defect.severity]: 1})
|
251 | 250 |
|
252 | 251 | for defect in result.get("defects", []):
|
253 |
| - component = dirname(defect.file) or defect.file |
| 252 | + component = os.path.dirname(defect.file) or defect.file |
254 | 253 | _append_defect(component, defect)
|
255 | 254 |
|
256 | 255 | if component.lower().startswith(get_project_dir().lower()):
|
257 | 256 | while os.sep in component:
|
258 |
| - component = dirname(component) |
| 257 | + component = os.path.dirname(component) |
259 | 258 | _append_defect(component, defect)
|
260 | 259 |
|
261 | 260 | return components
|
|
0 commit comments