This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-12-01
Channels
- # adventofcode (1)
- # bangalore-clj (1)
- # beginners (8)
- # boot (47)
- # cider (6)
- # cljsrn (3)
- # clojure (155)
- # clojure-brasil (2)
- # clojure-china (3)
- # clojure-conj (1)
- # clojure-hk (4)
- # clojure-korea (36)
- # clojure-russia (38)
- # clojure-spec (53)
- # clojure-taiwan (1)
- # clojure-uk (14)
- # clojurescript (70)
- # clojurex (9)
- # component (2)
- # cursive (20)
- # datascript (19)
- # datomic (39)
- # defnpodcast (1)
- # events (5)
- # figwheel (2)
- # hoplon (81)
- # incanter (2)
- # jobs (7)
- # juxt (3)
- # klipse (1)
- # leiningen (1)
- # luminus (15)
- # mount (1)
- # off-topic (21)
- # om (5)
- # om-next (2)
- # onyx (19)
- # pedestal (2)
- # proto-repl (1)
- # proton (5)
- # re-frame (19)
- # reagent (4)
- # rethinkdb (2)
- # ring-swagger (6)
- # rum (13)
- # specter (6)
- # untangled (4)
- # yada (1)
I'm thinking of writing a boot task to auto-format clj(s) code, similar to golang's gofmt tool, based on https://github.com/kkinnear/zprint. I'd like to change files in the repository. To determine the file list, would it make sense to look at the source paths to get a list of all the clj(s) files to reformat? Or should it do git ls-files
and go from there?
@pesterhazy that's cool (zprint and a boot task for it)!
I think file-seq
on the directories that are listed in :source-paths
(and maybe :resource-paths
) would be fine, can't think of a good reason to use the fileset stuff in this case
yeah that's what I thought
ultimately the tool should replace files in your repo (so you can use git diff
to check differences), and boot only writes to a designated target dir
(quite sensibly)
Hmh, this tools sounds like it doesn't benefit much from Boot features
I'd probably just write a function that takes path or paths that should be checked and updates files in place
Additionally there could be Boot task wrapper which calls this function with boot source/resource-paths
good idea
additionally, getting the list of files from git seems like a useful (optional) addition too
Perhaps, but contents of source-paths should be nearly the same anyways
@pesterhazy I was looking at cljfmt for this But this also might be interesting
Just out of curiosity why not use cljfmt? Especially when we implement: https://github.com/weavejester/cljfmt/issues/49
@mitchelkuijpers FWIW there's a very nice cljfmt thing on npm (I think) that you can just run as a script
Ah that is also cool, but I am leaning towards cljfmt with the nice indentation metadata
I would like a sort of standardized solution (if possible at all) And it helps that this has cider integration (sort of)
@mitchelkuijpers zprint seems a lot more powerful and configurable
might even be possible to pick between two "backend" pprinters
in either case a boot task would be useful to simplify integration
@pesterhazy yes it seems very powerfull
@pesterhazy I am not sure what you are looking for but our team is looking for elm-format like functionality where you just stop thinking about formatting
Makes life so much easier
that's what I'm looking for as well
potentially with ci integration (complain if not compliant)
If I can help in any way let me know @pesterhazy
thanks, I'll let you know!
@micha I'm working on my boot-nodejs task, how can I make the server restart when using the watch task? I modeled it after boot-jetty.
Whenever cljs files change
@micha would that spawn multiple processes until boot shuts down?
I'd have to manually do that I guess, maybe check for an atom instead of using def
That way I know when to try and kill the process
Yeah I would eventually like to do live reload
There is this: https://github.com/bodil/cljs-noderepl