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  
				
					
						
							
							
								 
						
							
							
								f4cebdc054 
								
							
								 
							
						 
						
							
							
								
								Tests: Run with LC_ALL=C for uniform tests  
							
							... 
							
							
							
							Use default (C) locale in all tests to make sure the localization
conditions are the same wherever tests are run. 
							
						 
						
							9 years ago  
				
					
						
							
							
								 
						
							
							
								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  
				
					
						
							
							
								 
						
							
							
								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  
				
					
						
							
							
								 
						
							
							
								cdd094220c 
								
							
								 
							
						 
						
							
							
								
								parser: Add tests for `Comment.is_inline()`  
							
							
							
						 
						
							9 years ago  
				
					
						
							
							
								 
						
							
							
								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  
				
					
						
							
							
								 
						
							
							
								867970258e 
								
							
								 
							
						 
						
							
							
								
								Patch allow-non-breakable-words on '-'  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								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  
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								59d5bffbec 
								
							
								 
							
						 
						
							
							
								
								Tests: cli: Detect and handle the `-d ''` case  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								53da21934d 
								
							
								 
							
						 
						
							
							
								
								Tests: Add many `cli.run` test cases  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								88ebcbbb93 
								
							
								 
							
						 
						
							
							
								
								Tests: Test cli.find_files_recursively  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								08615ec4f8 
								
							
								 
							
						 
						
							
							
								
								Tests: config: Check the non-valid-yaml-config case  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								29aceb430a 
								
							
								 
							
						 
						
							
							
								
								Tests: indentation: Increase coverage  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								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  
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								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. 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								9a7eec34b1 
								
							
								 
							
						 
						
							
							
								
								Rules: indentation: Fix `spaces: consitent` with broken flows  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								5b62548ece 
								
							
								 
							
						 
						
							
							
								
								Tests: indentation: Use 'spaces: consistent' by default  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								8fca8a7a33 
								
							
								 
							
						 
						
							
							
								
								Config: Allow 'enable' keyword for rules  
							
							... 
							
							
							
							In the same manner as 'disable', 'enable' allows setting a rule on
without worrying about its options. 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								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. 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								fa420499c7 
								
							
								 
							
						 
						
							
							
								
								Config: Allow types in multiple choices  
							
							... 
							
							
							
							For instance, allow rules with:
    CONF = {'choice': (int, 'hardcoded-string'),
            'string-or-bool': (str, bool)} 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								29c1c60143 
								
							
								 
							
						 
						
							
							
								
								Tests: Use absolute path to spec examples  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								10ad302e2f 
								
							
								 
							
						 
						
							
							
								
								Tests: Explicit encoding for spec examples  
							
							... 
							
							
							
							YAML specification examples contain unusual characters, let's explicit
`encoding='utf-8'` to prevent bugs. 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								73d9322813 
								
							
								 
							
						 
						
							
							
								
								linter: Test run on str, unicode, bytes and stream  
							
							... 
							
							
							
							Previously it was not tested, and broke on Python 2 `unicode` inputs. 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								6c8af97a40 
								
							
								 
							
						 
						
							
							
								
								Tests: unblacklist remaining spec examples  
							
							... 
							
							
							
							Since !!tags are now supported. 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								647d84ff94 
								
							
								 
							
						 
						
							
							
								
								Rules: indentation: Handle tags  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								8eb0d0ad74 
								
							
								 
							
						 
						
							
							
								
								Tests: unblacklist spec example 7.16  
							
							... 
							
							
							
							As is it supported -- it just lacks some indentation. 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								4bc3d5a01c 
								
							
								 
							
						 
						
							
							
								
								Rules: indentation: Handle anchors  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								48c7d65c54 
								
							
								 
							
						 
						
							
							
								
								parser: Provide nextnext for token rules  
							
							... 
							
							
							
							Because the indentation rule sometimes needs to look two tokens forward
(in case of anchors for instance). 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								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. 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								9a82b99d4b 
								
							
								 
							
						 
						
							
							
								
								Rules: indentation: Fix multi-line flows  
							
							... 
							
							
							
							To detect this as correct indentations:
    top:
      rules: [
        {
          foo: 1
        },
        {
          foo: 2
          bar: [
            a, b, c
          ],
        },
      ] 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								ba140ad42c 
								
							
								 
							
						 
						
							
							
								
								Tests: Remove ghost character from YAML spec example  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								f6bab05e8a 
								
							
								 
							
						 
						
							
							
								
								Rules: Add the 'key-duplicates' rule  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								c16eec4681 
								
							
								 
							
						 
						
							
							
								
								Style: Fix indentation not multiple of four  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								68618be4cc 
								
							
								 
							
						 
						
							
							
								
								Rules: indentation: Handle sets  
							
							... 
							
							
							
							Sets are like mappings, that do not contain values. Example:
    set:
      ? key one
      ? key two
      ? [non, scalar, key] 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								431a379c81 
								
							
								 
							
						 
						
							
							
								
								Tests: Add tests from YAML 1.2 specification  
							
							... 
							
							
							
							Write all examples from http://www.yaml.org/spec/1.2/spec.html  in
