Skip to content

Commit

Permalink
Move tests inline & revert cas coord change
Browse files Browse the repository at this point in the history
  • Loading branch information
mk committed Dec 8, 2021
1 parent 0078fe6 commit 1a086e1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 27 deletions.
10 changes: 2 additions & 8 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,8 @@

:build {:deps {io.github.clojure/tools.build {:git/tag "v0.6.1" :git/sha "515b334"}
io.github.slipset/deps-deploy {:git/sha "b4359c5d67ca002d9ed0c4b41b710d7e5a82e3bf"}
io.github.nextjournal/cas {:git/url "https://github.com/nextjournal/cas"
io.github.nextjournal/cas {:git/url "git@github.com:nextjournal/cas"
:git/sha "5e8079b720e347b9466db9c2282ce79a125a011c"}
rewrite-clj/rewrite-clj {:mvn/version "1.0.699-alpha"}
babashka/fs {:mvn/version "0.0.5"}}
:ns-default build}

:test {:extra-paths ["test"]
:extra-deps {io.github.cognitect-labs/test-runner
{:git/tag "v0.5.0" :git/sha "b3fd0d2"}}
:main-opts ["-m" "cognitect.test-runner"]
:exec-fn cognitect.test-runner.api/test}}}
:ns-default build}}}
15 changes: 9 additions & 6 deletions src/nextjournal/clerk.clj
Original file line number Diff line number Diff line change
Expand Up @@ -176,17 +176,20 @@
(throw e))))

(defn supported-file?
"Returns whether PATH points to a file that can be visualized."
"Returns whether `path` points to a file that should be shown."
[path]

;; Notes
;;
;; 1. file names starting with .# are most likely Emacs lock files
;; and should be ignored.
;; file names starting with .# are most likely Emacs lock files and should be ignored.
(->> path io/file .getName
(re-matches #"(?!^\.#).+\.(md|clj|cljc)$")
some?))

#_(supported-file? "foo_bar.clj")
#_(supported-file? "xyz/foo.md")
#_(supported-file? "xyz/foo.clj")
#_(supported-file? "xyz/abc.#name.cljc")
#_(supported-file? ".#name.clj")
#_(supported-file? "xyz/.#name.cljc")

(defn file-event [{:keys [type path]}]
(when (and (contains? #{:modify :create} type)
(supported-file? path))
Expand Down
13 changes: 0 additions & 13 deletions test/nextjournal/clerk_test.clj

This file was deleted.

0 comments on commit 1a086e1

Please sign in to comment.