Skip to content

Commit 7d9b367

Browse files
authored
Merge pull request quarkiverse#88 from lmartella1/add-vale-cli
feat(doc): add valeCLI github action to automatically lint extension …
2 parents cf4a939 + db90795 commit 7d9b367

File tree

5 files changed

+93
-0
lines changed

5 files changed

+93
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
extends: existence
3+
message: 'The subheading "%s" is nested too deeply. The max heading nesting depth is set to 3.'
4+
level: error
5+
scope: raw
6+
raw:
7+
- '(?<=\n)={4,}\s.+'
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
extends: occurrence
3+
message: Only use one sentence per line.
4+
level: error
5+
scope:
6+
- paragraph
7+
- list
8+
max: 1
9+
token: '(?<!Inc|e\.g|etc|i\.e|vs)[.!?](?: |$)'
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
DLQ
2+
JSON
3+
kubernetes
4+
NFRs
5+
openshift
6+
opentelemetry
7+
POJO[?s]
8+
Protobuf
9+
Quarkus
10+
Splunk
11+
XML
12+
YAML

.github/workflows/lint-with-vale.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: lint-with-vale.yml
2+
on:
3+
pull_request_target:
4+
paths:
5+
- 'docs/modules/ROOT/pages/**'
6+
- '.github/workflows/lint-with-vale.yml'
7+
8+
jobs:
9+
vale:
10+
name: Linting with Vale
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: errata-ai/vale-action@reviewdog
15+
with:
16+
files: ./docs/modules/ROOT/pages/
17+
filter_mode: added
18+
reporter: github-pr-review
19+
fail_on_error: false
20+
env:
21+
# Required, set by GitHub actions automatically:
22+
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
23+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
24+
REVIEWDOG_GITHUB_API_TOKEN: ${{secrets.GITHUB_TOKEN}}

.vale.ini

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Vale configuration file.
2+
# For more information, see: https://vale.sh/docs/topics/config.
3+
4+
# The relative path to the folder containing linting rules (styles).
5+
StylesPath = .github/styles
6+
7+
# Minimum alert level
8+
# -------------------
9+
# The minimum alert level in the output (suggestion, warning, or error).
10+
# If integrated into CI, builds fail by default on error-level alerts, unless you run Vale with the --no-exit flag
11+
MinAlertLevel = warning
12+
13+
# IgnoredScopes specifies inline-level HTML tags to ignore.
14+
# These tags may occur in an active scope (unlike SkippedScopes, skipped entirely) but their content still will not raise any alerts.
15+
# Default: ignore `code` and `tt`.
16+
IgnoredScopes = code, tt, img, url, a, body.id
17+
18+
# SkippedScopes specifies block-level HTML tags to ignore. Ignore any content in these scopes.
19+
# Default: ignore `script`, `style`, `pre`, and `figure`.
20+
SkippedScopes = script, style, pre, figure, code, tt, blockquote, listingblock, literalblock
21+
22+
Vocab = quarkus-kafka-streams-definitions
23+
24+
Packages = RedHat, AsciiDoc
25+
26+
[*.adoc]
27+
BasedOnStyles = Custom, RedHat, AsciiDoc
28+
29+
# Ignore code matching the following patterns:
30+
# (\x60[^\n\x60]+\x60) - code surrounded by backticks - e.g. `BatchApplication`
31+
# (:[^\n]+: [^\n]+) - attributes definitions - e.g. `:param: value`
32+
# ([^\n]+=[^\n]*) - config definitions - e.g. param=value
33+
# (https?:\/\/[^\n\s]+) - URLs - e.g. https://www.example.com
34+
# (\b\w+_\w+\b) - snake case words - e.g. batch_application
35+
# (\b\w+_\w+\b) - kebab case words - e.g. batch-application
36+
# (\{[^\}]+\}\S+\[) - URLs based on attribute - e.g. {url}/path[link]
37+
# (^\.\w+\.\w+$) - callouts title - e.g. .pom.xml
38+
TokenIgnores = (\x60[^\n\x60]+\x60), (:[^\n]+: [^\n]+), ([^\n]+=[^\n]*), (https?:\/\/[^\n\s]+), (\b\w+_\w+\b), (\b\w+-\w+\b), (\{[^\}]+\}\S+\[), (^\.\w+\.\w+$)
39+
40+
# Disable the execution of this style as all our callouts are using include::[] directive
41+
AsciiDoc.MatchingNumberedCallouts = NO

0 commit comments

Comments
 (0)