Skip to content

Commit 0da51fe

Browse files
authored
Merge branch 'master' into remove-cats-exception
2 parents b47dd64 + 8f1bed4 commit 0da51fe

File tree

13 files changed

+335
-279
lines changed

13 files changed

+335
-279
lines changed

.clj-kondo/config.edn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{:config-paths ["../resources/clj-kondo.exports/nubank/state-flow"]}

.github/workflows/clojure.yml

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,24 @@ on:
77
branches: [ master ]
88

99
jobs:
10-
test-using-java-8:
11-
name: 'Test using Java 8'
10+
test-using-java:
11+
strategy:
12+
matrix:
13+
java-version: [ '8', '11', '17', '21' ]
14+
name: Test using Java ${{ matrix.java-version }}
1215
runs-on: ubuntu-latest
1316
steps:
14-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v4
1518

16-
- uses: actions/setup-java@v1
19+
- uses: actions/setup-java@v4
1720
with:
18-
java-version: 8
21+
distribution: 'temurin'
22+
java-version: ${{ matrix.java-version }}
1923

20-
- name: Print java version
21-
run: java -version
22-
23-
- name: Install dependencies
24-
run: lein deps
25-
26-
- name: Run clj tests
27-
run: lein test
28-
29-
- name: Run midje tests
30-
run: lein midje
31-
32-
test-using-java-11:
33-
name: 'Test using Java 11'
34-
runs-on: ubuntu-latest
35-
steps:
36-
- uses: actions/checkout@v2
37-
38-
- uses: actions/setup-java@v1
24+
- name: Install clojure tools
25+
uses: DeLaGuardo/[email protected]
3926
with:
40-
java-version: 11
27+
lein: 2.11.2
4128

4229
- name: Print java version
4330
run: java -version
@@ -55,11 +42,17 @@ jobs:
5542
name: 'Lint'
5643
runs-on: ubuntu-latest
5744
steps:
58-
- uses: actions/checkout@v2
45+
- uses: actions/checkout@v4
46+
47+
- uses: actions/setup-java@v4
48+
with:
49+
distribution: 'temurin'
50+
java-version: 21
5951

60-
- uses: actions/setup-java@v1
52+
- name: Install clojure tools
53+
uses: DeLaGuardo/[email protected]
6154
with:
62-
java-version: 11
55+
lein: 2.11.2
6356

6457
- name: Lint check
6558
run: lein lint

.github/workflows/release.yml

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,24 @@ on:
66
- '*'
77

88
jobs:
9-
test-using-java-8:
10-
name: 'Test using Java 8'
9+
test-using-java:
10+
strategy:
11+
matrix:
12+
java-version: [ '8', '11', '17', '21' ]
13+
name: Test using Java ${{ matrix.java-version }}
1114
runs-on: ubuntu-latest
1215
steps:
13-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1417

15-
- uses: actions/setup-java@v1
18+
- uses: actions/setup-java@v4
1619
with:
17-
java-version: 8
20+
distribution: 'temurin'
21+
java-version: ${{ matrix.java-version }}
1822

19-
- name: Print java version
20-
run: java -version
21-
22-
- name: Install dependencies
23-
run: lein deps
24-
25-
- name: Run clj tests
26-
run: lein test
27-
28-
- name: Run midje tests
29-
run: lein midje
30-
31-
test-using-java-11:
32-
name: 'Test using Java 11'
33-
runs-on: ubuntu-latest
34-
steps:
35-
- uses: actions/checkout@v2
36-
37-
- uses: actions/setup-java@v1
23+
- name: Install clojure tools
24+
uses: DeLaGuardo/[email protected]
3825
with:
39-
java-version: 11
26+
lein: 2.11.2
4027

4128
- name: Print java version
4229
run: java -version
@@ -53,9 +40,19 @@ jobs:
5340
release:
5441
name: 'Publish on Clojars'
5542
runs-on: ubuntu-latest
56-
needs: [test-using-java-11, test-using-java-8]
43+
needs: test-using-java
5744
steps:
58-
- uses: actions/checkout@v2
45+
- uses: actions/checkout@v4
46+
47+
- uses: actions/setup-java@v4
48+
with:
49+
distribution: 'temurin'
50+
java-version: 21
51+
52+
- name: Install clojure tools
53+
uses: DeLaGuardo/[email protected]
54+
with:
55+
lein: 2.11.2
5956

