[doc_checker] Ignore files that start with '._'.
MacOS creates these files and they're not actually Markdown.
Before this, running this tool on my machine resulted in errors like:
Unhandled exception:
FileSystemException: Failed to decode data using encoding 'utf-8', path = '...docs/development/languages/dart/._mods.md'
Also update the README.md.
Test: Rebuilt and ran the tool.
Change-Id: I5ae5f11222fbf2a3f0b9aa4a838e5b916152f9f0
diff --git a/tools/doc_checker/README.md b/tools/doc_checker/README.md
index 343fb2a..a0b6343 100644
--- a/tools/doc_checker/README.md
+++ b/tools/doc_checker/README.md
@@ -17,12 +17,12 @@
In order to build this tool, add `topaz/packages/doc_checker` to your build
packages. The tool is then available at:
```
-out/debug-x64/host_x64/dart-tools/doc_checker
+out/x64/dart-tools/doc_checker
```
See the tool's help for how to hold it right.
-In order to view the generated graph, run:
+In order to view the generated graph, run (on Linux):
```
dot -Tpng graph.dot -o tree.png && feh tree.png
```
diff --git a/tools/doc_checker/bin/main.dart b/tools/doc_checker/bin/main.dart
index 2ed8ef5..ae944b4 100644
--- a/tools/doc_checker/bin/main.dart
+++ b/tools/doc_checker/bin/main.dart
@@ -107,7 +107,11 @@
final List<String> docs = new Directory(docsDir)
.listSync(recursive: true)
- .where((FileSystemEntity entity) => path.extension(entity.path) == '.md')
+ .where((FileSystemEntity entity) =>
+ path.extension(entity.path) == '.md' &&
+ // Skip these files created by macOS since they're not real Markdown:
+ // https://apple.stackexchange.com/q/14980
+ !path.basename(entity.path).startsWith('._'))
.map((FileSystemEntity entity) => entity.path)
.toList();