Skip to content
Snippets Groups Projects
Unverified Commit 76acb16c authored by Florian Forster's avatar Florian Forster
Browse files

fix(yamlfmt): Use the package's config file.

parent 5f0b08bd
No related branches found
No related tags found
No related merge requests found
Pipeline #23896906 passed
Loading
Loading
@@ -11,26 +11,13 @@ yamlfmt:
name: registry.gitlab.com/gitlab-com/gl-infra/common-ci-tasks-images/yamlfmt:${GL_ASDF_YAMLFMT_VERSION}
entrypoint: [""]
script:
# yamlfmt will fail if this file doesn't exist.
- touch .yamlfmtignore
- |
# Create default config if .yamlfmt.yaml doesn't exist.
if [ ! -e .yamlfmt.yaml ]; then
cat >.yamlfmt.yaml <<EOF
formatter:
type: basic
retain_line_breaks_single: true
scan_folded_as_literal: true
drop_merge_tag: true
pad_line_comments: 2
eof_newline: true
EOF
if [ -e .yamlfmtignore ]; then
echo "gitignore_path: .yamlfmtignore" >>.yamlfmt.yaml
echo "gitignore_excludes: true" >>.yamlfmt.yaml
fi
fi
echo "# .yamlfmt.yaml"
cat .yamlfmt.yaml
- yamlfmt -conf .yamlfmt.yaml .
# Dump yamlfmt config
echo "# /etc/yamlfmt.yaml"
cat /etc/yamlfmt.yaml
- yamlfmt -conf /etc/yamlfmt.yaml .
- git diff | tee yamlfmt.patch
- |
if [ -s yamlfmt.patch ]; then
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment