Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,18 @@ func validateFieldsV0(publiccode PublicCode, parser *Parser, network bool, baseU

if it != nil {
if it.Conforme != nil {
vr = append(vr, newValidationWarning(
"IT.conforme",
"This key is DEPRECATED and will be removed in the future. It's safe to drop it",
))
if it.Conforme.GDPR != nil && *it.Conforme.GDPR {
vr = append(vr, newValidationWarning(
"IT.conforme.gdpr",
"This key is DEPRECATED and will be removed in the future. "+
"Add a 'supports' entry with id 'alias:gdpr' instead",
))
} else {
vr = append(vr, newValidationWarning(
"IT.conforme",
"This key is DEPRECATED and will be removed in the future. It's safe to drop it",
))
}
}

if it.Riuso.CodiceIPA != "" {
Expand Down
114 changes: 114 additions & 0 deletions testdata/v0/valid_with_warnings/valid_with_it_conforme_gdpr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
publiccodeYmlVersion: "0"

name: Medusa
applicationSuite: MegaProductivitySuite
url: "https://github.com/italia/developers.italia.it.git"

isBasedOn: ["https://github.com/italia/developers.italia.it.git"]
softwareVersion: "1.0"
releaseDate: 2017-04-15

platforms:
- android
- ios

categories:
- cloud-management

roadmap: "https://designers.italia.it/roadmap/"

developmentStatus: development

softwareType: "standalone/other"

intendedAudience:
countries:
- IT
- DE

description:
en:
localisedName: Medusa
shortDescription: "A really interesting software."
longDescription: >
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 158 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 316 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 474 characters.
Very long description of this software, also split
on multiple rows. You should note what the software
is and why one should need it. This is 632 characters.

documentation: "https://raw.githubusercontent.com/italia/publiccode-parser-go/2a1f25a36e0f2ab2d71efb67db8b66ff00573fbe/testdata/v0/valid_with_warnings/valid_with_it_conforme.yml"
apiDocumentation: "https://developers.italia.it/it/api"

features:
- Very important feature
- Will run without a problem
- Has zero bugs
- Solves all the problems of the world
awards:
- 1st Price Software of the year

legal:
license: AGPL-3.0-or-later # SPDX expression of license
mainCopyrightOwner: City of Chicago

maintenance:
type: "contract"

contractors:
- name: "Fornitore Privato SPA" # if maintainance is a contract
website: "https://developers.italia.it"
until: "2019-01-01"

contacts:
- name: Francesco Rossi
email: "francesco.rossi@comune.reggioemilia.it"
affiliation: Comune di Reggio Emilia
phone: +3923113215112
- name: Dario Bianchi
email: "dario.bianchi@fornitore.it"
affiliation: Fornitore Privato S.P.A.
phone: +391624231322
- name: Giancarlo Verdi
email: "dario.bianchi@fornitore.it"
affiliation: Fornitore Privato S.P.A.
phone: +391624231322

localisation:
localisationReady: true
availableLanguages:
- en
- it
- fr
- de

dependsOn:
proprietary:
- name: Oracle
versionMin: "11.4"
- name: IBM SoftLayer
hardware:
- name: NFC Reader
optional: true

IT:
# Should have warnings for IT.conforme, because it is deprecated
conforme:
lineeGuidaDesign: true
modelloInteroperabilita: true
misureMinimeSicurezza: true
# Fields can also be nil
gdpr: true

piattaforme:
spid: false
pagopa: false
cie: false
anpr: false
3 changes: 3 additions & 0 deletions v0_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,9 @@ func TestValidWithWarningsTestcasesV0(t *testing.T) {
ValidationWarning{"", "inputTypes", "This key is DEPRECATED and will be removed in the future. It's safe to drop it", 48, 1},
ValidationWarning{"", "outputTypes", "This key is DEPRECATED and will be removed in the future. It's safe to drop it", 50, 1},
},
"valid_with_it_conforme_gdpr.yml": ValidationResults{
ValidationWarning{"", "IT.conforme.gdpr", "This key is DEPRECATED and will be removed in the future. Add a 'supports' entry with id 'alias:gdpr' instead", 108, 5},
},
"valid_with_it_conforme.yml": ValidationResults{
ValidationWarning{"", "IT.conforme", "This key is DEPRECATED and will be removed in the future. It's safe to drop it", 103, 3},
},
Expand Down
Loading