From d998e1d468943e6527367eb3307dfd2ae2d5a03f Mon Sep 17 00:00:00 2001 From: nolade Date: Tue, 30 Jun 2026 16:50:58 -0400 Subject: [PATCH] docs-v4: update format_raddb script so the .dotfiles are not included in the search for target files --- scripts/asciidoc/format_raddb.md | 4 ++++ scripts/asciidoc/format_raddb.py | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/asciidoc/format_raddb.md b/scripts/asciidoc/format_raddb.md index f89b69d9f2a..c9170a4af4a 100644 --- a/scripts/asciidoc/format_raddb.md +++ b/scripts/asciidoc/format_raddb.md @@ -19,6 +19,10 @@ should not be formatted. The list of files to ignore is below: * 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. diff --git a/scripts/asciidoc/format_raddb.py b/scripts/asciidoc/format_raddb.py index 743f3e219bd..620e3744fcf 100755 --- a/scripts/asciidoc/format_raddb.py +++ b/scripts/asciidoc/format_raddb.py @@ -110,6 +110,9 @@ def should_format(path, raddb_root): name = path.name + if name.startswith("."): + return False + if "certs" in parts: return False @@ -833,7 +836,7 @@ def main(argv=None): 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 -- 2.47.3