1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 23:34:47 -05:00

fix(cli/fmt): canonicalize files in current dir (#7508)

This commit is contained in:
tokiedokie 2020-09-19 02:03:37 +09:00 committed by GitHub
parent de95fbebc4
commit 4c2920ddd7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 2 deletions

View file

@ -236,8 +236,10 @@ pub fn collect_files(
let mut target_files: Vec<PathBuf> = vec![];
if files.is_empty() {
target_files
.extend(files_in_subtree(std::env::current_dir()?, is_supported));
target_files.extend(files_in_subtree(
std::env::current_dir()?.canonicalize()?,
is_supported,
));
} else {
for arg in files {
let p = PathBuf::from(arg);

View file

@ -3526,3 +3526,36 @@ fn rust_log() {
assert!(output.status.success());
assert!(!output.stderr.is_empty());
}
#[test]
fn lint_ignore_unexplicit_files() {
let output = util::deno_cmd()
.current_dir(util::root_path())
.arg("lint")
.arg("--unstable")
.arg("--ignore=./")
.stderr(std::process::Stdio::piped())
.spawn()
.unwrap()
.wait_with_output()
.unwrap();
assert!(output.status.success());
assert!(output.stderr.is_empty());
}
#[test]
fn fmt_ignore_unexplicit_files() {
let output = util::deno_cmd()
.current_dir(util::root_path())
.arg("fmt")
.arg("--unstable")
.arg("--check")
.arg("--ignore=./")
.stderr(std::process::Stdio::piped())
.spawn()
.unwrap()
.wait_with_output()
.unwrap();
assert!(output.status.success());
assert!(output.stderr.is_empty());
}