@codacy/tools-bandit-1 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +26 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -775,7 +775,20 @@ var adapter = {
775
775
  async checkAvailability(ctx) {
776
776
  ctx.logger.debug("Checking availability", { toolId: TOOL_ID });
777
777
  const pythonInfo = await (0, import_tooling.findPython)(PYTHON_VERSION_RANGE, ctx.logger).catch(() => null);
778
- const dependencies = pythonInfo ? [{ name: "Python", available: true, version: pythonInfo.version, installation: "global" }] : [{ name: "Python", available: false, reason: `Python 3 (${PYTHON_VERSION_RANGE}) not found` }];
778
+ const dependencies = pythonInfo ? [
779
+ {
780
+ name: "Python",
781
+ available: true,
782
+ version: pythonInfo.version,
783
+ installation: "global"
784
+ }
785
+ ] : [
786
+ {
787
+ name: "Python",
788
+ available: false,
789
+ reason: `Python 3 (${PYTHON_VERSION_RANGE}) not found`
790
+ }
791
+ ];
779
792
  const venvDir = (0, import_tooling.getVenvDir)(ctx.globalDir, ADAPTER_ID);
780
793
  try {
781
794
  const venvPython = import_path.default.join(venvDir, "bin", "python");
@@ -786,7 +799,13 @@ var adapter = {
786
799
  python: venvPython,
787
800
  pip: import_path.default.join(venvDir, "bin", "pip")
788
801
  };
789
- const version = await (0, import_tooling.checkVenvTool)(venv, "bandit", "--version", /bandit\s+(\S+)/, ctx.logger);
802
+ const version = await (0, import_tooling.checkVenvTool)(
803
+ venv,
804
+ "bandit",
805
+ "--version",
806
+ /bandit\s+(\S+)/,
807
+ ctx.logger
808
+ );
790
809
  if (version) {
791
810
  ctx.logger.debug("Found bandit in codacy venv", { toolId: TOOL_ID, version });
792
811
  return {
@@ -854,7 +873,11 @@ var adapter = {
854
873
  await (0, import_tooling.pipInstall)(venv, PIP_PACKAGES, ctx.logger);
855
874
  const banditPath = (0, import_tooling.resolveVenvBinary)(venv, "bandit");
856
875
  ctx.logger.info(`Installed bandit to ${banditPath}`);
857
- return { success: true, installedPath: banditPath, installedVersion: adapter.preferredVersion };
876
+ return {
877
+ success: true,
878
+ installedPath: banditPath,
879
+ installedVersion: adapter.preferredVersion
880
+ };
858
881
  } catch (err) {
859
882
  return {
860
883
  success: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/tools-bandit-1",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Bandit adapter — CLI-mode Python security linter",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,7 +8,7 @@
8
8
  "dist"
9
9
  ],
10
10
  "dependencies": {
11
- "@codacy/tooling": "0.1.0"
11
+ "@codacy/tooling": "0.2.0"
12
12
  },
13
13
  "license": "MIT",
14
14
  "author": "Codacy <support@codacy.com> (https://www.codacy.com)",