Code Monkey home page Code Monkey logo

Comments (7)

CasualX avatar CasualX commented on August 25, 2024 1

I can confirm that this is not the case, all files changed by cargo +nightly fmt (idk if nightly matters here) are changed from crlf to lf. Look like it is an open bug in rustfmt: rust-lang/rustfmt#4097

Some git magic later it's all fixed but these are the kind of rough edges that confirm my biases against rustfmt 😛

from pelite.

CasualX avatar CasualX commented on August 25, 2024 1

It took some time but it's there

from pelite.

Ben-Lichtman avatar Ben-Lichtman commented on August 25, 2024

The other option is to disable rustfmt project-wide with disable_all_formatting in the .rustfmt.toml, though I'd suggest that it's better to pick a suboptimal style rather than ad-hoc style chosen by contributors

from pelite.

Ben-Lichtman avatar Ben-Lichtman commented on August 25, 2024

I would PR this, but it would be difficult to review due to the large number of changes, so I'll leave it up to the maintainer to push a version with cargo fmt run on it

from pelite.

CasualX avatar CasualX commented on August 25, 2024

Thanks for your consideration! I've been working on implementing a rustfmt policy that I can stomach.

I'm not a fan of autoformatters in general as they tend to make everything look consistently ugly.
But with some okay settings, a nightly rustfmt, refactoring some code and liberal application of rustfmt::skip I think I can make it work.

I'll try to get a PR up in a few more hours.

from pelite.

CasualX avatar CasualX commented on August 25, 2024

Good lord I just noticed rustfmt rewrote everything to lf which conflicts with my windows checkout and usage of autocrlf setting... I'll try to keep going and get the repo to cleanly pass rustfmt but rustfmt is just not ready for actual usage...

from pelite.

Ben-Lichtman avatar Ben-Lichtman commented on August 25, 2024

You can adjust this with the newline_style setting.

Looks like the default is "auto" though which tries to use whatever that file already uses, so your file probably already had a LF present.

from pelite.

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.