Skip to content

Commit

Permalink
validate: Validate fd.o domain name, make GNOME warning only pedantic
Browse files Browse the repository at this point in the history
GNOME says that they're not ready yet to have this a high-priority
warning, so we hide it behind pedantic for now.
  • Loading branch information
ximion committed Oct 6, 2016
1 parent 7ab3795 commit d7e1435
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/as-validator.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,14 @@ as_validator_validate_component_id (AsValidator *validator, xmlNode *idnode, AsC
}

/* project-group specific constraints on the ID */
if (g_strcmp0 (as_component_get_project_group (cpt), "KDE") == 0) {
if ((g_strcmp0 (as_component_get_project_group (cpt), "Freedesktop") == 0) ||
(g_strcmp0 (as_component_get_project_group (cpt), "FreeDesktop") == 0)) {
if (!g_str_has_prefix (cid, "org.freedesktop."))
as_validator_add_issue (validator, idnode,
AS_ISSUE_IMPORTANCE_ERROR,
AS_ISSUE_KIND_VALUE_WRONG,
"The component is part of the Freedesktop project, but its id does not start with fd.o's reverse-DNS name (\"org.freedesktop\").");
} else if (g_strcmp0 (as_component_get_project_group (cpt), "KDE") == 0) {
if (!g_str_has_prefix (cid, "org.kde."))
as_validator_add_issue (validator, idnode,
AS_ISSUE_IMPORTANCE_ERROR,
Expand All @@ -471,7 +478,7 @@ as_validator_validate_component_id (AsValidator *validator, xmlNode *idnode, AsC
} else if (g_strcmp0 (as_component_get_project_group (cpt), "GNOME") == 0) {
if (!g_str_has_prefix (cid, "org.gnome."))
as_validator_add_issue (validator, idnode,
AS_ISSUE_IMPORTANCE_ERROR,
AS_ISSUE_IMPORTANCE_PEDANTIC,
AS_ISSUE_KIND_VALUE_WRONG,
"The component is part of the GNOME project, but its id does not start with GNOMEs reverse-DNS name (\"org.gnome\").");
}
Expand Down

0 comments on commit d7e1435

Please sign in to comment.