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

feat: Add minimal Vale configuration, existing package files #220

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 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
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ resources/
.markdownlint.json
**/.vscode/
**/.idea/

# Local Netlify artifacts
.netlify/plugins/*
.netlify/
# Vale files
/styles/Microsoft
/styles/.vale-config/1-Hugo.ini

# Local Lighthouse artifacts
lighthouse-reports
Expand Down
8 changes: 8 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
StylesPath = styles
Copy link
Contributor

Choose a reason for hiding this comment

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

I want it clear that this is a PoC for now....

Suggested change
StylesPath = styles
# This is a PoC, until we have a configuration that matches our style guide at
# https://github.com/nginx/documentation/blob/main/templates/style-guide.md
StylesPath = styles

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does the PR being in a draft state not create sufficient enough barrier to entry?

Someone would have to check out the branch to attempt to use it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess I don't understand your approach to this PR / change. Once it's taken out of draft, reviewed, and merged, I'm thinking this will be a PoC for a while -- until we're able to test this on a number of NGINX docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't intend to swap this to a review state until it's been tested across multiple documentation sets, and even then, it's an optional artifact for people to interact with until it's enforced as a requirement by both consensus and CI tooling.

MinAlertLevel = suggestion

Packages = Microsoft, Hugo

[*.{md}]

BasedOnStyles = Vale, Microsoft, NGINX
Copy link
Contributor

Choose a reason for hiding this comment

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

I see you've included NGINX Acronyms.yml

Partially as a test, I set this up to avoid the rules associated with https://github.com/errata-ai/Microsoft/blob/master/Microsoft/Acronyms.yml

Suggested change
BasedOnStyles = Vale, Microsoft, NGINX
BasedOnStyles = Vale, Microsoft, NGINX
# Style.Rule = {YES, NO, suggestion, warning, error} to
# enable/disable a rule or change its level.
Microsoft.Acronyms = NO

With this modification, I avoided this error message:

$ vale sync
$ vale content/nginx-one/getting-started.md 

 content/nginx-one/getting-started.md
 10:89    suggestion  'NGINX' has no definition.      Microsoft.Acronyms   

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see the value in re-documenting how Vale works.

I am going through active testing and adjustment of the rules: this PR is in a draft state while I do so, and as such, I am not accepting edit suggestions.

Copy link
Contributor

@mjang mjang Feb 24, 2025

Choose a reason for hiding this comment

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

I'm suggesting that we follow good coding practice. IOW, add comments that explain what's happening with the code.

this PR is in a draft state while I do so, and as such, I am not accepting edit suggestions.

Now you know what I'm looking for once you're ready to take this PR out of draft state. And even more, with this comment, I can remember what I think is needed when this PR is ready for review.

73 changes: 73 additions & 0 deletions styles/NGINX/Acronyms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
extends: conditional
message: "'%s' has no definition."
level: suggestion
ignorecase: false
# Ensures that the existence of 'first' implies the existence of 'second'.
first: '\b([A-Z]{3,5})\b'
second: '(?:\b[A-Z][a-z]+ )+\(([A-Z]{3,5})\)'
# ... with the exception of these:
exceptions:
- API
- ASP
- CLI
- CPU
- CSS
- CSV
- DEBUG
- DELETE
- DOM
- DPI
- F5
- FAQ
- GCC
- GDB
- GET
- GPU
- GTK
- GUI
- HTML
- HTTP
- HTTPS
- IDE
- IETF
- JAR
- JSON
- JSX
- LESS
- LLDB
- NET
- NOTE
- NVDA
- NGINX
- OSS
- PATH
- PATCH
- PDF
- PHP
- POST
- PUT
- RAM
- REPL
- REST
- RSA
- SCM
- SCSS
- SDK
- SQL
- SSH
- SSL
- SVG
- TBD
- TCP
- TODO
- TMOS
- URI
- URL
- USB
- UTF
- VLAN
- VPN
- XML
- XSS
- YAML
- ZIP
12 changes: 12 additions & 0 deletions styles/NGINX/Anthropomorphism.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extends: existence
message: "The word %s' is anthropomorphic. If possible, use a different word if you're referring to a product."
ignorecase: true
#code: false
level: error
tokens:
- decides
- knows
- listens
- hears
- sees
- walks
Loading