Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Support multiple configs for different languages in the same context #63

Closed
jganser opened this issue Oct 25, 2021 · 6 comments
Closed
Labels
question Further information is requested

Comments

@jganser
Copy link

jganser commented Oct 25, 2021

Multiple Configs

The issue at our company CONTACT Software is that we want to use the vale-vscode extension to help our developers and other less technical staff in writing good documentation. Depending on the project this has to be done in different languages, sometime multiple in the same project.

Our documentation is written in rst files and only the path to the file provides information about the language the file is in. For internal reasons we currently have to use the valeCLI approach at our company.

The current approach allows for only one config to be referenced and therefore only one language to be used.

The solution we are looking for is a way to provide e.g. patterns for selecting different vale config files (vale.ini files).

file path language example INI pattern
doc/example_book/en/src/foo.rst English .../vale/vale_en.ini **/doc/*/en/**/*.rst
doc/example_book2/en/src/foo.rst English .../vale/vale_en.ini **/doc/*/en/**/*.rst
doc/example_book/de/src/foo.rst German .../vale/vale_de.ini **/doc/*/de/**/*.rst
doc/example_book2/de/src/foo.rst German .../vale/vale_de.ini **/doc/*/de/**/*.rst
doc/example_book2/de/src/bar/foo.rst German .../vale/vale_de.ini **/doc/*/de/**/*.rst

Additionally

Additionally we would like the extension to allow vale checks even on single opened files (not as part of a workspace or folder) as some developers will use vscode only for writing documentation and some other IDE for coding, this will make it easier for less technical staff to jump into writing the documentation as well.

@jganser
Copy link
Author

jganser commented Oct 25, 2021

I am currently working on the topic as well. Expect a pull request soon =)

@jdkato
Copy link
Member

jdkato commented Oct 25, 2021

The current approach allows for only one config to be referenced and therefore only one language to be used.

This isn't true. You can:

  1. specify multiple sections within a single .vale.ini based on pattern-matching against the filename -- see Question: Writing .vale.ini to work around Hugo translations (article.fr.md) vale#245; or

  2. simply create multiple configuration files and the closest one to the active file will be used.

@jganser
Copy link
Author

jganser commented Oct 25, 2021

Thanks for the fast reply 👍

Does this approach work with a global .vale.ini that lies somewhere on my system as well?

Are ** wildcards allowed in the specification of the paths?

@jganser
Copy link
Author

jganser commented Oct 25, 2021

The current approach allows for only one config to be referenced and therefore only one language to be used.

This isn't true. You can:

  1. specify multiple sections within a single .vale.ini based on pattern-matching against the filename -- see Question: Writing .vale.ini to work around Hugo translations (article.fr.md) vale#245; or
  2. simply create multiple configuration files and the closest one to the active file will be used.

The second approach wouldn't work as we want to have one repository holding style guidelines for all projects and therefor if possible no vale.ini files in the projects.

@jdkato
Copy link
Member

jdkato commented Oct 25, 2021

If you use option 1, it doesn't matter where the configuration file is located.

You don't need to use wildcards; you're writing a pattern to match against certain file paths, not find them.

@jganser
Copy link
Author

jganser commented Oct 25, 2021

Still created the pull request with how I tackled the issue. If you have the time, have a look for reference, at least. =)

@jdkato jdkato added the question Further information is requested label Oct 25, 2021
@jdkato jdkato closed this as completed Oct 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants