cici-tools 0.17.1__py3-none-any.whl → 0.18.0__py3-none-any.whl

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.
cici/_version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.17.1'
32
- __version_tuple__ = version_tuple = (0, 17, 1)
31
+ __version__ = version = '0.18.0'
32
+ __version_tuple__ = version_tuple = (0, 18, 0)
33
33
 
34
- __commit_id__ = commit_id = 'ge578edc48'
34
+ __commit_id__ = commit_id = 'g36384f791'
@@ -327,13 +327,23 @@ def dump(
327
327
  data = unpack_jobs(data)
328
328
  data = style_scalars(data)
329
329
 
330
+ # DEBUG
331
+ # job = data.get("opentofu-trivy") or {}
332
+ # script = job.get("script") or []
333
+ # if script:
334
+ # print("\n[DUMP DEBUG] opentofu-trivy script[0] type:", type(script[0]))
335
+ # print("[DUMP DEBUG] script[0] repr:", repr(str(script[0])))
336
+ # print("[DUMP DEBUG] contains \\n\\n?:", "\n\n" in str(script[0]))
337
+ # print("[DUMP DEBUG] contains \\n?:", "\n" in str(script[0]))
338
+ # END DEBUG
339
+
330
340
  # user round trip mode to preserve ruamel scalar styles (FoldedScalarString etc)
331
341
  yaml = ruamel.yaml.YAML(typ="rt")
332
342
  yaml.default_flow_style = False
333
343
  yaml.explicit_start = False
334
344
  yaml.preserve_quotes = True # respect the quotes set in style_scalars()
335
345
  yaml.indent(mapping=2, sequence=4, offset=2)
336
- yaml.width = 1000 # prevent unwanted line wrapping
346
+ yaml.width = 120 # prevent unwanted line wrapping
337
347
  # makes sure ruamel.yml to always emit double quoted strings """"
338
348
  yaml.representer.add_representer(DoubleQuotedScalarString, always_double_quoted)
339
349
 
@@ -54,9 +54,18 @@ def make_scalar_string(line: str, quote: bool = False):
54
54
 
55
55
  return FoldedScalarString(wrap_if_long(unindented))
56
56
 
57
- # Commands and long lines get folded
57
+ # Folding long lines logic (like a script that is super long so that it does not do anything weird in the folding process)
58
58
  if unindented.startswith(("docker ", "helm ", "tar ", "curl ")):
59
- return FoldedScalarString(wrap_if_long(unindented))
59
+ command_string = unindented.strip()
60
+
61
+ folded_scalar = FoldedScalarString(command_string)
62
+
63
+ if " | " in command_string:
64
+ pipe_position = command_string.index(" | ")
65
+ # mypy does not like fold_pos however it solves an issue that breaks the .gitlab-ci.yaml
66
+ folded_scalar.fold_pos = [pipe_position] # type: ignore[attr-defined]
67
+
68
+ return folded_scalar
60
69
 
61
70
  # Multi-command sequences get folded
62
71
  if any(sym in unindented for sym in ("&&", ";", "\\")):
@@ -339,7 +348,7 @@ def style_scalars(
339
348
  "on_success",
340
349
  "on_failure",
341
350
  "manual",
342
- "cobertura", # :white_check_mark: coverage format
351
+ "cobertura", # coverage format
343
352
  "sigstore",
344
353
  }
345
354
  if stripped in UNQUOTED_KEYWORDS:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cici-tools
3
- Version: 0.17.1
3
+ Version: 0.18.0
4
4
  Summary: Continuous Integration Catalog Interface
5
5
  Author-email: Digital Safety Research Institute <contact@dsri.org>
6
6
  License: Apache-2.0
@@ -1,6 +1,6 @@
1
1
  cici/__init__.py,sha256=wdYYpZKxK2omc_mRJgPj86Ec-QwoB4noZzlk71sBjnk,87
2
2
  cici/__main__.py,sha256=TWDBrcS5vXSclLWLm0Iu3uUXOkDw0PzcJ8a0zd7_ClU,150
3
- cici/_version.py,sha256=UcfJr5SDMbnLubKNu1a83szGr60gwIDKBmzvM_wxU6c,714
3
+ cici/_version.py,sha256=PTW5ceeoiZ30PZOYQdG23n16b6duopk5WpCV1sEAxcY,714
4
4
  cici/constants.py,sha256=ydShHTAbuanWWXeg9tJZ5GLm65M41AKmIibUheKV5nw,913
5
5
  cici/exceptions.py,sha256=JMpcD5YjYwKdn65D0iOEchXiAgIVsKApAyngCTwVgI4,139
6
6
  cici/main.py,sha256=ceH9s7i2XdB-mpUtDWuzLVn9TZHiwmsq-daZOgB9oRI,748
@@ -22,9 +22,9 @@ cici/providers/gitlab/__init__.py,sha256=8ej6k3hd25UFOGFhHymLa2mvz9hEwMjdxyu66hn
22
22
  cici/providers/gitlab/constants.py,sha256=nA36aqGvwBBood8lTFJueEY8lKEsOVjkp6ciMjAeKJA,1786
23
23
  cici/providers/gitlab/models.py,sha256=zPOLSfb811yVYgkKNirAEhcAPkoBwE-r_fmxMfxn8GU,7084
24
24
  cici/providers/gitlab/normalizers.py,sha256=EFQiJzRDkoahes0zwIMahuVC3DOy9A97eZDhMXdamno,4762
25
- cici/providers/gitlab/serializers.py,sha256=4lV2WBksMwYcm9GDU3LEzH4yyAzko1-VHJEAsOqz7uE,11105
25
+ cici/providers/gitlab/serializers.py,sha256=heczGlwcmKesugYX8PhwIhVIw8kExsfXKsC52sAwLrc,11533
26
26
  cici/providers/gitlab/utils.py,sha256=NUZ25rAosSWQyWh7m3xhiHRotqVl1krckZL58yR0LKQ,651
27
- cici/providers/gitlab/yaml_style.py,sha256=Obqm6JxmGgksCG_KYOFL9JH3S-bwzH9qFRvtD68mNjs,13409
27
+ cici/providers/gitlab/yaml_style.py,sha256=8IAkk5Hv3KfqAp6eJymsG8RXs8MBsnYUeonokivfx40,13827
28
28
  cici/schema/LICENSE.gitlab,sha256=0N7FHuinuoGBqZE6aUlD84yw3CGylx8lyfzertgmtY0,2001
29
29
  cici/schema/__init__.py,sha256=wdYYpZKxK2omc_mRJgPj86Ec-QwoB4noZzlk71sBjnk,87
30
30
  cici/schema/gitlab-ci.json,sha256=BCymn2i9JOrUGS2SsvpoXCH8JcofQz9Rhux46zEnS_8,70638
@@ -39,10 +39,10 @@ cici/templates/target-table.md.j2,sha256=NYspLbP3ap1706WnehZRtu6a2uxL_mKf7zfm3y0
39
39
  cici/templates/targets.md.j2,sha256=k-lkfReFJMCu9t2SjuD5YJ-Q_KECJxdY7v-0TWDTaCM,116
40
40
  cici/templates/variable-list.md.j2,sha256=M9r3j7d8H171okQNj8j4pc92kMdeWSRoeZQ5QB3NUTQ,613
41
41
  cici/templates/variables.md.j2,sha256=2DquXagNupqBkD95_3ZI4guJOK-eG_igaaMdRIUDrcE,84
42
- cici_tools-0.17.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
43
- cici_tools-0.17.1.dist-info/licenses/NOTICE,sha256=dIBr-7sfvnoYXYvgHIozlRJTLD4EHORRtRJtIe4znW8,55
44
- cici_tools-0.17.1.dist-info/METADATA,sha256=teqs6ew12daHh-3g_JIJN7p17X_1XH3FpkjMauDoVX8,4178
45
- cici_tools-0.17.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
46
- cici_tools-0.17.1.dist-info/entry_points.txt,sha256=CuBAwYG3z7qOKm4IYARjZzdX5fytMLKyr59HLLJx_Is,44
47
- cici_tools-0.17.1.dist-info/top_level.txt,sha256=sv8xIjFuuqtyBMoyzueczNvZo_--q12r64Zc0lGKKF8,5
48
- cici_tools-0.17.1.dist-info/RECORD,,
42
+ cici_tools-0.18.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
43
+ cici_tools-0.18.0.dist-info/licenses/NOTICE,sha256=dIBr-7sfvnoYXYvgHIozlRJTLD4EHORRtRJtIe4znW8,55
44
+ cici_tools-0.18.0.dist-info/METADATA,sha256=T2W5kElsMmBy2N-UF8AYulOr0DTpcyAqU9hTBNHM0fw,4178
45
+ cici_tools-0.18.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
46
+ cici_tools-0.18.0.dist-info/entry_points.txt,sha256=CuBAwYG3z7qOKm4IYARjZzdX5fytMLKyr59HLLJx_Is,44
47
+ cici_tools-0.18.0.dist-info/top_level.txt,sha256=sv8xIjFuuqtyBMoyzueczNvZo_--q12r64Zc0lGKKF8,5
48
+ cici_tools-0.18.0.dist-info/RECORD,,