Skip to content

Commit 83bb554

Browse files
committed
Format project using pruner
1 parent 5216d5e commit 83bb554

File tree

13 files changed

+144
-144
lines changed

13 files changed

+144
-144
lines changed

packages/kmono-build/src/k16/kmono/build.clj

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
(defn published?
1717
"A `predicate-fn` designed to be used with [[k16.kmono.core.graph/filter-by]].
1818
19-
Checks whether a given `package` has been published to it's maven repository.
20-
The repositories from the packages `:mvn/deps` map will be used to run this
21-
check.
19+
Checks whether a given `package` has been published to it's maven repository.
20+
The repositories from the packages `:mvn/deps` map will be used to run this
21+
check.
2222
23-
Requires that the package has a `:version` set in order to perform a maven
24-
query.
23+
Requires that the package has a `:version` set in order to perform a maven
24+
query.
2525
26-
This fn will just return `false` if the package `:version` is not set."
26+
This fn will just return `false` if the package `:version` is not set."
2727
[package]
2828
(let [local-repo-override (str (fs/create-temp-dir))]
2929
(try
@@ -49,24 +49,24 @@
4949
(defn join
5050
"Attempt to join together a given a series of paths.
5151
52-
For example - given `(join \"/a/b/c\" \"../d\")` return `\"/a/b/d\"`"
52+
For example - given `(join \"/a/b/c\" \"../d\")` return `\"/a/b/d\"`"
5353
[& paths]
5454
(->> (apply fs/file paths)
5555
fs/normalize
5656
str))
5757

5858
(defn create-basis
5959
"Constructs a basis using [[clojure.tools.build.api/create-basis]] with a
60-
modified set of `:libs`.
60+
modified set of `:libs`.
6161
62-
Any `:local/root` kmono dependencies within the basis are replaced with their
63-
respective `:mvn/version` coordinate derived from the given `packages` map.
62+
Any `:local/root` kmono dependencies within the basis are replaced with their
63+
respective `:mvn/version` coordinate derived from the given `packages` map.
6464
65-
These `:libs` are then used to generate a correctly referenced `pom.xml` when
66-
using [[clojure.tools.build.api/write-pom]].
65+
These `:libs` are then used to generate a correctly referenced `pom.xml` when
66+
using [[clojure.tools.build.api/write-pom]].
6767
68-
Additional `opts` can be optionally provided and these will be given directly
69-
to `create-basis`."
68+
Additional `opts` can be optionally provided and these will be given directly
69+
to `create-basis`."
7070
([packages package] (create-basis packages package {}))
7171
([packages package opts]
7272
(let [dependencies
@@ -96,26 +96,26 @@
9696
(defn for-each-package
9797
"Execute a given `build-fn` for each package in the given `packages` map.
9898
99-
Accepts an optional `opts` map containing:
99+
Accepts an optional `opts` map containing:
100100
101-
- **`:concurrency`** :int (default 4) - The maximum number of packages that
102-
can be executing at a time.
103-
- **`:run-in-order`** :boolean (default `true`) - Set this to false to run
104-
all packages concurrently ignoring their dependency order.
105-
- **`silent`** :boolean (default `false`) - Set this to true to disable
106-
logging the package name and version.
101+
- **`:concurrency`** :int (default 4) - The maximum number of packages that
102+
can be executing at a time.
103+
- **`:run-in-order`** :boolean (default `true`) - Set this to false to run
104+
all packages concurrently ignoring their dependency order.
105+
- **`silent`** :boolean (default `false`) - Set this to true to disable
106+
logging the package name and version.
107107
108-
The `build-fn` will be called with the `*project-root*` var (from
109-
`clojure.tools.build.api`) bound to the subdirectory of the relevant package.
110-
This allows using the various API's from `tools.build` under the assumption
111-
that all specified paths will be relative to the package subdirectory.
108+
The `build-fn` will be called with the `*project-root*` var (from
109+
`clojure.tools.build.api`) bound to the subdirectory of the relevant package.
110+
This allows using the various API's from `tools.build` under the assumption
111+
that all specified paths will be relative to the package subdirectory.
112112
113-
TIP: Use the [[clojure.tools.build.api/resolve-path]] API to resolve a path
114-
relative to the current package dir.
113+
TIP: Use the [[clojure.tools.build.api/resolve-path]] API to resolve a path
114+
relative to the current package dir.
115115
116-
The `build-fn` will be called concurrently (up to max of `:concurrency` or
117-
`4`) but packages with dependencies will only be executed after each of their
118-
respective dependencies have run unless `:run-in-order` is `false`."
116+
The `build-fn` will be called concurrently (up to max of `:concurrency` or
117+
`4`) but packages with dependencies will only be executed after each of their
118+
respective dependencies have run unless `:run-in-order` is `false`."
119119
{:style/indent :defn
120120
:malli/schema
121121
[:function

packages/kmono-core/src/k16/kmono/core/config.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
(defn resolve-workspace-config
3232
"Read in and validate kmono workspace config at a given `root` dir.
3333
34-
This will attempt to load the key `:kmono/workspace` from both a `deps.edn`
35-
file and a `deps.local.edn` file at the given `root`. These will be merged
36-
together with the `deps.local.edn` taking precedence."
34+
This will attempt to load the key `:kmono/workspace` from both a `deps.edn`
35+
file and a `deps.local.edn` file at the given `root`. These will be merged
36+
together with the `deps.local.edn` taking precedence."
3737
[root]
3838
(let [root-workspace-config (read-kmono-config (fs/file root "deps.edn") :kmono/workspace)
3939
local-workspace-config (read-kmono-config (fs/file root "deps.local.edn") :kmono/workspace)
@@ -49,7 +49,7 @@
4949

5050
(defn resolve-package-config
5151
"Read in and validate kmono package config from a package at the given
52-
`package-path`."
52+
`package-path`."
5353
[package-path]
5454
(let [deps-file-path (fs/file package-path "deps.edn")
5555

packages/kmono-core/src/k16/kmono/core/deps.clj

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@
7979

8080
(defn filter-package-aliases
8181
"Filter the given `packages` map by those that contain aliases described by at
82-
least one of the given given `globs`.
82+
least one of the given given `globs`.
8383
84-
Returns a map with pkg-name as the key and the set of aliases from that
85-
package that matched the globs.
84+
Returns a map with pkg-name as the key and the set of aliases from that
85+
package that matched the globs.
8686
87-
```clojure
88-
(filter-package-aliases {:package-a {}} [:*/test])
89-
;; => {:package-a #{:test}}
90-
```"
87+
```clojure
88+
(filter-package-aliases {:package-a {}} [:*/test])
89+
;; => {:package-a #{:test}}
90+
```"
9191
[globs packages]
9292
(reduce
9393
(fn [packages [pkg-name pkg]]
@@ -113,17 +113,17 @@
113113

114114
(defn generate-sdeps-aliases
115115
"Generate an `-Sdeps` compatible map containing aliases generated from various
116-
workspace sources.
116+
workspace sources.
117117
118-
This is the primary way of augmenting clojure with new classpath information.
118+
This is the primary way of augmenting clojure with new classpath information.
119119
120-
Aliases are generated from:
120+
Aliases are generated from:
121121
122-
1. The set of packages in the workspace. These are added into an alias called
123-
`:kmono/packages` containing `:extra-deps`.
124-
2. All the aliases from all packages in the workspace are raised up and
125-
combined, scoping their alias names to the package name.
126-
3. The aliases from `deps.local.edn` in the project root."
122+
1. The set of packages in the workspace. These are added into an alias called
123+
`:kmono/packages` containing `:extra-deps`.
124+
2. All the aliases from all packages in the workspace are raised up and
125+
combined, scoping their alias names to the package name.
126+
3. The aliases from `deps.local.edn` in the project root."
127127
[project-root packages]
128128
(let [local-deps
129129
(fs/file project-root "deps.local.edn")

packages/kmono-core/src/k16/kmono/core/fs.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
(find-project-root parent current-root)))))
5757

5858
(defn find-project-root!
59-
"This is the same as [[k16.kmono.core.fs/find-project-root]] but will throw
60-
an exception if no project root can be found."
59+
"This is the same as [[k16.kmono.core.fs/find-project-root]] but will throw an
60+
exception if no project root can be found."
6161
([] (find-project-root! nil))
6262
([dir]
6363
(let [root (find-project-root dir)]

packages/kmono-core/src/k16/kmono/core/graph.clj

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
(defn find-cycle
4747
"Find a dependency cycle in `packages` and returns it as a closed path.
4848
49-
Returns a vector like `[a b c a]` for a cycle `a -> b -> c -> a`, or nil if
50-
no cycle is found."
49+
Returns a vector like `[a b c a]` for a cycle `a -> b -> c -> a`, or nil if
50+
no cycle is found."
5151
[packages]
5252
(loop [nodes (sort (keys packages))
5353
visited #{}
@@ -73,19 +73,19 @@
7373

7474
(defn parallel-topo-sort
7575
"Sort a given `packages` map by the order in which the packages therein depend
76-
on each other.
76+
on each other.
7777
78-
As an example, if I have 3 packages `a`, `b`, `c` and `b` depends on `a`
79-
then:
78+
As an example, if I have 3 packages `a`, `b`, `c` and `b` depends on `a`
79+
then:
8080
81-
```clojure
82-
(parallel-topo-sort {a {} b {} c {}})
83-
;; => [[a c] [b]]
84-
```
81+
```clojure
82+
(parallel-topo-sort {a {} b {} c {}})
83+
;; => [[a c] [b]]
84+
```
8585
86-
This is generally used to calculate the execution order of packages when
87-
trying to run commands in subpackages or build/release packages in the
88-
correct order."
86+
This is generally used to calculate the execution order of packages when
87+
trying to run commands in subpackages or build/release packages in the
88+
correct order."
8989
{:malli/schema [:=> [:cat core.schema/?PackageMap] [:maybe ?ExecOrder]]}
9090
[packages]
9191
(let [stage
@@ -113,7 +113,7 @@
113113
(defn query-dependents
114114
"Find all dependent packages of `pkg-name` within the give `packages` map.
115115
116-
This includes all transitive dependencies."
116+
This includes all transitive dependencies."
117117
{:malli/schema [:=> [:cat core.schema/?PackageMap :symbol] [:set :symbol]]}
118118
[packages pkg-name]
119119

@@ -156,15 +156,15 @@
156156
(defn filter-by
157157
"Filter a given `packages` map by those that match the given `predicate-fn`.
158158
159-
If the `:include-dependents` property is `true` then all dependent packages
160-
of the retained packages will also be kept.
159+
If the `:include-dependents` property is `true` then all dependent packages
160+
of the retained packages will also be kept.
161161
162-
This function will update the `:depends-on` and `:dependent` keys of each
163-
retained package to include only other packages that still remain in the map.
162+
This function will update the `:depends-on` and `:dependent` keys of each
163+
retained package to include only other packages that still remain in the map.
164164
165-
It's generally recommended to use this function instead of writing your own
166-
package filtering. If you need to write your own then you should also make
167-
sure to keep the `:depends-on` and `:dependents` updated."
165+
It's generally recommended to use this function instead of writing your own
166+
package filtering. If you need to write your own then you should also make
167+
sure to keep the `:depends-on` and `:dependents` updated."
168168
([predicate-fn packages] (filter-by predicate-fn {} packages))
169169
([predicate-fn {:keys [include-dependents]} packages]
170170
(let [filtered

packages/kmono-core/src/k16/kmono/core/packages.clj

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,18 @@
9090
(defn glob-matches?
9191
"Compare a namespaced keyword or symbol against a keyword `glob`.
9292
93-
The keyword `glob` should be provided as a keyword where either the namespace
94-
or name component can be substituted with a `*`. For example the below are
95-
all valid globs
96-
97-
```clojure
98-
(glob-matches? :*/* :a/b) ;; true
99-
(glob-matches? :a/* :a/b) ;; true
100-
(glob-matches? :*/b :a/b) ;; true
101-
(glob-matches? :*/b 'a/b) ;; true
102-
103-
(glob-matches? :a/a :a/b) ;; false
104-
```"
93+
The keyword `glob` should be provided as a keyword where either the namespace
94+
or name component can be substituted with a `*`. For example the below are
95+
all valid globs
96+
97+
```clojure
98+
(glob-matches? :*/* :a/b) ;; true
99+
(glob-matches? :a/* :a/b) ;; true
100+
(glob-matches? :*/b :a/b) ;; true
101+
(glob-matches? :*/b 'a/b) ;; true
102+
103+
(glob-matches? :a/a :a/b) ;; false
104+
```"
105105
{:malli/schema [:-> :keyword [:or :keyword :symbol] :boolean]}
106106
[glob kw|sym]
107107
(let [ns-matches
@@ -116,27 +116,27 @@
116116

117117
(defn name-matches?
118118
"A `predicate-fn` constructor (returns a `predicate-fn`) designed to be used
119-
with [[k16.kmono.core.graph/filter-by]].
119+
with [[k16.kmono.core.graph/filter-by]].
120120
121-
Compares a give `pkg` :fqn against a given set of `globs` in the format
122-
described by [[glob-matches?]]. Returns true if a match is found.
121+
Compares a give `pkg` :fqn against a given set of `globs` in the format
122+
described by [[glob-matches?]]. Returns true if a match is found.
123123
124-
```clojure
125-
(core.graph/filter-by (name-matches? [:*/*]))
126-
```"
124+
```clojure
125+
(core.graph/filter-by (name-matches? [:*/*]))
126+
```"
127127
[globs]
128128
(fn name-matches-filter-fn [pkg]
129129
(boolean (some #(glob-matches? % (:fqn pkg)) globs))))
130130

131131
(defn resolve-packages
132132
"Resolve the packages graph for a clojure project.
133133
134-
This will find all packages as described by the given `workspace-config` and
135-
will use them to build a graph of all workspace packages and their
136-
dependencies.
134+
This will find all packages as described by the given `workspace-config` and
135+
will use them to build a graph of all workspace packages and their
136+
dependencies.
137137
138-
See [[k16.kmono.core.schema/?PackageMap]] for a schema of the returned
139-
package map."
138+
See [[k16.kmono.core.schema/?PackageMap]] for a schema of the returned
139+
package map."
140140
{:malli/schema [:=> [:cat :string core.schema/?WorkspaceConfig] core.schema/?PackageMap]}
141141
[project-root workspace-config]
142142
(let [globs (:packages workspace-config)

packages/kmono-core/src/k16/kmono/core/thread.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
(ns ^:no-doc k16.kmono.core.thread
22
(:import
33
java.util.concurrent.ExecutionException
4-
java.util.concurrent.ExecutorService
5-
java.util.concurrent.Executors))
4+
java.util.concurrent.Executors
5+
java.util.concurrent.ExecutorService))
66

77
(set! *warn-on-reflection* true)
88

@@ -16,8 +16,8 @@
1616
(defn batch
1717
"Execute the given `coll` in batches of `batch-size`.
1818
19-
Each batch will be executed in parallel and a new batch will only be
20-
executed when all items in the previous batch have completed.
19+
Each batch will be executed in parallel and a new batch will only be executed
20+
when all items in the previous batch have completed.
2121
2222
If any items fail the entire operation fails."
2323
([f batch-size]

packages/kmono-core/src/k16/kmono/cp.clj

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@
3030
(defn collect-aliases
3131
"Collect a set of 'active' aliases from the workspace.
3232
33-
This function works by:
33+
This function works by:
3434
35-
1. Discovering all available package aliases in the workspace and filtering
36-
them based on the `:package-aliases` config from the provided
37-
`workspace-config`.
38-
2. Merging this set with the aliases defined in the `:aliases` key on the
39-
`workspace-config`.
40-
3. Adding the special `:kmono/packages` alias which contains the base package
41-
classpaths.
35+
1. Discovering all available package aliases in the workspace and filtering
36+
them based on the `:package-aliases` config from the provided
37+
`workspace-config`.
38+
2. Merging this set with the aliases defined in the `:aliases` key on the
39+
`workspace-config`.
40+
3. Adding the special `:kmono/packages` alias which contains the base package
41+
classpaths.
4242
43-
This function is designed to be used to collect the relevant set of aliases
44-
to provide to the clojure flags `-A`, `-M`, `-T`, `-X`."
43+
This function is designed to be used to collect the relevant set of aliases
44+
to provide to the clojure flags `-A`, `-M`, `-T`, `-X`."
4545
[workspace-config packages]
4646
(let [package-alias-globs (:package-aliases workspace-config)
4747
package-aliases (->> packages
@@ -74,10 +74,10 @@
7474
(defn resolve-classpath
7575
"Resolve a classpath string for a workspace.
7676
77-
This works by shelling out to `clojure -Spath` with additional flags
78-
generated from analysing the workspace.
77+
This works by shelling out to `clojure -Spath` with additional flags
78+
generated from analysing the workspace.
7979
80-
See [[generate-classpath-command]] for the command construction logic."
80+
See [[generate-classpath-command]] for the command construction logic."
8181
[project-root workspace-config packages]
8282
(:out
8383
(proc/shell

0 commit comments

Comments
 (0)