diff --git a/bin/chunk_preflight/indentation.py b/bin/chunk_preflight/indentation.py index 6f445152..51c3f6dc 100644 --- a/bin/chunk_preflight/indentation.py +++ b/bin/chunk_preflight/indentation.py @@ -9,7 +9,7 @@ import re from failure import Failure from git_cli.git_repo import git -# Files of common programming languages, by extension. Markdown, JSON and YAML aren't code: a format fixes their indentation. +# Files of common programming languages, by extension. The check skips Markdown, JSON and YAML, which are prose or data. CODE = re.compile(r".*\.(py|js|mjs|cjs|jsx|ts|tsx|rs|go|php|java|kt|kts|scala|rb|c|h|cc|cpp|hpp|cs|swift|sh|bash|lua|ex|exs|dart|vue|svelte)", re.IGNORECASE) # Committed copies of other people's code follow their authors' style. VENDORED = re.compile(r"(^|/)(vendor|node_modules|third_party)/") diff --git a/principles/technical-principles.md b/principles/technical-principles.md index 3157a948..50bcdedd 100644 --- a/principles/technical-principles.md +++ b/principles/technical-principles.md @@ -119,5 +119,5 @@ - Read config (credentials, hosts, paths) from CLI params or env vars, never hardcoded. * Indent with hard tabs by default. - Overriding it takes two things: a setting a tool reads (`.editorconfig` or a formatter's config, such as Prettier, `rustfmt.toml` or Biome) and a decision in the decision log that names the reason. A prose rule in `AGENTS.md`, or the existing files' habit, doesn't override it. - - Files whose format fixes their indentation, such as YAML (no tabs) or a spelling's JSON, are outside the rule. - - A file already indented with spaces keeps them until the project converts it or records the override, so no file mixes the two. `chunk-preflight` reports a project in that state where `.editorconfig`, `rustfmt.toml`, Prettier and Biome set nothing about it. + - A format that forbids tabs, such as YAML, and output a spec fixes, such as a JSON example it prints, are outside the rule. + - A file already indented with spaces keeps them until the project converts it or records the override, so no file mixes the two. `chunk-preflight` reports a project whose code is mostly indented with spaces where `.editorconfig`, `rustfmt.toml`, Prettier and Biome set nothing about it.