From 7fa17b9f00e982bc72a6f51c25468890c58a83eb Mon Sep 17 00:00:00 2001 From: Justin Garcia Date: Thu, 8 Oct 2026 00:13:34 +0000 Subject: [PATCH] Set default formatting width to 100 columns Amp-Thread-ID: https://ampcode.com/threads/T-01a11720-fd70-73ae-a723-70ad4084ac5b Co-authored-by: Amp --- compiler-executable/iris-cli/src/cli.rs | 2 +- compiler-frontend/formatting/src/lib.rs | 2 +- documentation/formatting.md | 2 +- tests-e2e/tests/snapshots/cli__help_format.snap | 2 +- .../1791041760_invalid_formatting_options/Main.snap | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler-executable/iris-cli/src/cli.rs b/compiler-executable/iris-cli/src/cli.rs index 6b8070100..015302607 100644 --- a/compiler-executable/iris-cli/src/cli.rs +++ b/compiler-executable/iris-cli/src/cli.rs @@ -59,7 +59,7 @@ pub struct FormatOptions { #[usage(arg_group)] pub mode: Option, - /// Preferred line width. Defaults to 80 columns. + /// Preferred line width. Defaults to 100 columns. #[usage(long, value_name = "COLUMNS")] pub width: Option, diff --git a/compiler-frontend/formatting/src/lib.rs b/compiler-frontend/formatting/src/lib.rs index 022f09c05..28159b583 100644 --- a/compiler-frontend/formatting/src/lib.rs +++ b/compiler-frontend/formatting/src/lib.rs @@ -22,7 +22,7 @@ pub struct Config { impl Default for Config { fn default() -> Config { - Config { line_width: 80, indent_width: 2, unicode: false } + Config { line_width: 100, indent_width: 2, unicode: false } } } diff --git a/documentation/formatting.md b/documentation/formatting.md index 549b7ed4e..46ff3f5a6 100644 --- a/documentation/formatting.md +++ b/documentation/formatting.md @@ -31,7 +31,7 @@ iris format --width 100 --indent 4 --unicode |--------|----------| | `--check` | List unformatted paths and exit with status 1 when changes are needed, without modifying files | | `--write` | Replace selected files with formatted output; the default in workspace mode | -| `--width COLUMNS` | Preferred line width; a positive value, defaulting to 80 | +| `--width COLUMNS` | Preferred line width; a positive value, defaulting to 100 | | `--indent SPACES` | Spaces per indentation level; from 1 to 65535, defaulting to 2 | | `--unicode` | Emit Unicode built-in signatures, arrows, constraints, and quantifiers | diff --git a/tests-e2e/tests/snapshots/cli__help_format.snap b/tests-e2e/tests/snapshots/cli__help_format.snap index 1fe7a5cbb..9fa17691e 100644 --- a/tests-e2e/tests/snapshots/cli__help_format.snap +++ b/tests-e2e/tests/snapshots/cli__help_format.snap @@ -10,7 +10,7 @@ Usage: iris format [FLAGS] Flags: --write Replace files with formatted output. This is the default for workspaces. --check Report files that are not formatted without changing them. - --width Preferred line width. Defaults to 80 columns. + --width Preferred line width. Defaults to 100 columns. --indent Spaces per indentation level. Defaults to 2. --unicode Use Unicode spellings for built-in operators and forall. --file Format only this file, without workspace discovery. Repeat for multiple files; use - for stdin. diff --git a/tests-integration/fixtures/formatting/1791041760_invalid_formatting_options/Main.snap b/tests-integration/fixtures/formatting/1791041760_invalid_formatting_options/Main.snap index ddcfb4608..78a404ec9 100644 --- a/tests-integration/fixtures/formatting/1791041760_invalid_formatting_options/Main.snap +++ b/tests-integration/fixtures/formatting/1791041760_invalid_formatting_options/Main.snap @@ -1,10 +1,10 @@ --- source: tests-integration/tests/formatting.rs -assertion_line: 78 +assertion_line: 127 --- === width 0, indent 2 === invalid formatting options: line width must be positive -=== width 80, indent 0 === +=== width 100, indent 0 === invalid formatting options: indent width must be between 1 and 65535 spaces -=== width 80, indent 65536 === +=== width 100, indent 65536 === invalid formatting options: indent width must be between 1 and 65535 spaces