Uh oh!
There was an error while loading. Please reload this page.
Skip documentation files without ``` when running markdown tests. - #42437
Conversation
This should reduce the 'running 0 tests' noise in builds, and is a good heuristic for us to use.
GuillaumeGomez
commented
Jun 5, 2017
Why not? :) |
It should be safe to go ahead. But there is no harm to check also Edit removed irrelevant info. |
Mark-Simulacrum
commented
Jun 5, 2017
I'm not sure I follow -- those presumably wouldn't be present in markdown files? Are they indications of code blocks? It doesn't feel to me like they are, but I could be wrong. |
alexcrichton
commented
Jun 5, 2017
Looks reasonable to me! My only worry is, as you commented above, not catching indented blocks or those separated by That being said if our style is to only use backticks (which I think it is) then this looks good to me. |
Mark-Simulacrum
commented
Jun 5, 2017
Yeah, I want @steveklabnik to comment to make sure that we're good with just backticks, but after that I think we'll be good to go. I initially wanted to put this sort of functionality into rustdoc directly (calling it with multiple files which it'd process separately but print together in one list) but that seemed more complicated and I decided to wait on that at least until the next rustdoc. |
steveklabnik
left a comment
There was a problem hiding this comment.
I am not opposed to this idea, but it also doesn't fully cover all the cases yet.
| let mut file = t!(File::open(markdown)); | ||
| let mut contents = String::new(); | ||
| t!(file.read_to_string(&mut contents)); | ||
| if !contents.contains("```") { |
There was a problem hiding this comment.
this isn't the only way there are code blocks though; for example, four spaces is also considered a code block
steveklabnik
commented
Jun 5, 2017
Yeah, it is; if everyone else is okay with just checking backticks, then I won't let the perfect be the enemy of the good 😄 |
Mark-Simulacrum
commented
Jun 5, 2017
I could add something like \n followed by 4 spaces, but I feel like that heuristic wouldn't work too well due to indentation. I'm open to adding it if we want to though. |
alexcrichton
commented
Jun 5, 2017
@steveklabnik the failure mode here will be that if you write a doc example or a doc block without three ticks in a markdown file then it won't get tested (in just rust-lang/rust during @Mark-Simulacrum this is primarily done to cut down on all the output generated, right? Do you know how many files end up having 0 tests? |
I believe 417 files would be skipped with this check. |
steveklabnik
commented
Jun 5, 2017
I think virtually everything uses the triple ticks, so it should be fine. Gonna bookmark this comment for someday when this randomly bites us, though 😆 |
alexcrichton
commented
Jun 5, 2017
Heh ok! Let's get that sweet sweet thousands-of-less-lines-of-output from travis then! @bors: r+ |
bors
commented
Jun 5, 2017
📌 Commit dd1d75e has been approved by |
bors
commented
Jun 6, 2017
Skip documentation files without ``` when running markdown tests. This should reduce the 'running 0 tests' noise in builds, and I believe this is a good heuristic for us to use. cc @rust-lang/docs -- do we use the indented format for code blocks anywhere? Will we? If so, we shouldn't do this. r? @alexcrichton
bors
commented
Jun 6, 2017
☀️ Test successful - status-appveyor, status-travis |
…crichton Skip printing for skipped doc tests. Followup to rust-lang#42437 to further reduce noise. r? @alexcrichton
Test src/doc once more This was accidentally broken in #42437 since we filtered too early to recurse into sub-directories. In theory, @bors p=10 r? @alexcrichton
This should reduce the 'running 0 tests' noise in builds, and I believe this is a good heuristic for us to use.
cc @rust-lang/docs -- do we use the indented format for code blocks anywhere? Will we? If so, we shouldn't do this.
r? @alexcrichton