git: 33856d1e84 - main - Vale: Add rule to avoid superfluous optional argument in link

Lorenzo Salvadore <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
The branch main has been updated by salvadore:

URL: https://cgit.FreeBSD.org/doc/commit/?id=33856d1e846bd2d63c6bc76526a68f94ed5feaa1

commit 33856d1e846bd2d63c6bc76526a68f94ed5feaa1
Author:     Lorenzo Salvadore <[email protected]>
AuthorDate: 2023-04-14 08:14:43 +0000
Commit:     Lorenzo Salvadore <[email protected]>
CommitDate: 2023-04-25 10:43:21 +0000

    Vale: Add rule to avoid superfluous optional argument in link
    
    Suggest to empty square brackets in `link:` macros when the displayed
    text coincides with the URL.
    
    Reviewed by:    bofh, grahamperrin
    Approved by:    carlavilla (mentor)
    Differential Revision: https://reviews.freebsd.org/D39569
---
 .vale.ini                                         | 2 ++
 .vale/styles/FreeBSD/SuperfluousOptArgInLinks.yml | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/.vale.ini b/.vale.ini
index 46d3593082..471e9e97a5 100644
--- a/.vale.ini
+++ b/.vale.ini
@@ -19,6 +19,7 @@ FreeBSD.ConsciousLanguage = NO
 FreeBSD.Contractions = NO
 FreeBSD.Hang = NO
 FreeBSD.Hyphens = NO
+FreeBSD.SuperfluousOptArgInLinks = NO
 FreeBSD.Repitition = NO
 FreeBSD.SemanticLineBreak = NO
 FreeBSD.Spacing = NO
@@ -34,6 +35,7 @@ FreeBSD.ConsciousLanguage = NO
 FreeBSD.Contractions = NO
 FreeBSD.Hang = NO
 FreeBSD.Hyphens = NO
+FreeBSD.SuperfluousOptArgInLinks = NO
 FreeBSD.Repitition = NO
 FreeBSD.SemanticLineBreak = NO
 FreeBSD.Spacing = NO
diff --git a/.vale/styles/FreeBSD/SuperfluousOptArgInLinks.yml b/.vale/styles/FreeBSD/SuperfluousOptArgInLinks.yml
new file mode 100644
index 0000000000..36b2b4158b
--- /dev/null
+++ b/.vale/styles/FreeBSD/SuperfluousOptArgInLinks.yml
@@ -0,0 +1,7 @@
+extends: existence
+message: "Displayed text coincides with URL, leave the brackets empty: %s"
+ignorecase: true
+level: suggestion
+scope: raw
+raw:
+ - 'link:([^ ]*)\/?\[\1\/?\]'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.