* ignore files in the `raddb/certs` directory
+* ignore dotfiles, i.e. files whose name begins with a `.`, e.g.
+ `.gitignore` or `.DS_Store`. These are not configuration files, and
+ some (such as `.DS_Store`) are binary and cannot be read as text.
+
## Whitespace
The configuration files should use tabs for indentation, not spaces.
name = path.name
+ if name.startswith("."):
+ return False
+
if "certs" in parts:
return False
for fp in files:
try:
sources[fp] = fp.read_text(encoding="utf-8")
- except OSError as e:
+ except (OSError, UnicodeDecodeError) as e:
print(f"format_raddb: {fp}: {e}", file=sys.stderr)
sources[fp] = None