Skip to content

Commit

Permalink
Merge pull request #843 from apinnick/github-links
Browse files Browse the repository at this point in the history
Add warning rule for Git links
  • Loading branch information
apinnick authored Aug 29, 2024
2 parents 26e1b4e + c4f5e8c commit a90d4a0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .vale/fixtures/RedHat/GitLinks/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `GitLinks` rule
StylesPath = ../../../styles
MinAlertLevel = warning
[*.adoc]
RedHat.GitLinks = YES
2 changes: 2 additions & 0 deletions .vale/fixtures/RedHat/GitLinks/testinvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/project
https://gitlab.com/project
2 changes: 2 additions & 0 deletions .vale/fixtures/RedHat/GitLinks/testvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/openshift/*
https://github.com/redhat-developer/*
12 changes: 12 additions & 0 deletions .vale/styles/RedHat/GitLinks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
extends: existence
message: Do not include a link to %s unless it is explicitly approved.
link: https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/gitlinks/
ignorecase: true
level: warning
scope: raw
action:
name: remove
tokens:
- 'https:\/\/gitlab\.com\/.*'
- 'https:\/\/github\.com\/(?!openshift|redhat-developer).*'

0 comments on commit a90d4a0

Please sign in to comment.