You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Before, it was required to specify all the options when customizing a
rule. For instance, one could use `empty-lines: enable` or `empty-lines:
{max: 1, max-start: 2, max-end: 2}`, but not just `empty-lines: {max:
1}` (it would fail with *invalid config: missing option "max-start" for
rule "empty-lines"*).
This was a minor problem for users, but it prevented the addition of new
options to existing rules, see [1] for an example. If a new option was
added, updating yamllint for all users that customize the rule would
produce a crash (*invalid config: missing option ...*).
To avoid that, let's embed default values inside the rules themselves,
instead of keeping them in `conf/default.yaml`.
This refactor should not have any impact on existing projects. I've
manually checked that it did not change the output of tests, on
different projects:
- ansible/ansible: `test/runner/ansible-test sanity --python 3.7 --test yamllint`
- ansible/molecule: `yamllint -s test/ molecule/`
- Neo23x0/sigma: `make test-yaml`
- markstory/lint-review: `yamllint .`
[1]: https://github.com/adrienverge/yamllint/pull/151
|
7 years ago | |
|---|---|---|
| .. | ||
| rules | 7 years ago | |
| yaml-1.2-spec-examples | 10 years ago | |
| __init__.py | 10 years ago | |
| common.py | 7 years ago | |
| test_cli.py | 7 years ago | |
| test_config.py | 7 years ago | |
| test_linter.py | 7 years ago | |
| test_module.py | 7 years ago | |
| test_parser.py | 7 years ago | |
| test_spec_examples.py | 7 years ago | |
| test_syntax_errors.py | 10 years ago | |
| test_yamllint_directives.py | 10 years ago | |