Structure rust-guidelines to make code easily accessible #26
Description
This probably dovetails with #17; I'm specifically interested in having all of the code in rust-guidelines
be easy reachable/buildable/etc, in order easily integrate with downstream analysis tools (specifically rustfmt
).
In my case, I've been working on pcwalton/rustfmt
a bit lately and I feel like it's finally nearing a place where it can focus on chasing down comforming to rust-guidelines
(at least the style
portion).
I'd like to be able to take rust-guidelines
as a dependency from rustfmt
, build rustfmt
, and then parse every code snippet in the style
section and fail if any of rustfmt
's output differs from the input as it exists in the style
snippets. Right now this would involve a manual process of running through every .md
file in the style directory to pull out the rust snippets, which I'd rather avoid if at all possible. Does why this is not really desirable make sense and give an idea of how we could arrange the code/docs in rust-guidelines
to make it more amenable to integrating with other tools/processes?
Anyways, I see #17 is already there, but there's not much in the way of commentary around that. So I'd like to start that conversation about how we can approach this. In any case, having every code snippet pass muster with rustc
is a desirable goal of rust-guidelines
, and pursuing this goal would also serve the purposes I have w/ rustfmt
.
Please do let me know if there's anything I can contribute towards this goal. I could also open a topic on the discussions board/listserv.