Compare commits
4 Commits
v1.25.0
...
fix/issues
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
415b1c7091 | ||
|
|
8eebab68ab | ||
|
|
2103bd73de | ||
|
|
85c8631183 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -5,3 +5,5 @@ __pycache__
|
|||||||
/yamllint.egg-info
|
/yamllint.egg-info
|
||||||
/build
|
/build
|
||||||
/.eggs
|
/.eggs
|
||||||
|
*.yaml
|
||||||
|
!*.yaml/
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ script:
|
|||||||
- if [[ $TRAVIS_PYTHON_VERSION != nightly ]]; then flake8 .; fi
|
- if [[ $TRAVIS_PYTHON_VERSION != nightly ]]; then flake8 .; fi
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION != 2* ]]; then doc8 $(git ls-files '*.rst'); fi
|
- if [[ $TRAVIS_PYTHON_VERSION != 2* ]]; then doc8 $(git ls-files '*.rst'); fi
|
||||||
- yamllint --strict $(git ls-files '*.yaml' '*.yml')
|
- yamllint --strict $(git ls-files '*.yaml' '*.yml')
|
||||||
- coverage run --source=yamllint setup.py test
|
- coverage run --source=yamllint -m unittest discover
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION != 2* ]]; then
|
- if [[ $TRAVIS_PYTHON_VERSION != 2* ]]; then
|
||||||
python setup.py build_sphinx;
|
python setup.py build_sphinx;
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Changelog
|
|||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
- Run tests on Travis both with and without UTF-8 locales
|
- 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
|
- Improve documentation with a Python API usage example
|
||||||
- Fix documentation on ``commas`` examples
|
- Fix documentation on ``commas`` examples
|
||||||
- Packaging: move setuptools' configuration from ``setup.py`` to ``setup.cfg``
|
- Packaging: move setuptools' configuration from ``setup.py`` to ``setup.cfg``
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ Pull Request Process
|
|||||||
|
|
||||||
.. code:: bash
|
.. code:: bash
|
||||||
|
|
||||||
python setup.py test
|
pip install --user .
|
||||||
|
python -m unittest discover # all tests...
|
||||||
|
python -m unittest tests/rules/test_commas.py # or just some tests (faster)
|
||||||
|
|
||||||
3. If you add code that should be tested, add tests.
|
3. If you add code that should be tested, add tests.
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ indentation, etc.
|
|||||||
Written in Python (compatible with Python 2 & 3).
|
Written in Python (compatible with Python 2 & 3).
|
||||||
|
|
||||||
⚠ Python 2 upstream support stopped on January 1, 2020. yamllint will keep
|
⚠ 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.
|
yamllint will drop all Python 2-related code.
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
|
|||||||
@@ -2,8 +2,11 @@
|
|||||||
|
|
||||||
yaml-files:
|
yaml-files:
|
||||||
- '*.yaml'
|
- '*.yaml'
|
||||||
|
- '!*.yaml/'
|
||||||
- '*.yml'
|
- '*.yml'
|
||||||
|
- '!*.yml/'
|
||||||
- '.yamllint'
|
- '.yamllint'
|
||||||
|
- '!.yamllint/'
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
braces: enable
|
braces: enable
|
||||||
|
|||||||
@@ -32,8 +32,14 @@ class YamlLintConfig(object):
|
|||||||
|
|
||||||
self.ignore = None
|
self.ignore = None
|
||||||
|
|
||||||
self.yaml_files = pathspec.PathSpec.from_lines(
|
self.yaml_files = pathspec.PathSpec.from_lines('gitwildmatch', [
|
||||||
'gitwildmatch', ['*.yaml', '*.yml', '.yamllint'])
|
'*.yaml',
|
||||||
|
'!*.yaml/',
|
||||||
|
'*.yml',
|
||||||
|
'!*.yml/',
|
||||||
|
'.yamllint',
|
||||||
|
'!.yamllint/',
|
||||||
|
])
|
||||||
|
|
||||||
self.locale = None
|
self.locale = None
|
||||||
|
|
||||||
@@ -48,7 +54,7 @@ class YamlLintConfig(object):
|
|||||||
return self.ignore and self.ignore.match_file(filepath)
|
return self.ignore and self.ignore.match_file(filepath)
|
||||||
|
|
||||||
def is_yaml_file(self, 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):
|
def enabled_rules(self, filepath):
|
||||||
return [yamllint.rules.get(id) for id, val in self.rules.items()
|
return [yamllint.rules.get(id) for id, val in self.rules.items()
|
||||||
|
|||||||
Reference in New Issue
Block a user