Skip to content

Commit

Permalink
format-ns
Browse files Browse the repository at this point in the history
  • Loading branch information
ikitommi committed Feb 14, 2022
1 parent 2aba561 commit f3dee76
Show file tree
Hide file tree
Showing 62 changed files with 325 additions and 411 deletions.
3 changes: 2 additions & 1 deletion .lsp/config.edn
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
{:cljfmt {:indents {for-all [[:inner 0]]
are [[:inner 0]]}}}
are [[:inner 0]]}}
:clean {:ns-inner-blocks-indentation :same-line}}
8 changes: 3 additions & 5 deletions modules/reitit-core/src/reitit/coercion.cljc
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
(ns reitit.coercion
(:require
[clojure.walk :as walk]
[reitit.impl :as impl])
(:require [clojure.walk :as walk]
[reitit.impl :as impl])
#?(:clj
(:import
(java.io Writer))))
(:import (java.io Writer))))

;;
;; Protocol
Expand Down
7 changes: 3 additions & 4 deletions modules/reitit-core/src/reitit/core.cljc
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
(ns reitit.core
(:require
[reitit.exception :as exception]
[reitit.impl :as impl]
[reitit.trie :as trie]))
(:require [reitit.exception :as exception]
[reitit.impl :as impl]
[reitit.trie :as trie]))

;;
;; Expand
Expand Down
3 changes: 1 addition & 2 deletions modules/reitit-core/src/reitit/dependency.cljc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
(ns reitit.dependency
"Dependency resolution for middleware/interceptors."
(:require
[reitit.exception :as exception]))
(:require [reitit.exception :as exception]))

(defn- providers
"Map from provision key to provider. `get-provides` should return the provision keys of a dependent."
Expand Down
3 changes: 1 addition & 2 deletions modules/reitit-core/src/reitit/exception.cljc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(ns reitit.exception
(:require
[clojure.string :as str]))
(:require [clojure.string :as str]))

(defn fail!
([type]
Expand Down
16 changes: 7 additions & 9 deletions modules/reitit-core/src/reitit/impl.cljc
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
(ns ^:no-doc reitit.impl
#?(:cljs (:require-macros [reitit.impl]))
(:require
[clojure.set :as set]
[clojure.string :as str]
[meta-merge.core :as mm]
[reitit.exception :as ex]
[reitit.trie :as trie])
(:require [clojure.set :as set]
[clojure.string :as str]
[meta-merge.core :as mm]
[reitit.exception :as ex]
[reitit.trie :as trie])
#?(:clj
(:import
(java.net URLEncoder URLDecoder)
(java.util HashMap Map))))
(:import (java.net URLEncoder URLDecoder)
(java.util HashMap Map))))

(defn parse [path opts]
(let [path #?(:clj (.intern ^String (trie/normalize path opts)) :cljs (trie/normalize path opts))
Expand Down
11 changes: 5 additions & 6 deletions modules/reitit-core/src/reitit/interceptor.cljc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
(ns reitit.interceptor
(:require
[clojure.pprint :as pprint]
[meta-merge.core :refer [meta-merge]]
[reitit.core :as r]
[reitit.exception :as exception]
[reitit.impl :as impl]))
(:require [clojure.pprint :as pprint]
[meta-merge.core :refer [meta-merge]]
[reitit.core :as r]
[reitit.exception :as exception]
[reitit.impl :as impl]))

(defprotocol IntoInterceptor
(into-interceptor [this data opts]))
Expand Down
11 changes: 5 additions & 6 deletions modules/reitit-core/src/reitit/middleware.cljc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
(ns reitit.middleware
(:require
[clojure.pprint :as pprint]
[meta-merge.core :refer [meta-merge]]
[reitit.core :as r]
[reitit.exception :as exception]
[reitit.impl :as impl]))
(:require [clojure.pprint :as pprint]
[meta-merge.core :refer [meta-merge]]
[reitit.core :as r]
[reitit.exception :as exception]
[reitit.impl :as impl]))

(defprotocol IntoMiddleware
(into-middleware [this data opts]))
Expand Down
9 changes: 4 additions & 5 deletions modules/reitit-core/src/reitit/spec.cljc
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
(ns reitit.spec
(:require
[clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]
[reitit.core :as r]
[reitit.exception :as exception]))
(:require [clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]
[reitit.core :as r]
[reitit.exception :as exception]))

