Giter Club home page Giter Club logo

Comments (4)

codeGlaze avatar codeGlaze commented on May 28, 2024 1

+1 for config

But, that's actually just a reason to drop a huge thank you @roman01la !
This is the first formatter I've found that actually worked on my system. <3 Thank you!

from zprint-clj.

kkinnear avatar kkinnear commented on May 28, 2024 1

Functionally, I'm hoping for four changes to zprint-clj:

  1. Read the file ~/.zprintrc and call set-options! with the result.
  2. Get a string from the command line, call cljs.reader\read-string on it, and call set-options! with the result.
  3. Accept a file from stdin and write the result to stdout. This makes it easy to use as a filter from any number of programs, including many editors (like the one I use).
  4. Three (mutually exclusive) possibilities for --hang:
    • Remove --hang from the UI, and don't call set-options! with the options map you are using now to remove all hangs. If people want to configure zprint-clj without hangs, they can just configure the ~/.zprintrc file with {:style :no-hang}, or put that options map on the command line. This would be my preference. It actually isn't the major UI change that it could be, since you don't document --hang explicitly in the readme, you have to read the .js code to see it.
    • If someone specified -i or -o, then call (set-options! {:style :no-hang}, so they get the current behavior if they use the current command line switches, but if they use stdin and stdout, they get the normal defaults -- which they can change in ~/.zprintrc and on the command line.
    • Before doing anything else, call (set-options! {:style :no-hang}, which makes no hanging the default but allows people to override that.

I would think that you could keep the current -i and -o user interface if you wanted to. Presumably you would use the file from -i instead of stdin and the file from -o instead of stdout if the switches were specified.

I was unable to hack something together quickly to do this in your existing .js main program, or I would have done so and sent it to you. The .cljs main program in @thheller package does much of what I've described in .cljs (without preserving your current command line switches, of course).

Thanks!

from zprint-clj.

roman01la avatar roman01la commented on May 28, 2024

@kkinnear Sorry I didn't respond earlier. I agree that configuration might be fine. Could you please list what exactly you think should be added/changed? I might take a look when I have time. Thanks!

from zprint-clj.

roman01la avatar roman01la commented on May 28, 2024

Resolved by #4

from zprint-clj.

Related Issues (5)

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.