Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/instructions/zsh-scripting.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,21 @@ execution profile.

## Options and emulation

### `zsh/options/canonical-spelling`

- Level: `required`
- Profiles: `standalone-executable`, `startup-file`, `sourced-library`, `autoload-function`, `test-fixture`
- Minimum Zsh: `null`
- Basis: `mixed`
- Evidence: `options`
- Enforcement: `human-review`

Write option names in the canonical underscore-separated form used by the Zsh
manual, including in `setopt`, `unsetopt`, option tests, and documentation. For
example, use `local_options`, `no_auto_pushd`, and `warn_create_global`, not
accepted separator-free aliases such as `localoptions`, `noautopushd`, and
`warncreateglobal`.

### `zsh/options/declare-correctness-state`

- Level: `required`
Expand Down
15 changes: 15 additions & 0 deletions lib/zsh-standard-policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,21 @@
"evidence": ["functions", "options"],
"enforcement": ["runtime-test"]
},
{
"id": "zsh/options/canonical-spelling",
"level": "required",
"profiles": [
"standalone-executable",
"startup-file",
"sourced-library",
"autoload-function",
"test-fixture"
],
"minimum_zsh": null,
"basis": "mixed",
"evidence": ["options"],
"enforcement": ["human-review"]
},
{
"id": "zsh/options/declare-correctness-state",
"level": "required",
Expand Down
7 changes: 4 additions & 3 deletions scripts/test_validate_zsh_standard_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def test_startup_profile_has_exact_rule_membership(self) -> None:
"zsh/review/report-without-rewrite",
"zsh/change/conform-touched-code",
"zsh/completion/preserve-trust-boundaries",
"zsh/options/canonical-spelling",
"zsh/options/declare-correctness-state",
"zsh/options/localize",
"zsh/options/no-blanket-error-mode",
Expand Down Expand Up @@ -249,7 +250,7 @@ def test_startup_profile_has_exact_rule_membership(self) -> None:
[rule["id"] for rule in matching_rules],
expected_rule_ids,
)
self.assertEqual(len(matching_rules), 48)
self.assertEqual(len(matching_rules), 49)
for rule in matching_rules:
with self.subTest(rule_id=rule["id"]):
if rule["id"] == "zsh/completion/preserve-trust-boundaries":
Expand Down Expand Up @@ -1977,7 +1978,7 @@ def test_repair_2_consumer_parser_outputs_match_frozen_golden(self) -> None:
},
"parsed_rules": validator._markdown_rules(instruction),
}
self.assertEqual(len(snapshot["rule_blocks"]), 63)
self.assertEqual(len(snapshot["rule_blocks"]), 64)
digest = hashlib.sha256(
json.dumps(
snapshot,
Expand All @@ -1989,7 +1990,7 @@ def test_repair_2_consumer_parser_outputs_match_frozen_golden(self) -> None:

self.assertEqual(
digest,
"15d3c2c6f7bcf5192f8fe4beb1b8e324262f0ea5779407b0c0609beadc13151c",
"e385f4d4c34496495e808b602b59adb88d5ace192619e04669c70f4020afc981",
)

def test_rejects_list_and_nested_container_rule_headings(self) -> None:
Expand Down
2 changes: 2 additions & 0 deletions scripts/validate-zsh-standard-policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
"zsh/test/isolate-environment",
"zsh/test/declare-negative-fixtures",
"zsh/test/match-production-profile",
"zsh/options/canonical-spelling",
"zsh/options/declare-correctness-state",
"zsh/options/localize",
"zsh/options/no-top-level-leak",
Expand Down Expand Up @@ -202,6 +203,7 @@
"zsh/review/report-without-rewrite",
"zsh/change/conform-touched-code",
"zsh/completion/preserve-trust-boundaries",
"zsh/options/canonical-spelling",
"zsh/options/declare-correctness-state",
"zsh/options/localize",
"zsh/options/no-blanket-error-mode",
Expand Down
Loading