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

Command No Longer Finding Configured .vale.ini File #955

Open
1 task done
saltorre opened this issue Jan 24, 2025 · 7 comments
Open
1 task done

Command No Longer Finding Configured .vale.ini File #955

saltorre opened this issue Jan 24, 2025 · 7 comments

Comments

@saltorre
Copy link

Check for existing issues

  • Completed

Environment

Windows.
Installed via Docker.
Vale Version: v3.9.3 to v.3.9.4

Describe the bug / provide steps to reproduce it

I have been storing my .vale.ini file in a directory called .vale/. My CI/CD picked up the latest version (v3.9.4) tonight and failed because it appears as if it can't find my .vale.ini file. It is flagging code for spelling errors. To confirm the errors, I pulled v3.9.4 locally. I then reverted back to v3.9.3 and I had no errors found. I did not see in the Release Notes for v.3.9.4 or in the Docs/vale-ini what breaking API changes may have occurred.

Here is the command I use:

- name: Run Vale Linter
        run: |
          docker run --rm -i \
          -v ${{ github.workspace }}:/repo \
          -w /repo \
          jdkato/vale --config=.vale/.vale.ini .

Here is my .vale.ini file:

# Configuration for Vale, a syntax-aware linter for prose.

# Location of the Vale styles directory:
StylesPath = styles

# Minimum alert level to display (suggestion, warning, or error):
MinAlertLevel = suggestion

# List of third party styles to use:
Packages = proselint

# Custom vocabulary directory located in `config/vocabularies` for Spelling
Vocab = spoores

# Ignore repetition in msp430fr5964.h to remove false positives.
[*SpooresLeakValve/test/unit-tests/mocks/include/msp430fr5964.h]
Vale.Repetition = NO

# This section applies to all Markdown files.
[*.{md}]
BasedOnStyles = Vale, proselint, custom

# This section applies to all C,C++, and Python files.
[*.{h,c,cpp,.py}]
BasedOnStyles = Vale, proselint, custom

# Disabling Typography rule for C and H files to prevent false positives 
# on hexadecimal literals (e.g., 0x45), which are mistakenly flagged as 
# multiplication expressions by Proselint.
proselint.Typography = NO

# Disabling DateSpacing rule for C and H files to prevent false positives
# on variables that appear to contain times like P2PMgr appears to have 2 PM.
proselint.DateSpacing = NO

# Ignore Annotations (Tasks) because there is a custom rule for them.
proselint.Annotations = No

# Disable Spelling for C and H files to prevent false positives on
# variable names and function names. Spelling handled by custom Spelling.yml.
Vale.Spelling = NO

# Ignore all files in the doxygen-awesome-css directory.
[*doxygen-awesome-css/*]
BasedOnStyles =

# Ignore all files in the proselint directory.
[*proselint/*]
BasedOnStyles =
@saltorre
Copy link
Author

I also tried --config='.vale/.vale.ini' after seeing it displayed on vale --debug but that didn't work.

@jdkato
Copy link
Member

jdkato commented Jan 24, 2025

I don't think the issue is finding the config file; I'd guess it's related to 992fddb.

Can you share the errors you're seeing and the relevant vocab entries?

@PigeonF
Copy link

PigeonF commented Jan 24, 2025

I ran into this as well. I think the issue is that the

# Ignore all files in the doxygen-awesome-css directory.
[*doxygen-awesome-css/*]
BasedOnStyles =

# Ignore all files in the proselint directory.
[*proselint/*]
BasedOnStyles =

part of the configuration is no longer applied, so we now get spelling issues that were suppressed before.

@PigeonF
Copy link

PigeonF commented Jan 24, 2025

Reproducer:

$ cat .vale.ini
[*.md]
BasedOnStyles = Vale

[exclude.md]
BasedOnStyles =
$ cat a.md
Joblint
$ cat exclude.md
Joblint
$ vale --version
vale version 3.9.1
$ vale .
 a.md
 1:1  error  Did you really mean 'Joblint'?  Vale.Spelling 

✖ 1 error, 0 warnings and 0 suggestions in 2 files.
$ ~/.local/bin/vale --version
vale version 3.9.4
$ ~/.local/bin/vale .        

 exclude.md
 1:1  error  Did you really mean 'Joblint'?  Vale.Spelling 


 a.md
 1:1  error  Did you really mean 'Joblint'?  Vale.Spelling 

✖ 2 errors, 0 warnings and 0 suggestions in 2 files.

yorickpeterse added a commit to inko-lang/inko that referenced this issue Jan 24, 2025
This should allow us to work around
errata-ai/vale#955 and also produce more
consistent results over time.
@jdkato
Copy link
Member

jdkato commented Jan 25, 2025

@PigeonF: Thanks for the repro steps. It will be fixed in the next release.

@saltorre
Copy link
Author

@PigeonF, well in addition to it finding problems in the doxygen submodule, it also flagged a lot of my variables and objects in code which should have been handled by:

# This section applies to all C,C++, and Python files.
[*.{h,c,cpp,.py}]
BasedOnStyles = Vale, proselint, custom

I don't think it is using my vale.ini file at all.

@jdkato, let me know if you still need to see error messages (I had a ton). It sounds to me like you got enough info from @PigeonF.

@jdkato
Copy link
Member

jdkato commented Jan 26, 2025

@saltorre, I think you may be describing a different issue. It would help to see the output as well as your vocabulary.

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

No branches or pull requests

3 participants