Giter Site home page Giter Site logo

Comments (4)

borkdude avatar borkdude commented on June 9, 2024 1

You can also do that with babashka for faster startup

from jet.

borkdude avatar borkdude commented on June 9, 2024

I'm playing around with this option, but I'm not sure if it would fit your needs this way. E.g., I'm using fipp (an EDN pretty printer):

$ cat deps.edn | clj -M -e "(require '[fipp.edn :as e]) (e/pprint (clojure.edn/read-string (slurp *in*)) {:width 20})"
{:paths ["src"
         "resources"],
 :deps {org.clojure/clojure {:mvn/version "1.11.1"},
        mvxcvi/puget {:mvn/version "1.3.4"},
        rewrite-clj/rewrite-clj {:mvn/version "1.1.47"},
        commons-io/commons-io {:mvn/version "2.11.0"},
        org.babashka/cli {:mvn/version "0.8.58"},
        com.cognitect/transit-clj {:mvn/version "1.0.333"},
        clj-commons/clj-yaml {:mvn/version "1.0.26"},
        cheshire/cheshire {:mvn/version "5.11.0"},
        org.babashka/sci {:mvn/version "0.8.41"},
        com.rpl/specter {:mvn/version "1.1.4"},
        camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.3"}},
 :aliases {:test {:extra-paths ["test"],
                  :extra-deps {clj-commons/conch {:mvn/version "0.9.2"}}}},
 :tools/usage {:ns-default jet.main}}

as you can see it still is more than 20 characters wide but the output does change when I set it to 200

from jet.

grav avatar grav commented on June 9, 2024

Bummer ... seems to work pretty well with clojure.pprint/pprint (see below, docs here).

But I guess there's performance reasons that you're not using it? FWIW, I can always pipe through the snippet below, when I need to.

cat deps.edn | clj -M -e "(require '[clojure.pprint :as pprint]) (binding [pprint/*print-right-margin* 15] (pprint/pprint (clojure.edn/read-string (slurp *in*))))"
{:paths
 ["src"
  "resources"],
 :deps
 {org.clojure/clojure
  #:mvn{:version
        "1.11.1"},
  mvxcvi/puget
  #:mvn{:version
        "1.3.4"},
  rewrite-clj/rewrite-clj
  #:mvn{:version
        "1.1.47"},
  commons-io/commons-io
[snip]

from jet.

borkdude avatar borkdude commented on June 9, 2024

I'm not exactly sure why I used fipp instead of pprint, I think it was because pprint didn't work properly with graalvm a long time ago.

from jet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.