Skip to content

Commit 1705989

Browse files
committed
chore: remove unnecessary get_dep_analyzer overrides
Signed-off-by: behnazh-w <[email protected]>
1 parent d1eb0fb commit 1705989

File tree

7 files changed

+0
-98
lines changed

7 files changed

+0
-98
lines changed

scripts/release_scripts/run_macaron.sh

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -486,20 +486,6 @@ else
486486
argv_command+=("--local-maven-repo" "${MACARON_WORKSPACE}/analyze_local_maven_repo_readonly")
487487

488488
mount_dir_ro "--local-maven-repo" "$HOME/.m2" "$local_maven_repo_in_container"
489-
# If the host's $HOME/.m2 doesn't exist, we create and mount an empty directory ${output}/analyze_local_maven_repo_readonly
490-
# into ${MACARON_WORKSPACE}/analyze_local_maven_repo_readonly. And then provide
491-
# ${MACARON_WORKSPACE}/analyze_local_maven_repo_readonly into the --local-maven-repo
492-
# flag.
493-
# This is because:
494-
# - By default if --local-maven-repo is not used, Macaron uses $HOME/.m2 of the current
495-
# environment as the local maven repo.
496-
else
497-
local_maven_repo_in_container="${MACARON_WORKSPACE}/analyze_local_maven_repo_readonly"
498-
output_local_maven_repo="${output}/analyze_local_maven_repo_readonly"
499-
mkdir -p "$output_local_maven_repo"
500-
argv_command+=("--local-maven-repo" "${MACARON_WORKSPACE}/analyze_local_maven_repo_readonly")
501-
502-
mount_dir_ro "--local-maven-repo" "$output_local_maven_repo" "$local_maven_repo_in_container"
503489
fi
504490
fi
505491
fi

src/macaron/slsa_analyzer/build_tool/docker.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"""
88

99
from macaron.config.defaults import defaults
10-
from macaron.dependency_analyzer.cyclonedx import NoneDependencyAnalyzer
1110
from macaron.slsa_analyzer.build_tool.base_build_tool import BaseBuildTool, file_exists
1211
from macaron.slsa_analyzer.build_tool.language import BuildLanguage
1312

@@ -45,19 +44,3 @@ def is_detected(self, repo_path: str) -> bool:
4544
True if this build tool is detected, else False.
4645
"""
4746
return any(file_exists(repo_path, file) for file in self.build_configs)
48-
49-
def get_dep_analyzer(self) -> NoneDependencyAnalyzer:
50-
"""Create a DependencyAnalyzer for the Docker build tool. Currently unimplemented.
51-
52-
Returns
53-
-------
54-
NoneDependencyAnalyser
55-
The NoneDependencyAnalyser object.
56-
57-
Raises
58-
------
59-
DependencyAnalyzerError
60-
"""
61-
# TODO: Find a suitable tool to analyse dependencies; as of now Syft
62-
# seems to be a good option, but need to experiment.
63-
return NoneDependencyAnalyzer()

src/macaron/slsa_analyzer/build_tool/go.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"""
88

99
from macaron.config.defaults import defaults
10-
from macaron.dependency_analyzer.cyclonedx import DependencyAnalyzer, NoneDependencyAnalyzer
1110
from macaron.slsa_analyzer.build_tool.base_build_tool import BaseBuildTool, file_exists
1211
from macaron.slsa_analyzer.build_tool.language import BuildLanguage
1312

@@ -45,14 +44,3 @@ def is_detected(self, repo_path: str) -> bool:
4544
"""
4645
go_config_files = self.build_configs + self.entry_conf
4746
return any(file_exists(repo_path, file) for file in go_config_files)
48-
49-
def get_dep_analyzer(self) -> DependencyAnalyzer:
50-
"""Create a DependencyAnalyzer for the build tool.
51-
52-
Returns
53-
-------
54-
DependencyAnalyzer
55-
The DependencyAnalyzer object.
56-
"""
57-
# TODO: Implement this method.
58-
return NoneDependencyAnalyzer()

src/macaron/slsa_analyzer/build_tool/gradle.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import subprocess # nosec B404
1111

1212
from macaron.config.defaults import defaults
13-
from macaron.dependency_analyzer.cyclonedx import DependencyAnalyzer, NoneDependencyAnalyzer
1413
from macaron.slsa_analyzer.build_tool.base_build_tool import BaseBuildTool, file_exists
1514
from macaron.slsa_analyzer.build_tool.language import BuildLanguage
1615

