-
Notifications
You must be signed in to change notification settings - Fork 47
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
Exclude is still a little bit wonky #139
Comments
I think this is coming down to excludes being absolute paths again. When passing the path into the argument, then the included path is I still don't handle mixed absolute path/relative path excludes well. I note it in the docs. Likely what I should do is check whether either one is an absolute path, and if one is then convert the other. But I would need to test that thoroughly to make sure it works in all scenarios. Either way I can see how this sucks for the editor plugin use-case; usually the content is just passed to As a short-term workaround, you can use ignore metadata on this file, which I know is not ideal but still should work for this usecase. |
I see. So from what I've read the paths need to be specified as relative to where the yamlfmt binary is, right? https://github.com/google/yamlfmt/blob/main/docs/paths.md#include-and-exclude |
Not relative to where the Starting with |
So something like this, @braydonk ? doublestar: true
exclude:
- "**/templates/*.yaml"
- "/Users/esn89/Documents/Projects/**/.gitlab-ci.yml"
formatter:
type: basic
indent: 2
include_document_start: true |
Yeah, I think if your neovim is open in a folder that has a |
Great, thanks. |
Hey, just an idea. Even if exclude is a bit wonky, that's alright, as long as there is a way to have yamlfmt not mess with anything similar to: |
Unfortunately not, and any way I can think of to add one would be challenging. That syntax from the helm charts is Go templating. The yaml library that |
I have
yamlfmt
installed via nvim mason and it resides in~/.local/share/nvim/mason/bin
.I have a file named
env-config.yaml
located inwhich looks like this:
I ran
~/.local/share/nvim/mason/bin/yamlfmt -conf ~/.config/nvim/.yamlfmt env-config.yaml
and it formats my file to look like this:These is really strange, as I have set the
**template/*.yaml
path to be excluded.My
~/.config/nvim/.yamlfmt
looks as follows:Any ideas?
The text was updated successfully, but these errors were encountered: