google / google/yamlfmt

Exclude is still a little bit wonky

Open
#139 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.8k
Forks
75
PR merge metrics
No merged PRs in 30d

Description

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 in

```
/Users/esn89/Documents/Projects/helm-charts/application.git/develop/services/superapp/templates
```

which looks like this:

```yaml
apiVersion: v1
data:
PROJECT: {{ .Values.project }}
JOB_NAME: {{ .Values.jobName }}

kind: ConfigMap
metadata:
namespace: {{ .Values.namespace }}
```

I ran `~/.local/share/nvim/mason/bin/yamlfmt -conf ~/.config/nvim/.yamlfmt env-config.yaml ` and it formats my file to look like this:

```yaml
---
apiVersion: v1
data:
PROJECT: {? {.Values.project: ''} : ''}
JOB_NAME: {? {.Values.jobName: ''} : ''}
kind: ConfigMap
metadata:
namespace: {? {.Values.namespace: ''} : ''}
```

These is really strange, as I have set the `**template/*.yaml` path to be excluded.

My `~/.config/nvim/.yamlfmt` looks as follows:

```yaml
doublestar: true
exclude:
- "/Users/esn89/Documents/Projects/**/templates/*.yaml"
- "/Users/esn89/Documents/Projects/**/.gitlab-ci.yml"
formatter:
type: basic
indent: 2
include_document_start: true
```

Any ideas?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.