rust-analyzer: enable check by default

This commit is contained in:
oxalica 2021-08-25 04:56:02 +08:00
parent b7efa4755c
commit 4b8c79896c
No known key found for this signature in database
GPG Key ID: CED392DE0C483D00
2 changed files with 26 additions and 2 deletions

View File

@ -1,8 +1,7 @@
{ lib, stdenv, fetchFromGitHub, rustPlatform, CoreServices, cmake { lib, stdenv, fetchFromGitHub, rustPlatform, CoreServices, cmake
, libiconv , libiconv
, useMimalloc ? false , useMimalloc ? false
# FIXME: Test doesn't pass under rustc 1.52.1 due to different escaping of `'` in string. , doCheck ? true
, doCheck ? false
}: }:
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
@ -17,9 +16,16 @@ rustPlatform.buildRustPackage rec {
sha256 = "sha256-6Tbgy77Essi3Hyd5kdJ7JJbx7RuFZQWURfRrpScvPPQ="; 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"; buildAndTestSubdir = "crates/rust-analyzer";
cargoBuildFlags = lib.optional useMimalloc "--features=mimalloc"; cargoBuildFlags = lib.optional useMimalloc "--features=mimalloc";
cargoTestFlags = lib.optional useMimalloc "--features=mimalloc";
nativeBuildInputs = lib.optional useMimalloc cmake; nativeBuildInputs = lib.optional useMimalloc cmake;

View File

@ -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()