357 lines
22 KiB
HTML
357 lines
22 KiB
HTML
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<link rel="stylesheet" href="../../../coverage.css"/> <title> dog_and_duck/quack/picky/constants.clj </title>
|
|
</head>
|
|
<body>
|
|
<span class="covered" title="1 out of 1 forms covered">
|
|
001 (ns dog-and-duck.quack.picky.constants
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
002 "Constants supporting the picky validator.")
|
|
</span><br/>
|
|
<span class="blank" title="0 out of 0 forms covered">
|
|
003
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
004 ;;; Copyright (C) Simon Brooke, 2022
|
|
</span><br/>
|
|
<span class="blank" title="0 out of 0 forms covered">
|
|
005
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
006 ;;; This program is free software; you can redistribute it and/or
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
007 ;;; modify it under the terms of the GNU General Public License
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
008 ;;; as published by the Free Software Foundation; either version 2
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
009 ;;; of the License, or (at your option) any later version.
|
|
</span><br/>
|
|
<span class="blank" title="0 out of 0 forms covered">
|
|
010
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
011 ;;; This program is distributed in the hope that it will be useful,
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
012 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
013 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
014 ;;; GNU General Public License for more details.
|
|
</span><br/>
|
|
<span class="blank" title="0 out of 0 forms covered">
|
|
015
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
016 ;;; You should have received a copy of the GNU General Public License
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
017 ;;; along with this program; if not, write to the Free Software
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
018 ;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
</span><br/>
|
|
<span class="blank" title="0 out of 0 forms covered">
|
|
019
|
|
</span><br/>
|
|
<span class="covered" title="2 out of 2 forms covered">
|
|
020 (def ^:const activitystreams-context-uri
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
021 "The URI of the context of an ActivityStreams object is expected to be this
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
022 literal string.
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
023
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
024 **NOTE THAT** the URI actually used in the published suite of
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
025 activitystreams-test-documents use this URI with 'http' rather than
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
026 'https' as the property part, but the spec itself specifies 'https'."
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
027 "https://www.w3.org/ns/activitystreams")
|
|
</span><br/>
|
|
<span class="blank" title="0 out of 0 forms covered">
|
|
028
|
|
</span><br/>
|
|
<span class="covered" title="1 out of 1 forms covered">
|
|
029 (def ^:const actor-types
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
030 "The set of types we will accept as actors.
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
031
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
032 There's an [explicit set of allowed actor types]
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
033 (https://www.w3.org/TR/activitystreams-vocabulary/#actor-types)."
|
|
</span><br/>
|
|
<span class="covered" title="6 out of 6 forms covered">
|
|
034 #{"Application"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
035 "Group"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
036 "Organization"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
037 "Person"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
038 "Service"})
|
|
</span><br/>
|
|
<span class="blank" title="0 out of 0 forms covered">
|
|
039
|
|
</span><br/>
|
|
<span class="covered" title="1 out of 1 forms covered">
|
|
040 (def ^:const context-key
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
041 "The Clojure reader barfs on `:@context`, although it is in principle a valid
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
042 keyword. So we'll make it once, here, to make the code more performant and
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
043 easier to read."
|
|
</span><br/>
|
|
<span class="covered" title="3 out of 3 forms covered">
|
|
044 (keyword "@context"))
|
|
</span><br/>
|
|
<span class="blank" title="0 out of 0 forms covered">
|
|
045
|
|
</span><br/>
|
|
<span class="covered" title="2 out of 2 forms covered">
|
|
046 (def ^:const re-rfc5646
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
047 "A regex which tests conformity to RFC 5646. Cribbed from
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
048 https://newbedev.com/regex-to-detect-locales"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
049 #"^[a-z]{2,4}(-[A-Z][a-z]{3})?(-([A-Z]{2}|[0-9]{3}))?$")
|
|
</span><br/>
|
|
<span class="blank" title="0 out of 0 forms covered">
|
|
050
|
|
</span><br/>
|
|
<span class="covered" title="1 out of 1 forms covered">
|
|
051 (def ^:const severity
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
052 "Severity of faults found, as follows:
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
053
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
054 0. `:info` not actually a fault, but an issue noted during validation;
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
055 1. `:minor` things which I consider to be faults, but which
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
056 don't actually breach the spec;
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
057 2. `:should` instances where the spec says something SHOULD
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
058 be done, which isn't;
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
059 3. `:must` instances where the spec says something MUST
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
060 be done, which isn't;
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
061 4. `:critical` instances where I believe the fault means that
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
062 the object cannot be meaningfully processed."
|
|
</span><br/>
|
|
<span class="covered" title="6 out of 6 forms covered">
|
|
063 #{:info :minor :should :must :critical})
|
|
</span><br/>
|
|
<span class="blank" title="0 out of 0 forms covered">
|
|
064
|
|
</span><br/>
|
|
<span class="covered" title="1 out of 1 forms covered">
|
|
065 (def ^:const severity-filters
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
066 "Hack for implementing a severity hierarchy"
|
|
</span><br/>
|
|
<span class="covered" title="8 out of 8 forms covered">
|
|
067 {:all #{}
|
|
</span><br/>
|
|
<span class="covered" title="1 out of 1 forms covered">
|
|
068 :info #{}
|
|
</span><br/>
|
|
<span class="covered" title="2 out of 2 forms covered">
|
|
069 :minor #{:info}
|
|
</span><br/>
|
|
<span class="covered" title="3 out of 3 forms covered">
|
|
070 :should #{:info :minor}
|
|
</span><br/>
|
|
<span class="covered" title="4 out of 4 forms covered">
|
|
071 :must #{:info :minor :should}
|
|
</span><br/>
|
|
<span class="covered" title="5 out of 5 forms covered">
|
|
072 :critical #{:info :minor :should :must}})
|
|
</span><br/>
|
|
<span class="blank" title="0 out of 0 forms covered">
|
|
073
|
|
</span><br/>
|
|
<span class="covered" title="2 out of 2 forms covered">
|
|
074 (def ^:const validation-fault-context-uri
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
075 "The URI of the context of a validation fault report object shall be this
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
076 literal string."
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
077 "https://simon-brooke.github.io/dog-and-duck/codox/Validation_Faults.html")
|
|
</span><br/>
|
|
<span class="blank" title="0 out of 0 forms covered">
|
|
078
|
|
</span><br/>
|
|
<span class="covered" title="1 out of 1 forms covered">
|
|
079 (def ^:const activity-types
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
080 "The set of types we will accept as activities.
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
081
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
082 There's an [explicit set of allowed activity types]
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
083 (https://www.w3.org/TR/activitystreams-vocabulary/#activity-types)."
|
|
</span><br/>
|
|
<span class="covered" title="29 out of 29 forms covered">
|
|
084 #{"Accept" "Add" "Announce" "Arrive" "Block" "Create" "Delete" "Dislike"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
085 "Flag" "Follow" "Ignore" "Invite" "Join" "Leave" "Like" "Listen" "Move"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
086 "Offer" "Question" "Reject" "Read" "Remove" "TentativeAccept"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
087 "TentativeReject" "Travel" "Undo" "Update" "View"})
|
|
</span><br/>
|
|
<span class="blank" title="0 out of 0 forms covered">
|
|
088
|
|
</span><br/>
|
|
<span class="covered" title="1 out of 1 forms covered">
|
|
089 (def ^:const noun-types
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
090 "The set of object types we will accept as nouns.
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
091
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
092 There's an [explicit set of allowed 'object types']
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
093 (https://www.w3.org/TR/activitystreams-vocabulary/#object-types), but by
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
094 implication it is not exhaustive."
|
|
</span><br/>
|
|
<span class="covered" title="16 out of 16 forms covered">
|
|
095 #{"Article"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
096 "Audio"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
097 "Document"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
098 "Event"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
099 "Image"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
100 "Link"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
101 "Mention"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
102 "Note"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
103 "Object"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
104 "Page"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
105 "Place"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
106 "Profile"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
107 "Relationsip"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
108 "Tombstone"
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
109 "Video"})
|
|
</span><br/>
|
|
<span class="blank" title="0 out of 0 forms covered">
|
|
110
|
|
</span><br/>
|
|
<span class="covered" title="1 out of 1 forms covered">
|
|
111 (def ^:const implicit-noun-types
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
112 "These types are not explicitly listed in [Section 3.3 of the spec]
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
113 (https://www.w3.org/TR/activitystreams-vocabulary/#object-types), but are
|
|
</span><br/>
|
|
<span class="not-tracked" title="0 out of 0 forms covered">
|
|
114 mentioned in narrative"
|
|
</span><br/>
|
|
<span class="covered" title="2 out of 2 forms covered">
|
|
115 #{"Link"})
|
|
</span><br/>
|
|
<span class="blank" title="0 out of 0 forms covered">
|
|
116
|
|
</span><br/>
|
|
</body>
|
|
</html>
|