Giter VIP home page Giter VIP logo

Comments (9)

tamasfe avatar tamasfe commented on August 25, 2024 2

Yes, I've started working on a cli tool. A lot of it is already written, but #19 needs to be done simultaneously, and it will involve some changes in the extension as well, and I'd like to refactor the repo as a whole a bit while I'm at it.

I think I'll have a usable version of it by this weekend.

from taplo.

sagiegurari avatar sagiegurari commented on August 25, 2024 2

thanks a lot. can't wait

from taplo.

sagiegurari avatar sagiegurari commented on August 25, 2024 1

Thanks for the update. I'll wait for the official release so i'll be able to test with standard installation flow.

my main goals are

  1. format my toml files naturally. got lots of those as apart of the Cargo.toml, i also have all the Makefile.toml files (especially inside cargo-make).
  2. write a format toml task inside cargo-make so all projects using cargo-make will automatically have access to this capability. (much like rustfmt format task

however to get there i'll need

  1. a very consistent toml formatter. meaning spacing, end of lines and all that would not break if i just write things too messy.
  2. ability to pass config via command line. if the task is defined inside cargo-make Makefile.toml than people can just configure it there via the formatter cli instead of having multiple config files.
    I see many people do the same thing for clippy for example.
  3. nice to have - later on, we can expand that on having a --check flag to make sure toml is formatted (good for CI)

there was another rust based toml formatter i tried long ago, but it wasn't active and the formatting didn't always work.
happy I have another shot at it :)

from taplo.

sagiegurari avatar sagiegurari commented on August 25, 2024 1

works amazing, really fast and great defaults. love it.
i'm going to put some default tasks inside cargo-make for it, i'll update this issue when done if you will be interested.

from taplo.

tamasfe avatar tamasfe commented on August 25, 2024 1

@sagiegurari Thank you, I'm glad you like it! They should be fixed in 0.1.1, I think this issue has served its purpose. Feel free to created an issue if you need anything, I also created #55 to discuss formatting option arguments.

from taplo.

tamasfe avatar tamasfe commented on August 25, 2024

@sagiegurari I ended up not having a lot of time, and I will need a few more hours probably. I've pushed the progress so far to a cli branch in case you really need this feature asap and would like to help with it.

from taplo.

tamasfe avatar tamasfe commented on August 25, 2024

@sagiegurari Sorry, it took way longer than I expected, there is now a CLI tool, however I haven't implemented passing formatter options because it needs additional arg parsing work.

I'm thinking along the lines of a--format-options option1=true,option2=20 ... flag, would that work for you?

from taplo.

sagiegurari avatar sagiegurari commented on August 25, 2024

thanks a lot. i'm checking it out :)

from taplo.

sagiegurari avatar sagiegurari commented on August 25, 2024

Just updated cargo-make 0.32.9 branch with few tasks to do toml formatting.
Basically you can now run:

cargo make format-toml

But more I updated the default task to always format toml files as well.
I'll probably officially release it once you resolve those 2 small issues I opened.
thanks a lot for the great tool. I was looking for such a thing for a long time.

from taplo.

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.