Skip to content

Commit 6bbe462

Browse files
committed
fix: update new tests for dataflow analysis changes
Narrow pylint suppression for bashparser model definitions and add explanatory comment. Suppress sphinx warning caused by forward references. Regenerated docs. Signed-off-by: Nicholas Allen <[email protected]>
1 parent f3b45a7 commit 6bbe462

File tree

9 files changed

+95
-15
lines changed

9 files changed

+95
-15
lines changed

docs/source/conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2022 - 2024, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2022 - 2025, Oracle and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/.
33

44
# Configuration file for the Sphinx documentation builder.
@@ -76,6 +76,10 @@
7676
"<class 'macaron.parsers.github_workflow_model.Workflow'>",
7777
]
7878

79+
suppress_warnings = [
80+
"sphinx_autodoc_typehints.forward_reference", # Sphinx has issues with resolving forward references.
81+
]
82+
7983

8084
# We add the docstrings for class constructors in the `__init__` methods.
8185
def skip(app, what, name, obj, would_skip, options):
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
macaron.build\_spec\_generator.dockerfile package
2+
=================================================
3+
4+
.. automodule:: macaron.build_spec_generator.dockerfile
5+
:members:
6+
:show-inheritance:
7+
:undoc-members:
8+
9+
Submodules
10+
----------
11+
12+
macaron.build\_spec\_generator.dockerfile.dockerfile\_output module
13+
-------------------------------------------------------------------
14+
15+
.. automodule:: macaron.build_spec_generator.dockerfile.dockerfile_output
16+
:members:
17+
:show-inheritance:
18+
:undoc-members:
19+
20+
macaron.build\_spec\_generator.dockerfile.pypi\_dockerfile\_output module
21+
-------------------------------------------------------------------------
22+
23+
.. automodule:: macaron.build_spec_generator.dockerfile.pypi_dockerfile_output
24+
:members:
25+
:show-inheritance:
26+
:undoc-members:

docs/source/pages/developers_guide/apidoc/macaron.build_spec_generator.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Subpackages
1414

1515
macaron.build_spec_generator.cli_command_parser
1616
macaron.build_spec_generator.common_spec
17+
macaron.build_spec_generator.dockerfile
1718
macaron.build_spec_generator.reproducible_central
1819

1920
Submodules

docs/source/pages/developers_guide/apidoc/macaron.repo_finder.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ macaron.repo\_finder.repo\_finder\_java module
5757
:show-inheritance:
5858
:undoc-members:
5959

60+
macaron.repo\_finder.repo\_finder\_npm module
61+
---------------------------------------------
62+
63+
.. automodule:: macaron.repo_finder.repo_finder_npm
64+
:members:
65+
:show-inheritance:
66+
:undoc-members:
67+
6068
macaron.repo\_finder.repo\_finder\_pypi module
6169
----------------------------------------------
6270

docs/source/pages/developers_guide/apidoc/macaron.slsa_analyzer.build_tool.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ macaron.slsa\_analyzer.build\_tool.base\_build\_tool module
1717
:show-inheritance:
1818
:undoc-members:
1919

20+
macaron.slsa\_analyzer.build\_tool.conda module
21+
-----------------------------------------------
22+
23+
.. automodule:: macaron.slsa_analyzer.build_tool.conda
24+
:members:
25+
:show-inheritance:
26+
:undoc-members:
27+
2028
macaron.slsa\_analyzer.build\_tool.docker module
2129
------------------------------------------------
2230

@@ -25,6 +33,14 @@ macaron.slsa\_analyzer.build\_tool.docker module
2533
:show-inheritance:
2634
:undoc-members:
2735

36+
macaron.slsa\_analyzer.build\_tool.flit module
37+
----------------------------------------------
38+
39+
.. automodule:: macaron.slsa_analyzer.build_tool.flit
40+
:members:
41+
:show-inheritance:
42+
:undoc-members:
43+
2844
macaron.slsa\_analyzer.build\_tool.go module
2945
--------------------------------------------
3046

@@ -41,6 +57,14 @@ macaron.slsa\_analyzer.build\_tool.gradle module
4157
:show-inheritance:
4258
:undoc-members:
4359

60+
macaron.slsa\_analyzer.build\_tool.hatch module
61+
-----------------------------------------------
62+
63+
.. automodule:: macaron.slsa_analyzer.build_tool.hatch
64+
:members:
65+
:show-inheritance:
66+
:undoc-members:
67+
4468
macaron.slsa\_analyzer.build\_tool.language module
4569
--------------------------------------------------
4670

@@ -81,6 +105,14 @@ macaron.slsa\_analyzer.build\_tool.poetry module
81105
:show-inheritance:
82106
:undoc-members:
83107

108+
macaron.slsa\_analyzer.build\_tool.pyproject module
109+
---------------------------------------------------
110+
111+
.. automodule:: macaron.slsa_analyzer.build_tool.pyproject
112+
:members:
113+
:show-inheritance:
114+
:undoc-members:
115+
84116
macaron.slsa\_analyzer.build\_tool.yarn module
85117
----------------------------------------------
86118

