]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
docs-v4: update format_raddb script so the .dotfiles are not included in the search... developer/alandekok master
authornolade <nola.aunger@inkbridge.io>
Tue, 30 Jun 2026 20:50:58 +0000 (16:50 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 1 Jul 2026 00:57:38 +0000 (20:57 -0400)
scripts/asciidoc/format_raddb.md
scripts/asciidoc/format_raddb.py

index f89b69d9f2ace1da3e79ceb49f9b4648d4599edd..c9170a4af4a374369ed245c936ee1d58c78769a3 100644 (file)
@@ -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.
index 743f3e219bd8b932eda18636c9c0ce6ee115a56c..620e3744fcfb4d3d994afda162036c17c25329bb 100755 (executable)
@@ -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