Giter Site home page Giter Site logo

Comments (11)

mark-i-m avatar mark-i-m commented on May 23, 2024

I don't think there is a hard style guide... I personally prefer hard wrapping at 80chars. If this was code, I would say "use rustfmt", but I have no strong preference for markup files.

Feel free to pick a convention. If you do, please add a note in the README. This could be turned a tracking issue of files that need to be properly formatted.

Let me know what you think :)

from rustc-dev-guide.

alexreg avatar alexreg commented on May 23, 2024

Hard-wrapping at 80, and keeping formatted parts (backticks, bold, underline) on their own line seems to make the most sense to me. Is there a tool that can automatically do this?

from rustc-dev-guide.

mark-i-m avatar mark-i-m commented on May 23, 2024

Is there a tool that can automatically do this?

Unfortunately, I don't know. I usually just use vim (gqgq)...

from rustc-dev-guide.

mark-i-m avatar mark-i-m commented on May 23, 2024

from rustc-dev-guide.

alexreg avatar alexreg commented on May 23, 2024

Hmm, we may be able to use the GNU fmt utility for this, and integrate it into the build script?

from rustc-dev-guide.

mark-i-m avatar mark-i-m commented on May 23, 2024

I'm not familiar with fmt, but it sounds promising. I think the best thing would be to have some sort of tidy check that is run by travis. That way a PR gets blocked until formatting is fixed.

from rustc-dev-guide.

alexreg avatar alexreg commented on May 23, 2024

Yeah, that could work too. Should be pretty easy to write a Bash script that does that.

from rustc-dev-guide.

nikomatsakis avatar nikomatsakis commented on May 23, 2024

I'm generally in favor of line wrapping -- it makes the text much more readable when it's not rendered, and it can help make diffs more readable -- though I see the advantage of not doing it too. I don't know about tooling for doing it; I also just hit M-q in emacs to do it. I suppose fmt might work?

from rustc-dev-guide.

alexreg avatar alexreg commented on May 23, 2024

I've seen some odd line wrapping conventions around the Rust codebase (70 chars?!), and even though I prefer not line wrapping (I prefer to leave it to the text editor / renderer), it seems like most people like it... so as long as we could standardise it, and put a check on the CI, that could work. (I just tried fmt -w 80 here, which works nicely for Markdown.

from rustc-dev-guide.

mark-i-m avatar mark-i-m commented on May 23, 2024

Thanks for the investigation @alexreg :)

Would you mind make a PR to add such a check to the CI?

from rustc-dev-guide.

alexreg avatar alexreg commented on May 23, 2024

@mark-i-m Sure, that should be simple enough...

from rustc-dev-guide.

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.