Closed andrewvaughan closed 2 months ago
Of note, when I removed Vale
from BasedOnStyles
I no longer get errors... although I also lose all of the Vale style guide value. My guess is that the Vale style guide is (I assume, inappropriately) taking precedence over the local vocab.
Okay, this is weird. I'll leave this open if I can help with any debugging, but I did the following and it fixed the issue:
Vale
from BasedOnStyles
vale
Vale
back into BasedOnStyles
Vale version for all commands:
$ vale --version
vale version 3.7.1
Now it works as-expected. This was a project I was actively updating from Vale v2 to Vale v3, if that's helpful. Feel free to close this, if not of interest, or let me know if I can answer any further questions. Thanks.
Edit: Ignore all of this - this was user error. I accidentally added Vale
to Packages
not BasedOnStyles
. When I add it back to BasedOnStyles
, the bug reappears.
Looks like this is the offending line:
Loading the vocabularies in the loadDefaultRules()
seems like a mistake, if the intent is to have local vocabs override styles. They're loaded in the wrong order, here:
My presumption is that mgr.loadVocabRules()
should come after mgr.loadStyles()
. I'll submit a PR, but I'm not a go dev, so please review thoroughly.
What is in your Project
vocab?
What is in your
Project
vocab?
Empty file for this project. It's a template repository. Here's the accept.txt
:
##
# Vale special words formatting dictionary. This isn't intended for spell-checking, but for formatting.
#
# This file defines acceptable words and phrases for this specific project. Add common operational phrases to the
# parallel `Ops` vocabulary folder, reserving this file for project-specific phrases.
#
# @link https://vale.sh/docs/topics/vocab/
#
# TEMPLATE TODO - Add the proper spelling of the project name, and any other known phrases with specific-formatting, to
# start this dictionary.
#
I can't reproduce this issue.
Vale doesn't have any default vocabulary, so the suggestion to use "release," for example, is coming from an external source.
What is the output of vale ls-config
?
Apologies for dropping off, I got ill. Here is my ls-config
:
{
"BlockIgnores": {},
"Checks": [
"Google.Acronyms",
"Vale.Spelling"
],
"Formats": {},
"Asciidoctor": {},
"FormatToLang": {},
"GBaseStyles": [
"Vale",
"Google"
],
"GChecks": {
"Google.Acronyms": false,
"Vale.Spelling": false
},
"IgnoredClasses": null,
"IgnoredScopes": null,
"MinAlertLevel": 0,
"Vocab": [
"Ops",
"Project"
],
"RuleToLevel": {},
"SBaseStyles": {},
"SChecks": {},
"SkippedScopes": null,
"Stylesheets": {},
"TokenIgnores": {},
"WordTemplate": "",
"RootINI": "/Users/andrew/Repositories/Personal/template-core/.vale.ini",
"Paths": [
"/Users/andrew/Library/Application Support/vale/styles",
"/Users/andrew/Repositories/Personal/template-core/.config/linters/vale/styles"
],
"ConfigFiles": [
"/Users/andrew/Repositories/Personal/template-core/.vale.ini"
],
"NLPEndpoint": ""
}
@jdkato here is the exact branch/environment where this issue is occurring: https://github.com/andrewvaughan/template-core/tree/ops/0077/megalinter-8.0
You can run make test
if you wish to run it in a Docker container via Megalinter, or it should show as above with vale README.md
in the project root.
Edit: I understand what you're saying about Vale not having a vocab. I'm not sure what to add, as the only way I can rectify the issues is by removing Vale
from BasedOnStyles
which led me to believe it had to do with that style being loaded.
I want to confirm - is this file not being used by Vale? It has all of the words being flagged in it:
https://github.com/errata-ai/vale/blob/v3/internal/spell/data/en_US-web.dic
Closing this issue, there was trailing TODO
blocks appended in my dictionary I somehow missed multiple times:
##
# TODO - Remove this group when this Issue resolves and URLs are no longer linted:
# https://github.com/errata-ai/vale/issues/711
#
branch
discussions
docker
editorconfig
fork
github
issue
issues
license
megalinter
milestones
mit
release
releases
sdlc
vale
Thanks for the engagement.
Check for existing issues
Environment
macOS
Describe the bug / provide steps to reproduce it
.vale.ini
:.config/linters/vale/styles/config/vocabularies/Ops/accept.txt
:It seems as if my vocabs have a lower priority than something buried in the Vale core, or is otherwise broken. I've confirmed that the vocabs are loading (by dictating how to format
FooBar
and seeing that thevale
command properly complains about that), but it also complains about a lot of things that should be valid with the config, above:No matter what I put in my vocabs, I can't override what Vale thinks
vale
orrelease
or any of my other specified terms should be. This occurs in my MegaLinter configuration, as well.