From 25f08e6fe931473560b21b59661fbea7227d3b91 Mon Sep 17 00:00:00 2001 From: Brett Blue Date: Mon, 18 Mar 2024 15:52:24 -0600 Subject: [PATCH] Add description field. --- .github/workflows/update-rules.yml | 2 +- scripts/update-rules-page.py | 6 ++++-- styles/Datadog/abbreviations.yml | 1 + styles/Datadog/americanspelling.yml | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-rules.yml b/.github/workflows/update-rules.yml index 46f4086..e52aa0c 100644 --- a/.github/workflows/update-rules.yml +++ b/.github/workflows/update-rules.yml @@ -34,6 +34,6 @@ jobs: git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git add RULES.md - TIMESTAMP=$(date -u +"%Y-%m-%d UTC") + TIMESTAMP=$(date -u +"%Y-%m-%d") git commit -m "Update RULES.md - $TIMESTAMP." || echo "No changes to commit." git push diff --git a/scripts/update-rules-page.py b/scripts/update-rules-page.py index 472afb2..27678b2 100644 --- a/scripts/update-rules-page.py +++ b/scripts/update-rules-page.py @@ -3,8 +3,10 @@ from datetime import datetime def generate_rule_markdown(rule_data): - message = rule_data['message'] - markdown = f"### {message}\n\n" + + ## Use description field if it exists; if not, use message field + description = rule_data.get('description', rule_data['message']) + markdown = f"### {description}\n\n" markdown += f"**Level:** *{rule_data['level']}*\n\n" if 'link' in rule_data: diff --git a/styles/Datadog/abbreviations.yml b/styles/Datadog/abbreviations.yml index bcd2163..ce733d5 100644 --- a/styles/Datadog/abbreviations.yml +++ b/styles/Datadog/abbreviations.yml @@ -1,4 +1,5 @@ extends: substitution +description: Don't use Latin abbreviations message: "Use '%s' instead of abbreviations like '%s'." link: "https://github.com/DataDog/documentation/blob/master/CONTRIBUTING.md#abbreviations" ignorecase: true diff --git a/styles/Datadog/americanspelling.yml b/styles/Datadog/americanspelling.yml index 415b8e6..9618399 100644 --- a/styles/Datadog/americanspelling.yml +++ b/styles/Datadog/americanspelling.yml @@ -1,4 +1,5 @@ extends: existence +description: Use American spelling message: "In general, use American spelling instead of '%s'." link: 'https://github.com/DataDog/documentation/blob/master/CONTRIBUTING.md' ignorecase: true