Commit Graph

188 Commits (1fb673be2ed104d2bff6e5187179d7a44b2e40a8)
 

Author SHA1 Message Date
Adrien Vergé 1fb673be2e Packaging: Debian: Add man page 8 years ago
Adrien Vergé ea658ec3d6 Packaging: Add files for Debian 8 years ago
Adrien Vergé 014a6d2db4 Packaging: Add files for Ubuntu packaging (PPA) 8 years ago
Adrien Vergé 559ad5574b yamllint version 1.5.0 8 years ago
Adrien Vergé adcb2d2953 Merge pull request #24 from adamchainz/dont_package_tests
setup.py - don't distribute tests
8 years ago
Adam Chainz e948509fe5 setup.py - don't distribute tests
Found them installed in my `site-packages`, importable as `import tests` 😱

Tested with:

```
In [2]: find_packages()
Out[2]: ['tests', 'yamllint', 'tests.rules', 'yamllint.rules']

In [3]: find_packages(exclude=['tests', 'tests.*'])
Out[3]: ['yamllint', 'yamllint.rules']
```
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é 073462a87d docs(rules): Fix missing truthy rule in index 8 years ago
Adrien Vergé 4b9ba9e201 docs(truthy): Enhance rule documentation 8 years ago
Peter Ericson 5294ff5552 truthy: Add tests for explicit booleans
From @adrienverge
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é 9b72a2d29a Merge branch 'adamchainz-readthedocs.io' 8 years ago
Adam Chainz d7c17c7e7c Doc: Convert readthedocs links from .org to .io
As per [their blog post of the 27th
April](https://blog.readthedocs.com/securing-subdomains/) ‘Securing
subdomains’:

> Starting today, Read the Docs will start hosting projects from
> subdomains on the domain readthedocs.io, instead of on
> readthedocs.org. This change addresses some security concerns around
> site cookies while hosting user generated data on the same domain as
> our dashboard.

Test Plan: Manually visited all the links I’ve modified.
8 years ago
Adrien Vergé 60b72daad4 yamllint version 1.4.0 8 years ago
Adrien Vergé 773bb8a648 Merge pull request #17 from allanlewis/improve-unbreakable
line_length: Allow mapping values with long unbreakable lines
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é 82dd7dbf16 Merge pull request #16 from adrienverge/coloured_output_on_tty
feat(cli): Colour output only on TTY
9 years ago
Adrien Vergé 4533b8ae49 doc(config): Show `relaxed` conf contents
Closes: #15
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é 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é 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
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é 09118e417c Doc: Add license information on README page 9 years ago
Adrien Vergé 71b90ae208 Doc: Add new features in README 9 years ago
Adrien Vergé 8844855353 Doc: Remove old Debian install commands from README 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é cdd094220c parser: Add tests for `Comment.is_inline()` 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
Adrien Vergé edd4cca02f Merge pull request #9 from michelebariani/master
Patch allow-non-breakable-words on '-'
9 years ago
Michele Bariani 867970258e Patch allow-non-breakable-words on '-' 9 years ago
Adrien Vergé d0cb5998c4 Merge pull request #7 from jwilk/spelling
Fix typos
9 years ago
Jakub Wilk a5c97220e7 Fix typos 9 years ago
Adrien Vergé 598e5e4370 Doc: Fix typo on configuration page intro 9 years ago
Adrien Vergé 03076ee214 Doc: Add a pointer to rules on configuration page intro 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