Repository navigation
Migrate from Leiningen to deps.edn, update CI, add clj-kondo config #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,9 @@ | ||
| /target | ||
| /classes | ||
| /checkouts | ||
| pom.xml | ||
| pom.xml.asc | ||
| *.jar | ||
| *.class | ||
| /.lein-* | ||
| pom.xml | ||
| /.nrepl-port | ||
| .hgignore | ||
| .hg/ | ||
| resources/public/cljs | ||
| /out | ||
| figwheel_server.log | ||
| /.cljs_rhino_repl | ||
| .cpcache | ||
| .shadow-cljs | ||
| node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # Contributing | ||
|
|
||
| Pull requests are welcome. Please run the test suite and check that all tests pass prior to submission. | ||
|
|
||
| ``` | ||
| make test # Clojure tests | ||
| make test-cljs # ClojureScript tests (requires npm install) | ||
| ``` | ||
|
|
||
| ## Releasing | ||
|
|
||
| 1. Commit and push any final changes to master | ||
| 2. Tag the release: `git tag <version> && git push --tags` — CI deploys to Clojars | ||
| 3. Verify the release appears on https://clojars.org/tortue/spy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| .PHONY: test test-cljs clean jar deploy | ||
|
|
||
| test: | ||
| clojure -M:test -m cognitect.test-runner | ||
|
|
||
| test-cljs: | ||
| npm test | ||
|
|
||
| clean: | ||
| clojure -T:build clean | ||
|
|
||
| jar: | ||
| clojure -T:build jar | ||
|
|
||
| deploy: | ||
| clojure -T:build deploy-jar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,5 +4,5 @@ set -euxo pipefail | |
|
|
||
| cd "$(dirname "${BASH_SOURCE[0]}")/.." | ||
|
|
||
| lein deps | ||
| clj -P -M:test | ||
| npm install | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,5 +4,5 @@ set -euxo pipefail | |
|
|
||
| cd "$(dirname "${BASH_SOURCE[0]}")/.." | ||
|
|
||
| lein test | ||
| clj -M:test -m cognitect.test-runner | ||
| npm test | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| (ns build | ||
| (:require [clojure.tools.build.api :as b] | ||
| [deps-deploy.deps-deploy :as deploy])) | ||
|
|
||
| (def lib 'tortue/spy) | ||
| (def version (or (System/getenv "RELEASE_VERSION") "dev")) | ||
| (def class-dir "target/classes") | ||
| (def src-dirs ["src/clj" "src/cljc" "src/cljs" "resources"]) | ||
| (def basis (delay (b/create-basis {:project "deps.edn"}))) | ||
| (def jar-file (format "target/%s-%s.jar" (name lib) version)) | ||
|
alexanderjamesking marked this conversation as resolved.
Resolved
|
||
|
|
||
| (defn- assert-release-version [] | ||
| (assert (re-matches #"\d+\.\d+\.\d+" version) | ||
| (str "RELEASE_VERSION must be set to a valid version (e.g. 2.16.0), got: " version))) | ||
|
|
||
| (defn clean [_] | ||
| (b/delete {:path "target"})) | ||
|
|
||
| (defn jar [_] | ||
| (b/delete {:path class-dir}) | ||
| (b/write-pom {:class-dir class-dir | ||
| :lib lib | ||
| :version version | ||
| :basis @basis | ||
| :description "Spy - a Clojure and ClojureScript library for stubs, spies and mocks" | ||
| :url "https://github.com/alexanderjamesking/spy" | ||
| :scm {:url "https://github.com/alexanderjamesking/spy"} | ||
| :pom-data [[:licenses | ||
| [:license | ||
| [:name "MIT License"] | ||
| [:url "https://opensource.org/licenses/MIT"]]]]}) | ||
| (b/copy-dir {:src-dirs src-dirs | ||
| :target-dir class-dir}) | ||
| (b/jar {:class-dir class-dir | ||
| :jar-file jar-file})) | ||
|
alexanderjamesking marked this conversation as resolved.
Resolved
|
||
|
|
||
| (defn deploy-jar [_] | ||
| (assert-release-version) | ||
| (jar nil) | ||
| (deploy/deploy {:installer :remote | ||
| :artifact jar-file | ||
| :pom-file (b/pom-path {:lib lib :class-dir class-dir})})) | ||
|
alexanderjamesking marked this conversation as resolved.
Resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| {:paths ["src/clj" "src/cljc" "src/cljs" "resources"] | ||
| :deps {} | ||
| :aliases | ||
| {:provided {:extra-deps {org.clojure/clojure {:mvn/version "1.12.1"} | ||
| org.clojure/clojurescript {:mvn/version "1.12.42"}}} | ||
| :test {:extra-paths ["test/clj" "test/cljc"] | ||
| :extra-deps {org.clojure/clojure {:mvn/version "1.12.1"} | ||
| io.github.cognitect-labs/test-runner {:git/tag "v0.5.1" :git/sha "dfb30dd"}}} | ||
| :build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.5"} | ||
| slipset/deps-deploy {:mvn/version "0.2.2"}} | ||
| :ns-default build}}} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| {:lint-as {spy.assert/called? clojure.core/assert | ||
|
alexanderjamesking marked this conversation as resolved.
Resolved
|
||
| spy.assert/not-called? clojure.core/assert | ||
| spy.assert/called-once? clojure.core/assert | ||
| spy.assert/called-n-times? clojure.core/assert | ||
| spy.assert/called-with? clojure.core/assert | ||
| spy.assert/not-called-with? clojure.core/assert | ||
| spy.assert/called-once-with? clojure.core/assert | ||
| spy.assert/called-at-least-once? clojure.core/assert | ||
| spy.assert/called-at-least-n-times? clojure.core/assert | ||
| spy.assert/called-no-more-than-once? clojure.core/assert | ||
| spy.assert/called-no-more-than-n-times? clojure.core/assert}} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.