Skip to content

Commit 5fe885f

Browse files
authored
chore: fix pylint message use-set-for-membership (#882)
Signed-off-by: Jens Troeger <jens.troeger@light-speed.de>
1 parent e8a779b commit 5fe885f

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ fail-under = 10.0
213213
suggestion-mode = true # Remove this setting when pylint v4 is released.
214214
load-plugins = [
215215
"pylint.extensions.for_any_all",
216+
"pylint.extensions.set_membership",
216217
]
217218
disable = [
218219
"fixme",

src/macaron/repo_finder/provenance_finder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def find_provenance(self, purl: PackageURL) -> list[InTotoPayload]:
6969
discovery_functions = [partial(find_npm_provenance, purl, self.npm_registry)]
7070
return self._find_provenance(discovery_functions)
7171

72-
if purl.type in ["gradle", "maven"]:
72+
if purl.type in {"gradle", "maven"}:
7373
# TODO add support for Maven Central provenance.
7474
if not self.jfrog_registry:
7575
logger.debug("Missing JFrog registry to find provenance in.")

src/macaron/repo_finder/repo_finder.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ def find_repo(purl: PackageURL) -> str:
6262
repo_finder: BaseRepoFinder
6363
if purl.type == "maven":
6464
repo_finder = JavaRepoFinder()
65-
elif defaults.getboolean("repofinder", "use_open_source_insights") and purl.type in [
65+
elif defaults.getboolean("repofinder", "use_open_source_insights") and purl.type in {
6666
"pypi",
6767
"nuget",
6868
"cargo",
6969
"npm",
70-
]:
70+
}:
7171
repo_finder = DepsDevRepoFinder()
7272
else:
7373
logger.debug("No Repo Finder found for package type: %s of %s", purl.type, purl)

src/macaron/slsa_analyzer/ci_service/github_actions/analyzer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def build_call_graph_from_node(node: GitHubWorkflowNode, repo_path: str) -> None
319319
# Right now, the script with the default shell is passed to the parser, which will fail
320320
# if the runner is Windows and Powershell is used. But there is no easy way to avoid passing
321321
# the script because that means we need to accurately determine the runner's OS.
322-
if step.get("run") and ("shell" not in step or step["shell"] in ["bash", "sh"]):
322+
if step.get("run") and ("shell" not in step or step["shell"] in {"bash", "sh"}):
323323
try:
324324
name = "UNKNOWN"
325325
node_id = None

src/macaron/slsa_analyzer/git_url.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ def parse_remote_url(
637637
res_netloc = ""
638638

639639
# e.g., https://github.com/owner/project.git
640-
if parsed_url.scheme in ("http", "https", "ftp", "ftps", "git+https"):
640+
if parsed_url.scheme in {"http", "https", "ftp", "ftps", "git+https"}:
641641
if parsed_url.netloc not in allowed_git_service_hostnames:
642642
return None
643643
path_params = parsed_url.path.strip("/").split("/")
@@ -651,7 +651,7 @@ def parse_remote_url(
651651
# e.g.:
652652
# ssh://git@hostname:port/owner/project.git
653653
# ssh://git@hostname:owner/project.git
654-
elif parsed_url.scheme in ("ssh", "git+ssh"):
654+
elif parsed_url.scheme in {"ssh", "git+ssh"}:
655655
user_host, _, port = parsed_url.netloc.partition(":")
656656
user, _, host = user_host.rpartition("@")
657657

src/macaron/slsa_analyzer/provenance/expectations/expectation_registry.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(self, expectation_paths: list[str]) -> None:
3333

3434
for expectation_path in expectation_paths:
3535
_, ext = os.path.splitext(expectation_path)
36-
if ext in (".cue",):
36+
if ext == ".cue":
3737
expectation = CUEExpectation.make_expectation(expectation_path)
3838
if expectation and expectation.target:
3939
self.expectations[expectation.target] = expectation

0 commit comments

Comments
 (0)