refactor(sterni/blërg): try to improve code readability

- Reduce visual noise, e.g. parens where it hurts readability.
- Separate parts of trains visually where it helps readability.
- Reduce amount of unnecessarily pointfree code.

Change-Id: Ie0ef03af7d344863a81bf0557b90a4dfb7974e84
Reviewed-on: https://cl.tvl.fyi/c/depot/+/13126
Autosubmit: sterni <sternenseemann@systemli.org>
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
This commit is contained in:
sterni 2025-02-07 15:28:57 +01:00 committed by clbot
parent 84940c7cee
commit 84de750436

View file

@ -11,20 +11,20 @@
MkDirP •file.CreateDir(¬•file.Exists) MkDirP •file.CreateDir(¬•file.Exists)
AsciiDown ('A'-'a')(-×('A''Z')) AsciiDown - ('A'-'a')×('A''Z')
Slugify '-'(¬(('A''z')<()"-_0123456789"))¨ AsciiDown Slugify '-'(('A' 'z') ¬ "-_0123456789"(˜)<)¨ AsciiDown
DropPrefix {𝕩(/)𝕨˜𝕩} DropPrefix {𝕩(/)𝕨˜𝕩}
StripLeft ((¬ `=)/) StripLeft (¬ `=)/
StripRight StripLeft StripRight StripLeft
_join {((𝕗))´𝕩;𝕨𝕗𝕩} _join {((𝕗))´𝕩;𝕨𝕗𝕩}
nl @+10 nl @+10
SplitChar ((=(¯1˙)¨+`=)) SplitChar (= (¯1˙)¨ +`=)
Lines nlSplitChar Lines nlSplitChar
ReadPosInt {(𝕨×+)´-'0'𝕩} # ty leah2 ReadPosInt {(𝕨×+)´ '0'-˜𝕩} # ty leah2
ReadPosDec 10ReadPosInt ReadPosDec 10ReadPosInt
Chomp {nl¯1𝕩? ¯1𝕩; 𝕩} Chomp {nl¯1𝕩? ¯1𝕩; 𝕩}
@ -90,7 +90,7 @@ converters ← ⍉>⟨
# TODO(sterni): don't assemble blocks in this ad hoc fashion # TODO(sterni): don't assemble blocks in this ad hoc fashion
# TODO(sterni): pipefail # TODO(sterni): pipefail
PipelineCmd {"pipeline"(' '¨𝕨)""𝕩} PipelineCmd {"pipeline"(' '¨𝕨)""𝕩}
GitBackend {𝕊 config: GitBackend {𝕊 config:
repo RelPath •file.At config j.ObjGet "repository" repo RelPath •file.At config j.ObjGet "repository"
@ -155,14 +155,14 @@ config ← {
raw j.Parse •FChars configFile raw j.Parse •FChars configFile
[bns,bcs] raw j.ObjGet "backends" [bns,bcs] raw j.ObjGet "backends"
bcs bcs ˘{21"name"𝕩}¨ bns bcs bcs ˘{21"name"𝕩}¨ bns
bts (j.ObjGet"type")˜¨ bcs bts j.ObjGet"type"¨ bcs
backends bcs {𝕏 𝕨}¨ backendsj.ObjGet¨ bts backends bcs {𝕏 𝕨}¨ backendsj.ObjGet¨ bts
title raw j.ObjGet "title" title raw j.ObjGet "title"
} }
entries (<"time") (((•ns.Get˜¨))) {𝕩.Entries @}¨ config.backends entries (( •ns.Get"time"¨)) {𝕩.Entries @}¨ config.backends
"All entry IDs must be unique"!(=) •ns.Get"id"¨ entries "All entry IDs must be unique"!(=) •ns.Get"id"¨ entries
MkDirP outDir MkDirP outDir