Compare commits

...

3 Commits

Author SHA1 Message Date
Adrien Vergé
415b1c7091 [WIP] Fix for #334 (directories like 'dir.yaml' + recursive search)
Partially reverts a221898 to fix https://github.com/adrienverge/yamllint/issues/334

Linked to https://github.com/cpburnz/python-path-specification/issues/41.
2020-10-10 10:26:31 +02:00
Florian Bruhin
8eebab68ab Fix typo in changelog 2020-10-05 09:42:42 +02:00
Per Lundberg
2103bd73de README.rst: fix typo 2020-10-02 12:51:01 +02:00
5 changed files with 16 additions and 5 deletions

2
.gitignore vendored
View File

@@ -5,3 +5,5 @@ __pycache__
/yamllint.egg-info
/build
/.eggs
*.yaml
!*.yaml/

View File

@@ -5,7 +5,7 @@ Changelog
-------------------
- Run tests on Travis both with and without UTF-8 locales
- Improve documentationon with default values to rules with options
- Improve documentation with default values to rules with options
- Improve documentation with a Python API usage example
- Fix documentation on ``commas`` examples
- Packaging: move setuptools' configuration from ``setup.py`` to ``setup.cfg``

View File

@@ -22,7 +22,7 @@ indentation, etc.
Written in Python (compatible with Python 2 & 3).
⚠ Python 2 upstream support stopped on January 1, 2020. yamllint will keep
best-effort support for Python 2.7 until January 1, 2021. Passed that date,
best-effort support for Python 2.7 until January 1, 2021. Past that date,
yamllint will drop all Python 2-related code.
Documentation

View File

@@ -2,8 +2,11 @@
yaml-files:
- '*.yaml'
- '!*.yaml/'
- '*.yml'
- '!*.yml/'
- '.yamllint'
- '!.yamllint/'
rules:
braces: enable

View File

@@ -32,8 +32,14 @@ class YamlLintConfig(object):
self.ignore = None
self.yaml_files = pathspec.PathSpec.from_lines(
'gitwildmatch', ['*.yaml', '*.yml', '.yamllint'])
self.yaml_files = pathspec.PathSpec.from_lines('gitwildmatch', [
'*.yaml',
'!*.yaml/',
'*.yml',
'!*.yml/',
'.yamllint',
'!.yamllint/',
])
self.locale = None
@@ -48,7 +54,7 @@ class YamlLintConfig(object):
return self.ignore and self.ignore.match_file(filepath)
def is_yaml_file(self, filepath):
return self.yaml_files.match_file(os.path.basename(filepath))
return self.yaml_files.match_file(filepath)
def enabled_rules(self, filepath):
return [yamllint.rules.get(id) for id, val in self.rules.items()