Skip to content

Commit

Permalink
Tweaking Gh action setup for Vale.
Browse files Browse the repository at this point in the history
  • Loading branch information
wmat committed Nov 15, 2024
1 parent 1a5cd04 commit 8e5abba
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 17 deletions.
8 changes: 0 additions & 8 deletions .github/.vale.ini

This file was deleted.

32 changes: 23 additions & 9 deletions .github/workflows/vale.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
name: reviewdog
---
#
# Copyright (c) 2021 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
name: Linting with Vale on pull request
on: [pull_request]

jobs:
vale:
name: runner / vale
runs-on: ubuntu-latest
name: Linting with Vale
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: errata-ai/[email protected]
- name: Install Asciidoctor
run: sudo apt-get install -y asciidoctor
- uses: errata-ai/vale-action@reviewdog
with:
version: 2.17.0
files: /src/*.adoc
reporter: github-pr-check
filter_mode: diff_context
vale_flags: "--no-exit --minAlertLevel=error --glob=*.adoc"
reporter: github-pr-review
fail_on_error: true
filter_mode: nofilter
token: ${{secrets.VALE_GITHUB_TOKEN}}
env:
# Required, set by GitHub actions automatically:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
REVIEWDOG_GITHUB_API_TOKEN: ${{secrets.GITHUB_TOKEN}}
40 changes: 40 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
StylesPath = .vale/styles

MinAlertLevel = suggestion

IgnoredScopes = code, tt, img, url, a, body.id

SkippedScopes = script, style, pre, figure, code, tt, blockquote, listingblock, literalblock

Packages = RedHat

# Match AsciiDoc files. See: https://vale.sh/docs/topics/scoping/
# Ignore files in a directory starting by `.`
# to avoid raising errors for `.vale/fixtures/*/testinvalid.adoc` files
[[!.]*.adoc]

BasedOnStyles = RedHat

[*.md]

BasedOnStyles = RedHat

# Ignore code surrounded by backticks or plus sign, parameters defaults, URLs.
TokenIgnores = (\x60[^\n\x60]+\x60), ([^\n]+=[^\n]*), (\+[^\n]+\+), (http[^\n]+\[)

# Match INI files. See: https://vale.sh/docs/topics/scoping/
[*.ini]

BasedOnStyles = RedHat

# Ignore code surrounded by backticks or plus sign, parameters defaults, URLs.
TokenIgnores = (\x60[^\n\x60]+\x60), ([^\n]+=[^\n]*), (\+[^\n]+\+), (http[^\n]+\[)

# Disabling rules (NO)
RedHat.CaseSensitiveTerms = NO
RedHat.ConfigMap = NO
RedHat.Definitions = NO
RedHat.Slash = NO
RedHat.Spacing = NO
RedHat.Spelling = NO
RedHat.TermsSuggestions = NO

0 comments on commit 8e5abba

Please sign in to comment.