-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Fix trimming of lint docs #79750
Fix trimming of lint docs #79750
Conversation
Thanks for taking a look at this. The second diff --git a/src/tools/lint-docs/src/lib.rs b/src/tools/lint-docs/src/lib.rs
index 326b7948098..ea54a351e03 100644
--- a/src/tools/lint-docs/src/lib.rs
+++ b/src/tools/lint-docs/src/lib.rs
@@ -143,8 +143,8 @@ fn lints_from_file(&self, path: &Path) -> Result<Vec<Lint>, Box<dyn Error>> {
Some((lineno, line)) => {
let line = line.trim();
if let Some(text) = line.strip_prefix("/// ") {
- doc_lines.push(text.trim().to_string());
- } else if line.starts_with("///") {
+ doc_lines.push(text.to_string());
+ } else if line == "///" {
doc_lines.push("".to_string());
} else if line.starts_with("// ") {
// Ignore comments. |
@ehuss Could you explain why you prefer that change over this one? |
It's just an opinion that it keeps the code simpler. There's no reason to differentiate between start/end trimming, so just the simple |
It was removing all the indentation before. Co-authored-by: Eric Huss <[email protected]>
31333de
to
b4b66f6
Compare
Ah, I think I got mixed up and thought that what you suggested wouldn't work. I applied your patch. This should be ready to merge now! |
@bors r+ rollup |
📌 Commit b4b66f6 has been approved by |
Rollup of 12 pull requests Successful merges: - rust-lang#79732 (minor stylistic clippy cleanups) - rust-lang#79750 (Fix trimming of lint docs) - rust-lang#79777 (Remove `first_merge` from liveness debug logs) - rust-lang#79795 (Privatize some of libcore unicode_internals) - rust-lang#79803 (Update xsv to prevent random CI failures) - rust-lang#79810 (Account for gaps in def path table during decoding) - rust-lang#79818 (Fixes to Rust coverage) - rust-lang#79824 (Strip prefix instead of replacing it with empty string) - rust-lang#79826 (Simplify visit_{foreign,trait}_item) - rust-lang#79844 (Move RWUTable to a separate module) - rust-lang#79861 (Update LLVM submodule) - rust-lang#79862 (Remove tab-lock and replace it with ctrl+up/down arrows to switch between search result tabs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes #79748.
It was removing all the indentation before.
r? @Mark-Simulacrum