Ignore hidden files in grammar test directories (#430)
This fixes "stream did not contain valid UTF-8" error due to `tree-sitter test` attempting to Vim's parse hidden binary swap files.
This commit is contained in:
parent
123dcfaec5
commit
9ba5f25594
1 changed files with 8 additions and 1 deletions
|
|
@ -183,7 +183,14 @@ pub fn parse_tests(path: &Path) -> io::Result<TestEntry> {
|
|||
let mut children = Vec::new();
|
||||
for entry in fs::read_dir(path)? {
|
||||
let entry = entry?;
|
||||
children.push(parse_tests(&entry.path())?);
|
||||
let hidden = entry
|
||||
.file_name()
|
||||
.to_str()
|
||||
.unwrap_or("")
|
||||
.starts_with(".");
|
||||
if !hidden {
|
||||
children.push(parse_tests(&entry.path())?);
|
||||
}
|
||||
}
|
||||
Ok(TestEntry::Group { name, children })
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue