LoginSignup
1
1

More than 5 years have passed since last update.

yamllintのconfig

Last updated at Posted at 2018-10-10

yamllint をインストールして使ったら、警告が出すぎるので設定変更。

~/.config/yamllint/config を作ってルールを設定しますが、extends 句で元にする設定を指定しないと、config で指定したルールだけになってしまいます。

最初、緩めるルールを一つ書いてテストしただけで、大量に出ていた警告がまったく出なくなっておかしいと思ったら、default のルールを参考にルールを書くか、extends でベースとするルールを指定する必要がありました。

作った設定は緩めの relaxed をベースにこんな感じで。

---
extends: relaxed

rules:
    document-start: 
        present: false
    brackets:
        min-spaces-inside: 0
        max-spaces-inside: 1
        min-spaces-inside-empty: 0
        max-spaces-inside-empty: 1 
    trailing-spaces: disable
    line-length: 
        max: 135
        allow-non-breakable-words: true
        allow-non-breakable-inline-mappings: true
    colons: 
        max-spaces-before: 0
        max-spaces-after: 1
    hyphens: 
        max-spaces-after: 3

参考
yamllint documentation
yamllintの設定の記事

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1