-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
caumond
committed
Nov 9, 2023
1 parent
9b419a0
commit d0485f0
Showing
13 changed files
with
76 additions
and
95 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
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,4 +1,4 @@ | ||
# That statistics counts number of line of code | ||
* clj-test-nb-lines - 1914 | ||
* clj-total-nb-lines - 6151 | ||
* ratio-in-pct - 45.17 | ||
* clj-test-nb-lines - 1906 | ||
* clj-total-nb-lines - 6064 | ||
* ratio-in-pct - 45.83 |
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
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
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
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
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,21 +1,18 @@ | ||
(ns automaton-core.os.code-formatter | ||
"Format code | ||
Proxy to [zprint](https://github.com/kkinnear/zprint)" | ||
(:require [automaton-core.adapters.files :as files] | ||
[automaton-core.adapters.commands :as cmds] | ||
(:require [zprint.core :as zprint] | ||
[automaton-core.adapters.time :as time] | ||
[clojure.string :as str])) | ||
|
||
(defn format-file | ||
(defn format-content | ||
"Format the `clj` or `edn` file | ||
Returns a string, ready to be spitted, with the header | ||
Params: | ||
* `filename` to format | ||
* `header` (optional) is written at the top of the file" | ||
([filename header] | ||
(let [format-content (slurp filename)] | ||
(files/spit-file filename (apply str [(when-not (str/blank? header) (print-str ";;" header (time/now-str) "\n")) format-content])) | ||
(cmds/exec-cmds [[["zprint" "-w" filename] | ||
{:dir "." | ||
:out :string}]]))) | ||
([filename] (format-file filename nil))) | ||
|
||
* `header` (optional) is written at the top of the file | ||
* `content` is a data structure to format" | ||
([header content] | ||
(let [format-content (-> content | ||
zprint/zprint-str)] | ||
(apply str [(when-not (str/blank? header) (print-str ";;" header (time/now-str) "\n")) format-content]))) | ||
([content] (format-content nil content))) |
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
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
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,4 +1,4 @@ | ||
;; Last generated version, note a failed push consume a number Wed Nov 8 13:00:30 CET 2023 | ||
;; Last generated version, note a failed push consume a number Thu Nov 9 14:16:52 CET 2023 | ||
{:major-version "0.0.-1" | ||
:minor-version 3 | ||
:version "0.0.3"} | ||
:minor-version 5 | ||
:version "0.0.5"} |