Skip to content

Commit 2f2e90e

Browse files
authored
feat: add fundedBy key (#258)
See publiccodeyml/publiccode.yml#220
1 parent 8b3a1c0 commit 2f2e90e

14 files changed

+619
-0
lines changed

parser_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,23 @@ func TestInvalidTestcasesV0(t *testing.T) {
342342
ValidationError{"usedBy", "wrong type for this field", 14, 1},
343343
},
344344

345+
// fundedBy
346+
"fundedBy_wrong_uri.yml": ValidationResults{
347+
ValidationError{"fundedBy[0].uri", "uri is not a valid URI", 0, 0},
348+
},
349+
"fundedBy_wrong_type.yml": ValidationResults{
350+
ValidationError{"fundedBy.name", "wrong type for this field", 18, 1},
351+
},
352+
"fundedBy_name_missing.yml": ValidationResults{
353+
ValidationError{"fundedBy[0].name", "name is a required field", 0, 0},
354+
},
355+
"fundedBy_uri_wrong_italian_pa.yml": ValidationResults{
356+
ValidationError{"fundedBy[0].uri", "uri is not a valid URI", 0, 0},
357+
},
358+
"fundedBy_uri_wrong_italian_pa2.yml": ValidationResults{
359+
ValidationError{"fundedBy[0].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)", 0, 0},
360+
},
361+
345362
// roadmap
346363
"roadmap_invalid.yml": ValidationResults{
347364
ValidationError{"roadmap", "roadmap must be an HTTP URL", 4, 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+
fundedBy:
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+
fundedBy:
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+
fundedBy:
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+
fundedBy:
17+
# Should NOT validate: fundedBy has to be 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+
fundedBy:
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+
fundedBy:
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)