Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vale #3147

Closed
wants to merge 2 commits into from
Closed

vale #3147

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/lint-with-vale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Linting with Vale on pull request
on: [pull_request]

jobs:
vale:
name: Linting with Vale
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: errata-ai/vale-action@reviewdog
with:
filter_mode: diff_context
vale_flags: "--no-exit --minAlertLevel=error --glob=!*/doc-*/common/*"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*.adoc will prevent the sym links problem

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean --glob=*.adoc?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't work for me locally.

Running it with --glob='*.adoc' (quoted, so my shell doesn't interpret the *) and it spins for minutes now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I misread your earlier comment. No, I meant this: --glob=!*/doc-*/common/*.adoc"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but now I'm not certain. I have not used that flag.

# github-pr-annotations doesn't require elevated token privileges
reporter: github-pr-annotations
fail_on_error: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has annotations, but the check doesn't appear to fail. That's confusing to me.

# let's limit this a bit
files: guides/
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ guides/common/default.css
/web/.byebug_history
/web/output/
/vendor
.vale/*
gl-code-quality-report.json
.vscode/*
38 changes: 38 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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, AsciiDoc

Vocab = Foreman

# Use local Vocab terms
Vale.Terms = YES
Vale.Avoid = YES

# Ignore files in dirs starting with `.` to avoid raising errors for `.vale/fixtures/*/testinvalid.adoc` files
[[!.]*.adoc]

BasedOnStyles = RedHat, AsciiDoc

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

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

# Disabling rules (NO)
RedHat.ReleaseNotes = NO

# Disabling rules (NO)
RedHat.CaseSensitiveTerms = NO
RedHat.ConfigMap = NO
RedHat.Definitions = NO
RedHat.Slash = YES
RedHat.Spacing = NO
RedHat.Spelling = NO
RedHat.TermsSuggestions = NO
13 changes: 13 additions & 0 deletions .vale/styles/config/vocabularies/Foreman/accept.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Regex terms added to accept.txt are ignored by the Vale linter and override RedHat Vale rules.
# Add terms that have a corresponding incorrectly capitalized form to reject.txt.
Katello
[Ss]hellhooks
installer
HAProxy
Product
SSL

# Terms added until they are fixed in Vale rules
content view
composite content view

7 changes: 7 additions & 0 deletions .vale/styles/config/vocabularies/Foreman/reject.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Regex terms added to reject.txt are highlighted as errors by the Vale linter and override RedHat Vale rules.
# Add terms that have a corresponding correctly capitalized form to accept.txt.
product

# Terms added until they are fixed in Vale rules
Content View
Composite Content View
7 changes: 7 additions & 0 deletions guides/common/modules/con_ERROR-TEST.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[id="Accessing_Server_{context}"]
= Accessing {ProjectName}

THIS IS A TEST

Content View

Check failure on line 6 in guides/common/modules/con_ERROR-TEST.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [RedHat.CaseSensitiveTerms] Use 'content view' rather than 'Content View'. Raw Output: {"message": "[RedHat.CaseSensitiveTerms] Use 'content view' rather than 'Content View'.", "location": {"path": "guides/common/modules/con_ERROR-TEST.adoc", "range": {"start": {"line": 6, "column": 1}}}, "severity": "ERROR"}
Composite Content View

Check failure on line 7 in guides/common/modules/con_ERROR-TEST.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [RedHat.CaseSensitiveTerms] Use 'content view' rather than 'Content View'. Raw Output: {"message": "[RedHat.CaseSensitiveTerms] Use 'content view' rather than 'Content View'.", "location": {"path": "guides/common/modules/con_ERROR-TEST.adoc", "range": {"start": {"line": 7, "column": 11}}}, "severity": "ERROR"}
Loading