src/macaron/parsers/bashparser_model.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
# Copyright (c) 2024 - 2025, Oracle and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/.
3-
# Licensed under the Universal Permissive License v 1.0 as shown at https:#oss.oracle.com/licenses/upl/.
4-
# pylint: skip-file
5-
# flake8: noqa
63

7-
# Type definitions for Bash AST as produced (and json-serialised) by the "mvdan.cc/sh/v3/syntax" bash parser
4+
"""Type definitions for Bash AST as produced (and json-serialised) by the "mvdan.cc/sh/v3/syntax" bash parser."""
5+
6+
# Suppress warnings about non-ALL_CAPS names (that reference the original names and so are not ours to change).
7+
# pylint: disable=invalid-name
8+
9+
# Suppress false positive warnings caused by a field with the same name as its type (again, not our names to change)
10+
# pylint: disable=used-before-assignment
11+
12+
# Refer to original definitions in codebase for description, no need to comment here.
13+
# pylint: disable=missing-class-docstring,missing-function-docstring
14+
15+
# Forward-referencing union type defs are not expressible with "|" until python 3.12 type statement syntax is available.
16+
# pylint: disable=consider-alternative-union-syntax
17+
18+
# Suppress all flake8 warnings for the same reasons as above (it does not allow selective disabling at file level).
19+
# flake8: noqa
820

921
from __future__ import annotations
1022

1123
from enum import Enum
12-
from typing import Any, Literal, NotRequired, Optional, TypedDict, TypeGuard, Union
24+
from typing import Literal, NotRequired, TypedDict, TypeGuard, Union
1325

1426

1527
class Pos(TypedDict):

tests/slsa_analyzer/build_tool/test_conda.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import pytest
99

10-
from macaron.code_analyzer.call_graph import BaseNode
1110
from macaron.slsa_analyzer.build_tool.base_build_tool import BuildToolCommand
1211
from macaron.slsa_analyzer.build_tool.conda import Conda
1312
from macaron.slsa_analyzer.build_tool.language import BuildLanguage
@@ -120,7 +119,7 @@ def test_is_conda_deploy_command(
120119
language_distributions=language_distributions,
121120
language_url=None,
122121
ci_path=ci_path,
123-
step_node=BaseNode(),
122+
step_node=None,
124123
reachable_secrets=reachable_secrets,
125124
events=events,
126125
),
@@ -220,7 +219,7 @@ def test_is_conda_package_command(
220219
language_distributions=language_distributions,
221220
language_url=None,
222221
ci_path=ci_path,
223-
step_node=BaseNode(),
222+
step_node=None,
224223
reachable_secrets=reachable_secrets,
225224
events=events,
226225
),

tests/slsa_analyzer/build_tool/test_flit.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import pytest
99

10-
from macaron.code_analyzer.call_graph import BaseNode
1110
from macaron.slsa_analyzer.build_tool.base_build_tool import BuildToolCommand
1211
from macaron.slsa_analyzer.build_tool.flit import Flit
1312
from macaron.slsa_analyzer.build_tool.language import BuildLanguage
@@ -120,7 +119,7 @@ def test_is_flit_deploy_command(
120119
language_distributions=language_distributions,
121120
language_url=None,
122121
ci_path=ci_path,
123-
step_node=BaseNode(),
122+
step_node=None,
124123
reachable_secrets=reachable_secrets,
125124
events=events,
126125
),
@@ -220,7 +219,7 @@ def test_is_flit_package_command(
220219
language_distributions=language_distributions,
221220
language_url=None,
222221
ci_path=ci_path,
223-
step_node=BaseNode(),
222+
step_node=None,
224223
reachable_secrets=reachable_secrets,
225224
events=events,
226225
),

tests/slsa_analyzer/build_tool/test_hatch.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import pytest
99

10-
from macaron.code_analyzer.call_graph import BaseNode
1110
from macaron.slsa_analyzer.build_tool.base_build_tool import BuildToolCommand
1211
from macaron.slsa_analyzer.build_tool.hatch import Hatch
1312
from macaron.slsa_analyzer.build_tool.language import BuildLanguage
@@ -120,7 +119,7 @@ def test_is_hatch_deploy_command(
120119
language_distributions=language_distributions,
121120
language_url=None,
122121
ci_path=ci_path,
123-
step_node=BaseNode(),
122+
step_node=None,
124123
reachable_secrets=reachable_secrets,
125124
events=events,
126125
),
@@ -220,7 +219,7 @@ def test_is_hatch_package_command(
220219
language_distributions=language_distributions,
221220
language_url=None,
222221
ci_path=ci_path,
223-
step_node=BaseNode(),
222+
step_node=None,
224223
reachable_secrets=reachable_secrets,
225224
events=events,
226225
),

0 commit comments

Comments
 (0)