Skip to content

Commit

Permalink
format: update alignment and remove whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
practicalli-johnny committed Oct 3, 2024
1 parent 06cd578 commit a7042e1
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 19 deletions.
9 changes: 7 additions & 2 deletions build.clj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
(ns build
(:require
[clojure.tools.build.api :as build-api]
[clojure.pprint :as pprint]))
[clojure.pprint :as pprint]
[clojure.tools.build.api :as build-api]))


;; ---------------------------------------------------------
;; Build configuration
Expand All @@ -18,6 +19,7 @@
:jar-file (format "target/%s-%s.jar" (name library-name) version)
:uberjar-file (format "target/%s-%s-standalone.jar" (name library-name) version)}))


;; End of Build configuration
;; ---------------------------------------------------------

Expand All @@ -32,6 +34,7 @@
[directory]
(build-api/delete {:path (or (:path directory) "target")}))


(defn jar
"Create a build of the project, cleaning existing build assets first"
[_]
Expand All @@ -48,6 +51,7 @@
(build-api/jar {:class-dir class-directory
:jar-file jar-file})))


(defn uberjar
"Create an archive containing Clojure and the build of the project"
[_]
Expand All @@ -65,5 +69,6 @@
:basis project-basis
:main main-namespace})))


;; End of Build tasks
;; ---------------------------------------------------------
22 changes: 9 additions & 13 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{;; ------------------------------------------
{;; ------------------------------------------
;; Source code paths
:paths
["src" "resources"]
;; ------------------------------------------
;; ------------------------------------------

;; ------------------------------------------
;; ------------------------------------------
;; Main dependencies
:deps
{org.clojure/clojure {:mvn/version "1.12.0"}}
;; ------------------------------------------

:aliases
{;; ------------------------------------------
{;; ------------------------------------------
;; Run application and functions

:run/main {:main-opts ["-m" "practicalli.random-function"]}

:run/greet {:ns-default practicalli.random-function
:exec-fn greet
:exec-args {:name "Clojure"}}
;; ------------------------------------------
;; ------------------------------------------

;; ------------------------------------------
;; ------------------------------------------
;; Testing
:test/env
{:extra-paths ["test"]
Expand All @@ -36,9 +36,9 @@
:exec-fn kaocha.runner/exec-fn
:exec-args {:randomize? false
:fail-fast? true}}
;; ------------------------------------------
;; ------------------------------------------

;; ------------------------------------------
;; ------------------------------------------
;; tools.build `build.clj` tasks

:build/env {:extra-paths "."}
Expand All @@ -47,8 +47,4 @@
{:replace-deps {io.github.clojure/tools.build
{:git/tag "v0.9.4" :git/sha "76b78fe"}}
:ns-default build}}}
;; ------------------------------------------




;; ------------------------------------------
5 changes: 3 additions & 2 deletions src/practicalli/random_clojure_function.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"Fully qualified function names from clojure.core"
(vals (ns-publics 'clojure.core)))


(def all-public-functions
"Fully qualified function names from available"
(mapcat #(vals (ns-publics %)) (all-ns)))
Expand All @@ -19,6 +20,7 @@
[namespace]
(vals (ns-publics namespace)))


(defn selective-namespace-functions
[namespace-sequence]
(mapcat #(function-list (symbol %)) namespace-sequence))
Expand All @@ -34,7 +36,6 @@
"\n " (function-details :doc))))



(defn -main
"Return a random function and its details
from the available namespaces"
Expand All @@ -45,7 +46,7 @@


;; REPL experiments
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;

(comment

Expand Down
5 changes: 3 additions & 2 deletions test/practicalli/random_clojure_function_test.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns practicalli.random-clojure-function-test
(:require [clojure.test :refer [deftest is testing]]
[practicalli.random-clojure-function :as SUT]))
(:require
[clojure.test :refer [deftest is testing]]
[practicalli.random-clojure-function :as SUT]))


(deftest random-function-test
Expand Down

0 comments on commit a7042e1

Please sign in to comment.