-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump Honey SQL version & Use JVM Kondo (#177)
- Loading branch information
Showing
4 changed files
with
69 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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,5 +1,8 @@ | ||
{:hooks | ||
{:analyze-call | ||
{next.jdbc/with-transaction | ||
hooks.com.github.seancorfield.next-jdbc/with-transaction}} | ||
:lint-as {next.jdbc/on-connection clojure.core/with-open}} | ||
hooks.com.github.seancorfield.next-jdbc/with-transaction | ||
next.jdbc/with-transaction+options | ||
hooks.com.github.seancorfield.next-jdbc/with-transaction+options}} | ||
:lint-as {next.jdbc/on-connection clojure.core/with-open | ||
next.jdbc/on-connection+options clojure.core/with-open}} |
34 changes: 34 additions & 0 deletions
34
...kondo/com.github.seancorfield/next.jdbc/hooks/com/github/seancorfield/next_jdbc.clj_kondo
This file contains 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,34 @@ | ||
(ns hooks.com.github.seancorfield.next-jdbc | ||
(:require [clj-kondo.hooks-api :as api])) | ||
|
||
(defn with-transaction | ||
"Expands (with-transaction [tx expr opts] body) | ||
to (let [tx expr] opts body) per clj-kondo examples." | ||
[{:keys [:node]}] | ||
(let [[binding-vec & body] (rest (:children node)) | ||
[sym val opts] (:children binding-vec)] | ||
(when-not (and sym val) | ||
(throw (ex-info "No sym and val provided" {}))) | ||
(let [new-node (api/list-node | ||
(list* | ||
(api/token-node 'let) | ||
(api/vector-node [sym val]) | ||
opts | ||
body))] | ||
{:node new-node}))) | ||
|
||
(defn with-transaction+options | ||
"Expands (with-transaction+options [tx expr opts] body) | ||
to (let [tx expr] opts body) per clj-kondo examples." | ||
[{:keys [:node]}] | ||
(let [[binding-vec & body] (rest (:children node)) | ||
[sym val opts] (:children binding-vec)] | ||
(when-not (and sym val) | ||
(throw (ex-info "No sym and val provided" {}))) | ||
(let [new-node (api/list-node | ||
(list* | ||
(api/token-node 'let) | ||
(api/vector-node [sym val]) | ||
opts | ||
body))] | ||
{:node new-node}))) |
This file contains 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 |
---|---|---|
|
@@ -10,41 +10,23 @@ jobs: | |
kondo: | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 10 | ||
env: | ||
CLJ_KONDO_VERSION: "2023.09.07" | ||
DOWNLOAD_URL: https://github.com/clj-kondo/clj-kondo/releases/download | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Setup Java & Clojure | ||
uses: ./.github/actions/setup | ||
with: | ||
cache-key: kondo | ||
- name: Install clj-kondo | ||
run: | | ||
curl -OL ${DOWNLOAD_URL}/v${CLJ_KONDO_VERSION}/clj-kondo-${CLJ_KONDO_VERSION}-linux-static-amd64.zip | ||
curl -OL ${DOWNLOAD_URL}/v${CLJ_KONDO_VERSION}/clj-kondo-${CLJ_KONDO_VERSION}-linux-static-amd64.zip.sha256 | ||
cat clj-kondo-${CLJ_KONDO_VERSION}-linux-static-amd64.zip.sha256 >> SHA256sum.txt | ||
echo " clj-kondo-${CLJ_KONDO_VERSION}-linux-static-amd64.zip" >> SHA256sum.txt | ||
sha256sum -c SHA256sum.txt | ||
unzip -d /usr/local/bin clj-kondo-${CLJ_KONDO_VERSION}-linux-static-amd64.zip | ||
- run: clj-kondo --version | ||
- name: Copy Kondo config from deps | ||
run: >- | ||
clj-kondo | ||
clojure -M:kondo | ||
--copy-configs | ||
--dependencies | ||
--lint "$(clojure -A:dev -Spath)" | ||
--skip-lint | ||
--parallel | ||
- name: Run clj-kondo | ||
run: >- | ||
clj-kondo | ||
--parallel | ||
--lint | ||
src | ||
test | ||
toucan1/src | ||
toucan1/test | ||
clojure -M:kondo:kondo/all | ||
tests-postgres: | ||
runs-on: ubuntu-20.04 | ||
|
@@ -139,7 +121,7 @@ jobs: | |
- run: clojure -X:dev:test-h2:cloverage | ||
name: Run tests with Cloverage | ||
- name: Upload results to codecov.io | ||
uses: codecov/codecov-action@v3 | ||
uses: codecov/codecov-action@v4.5.0 | ||
with: | ||
files: ./target/coverage/codecov.json | ||
|
||
|
This file contains 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