Skip to content

Commit a288e27

Browse files
committed
Bump version for release
1 parent d497224 commit a288e27

File tree

8 files changed

+51
-10
lines changed

8 files changed

+51
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ This changelog is loose. Versions are not semantic, they are incremental. Splint
44

55
## Unreleased
66

7+
## 1.20.0 - 2025-03-28
8+
9+
## 1.20.0 - 2025-03-28
10+
711
### New Rules
812

913
- `lint/misplaced-type-hint`: Prefer `(defn make-str ^String [] "abc")` over `(defn ^String make-str [] "abc")`. Only checks `defn` forms at the moment.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ More explicit instructions can be found in the [installation][installation], [us
2121
### Clojure CLI
2222

2323
```clojure lazytest/skip=true
24-
:aliases {:splint {:extra-deps {io.github.noahtheduke/splint {:mvn/version "1.19.0"}
24+
:aliases {:splint {:extra-deps {io.github.noahtheduke/splint {:mvn/version "1.20.0"}
2525
org.clojure/clojure {:mvn/version "1.11.1"}}
2626
:main-opts ["-m" "noahtheduke.splint"]}}
2727
```
@@ -33,7 +33,7 @@ Run with `clojure -M:splint [args...]`.
3333
Add this to `project.clj`:
3434

3535
```clojure lazytest/skip=true
36-
:profiles {:dev {:dependencies [[io.github.noahtheduke/splint "1.19.0"]
36+
:profiles {:dev {:dependencies [[io.github.noahtheduke/splint "1.20.0"]
3737
[org.clojure/clojure "1.11.1"]]}}
3838
:aliases {"splint" ["run" "-m" "noahtheduke.splint"]})
3939
```

docs/installation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ When used in a project as a library, put it in an alias to make it easier to inv
55
## Clojure CLI
66

77
```clojure
8-
:aliases {:splint {:extra-deps {io.github.noahtheduke/splint {:mvn/version "1.19.0"}
8+
:aliases {:splint {:extra-deps {io.github.noahtheduke/splint {:mvn/version "1.20.0"}
99
org.clojure/clojure {:mvn/version "1.11.1"}}
1010
:main-opts ["-m" "noahtheduke.splint"]}}
1111
```
@@ -17,7 +17,7 @@ Run with `clojure -M:splint [args...]`.
1717
Add this to `project.clj`:
1818

1919
```clojure
20-
:profiles {:dev {:dependencies [[io.github.noahtheduke/splint "1.19.0"]
20+
:profiles {:dev {:dependencies [[io.github.noahtheduke/splint "1.20.0"]
2121
[org.clojure/clojure "1.11.1"]]}}
2222
:aliases {"splint" ["run" "-m" "noahtheduke.splint"]}
2323
```
@@ -34,7 +34,7 @@ In the meantime, it runs fast on babashka and can be installed using `bbin`:
3434
$ bbin install io.github.noahtheduke/splint
3535
{:coords
3636
#:git{:url "https://github.com/noahtheduke/splint",
37-
:tag "v1.19.0",
37+
:tag "v1.20.0",
3838
:sha "..."},
3939
:lib io.github.noahtheduke/splint}
4040
```

docs/rules/lint.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
- [lint/locking-object](#lintlocking-object)
2626
- [lint/loop-do](#lintloop-do)
2727
- [lint/loop-empty-when](#lintloop-empty-when)
28+
- [lint/misplaced-type-hint](#lintmisplaced-type-hint)
2829
- [lint/missing-body-in-when](#lintmissing-body-in-when)
2930
- [lint/not-empty?](#lintnot-empty)
3031
- [lint/prefer-method-values](#lintprefer-method-values)
@@ -576,6 +577,42 @@ Empty loops with nested `when` can be `while`. Doesn't apply if the final expr o
576577

577578
---
578579

580+
## lint/misplaced-type-hint
581+
582+
| Enabled by default | Safe | Autocorrect | Version Added | Version Updated |
583+
| ------------------ | ---- | ----------- | ------------- | --------------- |
584+
| true | true | false | 1.20.0 | 1.20.0 |
585+
586+
In interop scenarios, it can be necessary to add a type hint to mark a function's return type. This can be done by adding metadata to the function's name symbol or to the function's param vector. The former works but is prone to errors and is not recommended by the core team, whereas the latter is the official method. (See links below for further discussion.)
587+
588+
**NOTE:** Only checks `defn` forms. (Compare with [eastwood's `:wrong-tag`](https://github.com/jonase/eastwood#wrong-tag) linter.)
589+
590+
### Examples
591+
592+
```clojure
593+
; avoid
594+
(defn ^String make-str
595+
[]
596+
"abc")
597+
598+
(defn ^String make-str
599+
([] "abc")
600+
([a] (str a "abc")))
601+
602+
; prefer
603+
(defn make-str ^String [] "abc")
604+
(defn make-str
605+
(^String [] "abc")
606+
(^String [a] (str a "abc")))
607+
```
608+
609+
### Reference
610+
611+
* <https://clojure.org/reference/java_interop#typehints>
612+
* <https://clojure.org/guides/faq#return_type_hint>
613+
614+
---
615+
579616
## lint/missing-body-in-when
580617

581618
| Enabled by default | Safe | Autocorrect | Version Added | Version Updated |

docs/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
```text
44
$ clojure -M:splint --help
5-
splint v1.19.0
5+
splint v1.20.0
66
77
Usage:
88
splint [options]

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ current_version := `cat resources/SPLINT_VERSION | xargs`
7373
# Builds the uberjar, builds the jar, sends the jar to clojars
7474
@release version:
7575
echo 'Running tests'
76-
just test-all
76+
just test-all --output quiet
7777
echo 'Setting new version {{version}}'
7878
just set-version {{version}}
7979
echo 'Rendering docs'

resources/SPLINT_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.19.0
1+
1.20.0

resources/config/default.edn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@
162162
lint/misplaced-type-hint
163163
{:description "Put type hint on function's param vector, not function name."
164164
:enabled true
165-
:added "<<next>>"
166-
:updated "<<next>>"
165+
:added "1.20.0"
166+
:updated "1.20.0"
167167
:links ["https://clojure.org/reference/java_interop#typehints"
168168
"https://clojure.org/guides/faq#return_type_hint"]}
169169

0 commit comments

Comments
 (0)