;;
;; routes
Expand Down
10 changes: 4 additions & 6 deletions modules/reitit-core/src/reitit/trie.cljc
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
(ns reitit.trie
(:refer-clojure :exclude [compile])
(:require
[clojure.string :as str]
[reitit.exception :as ex])
#?(:clj (:import
(java.net URLDecoder)
[reitit Trie Trie$Match Trie$Matcher])))
(:require [clojure.string :as str]
[reitit.exception :as ex])
#?(:clj (:import (java.net URLDecoder)
[reitit Trie Trie$Match Trie$Matcher])))

(defn ^:no-doc into-set [x]
(cond
Expand Down
25 changes: 12 additions & 13 deletions modules/reitit-dev/src/reitit/dev/pretty.cljc
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
(ns reitit.dev.pretty
(:require
[arrangement.core] ;; spell-spec
[clojure.spec.alpha :as s]
[clojure.string :as str]
[expound.alpha] ;; fipp
[expound.ansi]
[fipp.edn]
[fipp.ednize]
[fipp.engine]
[fipp.visit]
[reitit.exception :as exception]
[spell-spec.expound] ;; expound
))
(:require [arrangement.core] ;; spell-spec
[clojure.spec.alpha :as s]
[clojure.string :as str]
[expound.alpha] ;; fipp
[expound.ansi]
[fipp.edn]
[fipp.ednize]
[fipp.engine]
[fipp.visit]
[reitit.exception :as exception]
[spell-spec.expound] ;; expound
))

;;
;; colors
Expand Down
12 changes: 5 additions & 7 deletions modules/reitit-frontend/src/reitit/frontend.cljs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
(ns reitit.frontend
(:require
[clojure.set :as set]
[reitit.coercion :as coercion]
[reitit.core :as r])
(:import
goog.Uri
goog.Uri.QueryData))
(:require [clojure.set :as set]
[reitit.coercion :as coercion]
[reitit.core :as r])
(:import goog.Uri
goog.Uri.QueryData))

(defn- query-param [^QueryData q k]
(let [vs (.getValues q k)]
Expand Down
3 changes: 1 addition & 2 deletions modules/reitit-frontend/src/reitit/frontend/easy.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"Easy wrapper over reitit.frontend.history,
handling the state. Only one router can be active
at a time."
(:require
[reitit.frontend.history :as rfh]))
(:require [reitit.frontend.history :as rfh]))

(defonce history (atom nil))

Expand Down
10 changes: 4 additions & 6 deletions modules/reitit-frontend/src/reitit/frontend/history.cljs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
(ns reitit.frontend.history
"Provides integration to hash-change or HTML5 History
events."
(:require
[goog.events :as gevents]
[reitit.core :as reitit]
[reitit.frontend :as rf])
(:import
goog.Uri))
(:require [goog.events :as gevents]
[reitit.core :as reitit]
[reitit.frontend :as rf])
(:import goog.Uri))

(defprotocol History
(-init [this] "Create event listeners")
Expand Down
11 changes: 5 additions & 6 deletions modules/reitit-http/src/reitit/http.cljc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
(ns reitit.http
(:require
[meta-merge.core :refer [meta-merge]]
[reitit.core :as r]
[reitit.exception :as ex]
[reitit.interceptor :as interceptor]
[reitit.ring :as ring]))
(:require [meta-merge.core :refer [meta-merge]]
[reitit.core :as r]
[reitit.exception :as ex]
[reitit.interceptor :as interceptor]
[reitit.ring :as ring]))

(defrecord Endpoint [data interceptors queue handler path method])

Expand Down
7 changes: 3 additions & 4 deletions modules/reitit-http/src/reitit/http/coercion.cljc
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
(ns reitit.http.coercion
(:require
[reitit.coercion :as coercion]
[reitit.impl :as impl]
[reitit.spec :as rs]))
(:require [reitit.coercion :as coercion]
[reitit.impl :as impl]
[reitit.spec :as rs]))

(defn coerce-request-interceptor
"Interceptor for pluggable request coercion.
Expand Down
11 changes: 5 additions & 6 deletions modules/reitit-http/src/reitit/http/spec.cljc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
(ns reitit.http.spec
(:require
[clojure.spec.alpha :as s]
[reitit.exception :as exception]
[reitit.interceptor :as interceptor]
[reitit.ring.spec :as rrs]
[reitit.spec :as rs]))
(:require [clojure.spec.alpha :as s]
[reitit.exception :as exception]
[reitit.interceptor :as interceptor]
[reitit.ring.spec :as rrs]
[reitit.spec :as rs]))

