Adrien Vergé
1f1757ced4
yamllint version 1.2.1
9 years ago
Adrien Vergé
59d5bffbec
Tests: cli: Detect and handle the `-d ''` case
9 years ago
Adrien Vergé
0c36d0175c
cli: Print EnvironmentErrors on stderr
...
Errors such as "no such file or directory" should not be printed on
standard output.
9 years ago
Adrien Vergé
159e29ea6a
Rules: indentation: Remove non-existing case
...
A BlockMappingStartToken should always be followed by a KeyToken, on the
same line.
9 years ago
Adrien Vergé
f9198b7a9b
Rules: indentation: Fix B_SEQ instead of B_ENT
...
For example in this case, the scalar's parent is a B_ENT (only its
grandparent is a B_SEQ):
- >
multi
line
9 years ago
Adrien Vergé
76f47e91ca
Rules: indentation: Handle imbricated flows correctly
...
The following source -- although not loadable by pyyaml -- is valid
YAML:
{{key}}: value
This was processed badly by yamllint. The same for `[[value]]`,
`{{{{{moustaches}}}}}` or:
{[val,
{{key: val,
key2}}]}
This patch corrects it and add corresponding test cases.
Related-to: #3
9 years ago
Adrien Vergé
f98bed1085
Rules: indentation: Do not crash on unexpected token
...
Previously, when the indentation rule blocked on an unexpected token,
the program crashed with something like:
File "/usr/lib/python3/dist-packages/yamllint/rules/indentation.py",
line 434, in check
assert context['stack'][-1].type == KEY
AssertionError
Instead, we prefer report the error as a regular `LintProblem` and
continue processing.
Fixes : #3
9 years ago
Adrien Vergé
41733fc7a5
Use '.yaml' extension as default, not '.yml'
...
As someone said [1] on the internet:
Say ".yaml" not ".yml".
This is not MS-DOS, and YML is a Yahoo XML dialect.
Similarly, we use '.json', not '.jsn'.
[1]: https://github.com/ceph/s3-tests/commit/e17c56a
9 years ago
Adrien Vergé
dca3a54e63
yamllint version 1.2.0
9 years ago
Adrien Vergé
2dcfbd7e0d
Conf: relaxed: Remove unneeded lines
9 years ago
Adrien Vergé
73d7a608e8
Conf: relaxed: Re-enable hyphens (in warning)
9 years ago
Adrien Vergé
1c0f164fbf
Conf: relaxed: Set indentation's indent-sequences=consistent
9 years ago
Adrien Vergé
46e9108419
Rules: indentation: Add 'consistent' option for 'indent-sequences'
...
Using `indent-sequences: consistent` allows block sequences to be
indented or not to be, as long as it remains the same within the file.
9 years ago
Adrien Vergé
2f9e3cc71b
Conf: relaxed: Set indentation to warning level
9 years ago
Adrien Vergé
b13a03815a
Conf: default: Use `spaces: consistent` for indentation
9 years ago
Adrien Vergé
9a7eec34b1
Rules: indentation: Fix `spaces: consitent` with broken flows
9 years ago
Adrien Vergé
8fca8a7a33
Config: Allow 'enable' keyword for rules
...
In the same manner as 'disable', 'enable' allows setting a rule on
without worrying about its options.
9 years ago
Adrien Vergé
69ef9a7272
Conf: relaxed: Set max line-length back to 80
...
Because 80 has been the default for years. But keep it as a warning, not
an error.
9 years ago
Adrien Vergé
d8d1d92545
yamllint version 1.1.0
9 years ago
Adrien Vergé
7688567faa
cli: Add the `-d` option to provide inline conf
9 years ago
Adrien Vergé
4e188f8801
Conf: Add a new pre-defined conf 'relaxed'
...
It is more tolerant than 'default'.
9 years ago
Adrien Vergé
5693b1dddf
Rules: indentation: Add 'consistent' option for 'spaces'
...
Using `spaces: consistent` allows any number of spaces, as long as it
remains the same within the file.
9 years ago
Adrien Vergé
fa420499c7
Config: Allow types in multiple choices
...
For instance, allow rules with:
CONF = {'choice': (int, 'hardcoded-string'),
'string-or-bool': (str, bool)}
9 years ago
Adrien Vergé
adefe38a0d
yamllint version 1.0.4
9 years ago
Adrien Vergé
5956b20545
yamllint version 1.0.3
9 years ago
Adrien Vergé
73d9322813
linter: Test run on str, unicode, bytes and stream
...
Previously it was not tested, and broke on Python 2 `unicode` inputs.
9 years ago
Adrien Vergé
ca0ebe4583
yamllint version 1.0.2
9 years ago
Adrien Vergé
611a560082
yamllint version 1.0.1
9 years ago
Adrien Vergé
3ab3784a75
cli: Remove shebang
...
A shebang is present at the beginning of file, it dates from the time
when `yamllint/cli.py` was `bin/yamllint`, i.e. an executable launcher.
Since this is not the case anymore (see `entry_points` section in
`setup.py`), let's remove it.
9 years ago
Adrien Vergé
64caa95b6a
yamllint version 1.0.0
9 years ago
Adrien Vergé
316bee8c98
yamllint version 0.7.2
9 years ago
Adrien Vergé
647d84ff94
Rules: indentation: Handle tags
9 years ago
Adrien Vergé
4bc3d5a01c
Rules: indentation: Handle anchors
9 years ago
Adrien Vergé
48c7d65c54
parser: Provide nextnext for token rules
...
Because the indentation rule sometimes needs to look two tokens forward
(in case of anchors for instance).
9 years ago
Adrien Vergé
62fa4cbe39
Tests: indentation: Test the indent stack
...
The "indentation stack" is iteratively built by the `check()` function
of the indentation rule. It is important, since everything in the rule
relies on it.
This patch adds tests to make sure the stack is correctly built for some
known structures.
9 years ago
Adrien Vergé
8d38d349ac
Rules: indentation: Rewrite stack generation
...
"Indentation stack" generation was not done properly, hence did not work
in all cases. This commit does a cleaner rewriting.
9 years ago
Adrien Vergé
3f264806b9
yamllint version 0.7.1
9 years ago
Adrien Vergé
9a82b99d4b
Rules: indentation: Fix multi-line flows
...
To detect this as correct indentations:
top:
rules: [
{
foo: 1
},
{
foo: 2
bar: [
a, b, c
],
},
]
9 years ago
Adrien Vergé
0e04ee29e6
Doc: Update description
9 years ago
Adrien Vergé
ba9d86d645
yamllint version 0.7.0
9 years ago
Adrien Vergé
f6bab05e8a
Rules: Add the 'key-duplicates' rule
9 years ago
Adrien Vergé
68618be4cc
Rules: indentation: Handle sets
...
Sets are like mappings, that do not contain values. Example:
set:
? key one
? key two
? [non, scalar, key]
9 years ago
Adrien Vergé
dd163ed551
Rules: indentation: Fix flow sequences with multi-line scalars
...
Typically sequences like this:
["multi
line 1", "multi
line 2"]
9 years ago
Adrien Vergé
cae100071a
Rules: indentation: Add support for cleared sequence entries
...
The following construction is valid YAML, and its indentation should be
correctly handled:
- this is
-
a
-
sequence:
with cleared entries
9 years ago
Adrien Vergé
7cb7b4f669
Rules: commas: Add 'min-spaces-after'
...
Since such constructions are allowed and valid YAML:
- [one,two, three,four]
this commit adds a `min-spaces-after` option that defaults to 1.
9 years ago
Adrien Vergé
a7d39b5492
yamllint version 0.6.0
9 years ago
Adrien Vergé
4410bc3e23
Rules: indentation: Fix check-multi-line-strings
...
For strings that continue on next line at a lower indentation level:
Blaise Pascal: Je vous écris une longue lettre parce que
je n'ai pas le temps d'en écrire une courte.
9 years ago
Adrien Vergé
97c446907c
Rules: line-length: Add option `allow-non-breakable-words`
9 years ago
Adrien Vergé
376a6ed484
Doc: Enhance short description
9 years ago
Adrien Vergé
a1eb9d7d2f
yamllint version 0.5.2
9 years ago