{"id":2663,"date":"2022-07-06T12:30:31","date_gmt":"2022-07-06T03:30:31","guid":{"rendered":"https:\/\/blog.wsd.sh\/?p=2663"},"modified":"2022-07-06T13:32:12","modified_gmt":"2022-07-06T04:32:12","slug":"yamllint-%e3%81%a7-line-too-long-82-80-characters-line-length%e3%82%92%e6%8a%91%e6%ad%a2%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/blog.wsd.sh\/?p=2663","title":{"rendered":"<small>yamllint \u3067 line too long\u3068comment\u3068trailing spaces\u306eworning\u3092\u6291\u6b62\u3059\u308b\u65b9\u6cd5<\/small>"},"content":{"rendered":"<p>\uff11\uff0e\u76ee\u7684<br \/>\nyamllint \u3067\u4ee5\u4e0b\u306eworning\u306e\u307f\u3092\u6291\u6b62\u3059\u308b<br \/>\n\u30fbline too long (82 > 80 characters)  (line-length)<br \/>\n\u30fbcomment<br \/>\n\u30fbtrailing spaces<\/p>\n<p>\uff12\uff0e yamllint\u3000version<\/p>\n<pre>\r\n# yamllint -v\r\nyamllint 1.26.0\r\n<\/pre>\n<p>\uff13\uff0eDefault configuration<\/p>\n<pre>\r\nyaml-files:\r\n  - '*.yaml'\r\n  - '*.yml'\r\n  - '.yamllint'\r\n\r\nrules:\r\n  braces: enable\r\n  brackets: enable\r\n  colons: enable\r\n  commas: enable\r\n  comments:\r\n    level: warning\r\n  comments-indentation:\r\n    level: warning\r\n  document-end: disable\r\n  document-start:\r\n    level: warning\r\n  empty-lines: enable\r\n  empty-values: disable\r\n  hyphens: enable\r\n  indentation: enable\r\n  key-duplicates: enable\r\n  key-ordering: disable\r\n  line-length: enable\r\n  new-line-at-end-of-file: enable\r\n  new-lines: enable\r\n  octal-values: disable\r\n  quoted-strings: disable\r\n  trailing-spaces: enable\r\n  truthy:\r\n    level: warning\r\n<\/pre>\n<p>\uff14\uff0econfiguration file\u3000\u306e\u4f5c\u6210<\/p>\n<pre>\r\n# vi .yamllint\r\n<\/pre>\n<p>\uff15\uff0eline too long (82 > 80 characters)  (line-length)\u3068comment\u3092\u6291\u6b62<br \/>\n80\u884c\u304b\u3089120\u884c\u306b\u5909\u66f4<br \/>\n\u30fbbefore<\/p>\n<pre>\r\n  comments:\r\n    level: warning\r\n  line-length: enable\r\n  trailing-spaces: enable\r\n<\/pre>\n<p>\u30fbafter<\/p>\n<pre>\r\n  comments: enable\r\n  line-length:\r\n    max: 120\r\n    allow-non-breakable-words: true\r\n    allow-non-breakable-inline-mappings: false\r\n  trailing-spaces: disable\r\n<\/pre>\n<p>\uff15\uff0econfiguration file\u3000\u306e\u4f5c\u6210\u5f8c<\/p>\n<pre>\r\n# cat .yamllint\r\n---\r\n\r\nyaml-files:\r\n  - '*.yaml'\r\n  - '*.yml'\r\n  - '.yamllint'\r\n\r\nrules:\r\n  braces: enable\r\n  brackets: enable\r\n  colons: enable\r\n  commas: enable\r\n  comments: enable\r\n  comments-indentation:\r\n    level: warning\r\n  document-end: disable\r\n  document-start:\r\n    level: warning\r\n  empty-lines: enable\r\n  empty-values: disable\r\n  hyphens: enable\r\n  indentation: enable\r\n  key-duplicates: enable\r\n  key-ordering: disable\r\n  line-length:\r\n    max: 120\r\n    allow-non-breakable-words: true\r\n    allow-non-breakable-inline-mappings: false\r\n  new-line-at-end-of-file: enable\r\n  new-lines: enable\r\n  octal-values: disable\r\n  quoted-strings: disable\r\n  trailing-spaces: disable\r\n  truthy:\r\n    level: warning\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\uff11\uff0e\u76ee\u7684 yamllint \u3067\u4ee5\u4e0b\u306eworning\u306e\u307f\u3092\u6291\u6b62\u3059\u308b \u30fbline too long (82 > 80 characters) (line-length) \u30fbcomment \u30fbtrailing spaces \uff12&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts\/2663"}],"collection":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2663"}],"version-history":[{"count":21,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts\/2663\/revisions"}],"predecessor-version":[{"id":2665,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts\/2663\/revisions\/2665"}],"wp:attachment":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}