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.
6 years ago
Hugo
c281d48507
Drop support for EOL Python 2.6
6 years ago
sedrubal
5062b91cac
cli: Add -f colored to force colors
...
`-f standard` shows non-colored output,
`-f colored` shows colored output,
`-f auto` is the new default, it chooses `standard` or `colored`
depending on terminal capabilities.
6 years ago
Adrien Vergé
f713dc8be2
style: Fix E100 and E202 errors reported by pycodestyle
7 years ago
Adrien Vergé
ed5d319df8
tests: Use en_US.UTF-8 locale when C.UTF-8 not available
...
Some operating systems don't have the `C.UTF-8` locale installed yet
(for instance, CentOS 7). In such a case, fallback to `en_US.UTF-8` so
that tests can be run.
This follows commit 92ff315
.
7 years ago
Adrien Vergé
d422274563
style: Fix E722 errors reported by pycodestyle
...
Since a few days ago pycodestyle (formerly called pep8) has a new check:
E722 warning for bare except clauses.
Let's fix our code.
7 years ago
Adrien Vergé
1a961bd4b0
chore(tests): Also run tests on Python 2.6
8 years ago
Adrien Vergé
342d7b49dd
tests(cli): Create a temp test workspace only once
...
Do not re-create it for every test in the class.
8 years ago
Adrien Vergé
7d638d47b9
tests(cli): Refactor temp test workspace recreation
...
Make it simpler and re-usable.
8 years ago
sedrubal
30dfa78923
Use argparse mutually_exclusive_group for --config-file and --config-data
...
This does the same as your solution 😉
8 years ago
Jonathan Sokolowski
03e0f5aa6b
Add strict mode argument to CLI
8 years ago
Adrien Vergé
a2c68fdf9b
feat(cli): Colour output only on TTY
...
When piping yamllint output to a file, "coloured" characters aren't
interpreted and pollute text formatting with glyphs like:
�[4m./global.yaml�[0m
�[2m1439:52�[0m �[31merror�[0m no new line character...
With this commit, stdout is checked: if it's a TTY then output is
coloured, otherwise output is simple text.
Closes : #14
9 years ago
Adrien Vergé
92ff315fb4
Tests: Set proper LC_ALL when decoding UTF-8 is needed
...
Make sure the default localization conditions on the "test system"
support UTF-8 encoding.
9 years ago
Adrien Vergé
c8ba8f7e99
linter: Fix UnicodeError when parsing comments
...
And add tests when reading non-ASCII strings and comments (both from
Python strings and from files).
Fixes : #10
9 years ago
Adrien Vergé
eabd349902
Config: Allow a user-global configuration file
...
Instead of just looking for `.yamllint` in the current working
directory, also look for `~/.config/yamllint/config` (using
`$XDG_CONFIG_HOME` or `$HOME`, see [1] and [2] for information).
[1]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.6.html
[2]: https://wiki.archlinux.org/index.php/XDG_Base_Directory_support
Closes : #6
9 years ago
Adrien Vergé
59d5bffbec
Tests: cli: Detect and handle the `-d ''` case
9 years ago
Adrien Vergé
53da21934d
Tests: Add many `cli.run` test cases
9 years ago
Adrien Vergé
88ebcbbb93
Tests: Test cli.find_files_recursively
9 years ago