Skip to content

Commit 6fb6e27

Browse files
committed
feat: add organisation
See publiccodeyml/publiccode.yml#229
1 parent 2be0e5e commit 6fb6e27

11 files changed

+514
-0
lines changed

parser_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,24 @@ func TestInvalidTestcasesV0(t *testing.T) {
300300
ValidationError{"monochromeLogo", "no such file: " + cwd + "/testdata/v0/invalid/no_such_file.png", 18, 1},
301301
},
302302

303+
// organisation
304+
"organisation_wrong_uri.yml": ValidationResults{
305+
ValidationError{"organisation.uri", "uri is not a valid URI", 19, 3},
306+
},
307+
"organisation_wrong_type.yml": ValidationResults{
308+
ValidationError{"organisation.name", "wrong type for this field", 18, 1},
309+
ValidationError{"organisation.name", "name is a required field", 18, 3},
310+
},
311+
"organisation_name_missing.yml": ValidationResults{
312+
ValidationError{"organisation.name", "name is a required field", 17, 3},
313+
},
314+
"organisation_uri_wrong_italian_pa.yml": ValidationResults{
315+
ValidationError{"organisation.uri", "uri is not a valid URI", 20, 3},
316+
},
317+
"organisation_uri_wrong_italian_pa2.yml": ValidationResults{
318+
ValidationError{"organisation.uri", "uri must be a valid Italian Public Administration Code (iPA) with format 'urn:x-italian-pa:[codiceIPA]' (see https://www.indicepa.gov.it/public-services/opendata-read-service.php?dstype=FS&filename=amministrazioni.txt)", 19, 3},
319+
},
320+
303321
// inputTypes
304322
"inputTypes_invalid.yml": ValidationResults{
305323
ValidationError{"inputTypes[1]", "inputTypes[1] is not a valid MIME type", 1, 1},
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
publiccodeYmlVersion: "0.4"
2+
3+
name: Medusa
4+
url: "https://github.com/italia/developers.italia.it.git"
5+
6+
platforms:
7+
- web
8+
9+
categories:
10+
- cloud-management
11+
12+
developmentStatus: development
13+
14+
softwareType: "standalone/other"
15+
16+
organisation:
17+
uri: "https://example.org"
18+
# Should NOT validate: name is missing
19+
# name: foobar
20+
21+
description:
22+
en-GB:
23+
localisedName: Medusa
24+
shortDescription: >
25+
A rather short description which
26+
is probably useless
27+
longDescription: >
28+
Very long description of this software, also split
29+
on multiple rows. You should note what the software
30+
is and why one should need it. This is 158 characters.
31+
Very long description of this software, also split
32+
on multiple rows. You should note what the software
33+
is and why one should need it. This is 316 characters.
34+
Very long description of this software, also split
35+
on multiple rows. You should note what the software
36+
is and why one should need it. This is 474 characters.
37+
Very long description of this software, also split
38+
on multiple rows. You should note what the software
39+
is and why one should need it. This is 632 characters.
40+
features:
41+
- Just one feature
42+
43+
legal:
44+
license: AGPL-3.0-or-later
45+
46+
maintenance:
47+
type: "community"
48+
49+
contacts:
50+
- name: Francesco Rossi
51+
52+
localisation:
53+
localisationReady: true
54+
availableLanguages:
55+
- en
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
publiccodeYmlVersion: "0.4"
2+
3+
name: Medusa
4+
url: "https://github.com/italia/developers.italia.it.git"
5+
6+
platforms:
7+
- web
8+
9+
categories:
10+
- cloud-management
11+
12+
developmentStatus: development
13+
14+
softwareType: "standalone/other"
15+
16+
organisation:
17+
name: foobar
18+
# Should NOT validate: uri is a literal Italian CodiceIPA,
19+
# but should be in the format urn:x-italian-pa:[codiceIPA]
20+
uri: pcm
21+
22+
description:
23+
en-GB:
24+
localisedName: Medusa
25+
shortDescription: >
26+
A rather short description which
27+
is probably useless
28+
longDescription: >
29+
Very long description of this software, also split
30+
on multiple rows. You should note what the software
31+
is and why one should need it. This is 158 characters.
32+
Very long description of this software, also split
33+
on multiple rows. You should note what the software
34+
is and why one should need it. This is 316 characters.
35+
Very long description of this software, also split
36+
on multiple rows. You should note what the software
37+
is and why one should need it. This is 474 characters.
38+
Very long description of this software, also split
39+
on multiple rows. You should note what the software
40+
is and why one should need it. This is 632 characters.
41+
features:
42+
- Just one feature
43+
44+
legal:
45+
license: AGPL-3.0-or-later
46+
47+
maintenance:
48+
type: "community"
49+
50+
contacts:
51+
- name: Francesco Rossi
52+
53+
localisation:
54+
localisationReady: true
55+
availableLanguages:
56+
- en
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
publiccodeYmlVersion: "0.4"
2+
3+
name: Medusa
4+
url: "https://github.com/italia/developers.italia.it.git"
5+
6+
platforms:
7+
- web
8+
9+
categories:
10+
- cloud-management
11+
12+
developmentStatus: development
13+
14+
softwareType: "standalone/other"
15+
16+
organisation:
17+
name: foobar
18+
# Should NOT validate: invalid Italian PA,
19+
uri: urn:x-italian-pa:no_such_pa
20+
21+
description:
22+
en-GB:
23+
localisedName: Medusa
24+
shortDescription: >
25+
A rather short description which
26+
is probably useless
27+
longDescription: >
28+
Very long description of this software, also split
29+
on multiple rows. You should note what the software
30+
is and why one should need it. This is 158 characters.
31+
Very long description of this software, also split
32+
on multiple rows. You should note what the software
33+
is and why one should need it. This is 316 characters.
34+
Very long description of this software, also split
35+
on multiple rows. You should note what the software
36+
is and why one should need it. This is 474 characters.
37+
Very long description of this software, also split
38+
on multiple rows. You should note what the software
39+
is and why one should need it. This is 632 characters.
40+
features:
41+
- Just one feature
42+
43+
legal:
44+
license: AGPL-3.0-or-later
45+
46+
maintenance:
47+
type: "community"
48+
49+
contacts:
50+
- name: Francesco Rossi
51+
52+
localisation:
53+
localisationReady: true
54+
availableLanguages:
55+
- en
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
publiccodeYmlVersion: "0.4"
2+
3+
name: Medusa
4+
url: "https://github.com/italia/developers.italia.it.git"
5+
6+
platforms:
7+
- web
8+
9+
categories:
10+
- cloud-management
11+
12+
developmentStatus: development
13+
14+
softwareType: "standalone/other"
15+
16+
organisation:
17+
# Should NOT validate: organisation has to be an object, not a list
18+
- name: foobar
19+
uri: "urn:foo:bar"
20+
21+
description:
22+
en-GB:
23+
localisedName: Medusa
24+
shortDescription: >
25+
A rather short description which
26+
is probably useless
27+
longDescription: >
28+
Very long description of this software, also split
29+
on multiple rows. You should note what the software
30+
is and why one should need it. This is 158 characters.
31+
Very long description of this software, also split
32+
on multiple rows. You should note what the software
33+
is and why one should need it. This is 316 characters.
34+
Very long description of this software, also split
35+
on multiple rows. You should note what the software
36+
is and why one should need it. This is 474 characters.
37+
Very long description of this software, also split
38+
on multiple rows. You should note what the software
39+
is and why one should need it. This is 632 characters.
40+
features:
41+
- Just one feature
42+
43+
legal:
44+
license: AGPL-3.0-or-later
45+
46+
maintenance:
47+
type: "community"
48+
49+
contacts:
50+
- name: Francesco Rossi
51+
52+
localisation:
53+
localisationReady: true
54+
availableLanguages:
55+
- en
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
publiccodeYmlVersion: "0.4"
2+
3+
name: Medusa
4+
url: "https://github.com/italia/developers.italia.it.git"
5+
6+
platforms:
7+
- web
8+
9+
categories:
10+
- cloud-management
11+
12+
developmentStatus: development
13+
14+
softwareType: "standalone/other"
15+
16+
organisation:
17+
name: foobar
18+
# Should NOT validate: uri is an invalid URI
19+
uri: "1"
20+
21+
description:
22+
en-GB:
23+
localisedName: Medusa
24+
shortDescription: >
25+
A rather short description which
26+
is probably useless
27+
longDescription: >
28+
Very long description of this software, also split
29+
on multiple rows. You should note what the software
30+
is and why one should need it. This is 158 characters.
31+
Very long description of this software, also split
32+
on multiple rows. You should note what the software
33+
is and why one should need it. This is 316 characters.
34+
Very long description of this software, also split
35+
on multiple rows. You should note what the software
36+
is and why one should need it. This is 474 characters.
37+
Very long description of this software, also split
38+
on multiple rows. You should note what the software
39+
is and why one should need it. This is 632 characters.
40+
features:
41+
- Just one feature
42+
43+
legal:
44+
license: AGPL-3.0-or-later
45+
46+
maintenance:
47+
type: "community"
48+
49+
contacts:
50+
- name: Francesco Rossi
51+
52+
localisation:
53+
localisationReady: true
54+
availableLanguages:
55+
- en
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
publiccodeYmlVersion: "0.4"
2+
3+
name: Medusa
4+
url: "https://github.com/italia/developers.italia.it.git"
5+
6+
platforms:
7+
- web
8+
9+
categories:
10+
- cloud-management
11+
12+
developmentStatus: development
13+
14+
softwareType: "standalone/other"
15+
16+
organisation:
17+
name: foobar
18+
19+
description:
20+
en-GB:
21+
localisedName: Medusa
22+
shortDescription: >
23+
A rather short description which
24+
is probably useless
25+
longDescription: >
26+
Very long description of this software, also split
27+
on multiple rows. You should note what the software
28+
is and why one should need it. This is 158 characters.
29+
Very long description of this software, also split
30+
on multiple rows. You should note what the software
31+
is and why one should need it. This is 316 characters.
32+
Very long description of this software, also split
33+
on multiple rows. You should note what the software
34+
is and why one should need it. This is 474 characters.
35+
Very long description of this software, also split
36+
on multiple rows. You should note what the software
37+
is and why one should need it. This is 632 characters.
38+
features:
39+
- Just one feature
40+
41+
legal:
42+
license: AGPL-3.0-or-later
43+
44+
maintenance:
45+
type: "community"
46+
47+
contacts:
48+
- name: Francesco Rossi
49+
50+
localisation:
51+
localisationReady: true
52+
availableLanguages:
53+
- en

0 commit comments

Comments
 (0)