Skip to content

Commit ba2850c

Browse files
scimetfookitallis
andauthored
Configure CI (#46)
- Configure clj-kondo, cljfmt - Workflow status badge for the readme Co-authored-by: Akshay Gupta <kitallis@gmail.com>
1 parent 4c54491 commit ba2850c

File tree

6 files changed

+47
-8
lines changed

6 files changed

+47
-8
lines changed

.clj-kondo/config.edn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{:lint-as {honeysql.helpers/defhelper clj-kondo.lint-as/def-catch-all}}

.github/workflows/ci.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
java: [ '8', '11', '14' ]
11+
name: For (java ${{ matrix.java }})
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Setup Java
15+
uses: actions/setup-java@v1
16+
with:
17+
java-version: ${{ matrix.java }}
18+
- name: Setup Clojure
19+
uses: DeLaGuardo/setup-clojure@master
20+
with:
21+
tools-deps: '1.10.1.754'
22+
- name: Run tests (core)
23+
run: clojure -M:test:runner
24+
- name: Run tests (clojurescript)
25+
run: clojure -M:test:cljs-runner
26+
- name: Install clj-kondo
27+
run: |
28+
curl -sLO https://raw.githubusercontent.com/borkdude/clj-kondo/master/script/install-clj-kondo
29+
chmod +x install-clj-kondo
30+
sudo ./install-clj-kondo
31+
- name: Lint src
32+
run: clj-kondo --lint src/
33+
- name: Lint test
34+
run: clj-kondo --lint test/
35+
- name: Run cljfmt check
36+
run: clojure -Sdeps '{:deps {cljfmt {:mvn/version "0.7.0"}}}' -m cljfmt.main check

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ pom.xml.asc
88
/.nrepl-port
99
.hgignore
1010
.hg/
11+
.clj-kondo/.cache
12+
.lsp/
13+
cljs-test-runner-out/

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# honeysql-postgres
2-
[![Clojars Project](https://img.shields.io/clojars/v/nilenso/honeysql-postgres.svg)](https://clojars.org/nilenso/honeysql-postgres) [![NPM Version](https://img.shields.io/npm/v/@honeysql/honeysql-postgres.svg)](https://www.npmjs.org/package/@honeysql/honeysql-postgres) [![cljdoc badge](https://cljdoc.org/badge/nilenso/honeysql-postgres)](https://cljdoc.org/d/nilenso/honeysql-postgres/CURRENT)
1+
# honeysql-postgres [![Actions Status](https://github.com/nilenso/honeysql-postgres/workflows/CI/badge.svg)](https://github.com/nilenso/honeysql-postgres/actions) [![Clojars Project](https://img.shields.io/clojars/v/nilenso/honeysql-postgres.svg)](https://clojars.org/nilenso/honeysql-postgres) [![NPM Version](https://img.shields.io/npm/v/@honeysql/honeysql-postgres.svg)](https://www.npmjs.org/package/@honeysql/honeysql-postgres) [![cljdoc badge](https://cljdoc.org/badge/nilenso/honeysql-postgres)](https://cljdoc.org/d/nilenso/honeysql-postgres/CURRENT)
32

43
PostgreSQL extensions for the widely used [honeysql](https://github.com/jkk/honeysql).
54

src/honeysql_postgres/format.cljc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@
124124
(str " WHERE " (sqlf/format-predicate* where))))))
125125

126126
(defn- format-upsert-clause [upsert]
127-
(let [ks (keys upsert)]
128-
(map #(format-clause % (find upsert %)) upsert)))
127+
(map #(format-clause % (find upsert %)) upsert))
129128

130129
(defmethod format-clause :upsert [[_ upsert] _]
131130
(sqlf/space-join (format-upsert-clause upsert)))
@@ -174,7 +173,7 @@
174173
(str
175174
;; if the select clause has any columns in it then add a comma before the
176175
;; window functions
177-
(if (seq (:select complete-sql-map)) ", ")
176+
(when (seq (:select complete-sql-map)) ", ")
178177
(->> fields
179178
(map format-over-clause)
180179
sqlf/comma-join)))
@@ -232,7 +231,7 @@
232231
util/get-first
233232
sqlf/to-sql)))
234233

235-
(defmethod format-clause :create-extension [[_ [ extension-name if-not-exists]] _]
234+
(defmethod format-clause :create-extension [[_ [extension-name if-not-exists]] _]
236235
(str "CREATE EXTENSION "
237236
(when if-not-exists "IF NOT EXISTS ")
238237
(-> extension-name

src/honeysql_postgres/helpers.cljc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
(:require [honeysql-postgres.format]
44
[honeysql.helpers :as sqlh #?(:clj :refer :cljs :refer-macros) [defhelper]]))
55

6-
;; Extension of the honeysql helper funcitons for postgreSQL
6+
;; Extension of the honeysql helper functions for postgreSQL
77

8-
(defn do-nothing [m]
8+
(defn do-nothing
99
"Accepts a map and append {:do-nothing []} to it"
10+
[m]
1011
(assoc m :do-nothing []))
1112

1213
(defhelper do-update-set [m args]

0 commit comments

Comments
 (0)