Skip to content

Commit

Permalink
Exclude data_readers.cljc files from the :no-ns-form-found linter
Browse files Browse the repository at this point in the history
Fixes #447
  • Loading branch information
vemv committed Nov 3, 2023
1 parent 441e378 commit 0815186
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 15 deletions.
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -41,7 +41,7 @@ Eastwood can be run from the command line as a
Merge the following into your `project.clj` or `~/.lein/profiles.clj`:

```clojure
:plugins [[jonase/eastwood "1.4.0"]]
:plugins [[jonase/eastwood "1.4.1"]]
```

To run Eastwood with the default set of lint warnings on all of the
Expand All @@ -60,7 +60,7 @@ If you're using `deps.edn`, you can set Eastwood options in an edn map, like thi
"eastwood.lint"
;; Any Eastwood options can be passed here as edn:
{}]
:extra-deps {jonase/eastwood {:mvn/version "1.4.0"}}}}}
:extra-deps {jonase/eastwood {:mvn/version "1.4.1"}}}}}

```
to your `deps.edn`, and you should then be able to run Eastwood as
Expand Down Expand Up @@ -421,7 +421,7 @@ If you use Leiningen, merge this into your project's `project.clj`
file first:

```clojure
:profiles {:dev {:dependencies [[jonase/eastwood "1.4.0" :exclusions [org.clojure/clojure]]]}}
:profiles {:dev {:dependencies [[jonase/eastwood "1.4.1" :exclusions [org.clojure/clojure]]]}}
```

If you use a different build tool, you will need to add the dependency
Expand Down Expand Up @@ -564,7 +564,7 @@ can be used to modify this merging behavior.
For example, if your user-wide `profiles.clj` file contains this:

```clojure
{:user {:plugins [[jonase/eastwood "1.4.0"]]
{:user {:plugins [[jonase/eastwood "1.4.1"]]
:eastwood {:exclude-linters [:unlimited-use]
:debug [:time]}
}}
Expand Down Expand Up @@ -2202,7 +2202,7 @@ your local Maven repository:
$ cd path/to/eastwood
$ lein with-profile -user,-dev,+eastwood-plugin install

Then add `[jonase/eastwood "1.4.0"]` to
Then add `[jonase/eastwood "1.4.1"]` to
your `:plugins` vector in your `:user` profile, perhaps in your
`$HOME/.lein/profiles.clj` file.

Expand Down
7 changes: 7 additions & 0 deletions changes.md
@@ -1,3 +1,10 @@
## Changes from 1.4.0 to 1.4.1

#### Bugfixes

* Exclude `data_readers.cljc` files from the `:no-ns-form-found` linter.
* Closes https://github.com/jonase/eastwood/issues/447

## Changes from 1.3.0 to 1.4.0

* Make the `:def-in-def` linter omittable via the `disable-warning` mechanism.
Expand Down
2 changes: 1 addition & 1 deletion doc/README-creating-new-release.md
Expand Up @@ -23,7 +23,7 @@ Commit all of those changes.

Tag it with a version tag, e.g.:

% git tag -a v1.2.2 -m "1.2.2"
% git tag -a v1.4.1 -m "1.4.1"

'git push' by default does not push tags to the remote server. To
cause that to happen, use:
Expand Down
4 changes: 2 additions & 2 deletions project.clj
Expand Up @@ -64,8 +64,8 @@
[metosin/spec-tools "0.10.5"]
[org.clojure/core.async "1.6.673"]
[org.clojure/java.jdbc "0.7.12"]]}
:clj-kondo {:dependencies [[clj-kondo "2023.04.14"]]}
:antq {:plugins [[com.github.liquidz/antq "2.3.1043"]]
:clj-kondo {:dependencies [[clj-kondo "2023.10.20"]]}
:antq {:plugins [[com.github.liquidz/antq "2.7.1133"]]
:antq {:exclude ["nrepl/nrepl" "org.clojure/clojure"]}}
:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}
Expand Down
2 changes: 1 addition & 1 deletion resources/EASTWOOD_VERSION
@@ -1,5 +1,5 @@
{
:major 1
:minor 4
:patch 0
:patch 1
}
15 changes: 10 additions & 5 deletions src/eastwood/linters/misc.clj
Expand Up @@ -1008,11 +1008,16 @@
(map str)
(set))
tfilemap (-> filemap keys set)
maybe-data-readers (->> dir-name-strs
(map #(File.
(str % File/separator
"data_readers.clj")))
set)]
maybe-data-readers (into (->> dir-name-strs
(map #(File.
(str % File/separator
"data_readers.clj")))
set)
(->> dir-name-strs
(map #(File.
(str % File/separator
"data_readers.cljc")))
set))]
{:lint-warnings
(->> (set/difference files tfilemap maybe-data-readers omit)
(map (partial make-lint-warning :no-ns-form-found "No ns form was found in file" cwd)))})))
Expand Down
3 changes: 2 additions & 1 deletion src/eastwood/passes.clj
Expand Up @@ -128,7 +128,8 @@
ast))]
(postwalk ast pw)))

(def ^:private ^:dynamic *ancestors*)
(def ^:private ^:dynamic *ancestors*
nil)

(defn add-ancestors-pre [ast]
(swap! *ancestors* #(update % :ancestors conj ast))
Expand Down

0 comments on commit 0815186

Please sign in to comment.