Skip to content

Commit 967aa67

Browse files
committed
Add support for cljstyle for Clojure code
1 parent 543f6d6 commit 967aa67

File tree

9 files changed

+55
-0
lines changed

9 files changed

+55
-0
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog].
55

6+
## Unreleased
7+
### Formatters
8+
* [cljstyle](https://github.com/greglook/cljstyle) for
9+
for clojure, clojurescript, edn files.
10+
611
## 4.3 (released 2024-11-12)
712
### Features
813
* New user option `apheleia-skip-functions`, like

apheleia-formatters.el

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
(apheleia-formatters-mode-extension)
4343
".c")))
4444
(cljfmt . ("cljfmt" "fix" "-"))
45+
(cljstyle . ("cljstyle" "pipe"))
4546
(cmake-format . ("cmake-format" "-"))
4647
(crystal-tool-format . ("crystal" "tool" "format" "-"))
4748
(css-beautify "css-beautify" "--file" "-" "--end-with-newline"
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
curl -sLO "https://raw.githubusercontent.com/greglook/cljstyle/main/util/install-cljstyle" && chmod +x install-cljstyle && ./install-cljstyle
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
(ns hello
2+
(:require [java-time.api :as t]))
3+
4+
(defn time-str
5+
"Returns a string representation of a datetime in the local time zone."
6+
[instant]
7+
(t/format
8+
(t/with-zone (t/formatter "hh:mm a") (t/zone-id))
9+
instant))
10+
11+
(defn run [opts]
12+
(println "Hello world, the time is" (time-str (t/instant))))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(ns hello-world.core
2+
(:require react-dom))
3+
4+
(.render js/ReactDOM
5+
(.createElement js/React "h2" nil "Hello, React!")
6+
(.getElementById js/document "app"))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{:deps {clojure.java-time/clojure.java-time
2+
{:mvn/version "1.1.0"}
3+
}
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
(ns hello
2+
(:require
3+
[java-time.api :as t]))
4+
5+
6+
(defn time-str
7+
"Returns a string representation of a datetime in the local time zone."
8+
[instant]
9+
(t/format
10+
(t/with-zone (t/formatter "hh:mm a") (t/zone-id))
11+
instant))
12+
13+
14+
(defn run
15+
[opts]
16+
(println "Hello world, the time is" (time-str (t/instant))))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(ns hello-world.core
2+
(:require
3+
[react-dom]))
4+
5+
6+
(.render js/ReactDOM
7+
(.createElement js/React "h2" nil "Hello, React!")
8+
(.getElementById js/document "app"))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{:deps {clojure.java-time/clojure.java-time
2+
{:mvn/version "1.1.0"}}}

0 commit comments

Comments
 (0)