From 5b1878d5d596ed4c3c70f57aa5f20372bde54e61 Mon Sep 17 00:00:00 2001 From: Joseph Kato Date: Sun, 18 Feb 2024 19:46:46 -0800 Subject: [PATCH] Update Actions --- Google/EmDash.yml | 7 ++++--- Google/EnDash.yml | 13 ------------- Google/Exclamation.yml | 7 +++++-- Google/HeadingPunctuation.yml | 6 +++--- Google/LyHyphens.yml | 10 +++++----- Google/OptionalPlurals.yml | 6 +++--- 6 files changed, 20 insertions(+), 29 deletions(-) delete mode 100644 Google/EnDash.yml diff --git a/Google/EmDash.yml b/Google/EmDash.yml index 1befe72..5a81fb0 100644 --- a/Google/EmDash.yml +++ b/Google/EmDash.yml @@ -1,12 +1,13 @@ extends: existence message: "Don't put a space before or after a dash." -link: 'https://developers.google.com/style/dashes' +link: "https://developers.google.com/style/dashes" nonword: true level: error action: name: edit params: - - remove - - ' ' + - trim + - " " tokens: - '\s[—–]\s' + diff --git a/Google/EnDash.yml b/Google/EnDash.yml deleted file mode 100644 index b314dc4..0000000 --- a/Google/EnDash.yml +++ /dev/null @@ -1,13 +0,0 @@ -extends: existence -message: "Use an em dash ('—') instead of '–'." -link: 'https://developers.google.com/style/dashes' -nonword: true -level: error -action: - name: edit - params: - - replace - - '-' - - '—' -tokens: - - '–' diff --git a/Google/Exclamation.yml b/Google/Exclamation.yml index eea5fd2..b4e4a1f 100644 --- a/Google/Exclamation.yml +++ b/Google/Exclamation.yml @@ -1,9 +1,12 @@ extends: existence message: "Don't use exclamation points in text." -link: 'https://developers.google.com/style/exclamation-points' +link: "https://developers.google.com/style/exclamation-points" nonword: true level: error action: - name: remove + name: edit + params: + - trim_right + - "!" tokens: - '\w+!(?:\s|$)' diff --git a/Google/HeadingPunctuation.yml b/Google/HeadingPunctuation.yml index b538be5..c172986 100644 --- a/Google/HeadingPunctuation.yml +++ b/Google/HeadingPunctuation.yml @@ -1,13 +1,13 @@ extends: existence message: "Don't put a period at the end of a heading." -link: 'https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings' +link: "https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings" nonword: true level: warning scope: heading action: name: edit params: - - remove - - '.' + - trim_right + - "." tokens: - '[a-z0-9][.]\s*$' diff --git a/Google/LyHyphens.yml b/Google/LyHyphens.yml index ac8f557..50dacb4 100644 --- a/Google/LyHyphens.yml +++ b/Google/LyHyphens.yml @@ -1,14 +1,14 @@ extends: existence message: "'%s' doesn't need a hyphen." -link: 'https://developers.google.com/style/hyphens' +link: "https://developers.google.com/style/hyphens" level: error ignorecase: false nonword: true action: name: edit params: - - replace - - '-' - - ' ' + - regex + - "-" + - " " tokens: - - '\s[^\s-]+ly-' + - '\b[^\s-]+ly-\w+\b' diff --git a/Google/OptionalPlurals.yml b/Google/OptionalPlurals.yml index f858ea6..4a8767d 100644 --- a/Google/OptionalPlurals.yml +++ b/Google/OptionalPlurals.yml @@ -1,12 +1,12 @@ extends: existence message: "Don't use plurals in parentheses such as in '%s'." -link: 'https://developers.google.com/style/plurals-parentheses' +link: "https://developers.google.com/style/plurals-parentheses" level: error nonword: true action: name: edit params: - - remove - - '(s)' + - trim_right + - "(s)" tokens: - '\b\w+\(s\)'