rust-analyzer: enable check by default

launchpad/nixpkgs/master
oxalica 3 years ago
parent b7efa4755c
commit 4b8c79896c
No known key found for this signature in database
GPG Key ID: CED392DE0C483D00
  1. 10
      pkgs/development/tools/rust/rust-analyzer/default.nix
  2. 18
      pkgs/development/tools/rust/rust-analyzer/ignore-git-and-rustfmt-tests.patch

@ -1,8 +1,7 @@
{ lib, stdenv, fetchFromGitHub, rustPlatform, CoreServices, cmake
, libiconv
, useMimalloc ? false
# FIXME: Test doesn't pass under rustc 1.52.1 due to different escaping of `'` in string.
, doCheck ? false
, doCheck ? true
}:
rustPlatform.buildRustPackage rec {
@ -17,9 +16,16 @@ rustPlatform.buildRustPackage rec {
sha256 = "sha256-6Tbgy77Essi3Hyd5kdJ7JJbx7RuFZQWURfRrpScvPPQ=";
};
patches = [
# Code format and git history check require more dependencies but don't really matter for packaging.
# So just ignore them.
./ignore-git-and-rustfmt-tests.patch
];
buildAndTestSubdir = "crates/rust-analyzer";
cargoBuildFlags = lib.optional useMimalloc "--features=mimalloc";
cargoTestFlags = lib.optional useMimalloc "--features=mimalloc";
nativeBuildInputs = lib.optional useMimalloc cmake;

@ -0,0 +1,18 @@
--- a/crates/rust-analyzer/tests/slow-tests/tidy.rs
+++ b/crates/rust-analyzer/tests/slow-tests/tidy.rs
@@ -6,6 +6,7 @@ use std::{
use xshell::{cmd, pushd, pushenv, read_file};
#[test]
+#[ignore]
fn check_code_formatting() {
let _dir = pushd(sourcegen::project_root()).unwrap();
let _e = pushenv("RUSTUP_TOOLCHAIN", "stable");
@@ -138,6 +139,7 @@ fn check_cargo_toml(path: &Path, text: String) -> () {
}
#[test]
+#[ignore]
fn check_merge_commits() {
let stdout = cmd!("git rev-list --merges --invert-grep --author 'bors\\[bot\\]' HEAD~19..")
.read()
Loading…
Cancel
Save