Skip to content

Commit eabc43e

Browse files
authored
Merge pull request #56 from happysalada/add_cljfmt
add cljfmt and run it
2 parents 8874402 + a73b520 commit eabc43e

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

project.clj

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
:plugins [[lein-exec "0.3.7"]
1515
[lein-auto "0.1.3"]
1616
[lein-ring "0.12.5"]
17-
[cider/cider-nrepl "0.24.0"]]
17+
[cider/cider-nrepl "0.24.0"]
18+
[lein-cljfmt "0.7.0"]]
1819
:aliases {"generate-lightcycle" ["exec" "-p" "src/dactyl_keyboard/lightcycle.clj"]
1920
"generate-manuform" ["exec" "-p" "src/dactyl_keyboard/manuform.clj"]}
2021
:ring {:handler dactyl-keyboard.handler/app

src/dactyl_keyboard/lightcycle.clj

+4-5
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@
116116
hide-pinky (fn [column row]
117117
(not (and use-lastrow?
118118
hide-last-pinky?
119-
(last-pinky-location column row))))
120-
]
119+
(last-pinky-location column row))))]
121120
(apply union
122121
(for [column columns
123122
row rows
@@ -342,7 +341,7 @@
342341
(translate [0 (- (extended-plate-height %)) 0]))]
343342
;;Connecting main thumb keys.
344343
(union
345-
(case thumb-count
344+
(case thumb-count
346345
:eight (union
347346
(triangle-hulls (thumb-place c 0 0 (thumb-bl 1))
348347
(thumb-place c 1 0 (thumb-br 1))
@@ -365,7 +364,7 @@
365364
(thumb-place c 0 0 (thumb-bl 1))
366365
(thumb-place c 1 0 (thumb-br 1))))
367366
(triangle-hulls #_(thumb-place c 1 -1/2 (thumb-tl 2))
368-
(thumb-place c 0 -1/2 (thumb-bl 2))
367+
(thumb-place c 0 -1/2 (thumb-bl 2))
369368
(thumb-place c 1 -1/2 (thumb-br 2))
370369
(thumb-place c 0 -1/2 (thumb-tl 2))
371370
(thumb-place c 1 -1/2 (thumb-tr 2))
@@ -564,7 +563,7 @@
564563
(let [thickness (if thick-wall? 2 1)]
565564
(->> (sphere thickness)
566565
(translate coords)
567-
(with-fn wall-sphere-n) )))
566+
(with-fn wall-sphere-n))))
568567

569568
(defn scale-to-range [start end x]
570569
(+ start (* (- end start) x)))

src/dactyl_keyboard/manuform.clj

+13-14
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868

6969
; this is the function that puts the key switch holes
7070
; based on the row and the column.
71+
72+
7173
(defn key-place
7274
"Puts the keys' shape to its place based on it's column and row."
7375
[c column row shape]
@@ -136,8 +138,7 @@
136138
hide-pinky (fn [column row]
137139
(not (and (= last-row-count :full)
138140
hide-last-pinky?
139-
(last-pinky-location column row))))
140-
]
141+
(last-pinky-location column row))))]
141142
(apply
142143
union
143144
(for [column (if use-inner-column? (range -1 ncols) (columns ncols))
@@ -200,8 +201,7 @@
200201
hide-pinky (fn [column row]
201202
(not (and (= last-row-count :full)
202203
hide-last-pinky?
203-
(last-pinky-location column row))))
204-
]
204+
(last-pinky-location column row))))]
205205
(union
206206
(apply
207207
union
@@ -317,7 +317,7 @@
317317
x-rotation (if (= thumb-count :five) 10 -6)
318318
y-rotation (if (= thumb-count :five) -23 -34)
319319
z-rotation (if (= thumb-count :five) 25 48)
320-
movement (if (= thumb-count :five) [-23 -34 -6] [-29 -40 -13]) ]
320+
movement (if (= thumb-count :five) [-23 -34 -6] [-29 -40 -13])]
321321
(->> shape
322322
(rotate (deg2rad x-rotation) [1 0 0])
323323
(rotate (deg2rad y-rotation) [0 1 0])
@@ -355,11 +355,11 @@
355355
z-rotation (if (= thumb-count :five) 35 52)
356356
movement (if (= thumb-count :five) [-51 -25 -11.5] [-56.3 -43.3 -23.5])]
357357
(->> shape
358-
(rotate (deg2rad x-rotation) [1 0 0])
359-
(rotate (deg2rad y-rotation) [0 1 0])
360-
(rotate (deg2rad z-rotation) [0 0 1])
361-
(translate (thumborigin c))
362-
(translate movement))))
358+
(rotate (deg2rad x-rotation) [1 0 0])
359+
(rotate (deg2rad y-rotation) [0 1 0])
360+
(rotate (deg2rad z-rotation) [0 0 1])
361+
(translate (thumborigin c))
362+
(translate movement))))
363363

364364
(defn thumb-1x-layout [c shape]
365365
(let [thumb-count (get c :configuration-thumb-count)]
@@ -449,7 +449,7 @@
449449
(key-place c 2 cornerrow web-post-bl)
450450
(key-place c 2 lastrow web-post-tr)
451451
(key-place c 2 cornerrow web-post-br)
452-
(key-place c 3 cornerrow web-post-bl)) )))
452+
(key-place c 3 cornerrow web-post-bl)))))
453453

454454
(defn thumb-connector-three [c]
455455
(let [row-count (get c :configuration-last-row-count)
@@ -862,7 +862,7 @@
862862
lastrow (flastrow nrows)
863863
cornerrow (fcornerrow nrows)
864864
row-count (get c :configuration-last-row-count)
865-
thumb-tr-post (if (= (get c :configuration-thumb-count) :five ) web-post-br thumb-post-br)]
865+
thumb-tr-post (if (= (get c :configuration-thumb-count) :five) web-post-br thumb-post-br)]
866866
(union
867867
(wall-brace (partial thumb-tr-place c) 0 -1 thumb-tr-post
868868
(partial (partial key-place c) 3 (case row-count :zero cornerrow lastrow)) 0 -1 web-post-bl)
@@ -1156,7 +1156,7 @@
11561156
5 -1
11571157
6 -2
11581158
-3)]
1159-
( key-position c 1 0 (map - (wall-locate2 0 y-addition) [0 (/ mount-height 2) 0]))))
1159+
(key-position c 1 0 (map - (wall-locate2 0 y-addition) [0 (/ mount-height 2) 0]))))
11601160

11611161
(defn trrs-usb-holder-position [c]
11621162
(map + [17 19.3 0] [(first (trrs-usb-holder-ref c)) (second (trrs-usb-holder-ref c)) 2]))
@@ -1440,7 +1440,6 @@
14401440
screw-insert-outers)
14411441
(translate [0 0 -10] screw-insert-screw-holes))))))
14421442

1443-
14441443
#_(spit "things/left.scad"
14451444
(write-scad (mirror [-1 0 0] model-right)))
14461445

0 commit comments

Comments
 (0)