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:
Rob Donnelly 2019-08-19 09:03:12 -07:00 committed by Max Brunsfeld
parent 123dcfaec5
commit 9ba5f25594

View file

@ -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 {