6057
- name: Install dependencies
6158
run: lein deps

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ pom.xml.asc
1010
*.iml
1111
.idea
1212
**/*.DS_Store
13+
.clj-kondo
14+
!.clj-kondo/config.edn

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,44 @@
11
# Changelog
22

3+
## [5.20.2]
4+
- Fixing the "Too long name" error when attempting to `compile` most namespaces that use `state-flow.` Details [here](https://github.com/funcool/cats/pull/247)
5+
6+
## [5.20.1]
7+
- Use setMacro to flag macros in the api namespace to avoid AOT compilation errors
8+
9+
## [5.20.0]
10+
- Remove `com.taoensso/timbre` dependency
11+
- **BEHAVIOR CHANGE**: previously, failures logged by `state-flow.core/log-error` were sent to whatever
12+
appenders were configured in timbre. Now, failures are always logged to `clojure.core/*out*`.
13+
14+
## [5.19.0]
15+
- Bump dependencies
16+
- org.clojure/clojure from 1.11.4 to 1.12.0
17+
- com.taoensso/timbre from 6.5.0 to 6.6.1
18+
19+
## [5.18.0]
20+
- Bump dependencies
21+
- org.clojure/clojure from 1.11.1 to 1.11.4
22+
- com.taoensso/timbre from 4.10.0 to 6.5.0
23+
- nubank/matcher-combinators from 3.5.0 to 3.9.1
24+
25+
## [5.17.0]
26+
- revert linter `state-flow.labs.state/with-redefs`
27+
28+
## [5.16.0]
29+
- Add linter for `state-flow.labs.state/with-redefs` [#175](https://github.com/nubank/state-flow/pull/175)
30+
31+
## [5.15.0]
32+
- Store init function in state metadata
33+
34+
## [5.14.5]
35+
- switch the declare/import-var function to def in state.api [#171](https://github.com/nubank/state-flow/pull/171)
36+
37+
## [5.14.4]
38+
- Bump midje to 1.10.9
39+
40+
## [5.14.3]
41+
- Bump midje to 1.10.7
342

443
## [5.14.2]
544
- bump library dependencies

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
StateFlow is a testing framework designed to support the composition and reuse of individual test steps.
66

7+
## Learning Materials
8+
- [Tutorial](./samples/tutorial.clj)
9+
- [Walkthrough](./doc/walkthrough.repl)
10+
711
## Definitions
812

913
* A [*flow*](#flows) is a sequence of steps or bindings.

project.clj

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject nubank/state-flow "5.14.2"
1+
(defproject nubank/state-flow "5.20.2-beta.2"
22
:description "Integration testing with composable flows"
33
:url "https://github.com/nubank/state-flow"
44
:license {:name "MIT"}
@@ -9,19 +9,19 @@
99
:sign-releases false}]]
1010

1111
:plugins [[lein-project-version "0.1.0"]
12-
[lein-midje "3.2.1"]
13-
[lein-cloverage "1.0.10"]
12+
[lein-midje "3.2.2"]
13+
[lein-cloverage "1.2.4"]
1414
[lein-vanity "0.2.0"]
15-
[s3-wagon-private "1.3.1"]
16-
[lein-ancient "0.6.15"]
17-
[lein-cljfmt "0.6.1"]
18-
[lein-nsorg "0.2.0"]
15+
[s3-wagon-private "1.3.5"]
16+
[lein-ancient "0.7.0"]
17+
[lein-cljfmt "0.9.2"]
18+
[lein-nsorg "0.3.0"]
1919
[changelog-check "0.1.0"]]
2020

21-
:dependencies [[org.clojure/clojure "1.11.1"]
22-
[com.taoensso/timbre "4.10.0"]
23-
[funcool/cats "2.4.2"]
24-
[nubank/matcher-combinators "3.5.0"]]
21+
:dependencies [[org.clojure/clojure "1.12.0"]
22+
[org.clj-commons/pretty "3.5.0"]
23+
[funcool/cats "2.4.3-beta.2"]
24+
[nubank/matcher-combinators "3.9.1"]]
2525

2626
:exclusions [log4j]
2727

@@ -32,11 +32,11 @@
3232

3333
:profiles {:uberjar {:aot :all}
3434
:dev {:source-paths ["dev"]
35-
:dependencies [[ns-tracker "0.4.0"]
36-
[org.clojure/tools.namespace "1.2.0"]
37-
[midje "1.10.5"]
38-
[org.clojure/java.classpath "1.0.0"]
39-
[rewrite-clj "0.6.1"]]}}
35+
:dependencies [[ns-tracker "1.0.0"]
36+
[org.clojure/tools.namespace "1.5.0"]
37+
[midje "1.10.10"]
38+
[org.clojure/java.classpath "1.1.0"]
39+
[rewrite-clj "1.2.50"]]}}
4040

4141
:aliases {"coverage" ["cloverage" "-s" "coverage"]
4242
"lint" ["do" ["cljfmt" "check"] ["nsorg"]]

resources/clj-kondo.exports/nubank/state-flow/nubank/state_flow.clj

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
(ns nubank.state-flow
2+
(:refer-clojure :exclude [with-redefs])
23
(:require [clj-kondo.hooks-api :as hooks]))
34

45
(defn- normalize-mlet-binds
@@ -33,3 +34,25 @@
3334
(do-let body)])]
3435
{:node (with-meta new-node (meta node))
3536
:defined-by 'state-flow.cljtest/defflow}))
37+
38+
#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
39+
(defn with-redefs
40+
"This transformation hook converts
41+
42+
(state-flow.labs.state/with-redefs [bindings & flows])
43+
44+
into
45+
46+
(clojure.core/with-redefs bindings
47+
(state-flow.core/flow \"state-flow.labs.state/with-redefs\" flows))"
48+
[{:keys [node]}]
49+
(let [[bindings & flows] (rest (:children node))
50+
new-node (hooks/list-node
51+
[(hooks/token-node 'clojure.core/with-redefs)
52+
bindings
53+
(hooks/list-node
54+
(concat [(hooks/token-node 'state-flow.api/flow)
55+
(hooks/string-node "state-flow.labs.state/with-redefs")]
56+
flows))])]
57+
{:node (with-meta new-node (meta node))
58+
:defined-by 'state-flow.labs.state/with-redefs}))

0 commit comments

Comments
 (0)