This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-25
Channels
- # beginners (33)
- # cider (40)
- # clara (28)
- # cljs-dev (38)
- # cljsrn (5)
- # clojure (197)
- # clojure-greece (1)
- # clojure-italy (7)
- # clojure-losangeles (1)
- # clojure-nl (10)
- # clojure-spec (32)
- # clojure-uk (154)
- # clojurescript (48)
- # core-async (33)
- # cursive (32)
- # datomic (19)
- # duct (1)
- # fulcro (10)
- # graphql (6)
- # jobs (1)
- # lumo (1)
- # mount (6)
- # off-topic (48)
- # onyx (12)
- # other-languages (2)
- # re-frame (77)
- # reagent (19)
- # reitit (4)
- # ring (5)
- # ring-swagger (18)
- # rum (4)
- # shadow-cljs (52)
- # specter (12)
- # tools-deps (47)
I've pushed a new find-deps with @pesterhazy's PR merged and a fix for no longer returning SNAPSHOT versions from clojars (hard coded for the time being)
@hagmonk just tried it, works really well
I think hardcoding the hide-SNAPSHOT feature is a much better default
Yes definitely, I think the bug should not crop up in maven searches, I need to spend time finding an example there to validate that
good job on the library btw!
@dominicm that's worth an issue on github … appreciate any pointers you might have for how to avoid that
Pack avoids it (my library). Happy to try share a library for solving this problem. I'm secretly hopeful it can go into tools deps itself.
I'm still enjoying how much time this is saving me, occasionally I'm surprised it works as well as it does 😂
clj -A:find-deps "clojure cache"
{:deps {org.clojure/core.cache {:mvn/version "0.7.1"}}}
one possibility would be to run the result through zprint
, a great library for re-formatting clojure code or edn
zprint is an under-appreciated gem
@pesterhazy the problem is that everybody does formatting a little differently. I took the approach of trying to match existing indentation at most levels.
having worked with elm-format and exfmt I found it so nice to just not have to worry about this at all anymore
zprint gets you 90% there
They are too short :)
Do you happen to know of a way to change that behaviour? 80 chars isn't a goal, so much as a limit.
Not off the top of my head
But if you get consistency, convenience and the end of style wars in return, wouldn’t oneliners be a small price to pay?
I want consistency, very much. But I first have to convince important people that they will like the formatting, and that it's worth pioneering.
the :respect-nl
config should be able to help you with “80 chars isn’t a goal”: https://github.com/kkinnear/zprint/#respect-nl-false
I don't necessarily want to have it retain where I place newlines. I just find it weird to see:
(defn foo [args] body)
over
(defn foo
[args]
body)
It would be nice to have a style which is "do what most libraries do for formatting"
I think the :community
style is meant for that. kkinnear has been open to adapt that style to fit best practices, especially if those things would be documented in the clojure community style guide
NOT respecting newlines is one of the best things about elm-format
you can totally write your code in a single line and elm-format will expand it out
it helped me a lot when I was learning the language
I particularly don't want my tool to look at the input beyond raw clojure forms tbh. I'd even be happy if it made decisions about #:foo {:blah 10}
into {:foo/blah 10}
(but that's because I don't like the syntax)
Agree about elm-format, it’s a pleasure to use
we’re using zprint but there’s so many knobs. I think an autoformatter should ideally have 0 options. (or maybe one for the line width)
i’m not sure if this is the right place to ask… but does the :git/url
coordinate require a deps.edn file at that coordinate?
i.e. it doesn’t try to read a project.clj or boot file… it only plays nicely with another deps.edn (or maybe a pom) file?
correct (for now)
it’s also tolerant of finding none of those for the case of a dep with no transitive deps
> I think an autoformatter should ideally have 0 options. (or maybe one for the line width) Preach it! If I ever design a language, it will have a gofmt-style formatter from day 1.