Commit Graph

55 Commits (92798dbda998df0ee73e147f762b3acea93f27f4)
 

Author SHA1 Message Date
Adrien Vergé 92798dbda9 Distribution: Add new keywords 9 years ago
Adrien Vergé e3ebea6033 Distribution: Fix broken setup_requires
The `pyyaml` dependency is needed in `install_requires` but also in
`setup_requires`, because running `setup.py` requires importing
`yamllint`, which itself imports `yaml`.
9 years ago
Adrien Vergé 7983c66093 Doc: Clarify Python compatibility in README 9 years ago
Adrien Vergé fee72d484e Doc: Add a screenshot 9 years ago
Adrien Vergé 387d14f816 yamllint version 0.5.0 9 years ago
Adrien Vergé ba8a9d0ba1 Doc: Give an explicit link from configuration to rules 9 years ago
Adrien Vergé 26b5364be4 Doc: Add Read The Docs status badge in README 9 years ago
Adrien Vergé 47d6534e75 Doc: Write the configuration page 9 years ago
Adrien Vergé 237db5aeef Doc: Document how to use the yamllint Python module 9 years ago
Adrien Vergé 6e9de02eac Doc: Update index
Add a brief description and remove unused links.
9 years ago
Adrien Vergé 044c049462 Doc: Document rules 9 years ago
Adrien Vergé 48589176c7 Doc: Convert README.md to README.rst 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é 6a24781f96 Tests: indentation: Add explicit keys test cases 9 years ago
Adrien Vergé 33224a04e4 yamllint version 0.3.0 9 years ago
Adrien Vergé fd9d2a00ff Doc: Update README with examples 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é effb4db3b4 Tests: Rules: Remove unused `line` and `column` args
Now that every test case use the `problem=(x, y)` syntax.
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
Adrien Vergé a5b384ab21 Rules: Add the 'commas' rule 9 years ago
Adrien Vergé cfea0661ed Rules: Make max-spaces-* generic
The goal being to use them in the 'colons', 'hyphens', 'commas', etc.
rules.
9 years ago