-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update tidy check for error codes testing #66574
Update tidy check for error codes testing #66574
Conversation
b03aae2
to
749d731
Compare
Updated. |
Could you also say a bit about what this is doing? i.e., what is the goal of this PR, what are we trying to change, and why? I don't have the time to dig into that myself so it'd make an r+ easier on my end. |
Sure. Now that all the error codes have been grouped into one file, we moved the long error explanations into markdown files, which means that we need to read those markdown file to also count their code blocks as well. So 2 "big" things happened here:
|
let md = some_or_continue!(s.splitn(2, "include_str!(\"").skip(1).next()); | ||
let md_file_name = some_or_continue!(md.splitn(2, "\")").next()); | ||
let path = some_or_continue!(path.parent()).join(md_file_name); | ||
match File::open(&path) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use fs::read_to_string
here? Seems like there's no reason why not?
For the future it'd be great to include that information in the commit; I've copied it into the PR description. r=me with last nit fixed |
749d731
to
df9fed1
Compare
Indeed, sorry... |
@bors r+ |
📌 Commit df9fed1 has been approved by |
…-check, r=Mark-Simulacrum Update tidy check for error codes testing Now that all the error codes have been grouped into one file, we moved the long error explanations into markdown files, which means that we need to read those markdown file to also count their code blocks as well. So 2 "big" things happened here: * No more need to keep the current error code when reading the `error_codes.rs` file since it's been put into the equivalent markdown file. * Need to instead read the markdown file (but it's simpler since I can just look for code blocks directly).
Now that all the error codes have been grouped into one file, we moved the long error explanations into markdown files, which means that we need to read those markdown file to also count their code blocks as well.
So 2 "big" things happened here:
error_codes.rs
file since it's been put into the equivalent markdown file.