Quick PR to ignore the `/.eggs` folder, which appears to be generated every
time the `python setup.py test` command is run.
The content of the `./.eggs/README.txt` file:
> This directory contains eggs that were downloaded by setuptools to build,
> test, and run plug-ins.
>
> This directory caches those eggs to prevent repeated downloads.
>
> However, it is safe to delete this directory.
Fixes#325
The linter allows a directive to contain trailing whitespace characters like
\r, but does not trim them before iterating on the rules. As a result, the last
rule in the list contains the trailing whitespace characters and never matches
any existing rule.
I added the necessary trimming, as well as a test with 2 checks to go along
with it.
yamllint depends on pkg_resources.load_entry_point from setuptools to
make its command working, so this runtime dependency to setuptools is
necessary to be listed.
Add 'forbid' configuration parameters to the braces and brackets rules
to allow users to forbid the use of flow style collections, flow
mappings and flow sequences.
Move setuptools' packaging configuration from setup.py to setup.cfg to
simplify setup.py and make its packaging more dedeclarative.
Signed-off-by: Satoru SATOH <satoru.satoh@gmail.com>
Pound-signs followed by a lone CRLF should not
raise if require-starting-space is specified.
If require-starting-space is true, *and* either:
- new-lines: disbale, or
- newlines: type: dos
is specified, a line with `#\r` or `#\r\n` should
not raise a false positive.
This commit also uses a Set for O(1) membership testing
and uses the correct escape sequence for the nul byte.
If we find a CRLF when looking for Unix newlines, yamllint
should always raise, regardless of logic with
require-starting-space.
Closes: Issue #171.
Add ability to:
- require strings to be quoted if they match a pattern (PCRE regex)
- allow quoted strings if they match a pattern, while `require:
only-when-needed` is enforced.
Co-Authored-By: Leo Feyer (https://github.com/adrienverge/yamllint/pull/246)
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.
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.
Fixesadrienverge/yamllint#228
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.