spec now is valid

This commit is contained in:
jem 2020-05-13 17:49:37 +02:00
parent 0ae68af441
commit fed673f07c
2 changed files with 5 additions and 2 deletions

View file

@ -19,12 +19,14 @@
(s/def ::twitter map?) (s/def ::twitter map?)
(s/def ::tumblr map?) (s/def ::tumblr map?)
(s/def ::rss map?) (s/def ::rss map?)
(def config? (s/keys :req [::mastodon-config] (def config? (s/keys :req [::mastodon-config]
:opt [::twitter ::tumblr ::rss])) :opt [::twitter ::tumblr ::rss]))
(s/def ::config config?)
;this has to stay on top - only ns-keywords can be uses in spec ;this has to stay on top - only ns-keywords can be uses in spec
(defn-spec mastodon-config ::mastodon-config (defn-spec mastodon-config ::mastodon-config
[config any?] [config ::config]
(::mastodon-config config)) (::mastodon-config config))
(defn find-config [] (defn find-config []
@ -161,3 +163,4 @@
(parse-feed last-post-time parser feed)))))))) (parse-feed last-post-time parser feed))))))))
(set! *main-cli-fn* -main) (set! *main-cli-fn* -main)
(st/instrument 'mastodon-config)

View file

@ -24,7 +24,7 @@
(s/def ::max-post-length (fn [n] (and (s/def ::max-post-length (fn [n] (and
(int? n) (int? n)
(<= n 600) (<= n 600)
(< n 0)))) (> n 0))))
(s/def ::content-filters (s/* ::content-filter)) (s/def ::content-filters (s/* ::content-filter))
(s/def ::keyword-filters (s/* ::keyword-filter)) (s/def ::keyword-filters (s/* ::keyword-filter))