Comments (11)
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.
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.
Is there a tool that can automatically do this?
Unfortunately, I don't know. I usually just use vim (gqgq
)...
from rustc-dev-guide.
from rustc-dev-guide.
Hmm, we may be able to use the GNU fmt
utility for this, and integrate it into the build script?
from rustc-dev-guide.
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.
Yeah, that could work too. Should be pretty easy to write a Bash script that does that.
from rustc-dev-guide.
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.
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.
Thanks for the investigation @alexreg :)
Would you mind make a PR to add such a check to the CI?
from rustc-dev-guide.
@mark-i-m Sure, that should be simple enough...
from rustc-dev-guide.
Related Issues (20)
- Example in "Getting diagnostic through `rustc_interface`" is outdated and meaningless
- Modifying AST
- Date Reference Triage for 2024-01
- Getting Started page "help-wanted-search" link goes to a 404 Github page HOT 2
- Broken link in Canonicalization chapter HOT 3
- In Compiler Architecture section, state explicitly you assume the compiler do not change between build
- Clarify what is a UI test HOT 4
- Clarify why Salsa is mentioned HOT 2
- Not clear sentence "Eager expansion generally performs a subset of the things that lazy (normal) expansion does."
- In macro expansion section, explains why import and collections must be redone
- Clarify "call site hierarchy" in macro
- Date Reference Triage for 2024-02 HOT 1
- Appendix D: Compiler Lecture Series: Update
- HIR documentation is outdated
- Diagnostic/subdiagnostic example struct /struct field fluent slugs outdated
- Date Reference Triage for 2024-03 HOT 1
- Date Reference Triage for 2024-04 HOT 1
- Automated Dead Link Detection HOT 1
- Guide answers "what" but not "why" and "how" for codegen tests
- Date Reference Triage for 2024-05
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rustc-dev-guide.