From b1c04d8f88b23ef49d08147c8803cdbe908db9e8 Mon Sep 17 00:00:00 2001 From: Alex Gorevski Date: Tue, 17 Feb 2026 13:03:15 -0800 Subject: [PATCH] feat(tooling): add .editorconfig, rustfmt.toml, and clippy.toml Add explicit linting and formatting configuration files to document intent and provide consistent defaults across editors and platforms. - .editorconfig: UTF-8, LF line endings, 4-space indent for Rust, 2-space for YAML/TOML, preserve trailing whitespace in Markdown. - rustfmt.toml: Pin edition to 2021 matching Cargo.toml. Uses standard defaults; file documents that this is intentional. - clippy.toml: Set cognitive-complexity-threshold to 30, too-many-arguments-threshold to 10, and too-many-lines-threshold to 200. Thresholds tuned to match existing codebase patterns and reduce noise from existing allow-attributes. All values match current implicit defaults or are tuned to avoid triggering on existing code. No source code changes required. Validated: cargo fmt --check and cargo clippy -D clippy::correctness both pass with no regressions. Resolves #662 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .editorconfig | 25 +++++++++++++++++++++++++ clippy.toml | 9 +++++++++ rustfmt.toml | 1 + 3 files changed, 35 insertions(+) create mode 100644 .editorconfig create mode 100644 clippy.toml create mode 100644 rustfmt.toml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..eaf9deb --- /dev/null +++ b/.editorconfig @@ -0,0 +1,25 @@ +# EditorConfig — https://editorconfig.org +# Provides consistent formatting defaults across editors and platforms. + +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 4 + +[*.md] +# Trailing whitespace is significant in Markdown (line breaks). +trim_trailing_whitespace = false + +[*.{yml,yaml}] +indent_size = 2 + +[*.toml] +indent_size = 2 + +[Dockerfile] +indent_size = 4 diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 0000000..c45fd63 --- /dev/null +++ b/clippy.toml @@ -0,0 +1,9 @@ +# Clippy configuration for ZeroClaw. +# Thresholds tuned to match codebase patterns and reduce noise from +# existing allow-attributes while still catching genuinely complex code. + +cognitive-complexity-threshold = 30 + +too-many-arguments-threshold = 10 + +too-many-lines-threshold = 200 diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..3a26366 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1 @@ +edition = "2021"