@@ -70,20 +69,6 @@ def is_detected(self, repo_path: str) -> bool:
7069
gradle_config_files = self.build_configs + self.entry_conf
7170
return any(file_exists(repo_path, file) for file in gradle_config_files)
7271

73-
def get_dep_analyzer(self) -> DependencyAnalyzer:
74-
"""Create a DependencyAnalyzer for the Gradle build tool.
75-
76-
Returns
77-
-------
78-
DependencyAnalyzer
79-
The DependencyAnalyzer object.
80-
81-
Raises
82-
------
83-
DependencyAnalyzerError
84-
"""
85-
return NoneDependencyAnalyzer()
86-
8772
def get_group_id(self, gradle_exec: str, project_path: str) -> str | None:
8873
"""Get the group id of a Gradle project.
8974

src/macaron/slsa_analyzer/build_tool/maven.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
from macaron.config.defaults import defaults
1313
from macaron.config.global_config import global_config
14-
from macaron.dependency_analyzer.cyclonedx import DependencyAnalyzer, NoneDependencyAnalyzer
1514
from macaron.slsa_analyzer.build_tool.base_build_tool import BaseBuildTool, file_exists
1615
from macaron.slsa_analyzer.build_tool.language import BuildLanguage
1716

@@ -65,18 +64,3 @@ def is_detected(self, repo_path: str) -> bool:
6564
return False
6665
maven_config_files = self.build_configs
6766
return any(file_exists(repo_path, file) for file in maven_config_files)
68-
69-
def get_dep_analyzer(self) -> DependencyAnalyzer:
70-
"""
71-
Create a DependencyAnalyzer for the Maven build tool.
72-
73-
Returns
74-
-------
75-
DependencyAnalyzer
76-
The DependencyAnalyzer object.
77-
78-
Raises
79-
------
80-
DependencyAnalyzerError
81-
"""
82-
return NoneDependencyAnalyzer()

src/macaron/slsa_analyzer/build_tool/npm.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import os
1212

1313
from macaron.config.defaults import defaults
14-
from macaron.dependency_analyzer.cyclonedx import DependencyAnalyzer, NoneDependencyAnalyzer
1514
from macaron.slsa_analyzer.build_tool.base_build_tool import BaseBuildTool, BuildToolCommand, file_exists
1615
from macaron.slsa_analyzer.build_tool.language import BuildLanguage
1716
from macaron.slsa_analyzer.checks.check_result import Confidence
@@ -59,17 +58,6 @@ def is_detected(self, repo_path: str) -> bool:
5958
npm_config_files = self.build_configs + self.package_lock + self.entry_conf
6059
return any(file_exists(repo_path, file) for file in npm_config_files)
6160

62-
def get_dep_analyzer(self) -> DependencyAnalyzer:
63-
"""Create a DependencyAnalyzer for the build tool.
64-
65-
Returns
66-
-------
67-
DependencyAnalyzer
68-
The DependencyAnalyzer object.
69-
"""
70-
# TODO: Implement this method.
71-
return NoneDependencyAnalyzer()
72-
7361
def is_deploy_command(
7462
self, cmd: BuildToolCommand, excluded_configs: list[str] | None = None, provenance_workflow: str | None = None
7563
) -> tuple[bool, Confidence]:

src/macaron/slsa_analyzer/build_tool/yarn.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import os
1111

1212
from macaron.config.defaults import defaults
13-
from macaron.dependency_analyzer.cyclonedx import DependencyAnalyzer, NoneDependencyAnalyzer
1413
from macaron.slsa_analyzer.build_tool.base_build_tool import BaseBuildTool, BuildToolCommand, file_exists
1514
from macaron.slsa_analyzer.build_tool.language import BuildLanguage
1615
from macaron.slsa_analyzer.checks.check_result import Confidence
@@ -57,17 +56,6 @@ def is_detected(self, repo_path: str) -> bool:
5756
yarn_config_files = self.build_configs + self.package_lock + self.entry_conf
5857
return any(file_exists(repo_path, file) for file in yarn_config_files)
5958

60-
def get_dep_analyzer(self) -> DependencyAnalyzer:
61-
"""Create a DependencyAnalyzer for the build tool.
62-
63-
Returns
64-
-------
65-
DependencyAnalyzer
66-
The DependencyAnalyzer object.
67-
"""
68-
# TODO: Implement this method.
69-
return NoneDependencyAnalyzer()
70-
7159
def is_deploy_command(
7260
self, cmd: BuildToolCommand, excluded_configs: list[str] | None = None, provenance_workflow: str | None = None
7361
) -> tuple[bool, Confidence]:

0 commit comments

Comments
 (0)