about summary refs log tree commit diff
path: root/clippy_dev/src
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2024-09-24 11:58:04 +0200
committerPhilipp Krones <hello@philkrones.com>2024-09-24 11:58:04 +0200
commitb61fcbee76f8e862c1de7523058e7e8a8b4ed4ef (patch)
tree94c8da0e70fdde0f678142ebab95e1f55290e74a /clippy_dev/src
parent249210e8d86a4de347def1be559dfa79d346cb9f (diff)
downloadrust-b61fcbee76f8e862c1de7523058e7e8a8b4ed4ef.tar.gz
rust-b61fcbee76f8e862c1de7523058e7e8a8b4ed4ef.zip
Merge commit '7901289135257ca0fbed3a5522526f95b0f5edba' into clippy-subtree-update
Diffstat (limited to 'clippy_dev/src')
-rw-r--r--clippy_dev/src/fmt.rs2
-rw-r--r--clippy_dev/src/new_lint.rs2
-rw-r--r--clippy_dev/src/serve.rs3
-rw-r--r--clippy_dev/src/update_lints.rs30
4 files changed, 16 insertions, 21 deletions
diff --git a/clippy_dev/src/fmt.rs b/clippy_dev/src/fmt.rs
index 5fc4365c6e7..8c61c35533c 100644
--- a/clippy_dev/src/fmt.rs
+++ b/clippy_dev/src/fmt.rs
@@ -1,6 +1,6 @@
 use crate::clippy_project_root;
 use itertools::Itertools;
-use rustc_lexer::{tokenize, TokenKind};
+use rustc_lexer::{TokenKind, tokenize};
 use shell_escape::escape;
 use std::ffi::{OsStr, OsString};
 use std::ops::ControlFlow;
diff --git a/clippy_dev/src/new_lint.rs b/clippy_dev/src/new_lint.rs
index 87117832fb9..5fd65017cfb 100644
--- a/clippy_dev/src/new_lint.rs
+++ b/clippy_dev/src/new_lint.rs
@@ -441,7 +441,7 @@ fn create_lint_for_ty(lint: &LintData<'_>, enable_msrv: bool, ty: &str) -> io::R
 
 #[allow(clippy::too_many_lines)]
 fn setup_mod_file(path: &Path, lint: &LintData<'_>) -> io::Result<&'static str> {
-    use super::update_lints::{match_tokens, LintDeclSearchResult};
+    use super::update_lints::{LintDeclSearchResult, match_tokens};
     use rustc_lexer::TokenKind;
 
     let lint_name_upper = lint.name.to_uppercase();
diff --git a/clippy_dev/src/serve.rs b/clippy_dev/src/serve.rs
index 19560b31fd3..cc14cd8dae6 100644
--- a/clippy_dev/src/serve.rs
+++ b/clippy_dev/src/serve.rs
@@ -29,7 +29,7 @@ pub fn run(port: u16, lint: Option<String>) -> ! {
         }
         if let Some(url) = url.take() {
             thread::spawn(move || {
-                Command::new(PYTHON)
+                let mut child = Command::new(PYTHON)
                     .arg("-m")
                     .arg("http.server")
                     .arg(port.to_string())
@@ -40,6 +40,7 @@ pub fn run(port: u16, lint: Option<String>) -> ! {
                 thread::sleep(Duration::from_millis(500));
                 // Launch browser after first export.py has completed and http.server is up
                 let _result = opener::open(url);
+                child.wait().unwrap();
             });
         }
         thread::sleep(Duration::from_millis(1000));
diff --git a/clippy_dev/src/update_lints.rs b/clippy_dev/src/update_lints.rs
index 8dbda1c634c..d6ed36d52f4 100644
--- a/clippy_dev/src/update_lints.rs
+++ b/clippy_dev/src/update_lints.rs
@@ -1,7 +1,7 @@
 use crate::clippy_project_root;
 use aho_corasick::AhoCorasickBuilder;
 use itertools::Itertools;
-use rustc_lexer::{tokenize, unescape, LiteralKind, TokenKind};
+use rustc_lexer::{LiteralKind, TokenKind, tokenize, unescape};
 use std::collections::{HashMap, HashSet};
 use std::ffi::OsStr;
 use std::fmt::{self, Write};
@@ -1048,23 +1048,17 @@ mod tests {
             Lint::new("incorrect_match", "group1", "\"abc\"", "module_name", Range::default()),
         ];
         let mut expected: HashMap<String, Vec<Lint>> = HashMap::new();
-        expected.insert(
-            "group1".to_string(),
-            vec![
-                Lint::new("should_assert_eq", "group1", "\"abc\"", "module_name", Range::default()),
-                Lint::new("incorrect_match", "group1", "\"abc\"", "module_name", Range::default()),
-            ],
-        );
-        expected.insert(
-            "group2".to_string(),
-            vec![Lint::new(
-                "should_assert_eq2",
-                "group2",
-                "\"abc\"",
-                "module_name",
-                Range::default(),
-            )],
-        );
+        expected.insert("group1".to_string(), vec![
+            Lint::new("should_assert_eq", "group1", "\"abc\"", "module_name", Range::default()),
+            Lint::new("incorrect_match", "group1", "\"abc\"", "module_name", Range::default()),
+        ]);
+        expected.insert("group2".to_string(), vec![Lint::new(
+            "should_assert_eq2",
+            "group2",
+            "\"abc\"",
+            "module_name",
+            Range::default(),
+        )]);
         assert_eq!(expected, Lint::by_lint_group(lints.into_iter()));
     }
 }