metadata-json-lint 2.0.1 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +2 -1
- data/.rubocop.yml +2 -1
- data/.travis.yml +10 -3
- data/CHANGELOG.md +64 -3
- data/Gemfile +4 -0
- data/HISTORY.md +107 -0
- data/LICENSE +174 -9
- data/README.md +17 -16
- data/Rakefile +14 -0
- data/lib/metadata-json-lint/schema.rb +21 -3
- data/lib/metadata-json-lint/semantic_puppet_loader.rb +47 -0
- data/lib/metadata-json-lint/version_requirement.rb +39 -5
- data/lib/metadata_json_lint.rb +55 -2
- data/metadata-json-lint.gemspec +10 -8
- data/spec/metadata_json_lint_spec.rb +37 -0
- data/tests/duplicate-dep/metadata.json +1 -5
- data/tests/duplicate-requirement/Rakefile +2 -0
- data/tests/duplicate-requirement/expected +1 -0
- data/tests/duplicate-requirement/metadata.json +87 -0
- data/tests/non_array_requirements/Rakefile +2 -0
- data/tests/non_array_requirements/expected +1 -0
- data/tests/non_array_requirements/metadata.json +61 -0
- data/tests/requirements_eol_version/Rakefile +2 -0
- data/tests/requirements_eol_version/expected +2 -0
- data/tests/requirements_eol_version/metadata.json +92 -0
- data/tests/test.sh +16 -3
- metadata +52 -18
@@ -0,0 +1 @@
|
|
1
|
+
(ERROR) requirements: The property 'requirements' of type string did not match the following type: array
|
@@ -0,0 +1,61 @@
|
|
1
|
+
{
|
2
|
+
"name": "puppetlabs-postgresql",
|
3
|
+
"version": "3.4.1",
|
4
|
+
"author": "Inkling/Puppet Labs",
|
5
|
+
"summary": "PostgreSQL defined resource types",
|
6
|
+
"license": "Apache-2.0",
|
7
|
+
"source": "git://github.com/puppetlabs/puppet-postgresql.git",
|
8
|
+
"project_page": "https://github.com/puppetlabs/puppet-postgresql",
|
9
|
+
"issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues",
|
10
|
+
"operatingsystem_support": [
|
11
|
+
{
|
12
|
+
"operatingsystem": "RedHat",
|
13
|
+
"operatingsystemrelease": [
|
14
|
+
"5",
|
15
|
+
"6",
|
16
|
+
"7"
|
17
|
+
]
|
18
|
+
},
|
19
|
+
{
|
20
|
+
"operatingsystem": "CentOS",
|
21
|
+
"operatingsystemrelease": [
|
22
|
+
"5",
|
23
|
+
"6",
|
24
|
+
"7"
|
25
|
+
]
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"operatingsystem": "OracleLinux",
|
29
|
+
"operatingsystemrelease": [
|
30
|
+
"5",
|
31
|
+
"6",
|
32
|
+
"7"
|
33
|
+
]
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"operatingsystem": "Scientific",
|
37
|
+
"operatingsystemrelease": [
|
38
|
+
"5",
|
39
|
+
"6",
|
40
|
+
"7"
|
41
|
+
]
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"operatingsystem": "Debian",
|
45
|
+
"operatingsystemrelease": [
|
46
|
+
"6",
|
47
|
+
"7"
|
48
|
+
]
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"operatingsystem": "Ubuntu",
|
52
|
+
"operatingsystemrelease": [
|
53
|
+
"10.04",
|
54
|
+
"12.04",
|
55
|
+
"14.04"
|
56
|
+
]
|
57
|
+
}
|
58
|
+
],
|
59
|
+
"requirements": "aoeu",
|
60
|
+
"dependencies": []
|
61
|
+
}
|
@@ -0,0 +1,92 @@
|
|
1
|
+
{
|
2
|
+
"name": "puppetlabs-postgresql",
|
3
|
+
"version": "3.4.1",
|
4
|
+
"author": "Inkling/Puppet Labs",
|
5
|
+
"summary": "PostgreSQL defined resource types",
|
6
|
+
"license": "Apache-2.0",
|
7
|
+
"source": "git://github.com/puppetlabs/puppet-postgresql.git",
|
8
|
+
"project_page": "https://github.com/puppetlabs/puppet-postgresql",
|
9
|
+
"issues_url": "https://github.com/puppetlabs/puppet-postgresql/issues",
|
10
|
+
"tags": [ "postgres" ],
|
11
|
+
"operatingsystem_support": [
|
12
|
+
{
|
13
|
+
"operatingsystem": "RedHat",
|
14
|
+
"operatingsystemrelease": [
|
15
|
+
"5",
|
16
|
+
"6",
|
17
|
+
"7"
|
18
|
+
]
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"operatingsystem": "CentOS",
|
22
|
+
"operatingsystemrelease": [
|
23
|
+
"5",
|
24
|
+
"6",
|
25
|
+
"7"
|
26
|
+
]
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"operatingsystem": "OracleLinux",
|
30
|
+
"operatingsystemrelease": [
|
31
|
+
"5",
|
32
|
+
"6",
|
33
|
+
"7"
|
34
|
+
]
|
35
|
+
},
|
36
|
+
{
|
37
|
+
"operatingsystem": "Scientific",
|
38
|
+
"operatingsystemrelease": [
|
39
|
+
"5",
|
40
|
+
"6",
|
41
|
+
"7"
|
42
|
+
]
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"operatingsystem": "Debian",
|
46
|
+
"operatingsystemrelease": [
|
47
|
+
"6",
|
48
|
+
"7"
|
49
|
+
]
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"operatingsystem": "Ubuntu",
|
53
|
+
"operatingsystemrelease": [
|
54
|
+
"10.04",
|
55
|
+
"12.04",
|
56
|
+
"14.04"
|
57
|
+
]
|
58
|
+
}
|
59
|
+
],
|
60
|
+
"requirements": [
|
61
|
+
{
|
62
|
+
"name": "puppet",
|
63
|
+
"version_requirement": "3.2.0"
|
64
|
+
}
|
65
|
+
],
|
66
|
+
"dependencies": [
|
67
|
+
{
|
68
|
+
"name": "puppetlabs/stdlib",
|
69
|
+
"version_requirement": "1.2.3"
|
70
|
+
},
|
71
|
+
{
|
72
|
+
"name": "puppetlabs/apt",
|
73
|
+
"version_requirement": "< 1.2.3"
|
74
|
+
},
|
75
|
+
{
|
76
|
+
"name": "puppetlabs/puppetdb",
|
77
|
+
"version_requirement": "<= 1.2.3"
|
78
|
+
},
|
79
|
+
{
|
80
|
+
"name": "puppetlabs/vcsrepo",
|
81
|
+
"version_requirement": ">= 1.0.0 < 2.0.0"
|
82
|
+
},
|
83
|
+
{
|
84
|
+
"name": "puppetlabs/rabbitmq",
|
85
|
+
"version_requirement": "1.x"
|
86
|
+
},
|
87
|
+
{
|
88
|
+
"name": "puppetlabs/motd",
|
89
|
+
"version_requirement": "1.2.x"
|
90
|
+
}
|
91
|
+
]
|
92
|
+
}
|
data/tests/test.sh
CHANGED
@@ -112,15 +112,19 @@ test "mixed_version_syntax" $FAILURE
|
|
112
112
|
# Run one with empty dependencies array, expect SUCCESS
|
113
113
|
test "no_dependencies" $SUCCESS
|
114
114
|
|
115
|
-
# Run one with open ended dependency, expect SUCCESS
|
116
|
-
test "open_ended_dependency" $SUCCESS
|
115
|
+
# Run one with open ended dependency, expect SUCCESS as strict deps is off by default
|
116
|
+
test "open_ended_dependency" $SUCCESS
|
117
117
|
# Run one with open ended dependency and --strict-dependencies, expect FAILURE
|
118
118
|
test "open_ended_dependency" $FAILURE --strict-dependencies
|
119
|
+
# Run one with open ended dependency and --strict-dependencies, but pass on warnings, expect SUCCESS
|
120
|
+
test "open_ended_dependency" $SUCCESS --strict-dependencies --no-fail-on-warnings
|
119
121
|
|
120
122
|
# Run one with missing version_requirement and --no-strict-dependency, expect SUCCESS
|
121
|
-
test "missing_version_requirement" $SUCCESS
|
123
|
+
test "missing_version_requirement" $SUCCESS
|
122
124
|
# Run one with open ended dependency and --strict-dependencies, expect FAILURE
|
123
125
|
test "missing_version_requirement" $FAILURE --strict-dependencies
|
126
|
+
# Run one with open ended dependency and --strict-dependencies, but pass on warnings, expect SUCCESS
|
127
|
+
test "missing_version_requirement" $SUCCESS --strict-dependencies --no-fail-on-warnings
|
124
128
|
|
125
129
|
# Run test for "proprietary"-licensed modules, expect SUCCESS
|
126
130
|
test "proprietary" $SUCCESS
|
@@ -137,6 +141,15 @@ test "tags_no_array" $FAILURE
|
|
137
141
|
# Run with json output format
|
138
142
|
test "json_format" $FAILURE --format json
|
139
143
|
|
144
|
+
# Run against a metadata.json with a string for the requirements
|
145
|
+
test "non_array_requirements" $FAILURE
|
146
|
+
|
147
|
+
# Run against a metadata.json with an unsupported minimum Puppet version for the requirements
|
148
|
+
test "requirements_eol_version" $FAILURE --strict-puppet-version
|
149
|
+
|
150
|
+
# Run a broken one, expect FAILURE
|
151
|
+
test "duplicate-requirement" $FAILURE
|
152
|
+
|
140
153
|
# Test running without specifying file to parse
|
141
154
|
cd perfect
|
142
155
|
bundle exec metadata-json-lint
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metadata-json-lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vox Pupuli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spdx-licenses
|
@@ -39,25 +39,19 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2.8'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: pry
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
48
|
-
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: 6.0.0
|
51
|
-
type: :runtime
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
52
49
|
prerelease: false
|
53
50
|
version_requirements: !ruby/object:Gem::Requirement
|
54
51
|
requirements:
|
55
52
|
- - ">="
|
56
53
|
- !ruby/object:Gem::Version
|
57
|
-
version:
|
58
|
-
- - "<"
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 6.0.0
|
54
|
+
version: '0'
|
61
55
|
- !ruby/object:Gem::Dependency
|
62
56
|
name: rake
|
63
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,7 +67,7 @@ dependencies:
|
|
73
67
|
- !ruby/object:Gem::Version
|
74
68
|
version: '0'
|
75
69
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
70
|
+
name: semantic_puppet
|
77
71
|
requirement: !ruby/object:Gem::Requirement
|
78
72
|
requirements:
|
79
73
|
- - ">="
|
@@ -87,7 +81,7 @@ dependencies:
|
|
87
81
|
- !ruby/object:Gem::Version
|
88
82
|
version: '0'
|
89
83
|
- !ruby/object:Gem::Dependency
|
90
|
-
name:
|
84
|
+
name: rspec
|
91
85
|
requirement: !ruby/object:Gem::Requirement
|
92
86
|
requirements:
|
93
87
|
- - ">="
|
@@ -100,6 +94,20 @@ dependencies:
|
|
100
94
|
- - ">="
|
101
95
|
- !ruby/object:Gem::Version
|
102
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 0.50.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.50.0
|
103
111
|
description: Utility to verify Puppet metadata.json files
|
104
112
|
email: voxpupuli@groups.io
|
105
113
|
executables:
|
@@ -114,15 +122,18 @@ files:
|
|
114
122
|
- ".travis.yml"
|
115
123
|
- CHANGELOG.md
|
116
124
|
- Gemfile
|
125
|
+
- HISTORY.md
|
117
126
|
- LICENSE
|
118
127
|
- README.md
|
119
128
|
- Rakefile
|
120
129
|
- bin/metadata-json-lint
|
121
130
|
- lib/metadata-json-lint/rake_task.rb
|
122
131
|
- lib/metadata-json-lint/schema.rb
|
132
|
+
- lib/metadata-json-lint/semantic_puppet_loader.rb
|
123
133
|
- lib/metadata-json-lint/version_requirement.rb
|
124
134
|
- lib/metadata_json_lint.rb
|
125
135
|
- metadata-json-lint.gemspec
|
136
|
+
- spec/metadata_json_lint_spec.rb
|
126
137
|
- spec/schema_spec.rb
|
127
138
|
- spec/spec_helper.rb
|
128
139
|
- spec/version_requirement_spec.rb
|
@@ -135,6 +146,9 @@ files:
|
|
135
146
|
- tests/duplicate-dep/Rakefile
|
136
147
|
- tests/duplicate-dep/expected
|
137
148
|
- tests/duplicate-dep/metadata.json
|
149
|
+
- tests/duplicate-requirement/Rakefile
|
150
|
+
- tests/duplicate-requirement/expected
|
151
|
+
- tests/duplicate-requirement/metadata.json
|
138
152
|
- tests/json_format/Rakefile
|
139
153
|
- tests/json_format/expected
|
140
154
|
- tests/json_format/metadata.json
|
@@ -158,6 +172,9 @@ files:
|
|
158
172
|
- tests/no_pe/metadata.json
|
159
173
|
- tests/no_version_range/Rakefile
|
160
174
|
- tests/no_version_range/metadata.json
|
175
|
+
- tests/non_array_requirements/Rakefile
|
176
|
+
- tests/non_array_requirements/expected
|
177
|
+
- tests/non_array_requirements/metadata.json
|
161
178
|
- tests/noname/Rakefile
|
162
179
|
- tests/noname/expected
|
163
180
|
- tests/noname/metadata.json
|
@@ -176,6 +193,9 @@ files:
|
|
176
193
|
- tests/rake_multiple_json_options/Rakefile
|
177
194
|
- tests/rake_multiple_json_options/metadata_license.json
|
178
195
|
- tests/rake_multiple_json_options/metadata_ok.json
|
196
|
+
- tests/requirements_eol_version/Rakefile
|
197
|
+
- tests/requirements_eol_version/expected
|
198
|
+
- tests/requirements_eol_version/metadata.json
|
179
199
|
- tests/tags_no_array/Rakefile
|
180
200
|
- tests/tags_no_array/expected
|
181
201
|
- tests/tags_no_array/metadata.json
|
@@ -189,9 +209,13 @@ homepage: http://github.com/voxpupuli/metadata-json-lint
|
|
189
209
|
licenses:
|
190
210
|
- Apache-2.0
|
191
211
|
metadata: {}
|
192
|
-
post_install_message:
|
193
|
-
|
194
|
-
|
212
|
+
post_install_message: |2
|
213
|
+
|
214
|
+
----------------------------------------------------------
|
215
|
+
For the most accurate results, the semantic_puppet
|
216
|
+
gem should be included within your Gemfile if you
|
217
|
+
use Puppet <= 4.8.x
|
218
|
+
----------------------------------------------------------
|
195
219
|
rdoc_options: []
|
196
220
|
require_paths:
|
197
221
|
- lib
|
@@ -207,11 +231,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
231
|
version: '0'
|
208
232
|
requirements: []
|
209
233
|
rubyforge_project:
|
210
|
-
rubygems_version: 2.
|
234
|
+
rubygems_version: 2.7.7
|
211
235
|
signing_key:
|
212
236
|
specification_version: 4
|
213
237
|
summary: metadata-json-lint /path/to/metadata.json
|
214
238
|
test_files:
|
239
|
+
- spec/metadata_json_lint_spec.rb
|
215
240
|
- spec/schema_spec.rb
|
216
241
|
- spec/spec_helper.rb
|
217
242
|
- spec/version_requirement_spec.rb
|
@@ -224,6 +249,9 @@ test_files:
|
|
224
249
|
- tests/duplicate-dep/Rakefile
|
225
250
|
- tests/duplicate-dep/expected
|
226
251
|
- tests/duplicate-dep/metadata.json
|
252
|
+
- tests/duplicate-requirement/Rakefile
|
253
|
+
- tests/duplicate-requirement/expected
|
254
|
+
- tests/duplicate-requirement/metadata.json
|
227
255
|
- tests/json_format/Rakefile
|
228
256
|
- tests/json_format/expected
|
229
257
|
- tests/json_format/metadata.json
|
@@ -247,6 +275,9 @@ test_files:
|
|
247
275
|
- tests/no_pe/metadata.json
|
248
276
|
- tests/no_version_range/Rakefile
|
249
277
|
- tests/no_version_range/metadata.json
|
278
|
+
- tests/non_array_requirements/Rakefile
|
279
|
+
- tests/non_array_requirements/expected
|
280
|
+
- tests/non_array_requirements/metadata.json
|
250
281
|
- tests/noname/Rakefile
|
251
282
|
- tests/noname/expected
|
252
283
|
- tests/noname/metadata.json
|
@@ -265,6 +296,9 @@ test_files:
|
|
265
296
|
- tests/rake_multiple_json_options/Rakefile
|
266
297
|
- tests/rake_multiple_json_options/metadata_license.json
|
267
298
|
- tests/rake_multiple_json_options/metadata_ok.json
|
299
|
+
- tests/requirements_eol_version/Rakefile
|
300
|
+
- tests/requirements_eol_version/expected
|
301
|
+
- tests/requirements_eol_version/metadata.json
|
268
302
|
- tests/tags_no_array/Rakefile
|
269
303
|
- tests/tags_no_array/expected
|
270
304
|
- tests/tags_no_array/metadata.json
|