summaryrefslogtreecommitdiff
path: root/src/clarktown
diff options
context:
space:
mode:
authorAsko Nõmm <asko@bien.ee>2022-04-25 13:28:36 +0300
committerAsko Nõmm <asko@bien.ee>2022-04-25 13:28:36 +0300
commitd6e39c016e16b60b85b60898e93eda8d2c6f00db (patch)
tree8bfa72a89d4b4a97a272d51c40b89eb159ce1c6a /src/clarktown
parent829a5b1d96f2fd04f992dd3792d0faac5aacc2a8 (diff)
Improve naming
Diffstat (limited to 'src/clarktown')
-rw-r--r--src/clarktown/correctors.clj6
-rw-r--r--src/clarktown/engine.clj20
2 files changed, 13 insertions, 13 deletions
diff --git a/src/clarktown/correctors.clj b/src/clarktown/correctors.clj
index 14d82ca..e251595 100644
--- a/src/clarktown/correctors.clj
+++ b/src/clarktown/correctors.clj
@@ -7,10 +7,10 @@
(def
^{:doc "The default block separation correctors."}
default-block-separation-correctors
- {:empty-line-above?
+ {:newline-above
[code-block/empty-line-above?
atx-heading-block/empty-line-above?]
- :empty-line-below?
+ :newline-below
[code-block/empty-line-below?
atx-heading-block/empty-line-below?]})
@@ -18,4 +18,4 @@
(def
^{:doc "The default correctors."}
default-correctors
- {:block-separations default-block-separation-correctors}) \ No newline at end of file
+ {:block-separations default-block-separation-correctors})
diff --git a/src/clarktown/engine.clj b/src/clarktown/engine.clj
index 2dc9089..deca176 100644
--- a/src/clarktown/engine.clj
+++ b/src/clarktown/engine.clj
@@ -39,29 +39,29 @@
"Corrects block separations and adds newlines above or
below a block where needed."
[correctors lines]
- (let [above-correctors (:empty-line-above? correctors)
- below-correctors (:empty-line-below? correctors)]
+ (let [above-correctors (:newline-above correctors)
+ below-correctors (:newline-below correctors)]
(map-indexed
(fn [index line]
- (let [add-line-above? (some #(true? (% lines line index)) above-correctors)
- add-line-below? (some #(true? (% lines line index)) below-correctors)]
+ (let [add-newline-above? (some #(true? (% lines line index)) above-correctors)
+ add-newline-below? (some #(true? (% lines line index)) below-correctors)]
(cond
; If code block starts but there is no empty newline
; above, let's fix that
- (and add-line-above?
- (not add-line-below?))
+ (and add-newline-above?
+ (not add-newline-below?))
(str \newline line)
; If the code block ends, but there is no empty newline
; below, let's fix that.
- (and add-line-below?
- (not add-line-above?))
+ (and add-newline-below?
+ (not add-newline-above?))
(str line \newline)
; If the code block needs a newline both above and below,
; let's fix that.
- (and add-line-above?
- add-line-below?)
+ (and add-newline-above?
+ add-newline-below?)
(str \newline line \newline)
; otherwise is what it is