Add grammar compatibility option to the formatter (#1249)

This commit is contained in:
Islon Scherer
2025-10-28 13:29:08 +01:00
committed by GitHub
parent ef4989aa35
commit be0142d46b
9 changed files with 108 additions and 16 deletions

View File

@@ -743,6 +743,16 @@ It returns a non-zero status code in case violations are found.
If the path is a directory, recursively looks for files with a `.pkl` extension, or files named `PklProject`.
==== Options
.--grammar-version
[%collapsible]
====
Default: `2` (latest version) +
Select the grammar compatibility version for the formatter.
New versions are created for each backward incompatible grammar change.
====
[[command-format-apply]]
=== `pkl format apply`
@@ -760,6 +770,14 @@ If the path is a directory, recursively looks for files with a `.pkl` extension,
Do not write the name of wrongly formatted files to stdout.
====
.--grammar-version
[%collapsible]
====
Default: `2` (latest version) +
Select the grammar compatibility version for the formatter.
New versions are created for each backward incompatible grammar change.
====
[[common-options]]
=== Common options