{"action":"created","issue":{"url":"https://api.github.com/repos/w3c/specberus/issues/212","labels_url":"https://api.github.com/repos/w3c/specberus/issues/212/labels{/name}","comments_url":"https://api.github.com/repos/w3c/specberus/issues/212/comments","events_url":"https://api.github.com/repos/w3c/specberus/issues/212/events","html_url":"https://github.com/w3c/specberus/pull/212","id":94973506,"number":212,"title":"Initial support for exceptions","user":{"login":"plehegar","id":1490400,"avatar_url":"https://avatars.githubusercontent.com/u/1490400?v=3","gravatar_id":"","url":"https://api.github.com/users/plehegar","html_url":"https://github.com/plehegar","followers_url":"https://api.github.com/users/plehegar/followers","following_url":"https://api.github.com/users/plehegar/following{/other_user}","gists_url":"https://api.github.com/users/plehegar/gists{/gist_id}","starred_url":"https://api.github.com/users/plehegar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plehegar/subscriptions","organizations_url":"https://api.github.com/users/plehegar/orgs","repos_url":"https://api.github.com/users/plehegar/repos","events_url":"https://api.github.com/users/plehegar/events{/privacy}","received_events_url":"https://api.github.com/users/plehegar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/w3c/specberus/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"tripu","id":1016538,"avatar_url":"https://avatars.githubusercontent.com/u/1016538?v=3","gravatar_id":"","url":"https://api.github.com/users/tripu","html_url":"https://github.com/tripu","followers_url":"https://api.github.com/users/tripu/followers","following_url":"https://api.github.com/users/tripu/following{/other_user}","gists_url":"https://api.github.com/users/tripu/gists{/gist_id}","starred_url":"https://api.github.com/users/tripu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tripu/subscriptions","organizations_url":"https://api.github.com/users/tripu/orgs","repos_url":"https://api.github.com/users/tripu/repos","events_url":"https://api.github.com/users/tripu/events{/privacy}","received_events_url":"https://api.github.com/users/tripu/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-07-14T15:33:33Z","updated_at":"2015-07-15T03:12:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/w3c/specberus/pulls/212","html_url":"https://github.com/w3c/specberus/pull/212","diff_url":"https://github.com/w3c/specberus/pull/212.diff","patch_url":"https://github.com/w3c/specberus/pull/212.patch"},"body":"This allows exceptions per spec, eg\r\n\r\n```json\r\n  \"hr-time-2\": [\r\n    {\r\n      \"key\": \"error\",\r\n      \"name\": \"validation.css\"\r\n    },\r\n    {\r\n      \"key\": \"error\",\r\n      \"extra\":\r\n      {\r\n        \"message\": \"Attribute for not allowed on element a\"\r\n      },\r\n      \"name\": \"validation.html\"\r\n    }\r\n  ]\r\n```\r\n\r\nAddresses #208 "},"comment":{"url":"https://api.github.com/repos/w3c/specberus/issues/comments/121471027","html_url":"https://github.com/w3c/specberus/pull/212#issuecomment-121471027","issue_url":"https://api.github.com/repos/w3c/specberus/issues/212","id":121471027,"user":{"login":"tripu","id":1016538,"avatar_url":"https://avatars.githubusercontent.com/u/1016538?v=3","gravatar_id":"","url":"https://api.github.com/users/tripu","html_url":"https://github.com/tripu","followers_url":"https://api.github.com/users/tripu/followers","following_url":"https://api.github.com/users/tripu/following{/other_user}","gists_url":"https://api.github.com/users/tripu/gists{/gist_id}","starred_url":"https://api.github.com/users/tripu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tripu/subscriptions","organizations_url":"https://api.github.com/users/tripu/orgs","repos_url":"https://api.github.com/users/tripu/repos","events_url":"https://api.github.com/users/tripu/events{/privacy}","received_events_url":"https://api.github.com/users/tripu/received_events","type":"User","site_admin":false},"created_at":"2015-07-15T03:12:06Z","updated_at":"2015-07-15T03:12:06Z","body":"Thank you, @plehegar! See the couple of minor comments inline about your changes.\r\n\r\nApart from that, I have these suggestions (most important at the top):\r\n\r\n* iiuc, this new logic (have *errors* be only *warnings* when they're granted by an exception) works only when using Specberus stand-alone, ie its web interface. For all this to work also when used as an npm package, eg from Echidna, these changes should be in the class `Specberus`: filtering these errors in [`Specberus#error()`](https://github.com/w3c/specberus/blob/master/lib/validator.js#L91), etc. I think `app.js` would remain unchanged.\r\n* As it is now, errors are only &ldquo;filtered&rdquo; if we know the shortname. But that happens only [when the rule `headers/dl` returns metadata `latestVersion`](https://github.com/w3c/specberus/blob/master/lib/rules/headers/dl.js#L125). There are quite a few rules being applied [before that one](https://github.com/w3c/specberus/blob/master/lib/profiles/base.js#L32), for all profiles. I think exceptions for those would not work.\r\n* Which brings me to my next suggestion: I would prefer to have this logic isolated in a new rule, one that would be applied at the very beginning, for every profile (as the first element in [the base `rules` array](https://github.com/w3c/specberus/blob/master/lib/profiles/base.js#L26)). That way, we make sure the shortname will be known by the time all the other rules are applied. As this isn't really a *rule*, I'd put it inside `rules/heuristic/`.\r\n* Finally, I'm OK with your JSON definition (with *keys* and *names*), but I fear that matching UI messages too (*&ldquo;Attribute for not allowed on element a&rdquo;*) is going to be fragile and error-prone (because comparing strings of natural language verbatim always is). If someone simply fixes a typo in a validator, or in a L10n file of Specberus, or if the description of an error is rewritten to make it clearer for users&hellip; those are merely stylistic changes that should not cause a bunch of specs to suddenly stop validating, I think. Not sure what is the solution here, though. Ideas appreciated!"}}