Adrien Vergé
d68022b846
config: Allow generic types inside lists
...
For example it's possible to define a conf like:
rule:
foo: [str],
bar: [int, bool, 'magic'],
2020-04-17 10:29:55 +02:00
Adrien Vergé
851d34b9fd
config: Allow rules to validate their configuration
2020-04-17 10:29:55 +02:00
Adrien Vergé
483a8d89a5
yamllint version 1.22.1
2020-04-15 07:55:57 +02:00
Adrien Vergé
fa87913566
quoted-strings: Fix only-when-needed on corner cases
...
Change implementation of `required: only-when-needed`, because
maintaining a list of `START_TOKENS` and just looking at the first
character of string values has proven to be partially broken.
Cf. discussion at
https://github.com/adrienverge/yamllint/pull/246#issuecomment-612354097 .
Fixes https://github.com/adrienverge/yamllint/issues/242 and
https://github.com/adrienverge/yamllint/pull/244 .
2020-04-15 07:48:59 +02:00
Adrien Vergé
961c496b4f
yamllint version 1.22.0
2020-04-13 14:32:08 +02:00
Adrien Vergé
ce7d3fcc7b
quoted-strings: Remove test_quotes_required()
...
It is exactly the same tests as `test_quote_type_any()`.
2020-04-13 14:28:02 +02:00
Adrien Vergé
0bffba1e13
quoted-strings: Remove test_single_quotes_required()
...
It is exactly the same tests as `test_quote_type_single()`.
2020-04-13 14:28:02 +02:00
Adrien Vergé
2d8639c3a1
quoted-strings: Fix broken rule for list items
...
The rule worked for values like:
flow-map: {a: foo, b: "bar"}
block-map:
a: foo
b: "bar"
But not for:
flow-seq: [foo, "bar"]
block-seq:
- foo
- "bar"
Also add tests to make sure there will be no regression.
Fixes : #208 .
2020-04-13 14:15:29 +02:00
Adrien Vergé
e284d74be1
quoted-strings: Rename tests names for clarity
...
And move only-when-needed tests at the end for readability.
2020-04-13 14:15:29 +02:00
Adrien Vergé
1a13837e84
docs: Sunset Python 2
...
Keep supporting Python 2.7 for one extra year after upstream dropped it:
https://www.python.org/doc/sunset-python-2/
2020-04-09 16:29:43 +02:00
Adrien Vergé
46ed0c02be
truthy: Add missing test removed from PR
...
See https://github.com/adrienverge/yamllint/pull/247#discussion_r405421376 .
2020-04-08 12:31:12 +02:00
ilyam8
6ce11dedb4
truthy: add check-keys
option
2020-04-08 12:26:21 +02:00
Adrien Vergé
542ae758f5
yamllint version 1.21.0
2020-03-24 07:53:14 +01:00
Rui Pinge
3a6a09b7b6
Add support for redundant quotes in quoted-strings rule
...
Co-Authored-By: Adrien Vergé
2020-03-24 07:44:07 +01:00
Rui Pinge
15aea73fbe
Fix quoted-strings rules not working for string values matching scalars
2020-03-14 14:22:29 +01:00
Martin Packman
91763f5476
Fix new-lines rule on Python 3
...
Use io.open() when reading files in cli which has the same behaviour
in Python 2 and Python 3, and supply the newline='' parameter which
handles but does not translate line endings.
Add dos.yml test file with windows newlines.
Also add to file finding test expected output.
Add test for new-lines rule through the cli.
Validates files are read with the correct universal newlines setting.
Fixes adrienverge/yamllint#228
2020-02-13 12:02:45 +01:00
Martin Packman
5b049e4229
Add RunContext helper for cli tests
...
Single context manager that includes exit code and output streams.
Use new RunContext throughout test_cli.
Largely non-functional change, saving some repetition of setup.
Also improve some failures by bundling multiple assertions into one.
2020-02-13 12:02:45 +01:00
Adrien Vergé
044c7f0248
cli: Test unicode chars in paths too
2020-01-17 16:01:05 +01:00
Adrien Vergé
734d5d5f73
CI: Run tests on Python 3.8
...
Python 3.8 was released in October 2019.
2020-01-03 09:33:35 +01:00
dhutty
fd86455076
CI: Disable building on Python 3.4
...
As can be seen in https://travis-ci.org/adrienverge/yamllint/builds/631325436?utm_source=github_status&utm_medium=notification
The dependency, pathspec, requires Python '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*' but the running Python is 3.4.8
This commit stops Travis building yamllint against 3.4 so that CI can pass again.
2020-01-03 09:29:33 +01:00
Adrien Vergé
13a0f11e7c
yamllint version 1.20.0
2019-12-26 16:06:29 +01:00
Sylvestre Ledru
43b95e99d1
Use 'syntax' as rule name upon syntax errors
2019-12-17 19:29:49 +01:00
ffapitalle
8fa9eb3ced
Add --no-warnings option to suppress warning messages
...
Use `--no-warnings` option to hide warning messages. It only shows
problems marked as errors.
2019-12-12 09:12:53 +01:00
Adrien Vergé
da3788e95a
yamllint version 1.19.0
2019-11-19 11:28:21 +01:00
Joel Baranick
fb400dc64b
Allow disabling all checks for a file
...
Allow disabling of a file, even if it is invalid YAML (syntax error) by
including `# yamllint disable-file` in the first line.
2019-11-19 11:26:31 +01:00
Adrien Vergé
92324ae730
yamllint version 1.18.0
2019-10-15 09:49:20 +02:00
Imran Iqbal
7359785ea0
fix(default.yaml): disable empty-values
& octal-values
by default
...
* Close #204
2019-10-15 09:41:32 +02:00
Hossein Zolfi
579a975b70
docs: Fix pre-commit config file
...
* pre-commit show warning for unsupported key (sha)
* Demonstrate how to use custom yamllint
2019-10-01 11:36:07 +02:00
Imran Iqbal
f3d9196aa0
docs(configuration): improve yaml-files
code example
...
* A straight copy/paste of the existing example into the `.yamllint` file results in a `yamllint` error!
2019-09-10 19:47:25 +02:00
Ibrahim AshShohail
881d301883
feat: Support reading config from .yamllint.yml and .yamllint.yaml
...
Signed-off-by: Ibrahim AshShohail <me@ibrasho.com>
2019-08-27 09:49:09 +02:00
Adrien Vergé
b62b424dd4
feat: Lint .yamllint by default
2019-08-26 10:01:40 +02:00
Adrien Vergé
ce0336e430
yamllint version 1.17.0
2019-08-12 16:54:51 +02:00
grzesuav
063c854658
feat: Make YAML file extensions configurable
2019-08-12 16:53:30 +02:00
xatier
673bdbd324
fix(truthy): Fix extra whitespace
2019-08-11 14:50:11 +02:00
Remi Pointel
cb5fe2c050
add OpenBSD installation instructions.
2019-07-09 10:04:48 +02:00
Adrien Vergé
930c8eea94
docs: Simplify installation instruction in the README
2019-07-07 18:13:43 +02:00
Adrien Vergé
f6a24552d9
yamllint version 1.16.0
2019-06-07 10:04:55 +02:00
Adrien Vergé
0ba193331b
truthy: Validate options passed to 'allowed-values'
...
Make sure values passed in allowed values are correct ones. This is
possible thanks to previous commit, and should prevent users from
writing incorrect configurations.
2019-06-07 09:59:26 +02:00
Adrien Vergé
f65553c4f7
config: Validate config options with list of enums
...
Allow rules to declare a list of valid values for an option.
For example, a rule like:
CONF = {'allowed-values': list}
... allowed any value to be passed in the list (including bad ones).
It is now possible to declare:
CONF = {'allowed-values': ['value1', 'value2', 'value3']}
... so that the list passed to the options must contain only values in
`['value1', 'value2', 'value3']`.
2019-06-07 09:59:26 +02:00
Adrien Vergé
0fef4c14e7
truthy: Try to make docs on allowed-values more explicit
...
Edit documentation for the `truthy` rule, in order to:
- add quotes to examples (`'yes'` instead of `yes`) to avoid
misconfigurations,
- group truthy values in the `allowed-values` option paragraph, for
easier reading.
2019-06-07 09:59:10 +02:00
Ondrej Vaško
4ef7e05f3a
truthy: Add allowed-values configuration option
...
Allows using key `allowed-values` for `truthy` section in configuration file (#150 ).
This allows to use configuration `truthy: allowed-values: ["yes", "no",
"..."]`, to set custom allowed truthy values.
This is especially useful for people using ansible, where values like
`yes` or `no` are valid and officially supported, but yamllint reports
them as illegal.
Implemented by difference of set of TRUTHY constants and configured
allowed values.
Signed-off-by: Ondrej Vasko <ondrej.vaskoo@gmail.com>
2019-06-06 09:59:00 +02:00
xatier
43c50379e0
Sort import orders
2019-05-27 11:10:30 +02:00
Adrien Vergé
fec2c2fba7
fix(parser): Correctly handle DOS new lines in 'line' rules
...
Do not consider the trailing `\r` of a line a part of it.
2019-04-09 16:48:00 +02:00
Mateusz Piotrowski
2a66ec2e5e
Add FreeBSD installation instructions
2019-03-21 18:40:28 +01:00
Adrien Vergé
37700ab3e6
yamllint version 1.15.0
2019-02-11 14:18:11 +01:00
Adrien Vergé
f66661e36d
docs(cli): Add a paragraph about standard input
...
See commit 05dfcbc
"cli: Add command line option - to read from standard
input", cc @miguelbarao.
2019-02-11 14:16:33 +01:00
Adrien Vergé
d6b89e94e4
chore(docs): Fix conf.py styling
2019-02-11 14:09:20 +01:00
Miguel Barao
05dfcbc109
cli: Add command line option - to read from standard input
...
If YAML files are given as arguments, parses these files.
If yamllint is run with - option, stdin.
If no arguments are given, just fail.
2019-02-11 14:04:48 +01:00
Adrien Vergé
16b939958d
yamllint version 1.14.0
2019-01-14 09:47:07 +01:00
Adrien Vergé
b4740dc1fb
comments: Fix ignore-shebangs option on corner cases
2019-01-14 09:40:31 +01:00