;;
;; Specs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
(ns reitit.http.interceptors.dev
(:require
[lambdaisland.deep-diff :as ddiff]
[lambdaisland.deep-diff.printer :as printer]
[puget.color :as color]
[reitit.core :as r]))
(:require [lambdaisland.deep-diff :as ddiff]
[lambdaisland.deep-diff.printer :as printer]
[puget.color :as color]
[reitit.core :as r]))

(def printer
(-> (printer/puget-printer)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
(ns reitit.http.interceptors.exception
(:require
[clojure.spec.alpha :as s]
[clojure.string :as str]
[reitit.coercion :as coercion]
[reitit.ring :as ring])
(:import
(java.io PrintWriter Writer)
(java.time Instant)))
(:require [clojure.spec.alpha :as s]
[clojure.string :as str]
[reitit.coercion :as coercion]
[reitit.ring :as ring])
(:import (java.io PrintWriter Writer)
(java.time Instant)))

(s/def ::handlers (s/map-of any? fn?))
(s/def ::spec (s/keys :opt-un [::handlers]))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
(ns reitit.http.interceptors.multipart
(:require
[clojure.spec.alpha :as s]
[reitit.coercion :as coercion]
[reitit.spec]
[ring.middleware.multipart-params :as multipart-params]
[spec-tools.core :as st])
(:import
(java.io File)))
(:require [clojure.spec.alpha :as s]
[reitit.coercion :as coercion]
[reitit.spec]
[ring.middleware.multipart-params :as multipart-params]
[spec-tools.core :as st])
(:import (java.io File)))

(s/def ::filename string?)
(s/def ::content-type string?)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
(ns reitit.http.interceptors.muuntaja
(:require
[clojure.spec.alpha :as s]
[muuntaja.core :as m]
[muuntaja.interceptor]))
(:require [clojure.spec.alpha :as s]
[muuntaja.core :as m]
[muuntaja.interceptor]))

(s/def ::muuntaja m/muuntaja?)
(s/def ::spec (s/keys :opt-un [::muuntaja]))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(ns reitit.http.interceptors.parameters
(:require
[ring.middleware.params :as params]))
(:require [ring.middleware.params :as params]))

(defn parameters-interceptor
"Interceptor to parse urlencoded parameters from the query string and form
Expand Down
21 changes: 10 additions & 11 deletions modules/reitit-malli/src/reitit/coercion/malli.cljc
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
(ns reitit.coercion.malli
(:require
[clojure.set :as set]
[clojure.walk :as walk]
[malli.core :as m]
[malli.edn :as edn]
[malli.error :as me]
[malli.experimental.lite :as l]
[malli.swagger :as swagger]
[malli.transform :as mt]
[malli.util :as mu]
[reitit.coercion :as coercion]))
(:require [clojure.set :as set]
[clojure.walk :as walk]
[malli.core :as m]
[malli.edn :as edn]
[malli.error :as me]
[malli.experimental.lite :as l]
[malli.swagger :as swagger]
[malli.transform :as mt]
[malli.util :as mu]
[reitit.coercion :as coercion]))

;;
;; coercion
Expand Down
3 changes: 1 addition & 2 deletions modules/reitit-malli/src/reitit/ring/malli.cljc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(ns reitit.ring.malli
#?(:clj (:import
(java.io File))))
#?(:clj (:import (java.io File))))

#?(:clj
(def temp-file-part
Expand Down
9 changes: 4 additions & 5 deletions modules/reitit-middleware/src/reitit/ring/middleware/dev.clj
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
(ns reitit.ring.middleware.dev
(:require
[lambdaisland.deep-diff :as ddiff]
[lambdaisland.deep-diff.printer :as printer]
[puget.color :as color]
[reitit.core :as r]))
(:require [lambdaisland.deep-diff :as ddiff]
[lambdaisland.deep-diff.printer :as printer]
[puget.color :as color]
[reitit.core :as r]))

(def printer
(-> (printer/puget-printer)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
(ns reitit.ring.middleware.exception
(:require
[clojure.spec.alpha :as s]
[clojure.string :as str]
[reitit.coercion :as coercion]
[reitit.ring :as ring])
(:import
(java.io Writer PrintWriter)
(java.time Instant)))
(:require [clojure.spec.alpha :as s]
[clojure.string :as str]
[reitit.coercion :as coercion]
[reitit.ring :as ring])
(:import (java.io Writer PrintWriter)
(java.time Instant)))

(s/def ::handlers (s/map-of any? fn?))
(s/def ::spec (s/keys :opt-un [::handlers]))
Expand Down
Loading

0 comments on commit f3dee76

Please sign in to comment.