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

Allow per directory configuration override for vale diagnostics #157

Closed
1 task done
ianhomer opened this issue Jul 15, 2024 · 1 comment
Closed
1 task done

Allow per directory configuration override for vale diagnostics #157

ianhomer opened this issue Jul 15, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@ianhomer
Copy link
Contributor

ianhomer commented Jul 15, 2024

Issues

  • I have checked existing issues and there are no existing ones with the same request.

Feature description

Vale configuration - https://vale.sh/docs/topics/config/ - has a feature where the vale process scans up from the current directory to find the first .vale.ini configuration file in the current directory and any parent directory. It uses this configuration in addition to the global configuration. This allows per directory configuration to be set for vale processing.

The current implementation of the vale builtin for none-ls doesn't have a cwd function set and so falls back to setting cwd for the spawn process to the root directory for the nvim process. Vale in the current builtin implementation looks in that root folder and scans up through parent folders, however this misses the opportunity to do per-directory vale configuration.

Help

Yes - I have created a PR which I think implements this feature, thank you for any comments and thoughts on this.

Implementation help

If we set the cwd for the spawned vale process to the directory of the file being processed then we naturally pick up on the vale configuration from the directories and parent directory of the current file.

I suspect this is simply a matter of defining a cwd function for the vale builtin, e.g.

        cwd = function(params)
            return vim.fn.fnamemodify(params.bufname, ":h")
        end,
@mochaaP
Copy link
Member

mochaaP commented Jul 15, 2024

fixed in #158

@mochaaP mochaaP closed this as completed Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants