Skip to content

Commit d72111a

Browse files
committed
Redesign yamllint config for Travis CI config
Signed-off-by: 林博仁(Buo-ren Lin) <Buo.Ren.Lin@gmail.com>
1 parent b1652b8 commit d72111a

File tree

1 file changed

+91
-4
lines changed

1 file changed

+91
-4
lines changed

.yamllint

Lines changed: 91 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,135 @@
1-
# Configuration File for yamllint(1)
1+
%YAML 1.2
22
---
3+
# Configuration File of yamllint for Travis CI configurations and similarly relaxed YAML documents
4+
# https://github.com/Lin-Buo-Ren/Configuration-Templates-for-Travis-CI
5+
#
6+
# This file is in YAML Ain’t Markup Language (YAML™)
7+
# http://yaml.org/
8+
#
9+
# This file is based on the `default` pre-defined configuration from yamllint with documentation copied from its documentation
10+
# https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration
11+
#
12+
# This file is based on The Unofficial yamllint Configuration Templates
13+
# https://github.com/Lin-Buo-Ren/yamllint-configuration-templates
314
rules:
15+
# Use this rule to control the number of spaces inside braces (`{` and `}`).
16+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.braces
417
braces:
518
min-spaces-inside: 0
619
max-spaces-inside: 0
720
min-spaces-inside-empty: -1
821
max-spaces-inside-empty: -1
22+
23+
# Use this rule to control the number of spaces inside brackets (`[` and `]`).
24+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.brackets
925
brackets:
1026
min-spaces-inside: 0
1127
max-spaces-inside: 0
1228
min-spaces-inside-empty: -1
1329
max-spaces-inside-empty: -1
30+
31+
# Use this rule to control the number of spaces before and after colons (`:`).
32+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.colons
1433
colons:
1534
max-spaces-before: 0
1635
max-spaces-after: 1
36+
37+
# Use this rule to control the number of spaces before and after commas (`,`).
38+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.commas
1739
commas:
1840
max-spaces-before: 0
1941
min-spaces-after: 1
2042
max-spaces-after: 1
43+
44+
# Use this rule to control the position and formatting of comments.
45+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.comments
2146
comments:
2247
level: warning
48+
# PATCH: Comments without separate space are disabled content
2349
require-starting-space: false
50+
# PATCH: We're good with 1
2451
min-spaces-from-content: 1
52+
53+
# Use this rule to force comments to be indented like content.
54+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.comments_indentation
55+
# PATCH: False positives, disabled
2556
comments-indentation: disable
57+
#level: warning
58+
59+
# Use this rule to require or forbid the use of document end marker (`...`).
60+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.document_end
2661
document-end: disable
27-
document-start: disable
62+
63+
# Use this rule to require or forbid the use of document start marker (`---`).
64+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.document_start
65+
document-start:
66+
# PATCH: Travis CI doesn't allow documents with document start markers
67+
# https://github.com/travis-ci/travis-ci/issues/9600
68+
level: error
69+
present: false
70+
71+
# Use this rule to set a maximal number of allowed consecutive blank lines.
72+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.empty_lines
2873
empty-lines:
2974
max: 2
3075
max-start: 0
3176
max-end: 0
77+
78+
# Use this rule to prevent nodes with empty content, that implicitly result in null values.
79+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.empty_values
80+
empty-values:
81+
forbid-in-block-mappings: false
82+
forbid-in-flow-mappings: false
83+
84+
# Use this rule to control the number of spaces after hyphens (`-`).
85+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.hyphens
3286
hyphens:
3387
max-spaces-after: 1
88+
89+
# Use this rule to control the indentation.
90+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.indentation
3491
indentation:
3592
spaces: consistent
3693
indent-sequences: consistent
3794
check-multi-line-strings: false
95+
96+
# Use this rule to prevent multiple entries with the same key in mappings.
97+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.key_duplicates
3898
key-duplicates: enable
99+
100+
# Use this rule to enforce alphabetical ordering of keys in mappings. The sorting order uses the Unicode code point number. As a result, the ordering is case-sensitive and not accent-friendly (see examples below).
101+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.key_ordering
102+
key-ordering: disable
103+
104+
# Use this rule to set a limit to lines length.
105+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.line_length
39106
line-length:
40-
max: 9999
107+
# PATCHED: Modern text editors handle long lines nicely
108+
max: 99999
41109
allow-non-breakable-words: true
42110
allow-non-breakable-inline-mappings: false
111+
112+
# Use this rule to require a new line character (`\n`) at the end of files.
113+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.new_line_at_end_of_file
43114
new-line-at-end-of-file: enable
115+
116+
# Use this rule to force the type of new line characters.
117+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.new_lines
44118
new-lines:
45119
type: unix
120+
121+
# Use this rule to prevent values with octal numbers. In YAML, numbers that start with `0` are interpreted as octal, but this is not always wanted. For instance `010` is the city code of Beijing, and should not be converted to `8`.
122+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.octal_values
123+
octal-values:
124+
forbid-implicit-octal: false
125+
forbid-explicit-octal: false
126+
127+
# Use this rule to forbid trailing spaces at the end of lines.
128+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.trailing_spaces
46129
trailing-spaces: enable
130+
131+
# Use this rule to forbid non-explictly typed truthy values other than `true` and `false`, for example `YES`, `False` and `off`.
132+
# https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.truthy
47133
truthy:
48-
level: warning
134+
level: warning
135+
...

0 commit comments

Comments
 (0)