From 6606eec32612c3c4b87d59559869e5f3dd1f678c Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 15 Sep 2022 09:41:26 -0300 Subject: [PATCH] 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. --- .goreleaser.yaml | 5 +++++ internal/static/config.go | 4 ++++ www/docs/customization/index.md | 12 ++++++++++++ 3 files changed, 21 insertions(+) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 7d8a84ae28c..6979133e3e3 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -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 + diff --git a/internal/static/config.go b/internal/static/config.go index 859b9121a75..7538744d117 100644 --- a/internal/static/config.go +++ b/internal/static/config.go @@ -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 ` diff --git a/www/docs/customization/index.md b/www/docs/customization/index.md index 5c9c9b22e05..e412d8ad964 100644 --- a/www/docs/customization/index.md +++ b/www/docs/customization/index.md @@ -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