Commit Graph

254 Commits (b8c85f0dfd85ecf63354caa4ab0c90458b963e43)

Author SHA1 Message Date
Adrien Vergé d41b64aa97 yamllint version 1.12.0 6 years ago
Guido Wischrop (mgm tp) aaa8777f1d Add quoted-strings rule
* taken from https://github.com/adrienverge/yamllint/pull/110 (submitted by @jurajseffer)
* small fixes for generic and multi-line strings
* fixes for comments from @adrienverge
6 years ago
Adrien Vergé 506e066410 yamllint version 1.11.1 7 years ago
Adrien Vergé 54f21c0514 parser: Fix crash with latest PyYAML
There is a backwards-incompatible change in PyYAML that induces a crash
if `check_token()` is not called before `peek_token()`. See commit
a02d17a in PyYAML or https://github.com/yaml/pyyaml/pull/150.

Closes #105.
7 years ago
Adam Johnson 36b4776778 Clarify documentation on the 'truthy' rule
I like the 'truthy' rule but its documentation and message have confused several of my colleagues. I've tried rewriting it to be clearer.
7 years ago
Nick Burke 1b379628d7 key-duplicates: Handle merge keys (<<)
Merge keys are described here: http://yaml.org/type/merge.html
They shouldn't be considered as duplicated keys.

Fixes https://github.com/adrienverge/yamllint/issues/88
7 years ago
Adrien Vergé 6a842229fd yamllint version 1.11.0 7 years ago
xieenlong 22e792a433 Feature: checking octal numbers 7 years ago
Adrien Vergé a92743c8ca yamllint version 1.10.0 7 years ago
Adrien Vergé c4475ece34 empty-values: Add `forbid-in-flow-mappings` conf
This allows preventing implicit `null` from empty values in flow
mappings.

For example:

    {a:}

    {a:, b: 2}

    {
      a: {
        b: ,
        c: {
          d: 4,
          e:
        }
      },
      f:
    }
7 years ago
Greg Dubicki 8537b0a164 Add rule: empty-values, to forbid implicit nulls
only in block mappings for now
7 years ago
Waylan Limberg e43768f203 Better color support check.
Not all systems have `isatty` attribute on `sys.stdout` so check for
existance of attribute before checking value. Also don't use color in
Windows unless environ indicates support. Apparently, Windows can indicate
support by either the presence of `ANSICON` environ variable or if the
`TERM` environ variable is set to `ANSI`. Fixes #79.

No additional tests added, as the relevant tests use fcntl, which is a
Unix only lib. In fact, the tests won't even run in Windows.
7 years ago
Adrien Vergé 2d931b5a81 yamllint version 1.9.0 7 years ago
Adrien Vergé 773bfc0f3c key-ordering: Add more test cases and documentation 7 years ago
Johannes F. Knauf 1543d0e435 New rule key-ordering
closes #67
7 years ago
Tim Wade ca540c113b Fix indentation rule for key following empty list
If a key-value pair follows an empty list, i.e.:

```yaml
a:
-
b: c
```

yamllint will complain:

```
warning  wrong indentation: expected 2 but found 0  (indentation)
```

This is because it is expecting the second key to be a continuation of
the block entry above:

```yaml
a:
-
  b: c
```