independent files in tests/yaml-1.2-spec-examples; and test them with
yamllint. 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								6b5948c06b 
								
							
								 
							
						 
						
							
							
								
								Tests: Reorganize common and global tests  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								dd163ed551 
								
							
								 
							
						 
						
							
							
								
								Rules: indentation: Fix flow sequences with multi-line scalars  
							
							... 
							
							
							
							Typically sequences like this:
    ["multi
      line 1", "multi
                line 2"] 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								14c99da2bb 
								
							
								 
							
						 
						
							
							
								
								Tests: Add test cases for empty flows  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								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 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								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. 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								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. 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								97c446907c 
								
							
								 
							
						 
						
							
							
								
								Rules: line-length: Add option `allow-non-breakable-words`  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								5ed496f471 
								
							
								 
							
						 
						
							
							
								
								Distribution: Remove unneeded `setup_requires`  
							
							... 
							
							
							
							With the new project layout, `pyyaml` is not needed anymore for parsing
setup.py. 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								7b147cb411 
								
							
								 
							
						 
						
							
							
								
								Tests: Remove Python 2.6 from CI tests  
							
							... 
							
							
							
							Because:
1. It is old. VERY old.
2. Some useful methods (`assertRaisesRegexp`, `assertIsInstance`) are
   only available from Python 2.7. 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								fc108e7cee 
								
							
								 
							
						 
						
							
							
								
								Config: Refactor to use YamlLintConfig objects  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								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");
              } 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								67d13d60ae 
								
							
								 
							
						 
						
							
							
								
								Rules: indentation: Check multi-line scalars  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								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 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								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 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								6a24781f96 
								
							
								 
							
						 
						
							
							
								
								Tests: indentation: Add explicit keys test cases  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								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. 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								ad5cec9c6c 
								
							
								 
							
						 
						
							
							
								
								Config: Allow overriding only one option when extending  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								8288a6f331 
								
							
								 
							
						 
						
							
							
								
								Rules: colons: Apply to '?' also  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								9d8b0d4d2c 
								
							
								 
							
						 
						
							
							
								
								Rules: commas: Don't allow a comma on a new line  
							
							... 
							
							
							
							Forbid such constructions:
    [ a, b, c
      , d, e ] 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								39c878c819 
								
							
								 
							
						 
						
							
							
								
								Rules: indentation: Rewrite the algorithm (again)  
							
							... 
							
							
							
							Use a new, better thought algorithm that keeps an history stack with all
the parents indentations. 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								222f7a27c1 
								
							
								 
							
						 
						
							
							
								
								Make syntax errors prevail over all yamllint problems  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								effb4db3b4 
								
							
								 
							
						 
						
							
							
								
								Tests: Rules: Remove unused `line` and `column` args  
							
							... 
							
							
							
							Now that every test case use the `problem=(x, y)` syntax. 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								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 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								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()`. 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								233a70adb3 
								
							
								 
							
						 
						
							
							
								
								Rules: Add the 'comments-indentation' rule  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								e81b73c111 
								
							
								 
							
						 
						
							
							
								
								Rules: indentation: Rewrite algorithm  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								3989a09d32 
								
							
								 
							
						 
						
							
							
								
								Rules: comments: Allow empty comments  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								5cc900f2a8 
								
							
								 
							
						 
						
							
							
								
								Rules: document-start: Allow directives  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								851b9ac42c 
								
							
								 
							
						 
						
							
							
								
								Rules: Add the 'comments' rule  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								5c4c208b98 
								
							
								 
							
						 
						
							
							
								
								Rules: Add the 'braces' rule  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								d08eb22081 
								
							
								 
							
						 
						
							
							
								
								Rules: Add the 'brackets' rule  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								a5b384ab21 
								
							
								 
							
						 
						
							
							
								
								Rules: Add the 'commas' rule  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								07c5b4177c 
								
							
								 
							
						 
						
							
							
								
								Rewrite syntax errors handling and test them  
							
							... 
							
							
							
							If a syntax errors occurs at the same place than a regular yamllint rule
error, only the yamllint one is issued. 
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								bf96bdde01 
								
							
								 
							
						 
						
							
							
								
								Tests: Remove assertIsInstance to support Python 2.6  
							
							
							
						 
						
							10 years ago  
				
					
						
							
							
								 
						
							
							
								350213b165 
								
							
								 
							
						 
						
							
							
								
								Initial commit  
							
							
							
						 
						
							10 years ago