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

Update action.yml #63

Merged
merged 6 commits into from
Jul 18, 2024
Merged

Update action.yml #63

merged 6 commits into from
Jul 18, 2024

Conversation

evilnick
Copy link
Contributor

I believe this fixes the action to work with the Vocab changes

Maybe someone helpful can review it

ru-fu
ru-fu previously approved these changes Jul 16, 2024
Copy link
Contributor

@ru-fu ru-fu left a comment

Choose a reason for hiding this comment

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

Not tested, but it looks like it makes sense. :)

@evilnick
Copy link
Contributor Author

I'm liking your reviews these days :)

@a-velasco
Copy link
Contributor

a-velasco commented Jul 17, 2024

When testing the action on this branch, it now correctly parses the .ini and correctly identifies the Canonical rules that were broken.

However, the Vale.Spelling style throws errors inside the Accept.txt file:

{"message": "[Vale.Spelling] Did you really mean 'Anbox'?", "location": {"path": "styles/config/vocabularies/Canonical/Accept.txt", "range": {"start": {"line": 1, "column": 1}}}, "severity": "ERROR"
{"message": "[Vale.Spelling] Did you really mean 'Kubeflow'?", "location": {"path": "styles/config/vocabularies/Canonical/Accept.txt", "range": {"start": {"line": 2, "column": 9}}}, "severity": "ERROR"}
{"message": "[Vale.Spelling] Did you really mean 'Charmhub'?", "location": {"path": "styles/config/vocabularies/Canonical/Accept.txt", "range": {"start": {"line": 3, "column": 1}}}, "severity": "ERROR"}
{"message": "[Vale.Spelling] Did you really mean 'Multipass'?", "location": {"path": "styles/config/vocabularies/Canonical/Accept.txt", "range": {"start": {"line": 17, "column": 1}}}, "severity": "ERROR"}
{"message": "[Vale.Spelling] Did you really mean 'Snapcraft'?", "location": {"path": "styles/config/vocabularies/Canonical/Accept.txt", "range": {"start": {"line": 21, "column": 1}}}, "severity": "ERROR"}
{"message": "[Vale.Spelling] Did you really mean 'snapd'?", "location": {"path": "styles/config/vocabularies/Canonical/Accept.txt", "range": {"start": {"line": 22, "column": 1}}}, "severity": "ERROR"}

So even if there are no real style or spelling issues, it seems like the action would fail by default.

I'm still trying to work out why this might be happening. (Is the Accept.txt not being identified properly? Is Vale even supposed to be running checks in the /styles directory?)

@a-velasco
Copy link
Contributor

a-velasco commented Jul 18, 2024

Update:
The action had the behavior described in my previous comment for three reasons:

  • accept.txt and reject.txt should be in lowercase letters, otherwise they won't get picked up by Vale. This is part of the reason why Vale was throwing spelling errors in those files.
    • Solved this by renaming the files.
  • Since the action copies the /style directory to a temporary folder in the repository when it's running, its contents will get included in Vale checks when configured to run from the repo's root directory. This is the other reason why the accept.txt was getting checked, as well as the .yaml rule files.
    • Mitigated this by specifying relevant file extensions in the .ini. These false positives can only be fully avoided (afaik) if the repository can run Vale checks on a specific directory instead of all files (this would be specified in the files parameter of the workflow)
  • Terms with two words in the accept.txt file like Charmed Kubeflow don't get considered as exceptions when the individual words show up on their own (e.g. just Kubeflow)
    • Fixed this by adding entries with the individual words.

Copy link
Contributor

@ru-fu ru-fu left a comment

Choose a reason for hiding this comment

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

Again, not tested, but both the changes and the explanation make a lot of sense. :)

@evilnick
Copy link
Contributor Author

They do. And we tested them. Well, I watched Andreia test them

🍰 all round, well done team

@evilnick evilnick merged commit 29c8dae into main Jul 18, 2024
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.

3 participants