However, both are perfectly valid, though structurally different.
7 years ago
Adrien Vergé c8fc170ff0 yamllint version 1.8.2 7 years ago
Adrien Vergé f4edb85a04 fix(config): Be clearer about the `ignore` conf type 8 years ago
Adrien Vergé d99bb9fec3 yamllint version 1.8.1 8 years ago
Adrien Vergé f9709bc6e6 yamllint version 1.8.0 8 years ago
Adrien Vergé 5060917e40 style(cli): Space import sections 8 years ago
Adrien Vergé df26cc0438 feat(config): Add support to ignore paths on per-rule basis
Example of configuration to use this feature:

    # For all rules
    ignore: |
      *.dont-lint-me.yaml
      /bin/
      !/bin/*.lint-me-anyway.yaml

    rules:
      key-duplicates:
        ignore: |
          generated
          *.template.yaml
      trailing-spaces:
        ignore: |
          *.ignore-trailing-spaces.yaml
          /ascii-art/*

Closes #43.
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
Adrien Vergé 4ae829c062 yamllint version 1.7.0 8 years ago
John Vandenberg 38d14c7314 Add __main__
Allows execution using python -m yamllint
8 years ago
Adrien Vergé ff1c9ad221 Merge pull request #38 from jhriggs/feature/empty_braces_brackets
Add min-spaces-inside-empty, max-spaces-inside-empty to braces and brackets
8 years ago
Jim Riggs 4b2b57aa32 Rules: Add min-spaces-inside-empty and max-spaces-inside-empty
Add min-spaces-inside-empty and max-spaces-inside-empty to braces and
brackets to allow separate handling for empty and non-empty objects.
8 years ago
Adrien Vergé c037d3e586 yamllint version 1.6.1 8 years ago
Adrien Vergé 228c47ab77 fix(indentation): Fix seq indent detection with consistent spaces
In the case when the conf is as follows:

    indentation:
      spaces: consistent
      indent-sequences: true

and there is no indented block before the first block sequence, and this
block sequence is not indented, then the spaces number is computed as
zero (while it obviously shouldn't be).

This causes such a document to fail on 4th line, instead of 2nd:

    a:
    - b
    c:
      - d

This commit fixes that, and adds corresponding tests.

Fixes: #39
8 years ago
Russell Teague c332c8e3d4
Minor cosmetic typo 8 years ago
Adrien Vergé 42eda54014 yamllint version 1.6.0 8 years ago
Adrien Vergé e909692f88 docs(truthy): Fix typo 8 years ago
Adrien Vergé 21e81b6435 fix(rules): Use `true`/`false`, not `yes`/`no`
Although `yes` and `no` are recognized as booleans by the pyyaml parser,
the correct keywords are `true` and `false` (as highlighted by the newly
added `truthy` rule).

This commit replaces the use of `yes`/`no` by `true`/`false` and
advertise it in the docs, but also makes sure this change is
backward-compatible (so that `yes` and `no` still work).
8 years ago
Jonathan Sokolowski 03e0f5aa6b Add strict mode argument to CLI 8 years ago
Adrien Vergé 559ad5574b yamllint version 1.5.0 8 years ago
Adrien Vergé 6dae8f5b6e feat(truthy): Allow explicit types
With this change, we don't require quotes for truthy values that are
explicitly typed. For instance, the following examples are all
considered valid:

    string1: !!str True
    string2: !!str yes
    string3: !!str off
    encoded: !!binary |
               True
               OFF
               pad==  # this decodes as 'N\xbb\x9e8Qii'
    boolean1: !!bool true
    boolean2: !!bool "false"
    boolean3: !!bool FALSE
    boolean4: !!bool True
    boolean5: !!bool off
    boolean6: !!bool NO
8 years ago
Adrien Vergé 4b9ba9e201 docs(truthy): Enhance rule documentation 8 years ago
Peter Ericson 1f472bc144 Add rule: truthy, to forbid truthy values that are not quoted 8 years ago
Adrien Vergé c163135ee5 yamllint version 1.4.1 8 years ago
Adrien Vergé f656cf42d2 fix(line-length): Wrap token scanning securely
With `allow-non-breakable-inline-mappings` enabled, every long line is
passed through `loader.peek_token()`. Even lines that are not valid
YAML. For this reason, this code must be wrapped in a `try`/`except`
block.

Closes: #21
8 years ago
Adrien Vergé 60b72daad4 yamllint version 1.4.0 8 years ago
Adrien Vergé d3cd8ba332 line-length: Generalize ...-inline-mappings for corner cases
This commit refactors the `allow-non-breakable-inline-mappings` logic to
use YAML tokens and avoid crashes or erroneous reports on cases like:

```yaml
- {a: "http://localhost/very/very/very/very/very/very/long/url"
   }
```

```yaml
dict:
  {a: long long long long long long long, b: nospace}
```

```yaml
- long_line: http://localhost/very/very/long/url
```

```yaml
long_line: and+some+space+at+the+end       <-- extra spaces
```

For reference see:
https://github.com/adrienverge/yamllint/pull/17#issuecomment-247805799
8 years ago
Allan Lewis e56a7c788c line_length: Extract inline logic to new config option
This commit extracts the inline mappings logic defined in the previous
commit to a separate config option, as suggested by @adrienverge. I'll
squash this into the previous commit if the change is accepted. (I named
the option slightly differently to what was suggested as I think my
proposal reads better without consulting the docs: I'd be happy to
reconsider this.)
8 years ago
Allan Lewis d017631aff line_length: Allow mapping values with long unbreakable lines 8 years ago
Adrien Vergé 5b98cd2053 feat(comments): Allow comments with multiple hash chars
This change make the `comments` rule accept comments that start with
multiple pound signs, e.g.:

    ##############################
    ## This is some documentation

Closes: #12
9 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é 82ed191bc9 yamllint version 1.3.2 9 years ago
Adrien Vergé d174f9e3e3 yamllint version 1.3.1 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é 63dd8313f8 yamllint version 1.3.0 9 years ago
Adrien Vergé 7be5867675 linter: Remove dead code
There is *always* a `Line` element at the end of file, even if the
newline character (`\n`) is missing.
9 years ago
Adrien Vergé 6061a2c4cc Rules: common: Remove dead code 9 years ago
Adrien Vergé 0eb310e102 Allow disabling yamllint checks using comments
Implement problem report disabling with comments in YAML source, for
instance:

    # The following mapping contains the same key twice,
    # but I know what I'm doing:
    key: value 1
    key: value 2  # yamllint disable-line rule:key-duplicates

or:

    # yamllint disable rule:colons
    - Lorem       : ipsum
      dolor       : sit amet,
      consectetur : adipiscing elit
    # yamllint enable rule:colons

Closes: #8
9 years ago
Adrien Vergé 7a7d98c96a parser: Iterate over lines + tokens + comments
Instead of iterating over lines and tokens (and find comments between
tokens in the comment rules), add a new `Comment` type and set rules
with `type = 'comment'`.
9 years ago
Adrien Vergé 9f99f25db5 linter: Assert that `_run()` is called with a buffer 9 years ago
Adrien Vergé 8c839a20c2 Config: Detect user config using `os.path.expanduser()`
Instead of `$HOME`, since the former works when `$HOME` is not set.

[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=828033#10
9 years ago
Adrien Vergé 8e6e851c5b yamllint version 1.2.2 9 years ago
Michele Bariani 867970258e Patch allow-non-breakable-words on '-' 9 years ago
Jakub Wilk a5c97220e7 Fix typos 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é 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
Adrien Vergé be998593dd Distribution: Create script with `setup.py` 9 years ago
Adrien Vergé dbbecb5875 Refactor project layout to import yamllint alone
Currently importing yamllint recursively imports its submodules, which
finally requires having pyyaml installed. This is a problem when you
just want to import APP_VERSION from yamllint. For instance, setup.py
imports yamllint to know the version, but doesn't know yet that pyyaml
is to be installed, because it is stated in setup.py itself.

To solve this, yamllint/__init__.py will only contain constants. The
linting functions will be in yamllint/linter.py.
9 years ago
Adrien Vergé fc108e7cee Config: Refactor to use YamlLintConfig objects 9 years ago
Adrien Vergé 792bdf99b4 yamllint version 0.5.1 9 years ago
Adrien Vergé 387d14f816 yamllint version 0.5.0 9 years ago
Adrien Vergé 237db5aeef Doc: Document how to use the yamllint Python module 9 years ago
Adrien Vergé 044c049462 Doc: Document rules 9 years ago
Adrien Vergé 38234a1d3c Doc: Generate documentation with Sphinx
HTML documentation should be built with sphinx. This enables easy
integration with Read The Docs [1]. It can also be generated manually by
running:

    make -C docs html

A man page can be generated by running:

    make -C docs man

[1]: http://yamllint.readthedocs.org/
9 years ago
Adrien Vergé 1bfd18097a Rules: indentation: Add 'check-multi-line-strings' option
This options allows the user to control whether to lint indentation
inside multi-line scalars or not.

When enabled, such YAML source will be detected as a problem:

    - C code: void main() {
                  printf("foo");
              }

whereas this one would not:

    - C code: void main() {
              printf("foo");
              }
9 years ago
Adrien Vergé 08f99ccc19 Rules: new-lines: Force `type` to be in ('unix', 'dos') 9 years ago
Adrien Vergé 7b6f024448 yamllint version 0.4.0 9 years ago
Adrien Vergé 75b4758c95 cli: 'standard' format: Print filename only when error 9 years ago
Adrien Vergé 0e98df2643 cli: Allow passing directories as arguments
For instance:

    yamllint .
    yamllint file.yml ../my-other-dir
9 years ago
Adrien Vergé d4189083d0 Introduce the 'cli' module and call it from the script 9 years ago
Adrien Vergé 67d13d60ae Rules: indentation: Check multi-line scalars 9 years ago
Adrien Vergé 96465008ab Rules: Fix `spaces_before` when prev is multi-line scalar
YAML content like the following one produced an error, because the
multi-line ScalarToken ends at the beginning of the 4th line (the one
with the value):

    ? >
        multi-line
        key
    : value
9 years ago
Adrien Vergé 847f7e3fff Rules: comments: Fix bug when multi-line scalar
YAML content like the following one produced an error, because the
ScalarToken associated whose value is "this is plain text" ends at the
beginning of the 5th line (the one with the comment):

    ---
    string: >
      this is plain text

    # comment
9 years ago
Adrien Vergé 33224a04e4 yamllint version 0.3.0 9 years ago
Adrien Vergé 0b0251bacc Rules: indentation: Add the 'indent-sequences' option
Using either 'yes', 'no' or 'whatever', the user will be able to choose
whether to force block sequence items to be indented, to force them not
to be indented, or don't care, respectively.
9 years ago
Adrien Vergé ad5cec9c6c Config: Allow overriding only one option when extending 9 years ago
Adrien Vergé fb14cbdbd9 Config: Allow options to be in a pre-defined list 9 years ago
Adrien Vergé 8288a6f331 Rules: colons: Apply to '?' also 9 years ago
Adrien Vergé 9d8b0d4d2c Rules: commas: Don't allow a comma on a new line
Forbid such constructions:

    [ a, b, c
      , d, e ]
9 years ago
Adrien Vergé 39c878c819 Rules: indentation: Rewrite the algorithm (again)
Use a new, better thought algorithm that keeps an history stack with all
the parents indentations.
9 years ago
Adrien Vergé 222f7a27c1 Make syntax errors prevail over all yamllint problems 9 years ago
Adrien Vergé d617eb70ae Rules: Keep a persistent context for token rules
This will be needed to build a clean indentation checking algorithm.
9 years ago
Adrien Vergé f09aef4f89 Rules: comments-indentation: Allow two levels
Previously only comments that were indented like the following content
line were allowed, e.g.:

    prev: line:
      # commented line
      current: line

With this change, such new cases are also allowed:

      prev: line
      # commented line 1
    # commented line 2
    current: line
9 years ago
Adrien Vergé 01c12f2462 Syntax errors: Use the BaseLoader for safety 9 years ago
Adrien Vergé 918f15b68d Make syntax errors prevail over yamllint 'warnings'
When both a syntax error (unability to parse a document) and a cosmetic
yamllint problem are found at the same place, the yamllint problem had
the priority -- and the syntax error was not displayed.

This had the following problem: if a rule is at the 'warning' level, its
problems will not make the `yamllint` script return a failure return
code (`!= 0`), even when it should (because there was a syntax error,
precisely).

This commit changes this behavior by preferring yamllint problems only
when they have the 'error' level.
9 years ago
Adrien Vergé 97e2210ec9 Don't treat non-importable YAML as syntax error
`yaml.load()` exceptions are not necessarily syntax errors. For
instance, the following YAML source cannot be `load()`ed into a Python
object, but is valid nonetheless:

    ? - Detroit Tigers
      - Chicago cubs
    :
      - 2001-07-23

    ? [ New York Yankees,
        Atlanta Braves ]
    : [ 2001-07-02, 2001-08-12,
        2001-08-14 ]

This commit detects syntax errors from `yaml.parse()` exceptions rather
than `yaml.load_all()`.
9 years ago
Adrien Vergé 1934206cef Rules: comments-indentation: Fix typo 9 years ago
Adrien Vergé 1235eba94e yamllint version 0.2.0 9 years ago
Adrien Vergé 11a14d4df8 Distribution: Update program description 9 years ago
Adrien Vergé 233a70adb3 Rules: Add the 'comments-indentation' rule 9 years ago
Adrien Vergé e81b73c111 Rules: indentation: Rewrite algorithm 9 years ago
Adrien Vergé 3989a09d32 Rules: comments: Allow empty comments 9 years ago
Adrien Vergé 5cc900f2a8 Rules: document-start: Allow directives 9 years ago
Adrien Vergé 851b9ac42c Rules: Add the 'comments' rule 9 years ago
Adrien Vergé 5c4c208b98 Rules: Add the 'braces' rule 9 years ago
Adrien Vergé d08eb22081 Rules: Add the 'brackets' rule 9 years ago