Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: yaml-lang-server modelines in init config (#3376)
- docs on how to specify the schema to the lang server
- add it automatically along with vim modelines to the init config
- added it to our config as well

this should prevent some "out of date" schema issues, as well as mixing
tabs with spaces and whatnot when an editorconfig plugin is not
installed.
  • Loading branch information
caarlos0 committed Sep 15, 2022
1 parent 89978a2 commit 6606eec
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .goreleaser.yaml
Expand Up @@ -318,3 +318,8 @@ announce:
discord:
enabled: true
message_template: 'GoReleaser {{ .Tag }} is out! Check it out: https://github.com/goreleaser/goreleaser/releases/tag/{{ .Tag }}'


# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=jcroql

4 changes: 4 additions & 0 deletions internal/static/config.go
Expand Up @@ -36,4 +36,8 @@ changelog:
exclude:
- '^docs:'
- '^test:'
# modelines, feel free to remove those if you don't want/use them:
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
`
12 changes: 12 additions & 0 deletions www/docs/customization/index.md
Expand Up @@ -15,11 +15,23 @@ GoReleaser also has a [jsonschema][] file which you can use to have better edito
https://goreleaser.com/static/schema.json
```

You can also specify it in your `.goreleaser.yml` config file by adding a
comment like the following:
```yaml
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
```

=== "Pro"
```sh
https://goreleaser.com/static/schema-pro.json
```

You can also specify it in your `.goreleaser.yml` config file by adding a
comment like the following:
```yaml
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
```

You can also generate it for your specific version using the [`goreleaser jsonschema`][schema] command.

[jsonschema]: http://json-schema.org/draft/2020-12/json-schema-validation.html
Expand Down

0 comments on commit 6606eec

Please sign in to comment.