bitwarden_workflow_linter 0.2.0__py3-none-any.whl → 0.2.1__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.
- bitwarden_workflow_linter/__about__.py +1 -1
- bitwarden_workflow_linter/default_settings.yaml +1 -0
- bitwarden_workflow_linter/lint.py +5 -3
- bitwarden_workflow_linter/rules/job_environment_prefix.py +2 -1
- bitwarden_workflow_linter/rules/step_approved.py +2 -2
- bitwarden_workflow_linter/rules/step_pinned.py +1 -1
- bitwarden_workflow_linter/rules/underscore_outputs.py +21 -10
- {bitwarden_workflow_linter-0.2.0.dist-info → bitwarden_workflow_linter-0.2.1.dist-info}/METADATA +1 -1
- {bitwarden_workflow_linter-0.2.0.dist-info → bitwarden_workflow_linter-0.2.1.dist-info}/RECORD +12 -12
- {bitwarden_workflow_linter-0.2.0.dist-info → bitwarden_workflow_linter-0.2.1.dist-info}/WHEEL +0 -0
- {bitwarden_workflow_linter-0.2.0.dist-info → bitwarden_workflow_linter-0.2.1.dist-info}/entry_points.txt +0 -0
- {bitwarden_workflow_linter-0.2.0.dist-info → bitwarden_workflow_linter-0.2.1.dist-info}/licenses/LICENSE.txt +0 -0
@@ -4,6 +4,7 @@ enabled_rules:
|
|
4
4
|
- bitwarden_workflow_linter.rules.pinned_job_runner.RuleJobRunnerVersionPinned
|
5
5
|
- bitwarden_workflow_linter.rules.job_environment_prefix.RuleJobEnvironmentPrefix
|
6
6
|
- bitwarden_workflow_linter.rules.step_pinned.RuleStepUsesPinned
|
7
|
+
- bitwarden_workflow_linter.rules.step_pinned.RuleStepUsesPinned
|
7
8
|
- bitwarden_workflow_linter.rules.underscore_outputs.RuleUnderscoreOutputs
|
8
9
|
|
9
10
|
approved_actions_path: default_actions.json
|
@@ -54,6 +54,7 @@ class LinterCmd:
|
|
54
54
|
)
|
55
55
|
parser_lint.add_argument("-f", "--files", action="append", help="files to lint")
|
56
56
|
parser_lint.add_argument(
|
57
|
+
"-o",
|
57
58
|
"--output",
|
58
59
|
action="store",
|
59
60
|
help="output format: [stdout|json|md]",
|
@@ -137,9 +138,10 @@ class LinterCmd:
|
|
137
138
|
if os.path.isfile(path):
|
138
139
|
workflow_files.append(path)
|
139
140
|
elif os.path.isdir(path):
|
140
|
-
for
|
141
|
-
|
142
|
-
|
141
|
+
for dirpath, dirnames, filenames in os.walk(path):
|
142
|
+
dirnames[:] = []
|
143
|
+
for file in filenames:
|
144
|
+
filepath = dirpath + os.sep + file
|
143
145
|
if filepath.endswith((".yml", ".yaml")):
|
144
146
|
workflow_files.append(filepath)
|
145
147
|
|
@@ -58,11 +58,12 @@ class RuleJobEnvironmentPrefix(Rule):
|
|
58
58
|
incorrectly named environment variables.
|
59
59
|
"""
|
60
60
|
correct = True
|
61
|
+
allowed_envs = {"NODE_OPTION", "NUGET_PACKAGES", "MINT_PATH", "MINT_LINK_PATH"}
|
61
62
|
|
62
63
|
if obj.env:
|
63
64
|
offending_keys = []
|
64
65
|
for key in obj.env.keys():
|
65
|
-
if key[0] != "_":
|
66
|
+
if key not in allowed_envs and key[0] != "_":
|
66
67
|
offending_keys.append(key)
|
67
68
|
correct = False
|
68
69
|
|
@@ -41,8 +41,8 @@ class RuleStepUsesApproved(Rule):
|
|
41
41
|
if "@" not in obj.uses:
|
42
42
|
return True
|
43
43
|
|
44
|
-
## Force pass for any bitwarden/
|
45
|
-
if obj.uses.startswith("bitwarden/
|
44
|
+
## Force pass for any bitwarden/
|
45
|
+
if obj.uses.startswith("bitwarden/"):
|
46
46
|
return True
|
47
47
|
|
48
48
|
return False
|
@@ -25,7 +25,7 @@ class RuleUnderscoreOutputs(Rule):
|
|
25
25
|
A Settings object that contains any default, overridden, or custom settings
|
26
26
|
required anywhere in the application.
|
27
27
|
"""
|
28
|
-
self.message = "outputs with more than one word
|
28
|
+
self.message = "outputs with more than one word should use an underscore"
|
29
29
|
self.on_fail = LintLevels.WARNING
|
30
30
|
self.compatibility = [Workflow, Job, Step]
|
31
31
|
self.settings = settings
|
@@ -90,15 +90,18 @@ class RuleUnderscoreOutputs(Rule):
|
|
90
90
|
if isinstance(obj, Workflow):
|
91
91
|
if obj.on.get("workflow_dispatch"):
|
92
92
|
if obj.on["workflow_dispatch"].get("outputs"):
|
93
|
-
|
93
|
+
for output, _ in obj.on["workflow_dispatch"]["outputs"].items():
|
94
|
+
outputs.append(output)
|
94
95
|
|
95
96
|
if obj.on.get("workflow_call"):
|
96
97
|
if obj.on["workflow_call"].get("outputs"):
|
97
|
-
|
98
|
+
for output, _ in obj.on["workflow_call"]["outputs"].items():
|
99
|
+
outputs.append(output)
|
98
100
|
|
99
101
|
if isinstance(obj, Job):
|
100
102
|
if obj.outputs:
|
101
|
-
|
103
|
+
for output in obj.outputs.keys():
|
104
|
+
outputs.append(output)
|
102
105
|
|
103
106
|
if isinstance(obj, Step):
|
104
107
|
if obj.run:
|
@@ -108,10 +111,18 @@ class RuleUnderscoreOutputs(Rule):
|
|
108
111
|
)
|
109
112
|
)
|
110
113
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
114
|
+
correct = True
|
115
|
+
offending_keys = []
|
116
|
+
|
117
|
+
for name in outputs:
|
118
|
+
if "-" in name:
|
119
|
+
offending_keys.append(name)
|
120
|
+
correct = False
|
121
|
+
|
122
|
+
if correct:
|
123
|
+
return True, ""
|
116
124
|
|
117
|
-
return
|
125
|
+
return (
|
126
|
+
False,
|
127
|
+
f"{obj.__class__.__name__} {self.message}: ({' ,'.join(offending_keys)})",
|
128
|
+
)
|
{bitwarden_workflow_linter-0.2.0.dist-info → bitwarden_workflow_linter-0.2.1.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: bitwarden_workflow_linter
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.1
|
4
4
|
Summary: Custom GitHub Action Workflow Linter
|
5
5
|
Project-URL: Homepage, https://github.com/bitwarden/workflow-linter
|
6
6
|
Project-URL: Issues, https://github.com/bitwarden/workflow-linter/issues
|
{bitwarden_workflow_linter-0.2.0.dist-info → bitwarden_workflow_linter-0.2.1.dist-info}/RECORD
RENAMED
@@ -1,10 +1,10 @@
|
|
1
|
-
bitwarden_workflow_linter/__about__.py,sha256=
|
1
|
+
bitwarden_workflow_linter/__about__.py,sha256=i7sjN4kIit1ye9XdGItqGi91cWiWv11IUmljOfGbykA,59
|
2
2
|
bitwarden_workflow_linter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
bitwarden_workflow_linter/actions.py,sha256=daob3be2Y22gfsAmGhTgBRCgGk18mlGduqc5Zn1Onz4,7897
|
4
4
|
bitwarden_workflow_linter/cli.py,sha256=wgkK1MlVbo6Zx3f2CZZ_tkSWq_hdsGciHJA1knX6Yuw,1699
|
5
5
|
bitwarden_workflow_linter/default_actions.json,sha256=BeFllnAu9v6cX6eeGeNoQf3rXs7ZOjAtjTNBQuAZ8-k,8087
|
6
|
-
bitwarden_workflow_linter/default_settings.yaml,sha256=
|
7
|
-
bitwarden_workflow_linter/lint.py,sha256=
|
6
|
+
bitwarden_workflow_linter/default_settings.yaml,sha256=lgIKpirGuxRa06QCOxalPP9H-aObYhXFryrHkEKQNM0,572
|
7
|
+
bitwarden_workflow_linter/lint.py,sha256=RDHv5jGeGCf5XIHE8jyqQET3-cFykl7223SQVS4Q3pg,5525
|
8
8
|
bitwarden_workflow_linter/load.py,sha256=Ece2bwSSYeQ1xQQEjjqY6DlCkwznFYLG56VW_VTxU4E,4472
|
9
9
|
bitwarden_workflow_linter/rule.py,sha256=Qb60JiUDAWN3ayrMGoSbbDCSFmw-ql8djzAkxISaob4,3250
|
10
10
|
bitwarden_workflow_linter/utils.py,sha256=9WO3T9w9vKAow_xR6JDz2MvdMXKExV18AzucF0vh67s,4695
|
@@ -13,15 +13,15 @@ bitwarden_workflow_linter/models/job.py,sha256=nBK7_VYu6RRST7WLtdLsoRErl5j4Er8W9
|
|
13
13
|
bitwarden_workflow_linter/models/step.py,sha256=1bKAtKZmHcO8O1e_HuoXxR1bwHDEXUssYo7EHOjY7QI,1711
|
14
14
|
bitwarden_workflow_linter/models/workflow.py,sha256=MkqvIY4JX2eWFODNTodS_l4I8uUq08WCHy3C4kYcL0s,1395
|
15
15
|
bitwarden_workflow_linter/rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
|
-
bitwarden_workflow_linter/rules/job_environment_prefix.py,sha256=
|
16
|
+
bitwarden_workflow_linter/rules/job_environment_prefix.py,sha256=HJeZhw1JVk4PTYZUY8C2j9wG5x5SqaNy_6WHHlZ_iM4,2531
|
17
17
|
bitwarden_workflow_linter/rules/name_capitalized.py,sha256=XwRZ33OeQv_i7z_2Yf7TEgJNodOl5byXfegqfmhaTYQ,1914
|
18
18
|
bitwarden_workflow_linter/rules/name_exists.py,sha256=MxcaNQz64JXeHRPiOip9BxJNgPdpKQa7Z51mDoNw2hU,1681
|
19
19
|
bitwarden_workflow_linter/rules/pinned_job_runner.py,sha256=Dm6_sdPX0yFMji_y2LMFj4gWFaToEgauyBVpNRP2qiI,1606
|
20
|
-
bitwarden_workflow_linter/rules/step_approved.py,sha256=
|
21
|
-
bitwarden_workflow_linter/rules/step_pinned.py,sha256=
|
22
|
-
bitwarden_workflow_linter/rules/underscore_outputs.py,sha256=
|
23
|
-
bitwarden_workflow_linter-0.2.
|
24
|
-
bitwarden_workflow_linter-0.2.
|
25
|
-
bitwarden_workflow_linter-0.2.
|
26
|
-
bitwarden_workflow_linter-0.2.
|
27
|
-
bitwarden_workflow_linter-0.2.
|
20
|
+
bitwarden_workflow_linter/rules/step_approved.py,sha256=xZE9x40P-C4SqOxjYN3ZHR4gxWSkYJFEfYwEzA2c05w,3287
|
21
|
+
bitwarden_workflow_linter/rules/step_pinned.py,sha256=CSHbyeLx1uT8exRzOgFVc1dzMJGnbXhTHiteaoOLWUk,3390
|
22
|
+
bitwarden_workflow_linter/rules/underscore_outputs.py,sha256=johfE2Qwb_ww4xbW5u-ug37wNZbHZgKdRYg339cxUR8,4381
|
23
|
+
bitwarden_workflow_linter-0.2.1.dist-info/METADATA,sha256=-2gvyfTfmDQrjtDMT1kwxuISDAvoikpJkXj611PdvSI,6146
|
24
|
+
bitwarden_workflow_linter-0.2.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
25
|
+
bitwarden_workflow_linter-0.2.1.dist-info/entry_points.txt,sha256=SA_yF9CwL4VMUvdcmCd7k9rjsQNzfeOUBuDnMnaO8QQ,60
|
26
|
+
bitwarden_workflow_linter-0.2.1.dist-info/licenses/LICENSE.txt,sha256=uY-7N9tbI7xc_c0WeTIGpacSCnsB91N05eCIg3bkaRw,35140
|
27
|
+
bitwarden_workflow_linter-0.2.1.dist-info/RECORD,,
|
{bitwarden_workflow_linter-0.2.0.dist-info → bitwarden_workflow_linter-0.2.1.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|
File without changes
|