Skip to content

AMW-590 Collection spelling and grammar checking for PRs#24

Open
RanabirChakraborty wants to merge 1 commit into
ansible-middleware:mainfrom
RanabirChakraborty:AMW-590
Open

AMW-590 Collection spelling and grammar checking for PRs#24
RanabirChakraborty wants to merge 1 commit into
ansible-middleware:mainfrom
RanabirChakraborty:AMW-590

Conversation

@RanabirChakraborty

Copy link
Copy Markdown
Member

@iweiss

iweiss commented Jul 10, 2026

Copy link
Copy Markdown

A couple of notes:

  • This should be documented in README.md with how to use this action, per-project settings, global settings, etc.
  • All files should be spell and grammar checked, not only .md, .rst and task names
  • You are excluding Andrew's name. If it gets flagged, maybe we need a base English dictionary



def _load_accepted_terms():
"""Load accepted spelling terms from the shared Vale vocabulary file."""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe merged instead of shared?

SKIP_RULES = {
"write-good.TooWordy",
"write-good.Weasel",
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Couldn't this be part of a shared vale.ini that can be overridden by a project's own vale.ini?

@RanabirChakraborty RanabirChakraborty force-pushed the AMW-590 branch 2 times, most recently from 5391576 to 00a2a10 Compare July 11, 2026 16:07
@RanabirChakraborty

Copy link
Copy Markdown
Member Author

@iweiss Thanks for the suggestions, Fixed it accordingly.

current = parent


VALE_CONFIG = _find_vale_config()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What happens if the file isn't found?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Currently it silently returns a nonexistent path. We can add an error msg to handle this and also in the README we have mentioned that in every collection root path we need to have .vale.ini file present.

with tempfile.NamedTemporaryFile(
mode='w', suffix='.md', dir=PROJECT_ROOT, delete=False
) as tmp:
tmp.write(clean + '\n')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What is being accomplished by writing this temporary file?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Actually Vale's CLI only accepts file paths, it has no stdin mode. Adding a comment here.

FQCN
Jinja
jinja
playbook

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Isn't this in the standard English dictionary?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.

colocated
multicast
infinispan
idempotency

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ditto

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.

utils
repo
repos
boolean

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ditto

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.

Comment thread README.md Outdated
It runs two checks in every pull request:

1. **Prose files** — Vale lints all Markdown and RST files in the collection using the styles configured in the project's `.vale.ini`.
2. **Ansible YAML name fields** — A Python script extracts `name:` fields from task files, handler files, playbooks, and Molecule scenarios and runs them through Vale individually, suppressing rules that are too noisy for short imperative strings.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Edited it.

Comment thread README.md Outdated
Spell and grammar checking for ansible-middleware collections using [Vale](https://vale.sh/).
It runs two checks in every pull request:

1. **Prose files** — Vale lints all Markdown and RST files in the collection using the styles configured in the project's `.vale.ini`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't see a .vale.ini in this PR. Is this on purpose?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think .vale.ini should be independent to the collection, that's why haven't provided any .vale.ini here, we can add one in the collection root path. Also added an example in README.

Comment thread README.md Outdated
name: Spelling and Grammar check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Always suggest and use the latest version of an action, even in examples.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.

@@ -0,0 +1,106 @@
Ranabir

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can't the authors key/array be excluded from checking?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed it.

Comment thread README.md Outdated
TokenIgnores = (?:[a-z][a-z\d]*_)+[a-z\d_]+
```

`TokenIgnores` is important: it prevents Vale from spell-checking Ansible `snake_case` variable names inside prose.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What do you mean by "inside prose" in this context?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

like for this case, jboss_home appears within a sentence in a Markdown or RST file. Vale would split it at underscores and flag jboss and home separately as misspelled words. Inside prose means the underscored vars. Explained in the comment as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants