From 97b4ef6c9f0ee73ec9e1863a3e42cfe48c7d8dc9 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Fri, 28 Aug 2026 14:24:38 +0200 Subject: [PATCH] Point Rust Analayzer to target/rust-analyzer --- .gitignore | 2 +- .vscode/settings.json | 4 ++-- scripts/lint.py | 11 ++++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 588826e7d..75ac73f5b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ .DS_Store **/target -**/target_ra +**/target_ra # legacy Rust Analyzer target dir **/target_wasm **/tests/snapshots/**/*.diff.png **/tests/snapshots/**/*.new.png diff --git a/.vscode/settings.json b/.vscode/settings.json index 21d4bb4b0..113ad5092 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,7 +8,7 @@ } }, "files.exclude": { - "target_ra/**": true, + "target_ra/**": true, // legacy Rust Analyzer target dir "target_wasm/**": true, "target/**": true, }, @@ -18,7 +18,7 @@ "rust-analyzer.cargo.allTargets": true, "rust-analyzer.cargo.features": "all", // Use a separate target directory for Rust Analyzer so it doesn't prevent cargo/clippy from doing things. - "rust-analyzer.cargo.targetDir": "target_ra", + "rust-analyzer.cargo.targetDir": true, "rust-analyzer.showUnlinkedFileNotification": false, // Uncomment the following options and restart rust-analyzer to get it to check code behind `cfg(target_arch=wasm32)`. // Don't forget to put it in a comment again before committing. diff --git a/scripts/lint.py b/scripts/lint.py index 0c1319e8a..1d26e5ca1 100755 --- a/scripts/lint.py +++ b/scripts/lint.py @@ -66,11 +66,8 @@ def lint_lines(filepath, lines_in): ) lines_out.append("#[inline]") - if re.search(r"TODO[^(]", line): - errors.append( - f"{filepath}:{line_nr}: write 'TODO(username):' instead" - ) + errors.append(f"{filepath}:{line_nr}: write 'TODO(username):' instead") if re.search(r"\.zip\(", line): errors.append( @@ -177,7 +174,11 @@ def main(): root_dirpath = os.path.abspath(f"{script_dirpath}/..") os.chdir(root_dirpath) - exclude = set(["target", "target_ra", "target_wasm"]) + exclude = { + "target", + "target_ra", # legacy Rust Analyzer target dir + "target_wasm", + } for root, dirs, files in os.walk(".", topdown=True): dirs[:] = [d for d in dirs if d not in exclude] for filename in files: