From 7d6174da80c87440067b717cdc50c121b6dbfe72 Mon Sep 17 00:00:00 2001 From: Nick Lockwood Date: Sun, 26 Nov 2023 15:56:48 +0000 Subject: [PATCH] Exclude deprecated rule options from Rules.md --- Rules.md | 1 - Tests/MetadataTests.swift | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Rules.md b/Rules.md index 2d99dd9f1..00e295237 100644 --- a/Rules.md +++ b/Rules.md @@ -2586,7 +2586,6 @@ Option | Description --- | --- `--funcattributes` | Function @attributes: "preserve", "prev-line", or "same-line" `--typeattributes` | Type @attributes: "preserve", "prev-line", or "same-line" -`--varattributes` | Property @attributes: "preserve", "prev-line", or "same-line" `--storedvarattrs` | Stored var @attribs: "preserve", "prev-line", or "same-line" `--computedvarattrs` | Computed var @attribs: "preserve", "prev-line", "same-line" diff --git a/Tests/MetadataTests.swift b/Tests/MetadataTests.swift index 525349ef0..54f025d54 100644 --- a/Tests/MetadataTests.swift +++ b/Tests/MetadataTests.swift @@ -86,8 +86,11 @@ class MetadataTests: XCTestCase { if !rule.options.isEmpty { result += "\n\nOption | Description\n--- | ---" for option in rule.options { - let help = Descriptors.byName[option]!.help - result += "\n`--\(option)` | \(help)" + let descriptor = Descriptors.byName[option]! + guard !descriptor.isDeprecated else { + continue + } + result += "\n`--\(option)` | \(descriptor.help)" } } if let examples = rule.examples {