Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
058fef7559 | ||
|
|
f47d5318cf | ||
|
|
33ce0fa960 | ||
|
|
43744902e9 | ||
|
|
85ccd625a3 | ||
|
|
e53ea093e2 | ||
|
|
5d8ef2ea23 | ||
|
|
4515269233 | ||
|
|
66bf76a362 | ||
|
|
8f682481c7 |
54
.github/workflows/ci.yaml
vendored
Normal file
54
.github/workflows/ci.yaml
vendored
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on: # yamllint disable-line rule:truthy
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: Linters
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: 3.9
|
||||||
|
- run: python -m pip install flake8 flake8-import-order doc8 sphinx
|
||||||
|
- run: python -m pip install .
|
||||||
|
- run: flake8 .
|
||||||
|
- run: doc8 $(git ls-files '*.rst')
|
||||||
|
- run: yamllint --strict $(git ls-files '*.yaml' '*.yml')
|
||||||
|
- run: python setup.py build_sphinx
|
||||||
|
|
||||||
|
test:
|
||||||
|
name: Tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version:
|
||||||
|
- 3.5
|
||||||
|
- 3.6
|
||||||
|
- 3.7
|
||||||
|
- 3.8
|
||||||
|
- 3.9
|
||||||
|
- nightly
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Set up Python ${{ matrix.pyver }}
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.pyver }}
|
||||||
|
- name: Fix GitHub Actions path
|
||||||
|
run: echo /home/runner/.local/bin >>$GITHUB_PATH
|
||||||
|
- run: pip install coveralls
|
||||||
|
- run: pip install .
|
||||||
|
- run: coverage run --source=yamllint -m unittest discover
|
||||||
|
- name: Coveralls
|
||||||
|
uses: AndreMiras/coveralls-python-action@develop
|
||||||
25
.travis.yml
25
.travis.yml
@@ -1,25 +0,0 @@
|
|||||||
---
|
|
||||||
dist: xenial # required for Python >= 3.7 (travis-ci/travis-ci#9069)
|
|
||||||
language: python
|
|
||||||
python:
|
|
||||||
- 3.5
|
|
||||||
- 3.6
|
|
||||||
- 3.7
|
|
||||||
- 3.8
|
|
||||||
- 3.9
|
|
||||||
- nightly
|
|
||||||
env:
|
|
||||||
- REMOVE_LOCALES=false
|
|
||||||
- REMOVE_LOCALES=true
|
|
||||||
install:
|
|
||||||
- pip install pyyaml coveralls flake8 flake8-import-order doc8 sphinx
|
|
||||||
- pip install .
|
|
||||||
- if [[ $REMOVE_LOCALES = "true" ]]; then sudo rm -rf /usr/lib/locale/*; fi
|
|
||||||
script:
|
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION != nightly ]]; then flake8 .; fi
|
|
||||||
- doc8 $(git ls-files '*.rst')
|
|
||||||
- yamllint --strict $(git ls-files '*.yaml' '*.yml')
|
|
||||||
- coverage run --source=yamllint -m unittest discover
|
|
||||||
- python setup.py build_sphinx
|
|
||||||
after_success:
|
|
||||||
coveralls
|
|
||||||
@@ -1,6 +1,22 @@
|
|||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
1.26.3 (2021-08-21)
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
- Restore runtime dependency ``setuptools`` for Python < 3.8
|
||||||
|
|
||||||
|
1.26.2 (2021-08-03)
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
- Fix ``python_requires`` to comply with PEP 345 and PEP 440
|
||||||
|
|
||||||
|
1.26.1 (2021-04-06)
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
- Remove runtime dependency ``setuptools`` for Python < 3.8
|
||||||
|
- Fix ``line_length`` to skip all hash signs starting comment
|
||||||
|
|
||||||
1.26.0 (2021-01-29)
|
1.26.0 (2021-01-29)
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ project_urls =
|
|||||||
[options]
|
[options]
|
||||||
packages = find:
|
packages = find:
|
||||||
|
|
||||||
python_requires = >=3.5.*
|
python_requires = >=3.5
|
||||||
|
|
||||||
include_package_data = True
|
include_package_data = True
|
||||||
install_requires =
|
install_requires =
|
||||||
@@ -67,3 +67,6 @@ yamllint = conf/*.yaml
|
|||||||
[options.entry_points]
|
[options.entry_points]
|
||||||
console_scripts =
|
console_scripts =
|
||||||
yamllint = yamllint.cli:run
|
yamllint = yamllint.cli:run
|
||||||
|
|
||||||
|
[coverage:run]
|
||||||
|
relative_files = True
|
||||||
|
|||||||
@@ -116,6 +116,27 @@ class LineLengthTestCase(RuleTestCase):
|
|||||||
'long_line: http://localhost/very/very/long/url\n'
|
'long_line: http://localhost/very/very/long/url\n'
|
||||||
'...\n', conf, problem=(2, 21))
|
'...\n', conf, problem=(2, 21))
|
||||||
|
|
||||||
|
conf = 'line-length: {max: 20, allow-non-breakable-words: true}'
|
||||||
|
self.check('---\n'
|
||||||
|
'# http://www.verylongurlurlurlurlurlurlurlurl.com\n'
|
||||||
|
'key:\n'
|
||||||
|
' subkey: value\n', conf)
|
||||||
|
self.check('---\n'
|
||||||
|
'## http://www.verylongurlurlurlurlurlurlurlurl.com\n'
|
||||||
|
'key:\n'
|
||||||
|
' subkey: value\n', conf)
|
||||||
|
self.check('---\n'
|
||||||
|
'# # http://www.verylongurlurlurlurlurlurlurlurl.com\n'
|
||||||
|
'key:\n'
|
||||||
|
' subkey: value\n', conf,
|
||||||
|
problem=(2, 21))
|
||||||
|
self.check('---\n'
|
||||||
|
'#A http://www.verylongurlurlurlurlurlurlurlurl.com\n'
|
||||||
|
'key:\n'
|
||||||
|
' subkey: value\n', conf,
|
||||||
|
problem1=(2, 2, 'comments'),
|
||||||
|
problem2=(2, 21, 'line-length'))
|
||||||
|
|
||||||
conf = ('line-length: {max: 20, allow-non-breakable-words: true}\n'
|
conf = ('line-length: {max: 20, allow-non-breakable-words: true}\n'
|
||||||
'trailing-spaces: disable')
|
'trailing-spaces: disable')
|
||||||
self.check('---\n'
|
self.check('---\n'
|
||||||
|
|||||||
@@ -297,6 +297,7 @@ class CommandLineTestCase(unittest.TestCase):
|
|||||||
cli.run(('-c', f.name, os.path.join(self.wd, 'a.yaml')))
|
cli.run(('-c', f.name, os.path.join(self.wd, 'a.yaml')))
|
||||||
self.assertEqual(ctx.returncode, 1)
|
self.assertEqual(ctx.returncode, 1)
|
||||||
|
|
||||||
|
@unittest.skipIf(os.environ.get('GITHUB_RUN_ID'), '$HOME not overridable')
|
||||||
def test_run_with_user_global_config_file(self):
|
def test_run_with_user_global_config_file(self):
|
||||||
home = os.path.join(self.wd, 'fake-home')
|
home = os.path.join(self.wd, 'fake-home')
|
||||||
dir = os.path.join(home, '.config', 'yamllint')
|
dir = os.path.join(home, '.config', 'yamllint')
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ indentation, etc."""
|
|||||||
|
|
||||||
|
|
||||||
APP_NAME = 'yamllint'
|
APP_NAME = 'yamllint'
|
||||||
APP_VERSION = '1.26.0'
|
APP_VERSION = '1.26.3'
|
||||||
APP_DESCRIPTION = __doc__
|
APP_DESCRIPTION = __doc__
|
||||||
|
|
||||||
__author__ = u'Adrien Vergé'
|
__author__ = u'Adrien Vergé'
|
||||||
|
|||||||
@@ -140,7 +140,11 @@ def check(conf, line):
|
|||||||
start += 1
|
start += 1
|
||||||
|
|
||||||
if start != line.end:
|
if start != line.end:
|
||||||
if line.buffer[start] in ('#', '-'):
|
if line.buffer[start] == '#':
|
||||||
|
while line.buffer[start] == '#':
|
||||||
|
start += 1
|
||||||
|
start += 1
|
||||||
|
elif line.buffer[start] == '-':
|
||||||
start += 2
|
start += 2
|
||||||
|
|
||||||
if line.buffer.find(' ', start, line.end) == -1:
|
if line.buffer.find(' ', start, line.end) == -1:
|
||||||
|
|||||||
Reference in New Issue
Block a user