From 49af51129b943784a3e6dbe33b05b6f683965b28 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 12 Aug 2020 12:45:38 +0200 Subject: Deny clippy --- xtask/tests/tidy.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'xtask') diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index d65a2acbc..ca2301021 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs @@ -44,11 +44,25 @@ fn rust_files_are_tidy() { let text = fs2::read_to_string(&path).unwrap(); check_todo(&path, &text); check_trailing_ws(&path, &text); + deny_clippy(&path, &text); tidy_docs.visit(&path, &text); } tidy_docs.finish(); } +fn deny_clippy(path: &PathBuf, text: &String) { + if text.contains("[\u{61}llow(clippy") { + panic!( + "\n\nallowing lints is forbidden: {}. +rust-analyzer intentionally doesn't check clippy on CI. +You can allow lint globally via `xtask clippy`. + +", + path.display() + ) + } +} + #[test] fn check_licenses() { let expected = " -- cgit v1.2.3 From c81e7a3a5936688cbe94c32f4e872ff36100def2 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 12 Aug 2020 13:03:43 +0200 Subject: Minor --- xtask/tests/tidy.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'xtask') diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index ca2301021..4ff72865e 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs @@ -56,6 +56,7 @@ fn deny_clippy(path: &PathBuf, text: &String) { "\n\nallowing lints is forbidden: {}. rust-analyzer intentionally doesn't check clippy on CI. You can allow lint globally via `xtask clippy`. +See https://github.com/rust-lang/rust-clippy/issues/5537 for discussion. ", path.display() -- cgit v1.2.3 From 208b7bd7ba687fb570feb1b89219f14c63712ce8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 12 Aug 2020 16:32:36 +0200 Subject: Rename ra_prof -> profile --- xtask/tests/tidy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xtask') diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index 4ff72865e..7384205db 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs @@ -197,7 +197,7 @@ impl TidyDocs { "ra_ide", "ra_mbe", "ra_parser", - "ra_prof", + "profile", "ra_project_model", "ra_syntax", "ra_tt", -- cgit v1.2.3 From 550d7fbe3cbf2af4a47fca6c9bbefaf798cd7b7b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 12 Aug 2020 16:46:20 +0200 Subject: Rename ra_tt -> tt --- xtask/tests/tidy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xtask') diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index 7384205db..ddaab93ab 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs @@ -200,7 +200,7 @@ impl TidyDocs { "profile", "ra_project_model", "ra_syntax", - "ra_tt", + "tt", "ra_hir_ty", ]; -- cgit v1.2.3 From 50a02eb3593591a02677e1b56f24d7ff0459b9d0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 12 Aug 2020 17:06:49 +0200 Subject: Rename ra_parser -> parser --- xtask/src/codegen.rs | 4 ++-- xtask/tests/tidy.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'xtask') diff --git a/xtask/src/codegen.rs b/xtask/src/codegen.rs index f5f4b964a..08e7a10b7 100644 --- a/xtask/src/codegen.rs +++ b/xtask/src/codegen.rs @@ -24,11 +24,11 @@ pub use self::{ gen_syntax::generate_syntax, }; -const GRAMMAR_DIR: &str = "crates/ra_parser/src/grammar"; +const GRAMMAR_DIR: &str = "crates/parser/src/grammar"; const OK_INLINE_TESTS_DIR: &str = "crates/ra_syntax/test_data/parser/inline/ok"; const ERR_INLINE_TESTS_DIR: &str = "crates/ra_syntax/test_data/parser/inline/err"; -const SYNTAX_KINDS: &str = "crates/ra_parser/src/syntax_kind/generated.rs"; +const SYNTAX_KINDS: &str = "crates/parser/src/syntax_kind/generated.rs"; const AST_NODES: &str = "crates/ra_syntax/src/ast/generated/nodes.rs"; const AST_TOKENS: &str = "crates/ra_syntax/src/ast/generated/tokens.rs"; diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index ddaab93ab..f1a7e8288 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs @@ -196,7 +196,7 @@ impl TidyDocs { "ra_hir_expand", "ra_ide", "ra_mbe", - "ra_parser", + "parser", "profile", "ra_project_model", "ra_syntax", -- cgit v1.2.3 From a1c187eef3ba08076aedb5154929f7eda8d1b424 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 12 Aug 2020 18:26:51 +0200 Subject: Rename ra_syntax -> syntax --- xtask/src/codegen.rs | 8 ++++---- xtask/src/codegen/gen_syntax.rs | 2 +- xtask/src/lib.rs | 2 +- xtask/tests/tidy.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'xtask') diff --git a/xtask/src/codegen.rs b/xtask/src/codegen.rs index 08e7a10b7..2acd598d1 100644 --- a/xtask/src/codegen.rs +++ b/xtask/src/codegen.rs @@ -25,12 +25,12 @@ pub use self::{ }; const GRAMMAR_DIR: &str = "crates/parser/src/grammar"; -const OK_INLINE_TESTS_DIR: &str = "crates/ra_syntax/test_data/parser/inline/ok"; -const ERR_INLINE_TESTS_DIR: &str = "crates/ra_syntax/test_data/parser/inline/err"; +const OK_INLINE_TESTS_DIR: &str = "crates/syntax/test_data/parser/inline/ok"; +const ERR_INLINE_TESTS_DIR: &str = "crates/syntax/test_data/parser/inline/err"; const SYNTAX_KINDS: &str = "crates/parser/src/syntax_kind/generated.rs"; -const AST_NODES: &str = "crates/ra_syntax/src/ast/generated/nodes.rs"; -const AST_TOKENS: &str = "crates/ra_syntax/src/ast/generated/tokens.rs"; +const AST_NODES: &str = "crates/syntax/src/ast/generated/nodes.rs"; +const AST_TOKENS: &str = "crates/syntax/src/ast/generated/tokens.rs"; const ASSISTS_DIR: &str = "crates/ra_assists/src/handlers"; const ASSISTS_TESTS: &str = "crates/ra_assists/src/tests/generated.rs"; diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs index cafad8070..dd1f4d6a2 100644 --- a/xtask/src/codegen/gen_syntax.rs +++ b/xtask/src/codegen/gen_syntax.rs @@ -1,7 +1,7 @@ //! This module generates AST datatype used by rust-analyzer. //! //! Specifically, it generates the `SyntaxKind` enum and a number of newtype -//! wrappers around `SyntaxNode` which implement `ra_syntax::AstNode`. +//! wrappers around `SyntaxNode` which implement `syntax::AstNode`. use std::{ collections::{BTreeSet, HashSet}, diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs index 2fdb08f2e..904a9ee71 100644 --- a/xtask/src/lib.rs +++ b/xtask/src/lib.rs @@ -103,7 +103,7 @@ pub fn run_clippy() -> Result<()> { } pub fn run_fuzzer() -> Result<()> { - let _d = pushd("./crates/ra_syntax"); + let _d = pushd("./crates/syntax"); let _e = pushenv("RUSTUP_TOOLCHAIN", "nightly"); if run!("cargo fuzz --help").is_err() { run!("cargo install cargo-fuzz")?; diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index f1a7e8288..8c608284a 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs @@ -199,7 +199,7 @@ impl TidyDocs { "parser", "profile", "ra_project_model", - "ra_syntax", + "syntax", "tt", "ra_hir_ty", ]; -- cgit v1.2.3 From 2f45cfc415626cfae5cba89c88a25fb3225486f7 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 13 Aug 2020 10:08:11 +0200 Subject: Rename ra_mbe -> mbe --- xtask/tests/tidy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xtask') diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index 8c608284a..0188aaa2e 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs @@ -195,7 +195,7 @@ impl TidyDocs { "ra_hir", "ra_hir_expand", "ra_ide", - "ra_mbe", + "mbe", "parser", "profile", "ra_project_model", -- cgit v1.2.3 From eac24d52e672c0a9c118e8969bf1b839c3e7f1f3 Mon Sep 17 00:00:00 2001 From: Pavan Kumar Sunkara Date: Thu, 13 Aug 2020 12:05:30 +0200 Subject: Rename ra_project_model -> project_model --- xtask/tests/tidy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xtask') diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index 0188aaa2e..2e68e71db 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs @@ -198,7 +198,7 @@ impl TidyDocs { "mbe", "parser", "profile", - "ra_project_model", + "project_model", "syntax", "tt", "ra_hir_ty", -- cgit v1.2.3 From b7aa4898e0841ab8199643f89a0caa967b698ca8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 13 Aug 2020 16:26:29 +0200 Subject: Rename ra_hir_expand -> hir_expand --- xtask/tests/tidy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xtask') diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index 2e68e71db..dc367d1e0 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs @@ -193,7 +193,7 @@ impl TidyDocs { let poorly_documented = [ "ra_hir", - "ra_hir_expand", + "hir_expand", "ra_ide", "mbe", "parser", -- cgit v1.2.3 From 50f8c1ebf23f634b68529603a917e3feeda457fa Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 13 Aug 2020 16:31:04 +0200 Subject: Somewhat fix pre-cache --- xtask/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xtask') diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs index 904a9ee71..807ef587c 100644 --- a/xtask/src/lib.rs +++ b/xtask/src/lib.rs @@ -139,7 +139,7 @@ pub fn run_pre_cache() -> Result<()> { } fs2::remove_file("./target/.rustc_info.json")?; - let to_delete = ["ra_", "heavy_test", "xtask"]; + let to_delete = ["hir", "heavy_test", "xtask", "ide", "rust-analyzer"]; for &dir in ["./target/debug/deps", "target/debug/.fingerprint"].iter() { for entry in Path::new(dir).read_dir()? { let entry = entry?; -- cgit v1.2.3 From 6a77ec7bbe6ddbf663dce9529d11d1bb56c5489a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 13 Aug 2020 16:35:29 +0200 Subject: Rename ra_hir_ty -> hir_ty --- xtask/tests/tidy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xtask') diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index dc367d1e0..5a5bd4a3e 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs @@ -201,7 +201,7 @@ impl TidyDocs { "project_model", "syntax", "tt", - "ra_hir_ty", + "hir_ty", ]; let mut has_fixmes = -- cgit v1.2.3 From ae71a631fd657368e8593feb5e025d23147afe60 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 13 Aug 2020 16:36:55 +0200 Subject: Rename ra_hir -> hir --- xtask/tests/tidy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xtask') diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index 5a5bd4a3e..97a11a01e 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs @@ -192,7 +192,7 @@ impl TidyDocs { } let poorly_documented = [ - "ra_hir", + "hir", "hir_expand", "ra_ide", "mbe", -- cgit v1.2.3 From fc34403018079ea053f26d0a31b7517053c7dd8c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 13 Aug 2020 17:33:38 +0200 Subject: Rename ra_assists -> assists --- xtask/src/codegen.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xtask') diff --git a/xtask/src/codegen.rs b/xtask/src/codegen.rs index 2acd598d1..78a84f68d 100644 --- a/xtask/src/codegen.rs +++ b/xtask/src/codegen.rs @@ -32,8 +32,8 @@ const SYNTAX_KINDS: &str = "crates/parser/src/syntax_kind/generated.rs"; const AST_NODES: &str = "crates/syntax/src/ast/generated/nodes.rs"; const AST_TOKENS: &str = "crates/syntax/src/ast/generated/tokens.rs"; -const ASSISTS_DIR: &str = "crates/ra_assists/src/handlers"; -const ASSISTS_TESTS: &str = "crates/ra_assists/src/tests/generated.rs"; +const ASSISTS_DIR: &str = "crates/assists/src/handlers"; +const ASSISTS_TESTS: &str = "crates/assists/src/tests/generated.rs"; #[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum Mode { -- cgit v1.2.3 From 1b0c7701cc97cd7bef8bb9729011d4cf291a60c5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 13 Aug 2020 17:42:52 +0200 Subject: Rename ra_ide -> ide --- xtask/tests/tidy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xtask') diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index 97a11a01e..76895aeca 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs @@ -194,7 +194,7 @@ impl TidyDocs { let poorly_documented = [ "hir", "hir_expand", - "ra_ide", + "ide", "mbe", "parser", "profile", -- cgit v1.2.3 From 1d11c9c91aeeb891f5d214f59d714eedd6679002 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 14 Aug 2020 17:30:16 +0200 Subject: Document xtask has few deps invariant --- xtask/Cargo.toml | 1 + 1 file changed, 1 insertion(+) (limited to 'xtask') diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 1a1140b04..e9edbdd10 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -18,3 +18,4 @@ quote = "1.0.2" ungrammar = "1.1.1" walkdir = "2.3.1" write-json = "0.1.0" +# Avoid adding more dependencies to this crate -- cgit v1.2.3