Hello community, here is the log from the commit of package python-yamllint for openSUSE:Factory checked in at 2019-09-05 12:34:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-yamllint (Old) and /work/SRC/openSUSE:Factory/.python-yamllint.new.7948 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-yamllint" Thu Sep 5 12:34:04 2019 rev:6 rq:724508 version:1.17.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-yamllint/python-yamllint.changes 2019-06-14 20:43:03.570325788 +0200 +++ /work/SRC/openSUSE:Factory/.python-yamllint.new.7948/python-yamllint.changes 2019-09-05 12:34:04.963576086 +0200 @@ -1,0 +2,8 @@ +Mon Aug 19 08:43:21 UTC 2019 - Tomáš Chvátal <tchva...@suse.com> + +- Update to 1.17.0: + * Simplify installation instructions in the README + * Add OpenBSD installation instructions + * Make YAML file extensions configurable + +------------------------------------------------------------------- Old: ---- yamllint-1.16.0.tar.gz New: ---- yamllint-1.17.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-yamllint.spec ++++++ --- /var/tmp/diff_new_pack.Xm95Kq/_old 2019-09-05 12:34:05.371576005 +0200 +++ /var/tmp/diff_new_pack.Xm95Kq/_new 2019-09-05 12:34:05.371576005 +0200 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-yamllint -Version: 1.16.0 +Version: 1.17.0 Release: 0 Summary: A linter for YAML files License: GPL-3.0-only ++++++ yamllint-1.16.0.tar.gz -> yamllint-1.17.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yamllint-1.16.0/PKG-INFO new/yamllint-1.17.0/PKG-INFO --- old/yamllint-1.16.0/PKG-INFO 2019-06-07 10:07:07.000000000 +0200 +++ new/yamllint-1.17.0/PKG-INFO 2019-08-12 16:57:07.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: yamllint -Version: 1.16.0 +Version: 1.17.0 Summary: A linter for YAML files. Home-page: https://github.com/adrienverge/yamllint Author: Adrien Vergé diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yamllint-1.16.0/README.rst new/yamllint-1.17.0/README.rst --- old/yamllint-1.16.0/README.rst 2019-03-25 17:35:46.000000000 +0100 +++ new/yamllint-1.17.0/README.rst 2019-07-16 11:14:11.000000000 +0200 @@ -38,38 +38,16 @@ Installation ^^^^^^^^^^^^ -On Fedora / CentOS (note: `EPEL <https://fedoraproject.org/wiki/EPEL>`_ is -required on CentOS): - -.. code:: bash - - sudo dnf install yamllint - -On Debian 8+ / Ubuntu 16.04+: - -.. code:: bash - - sudo apt-get install yamllint - -On FreeBSD: - -.. code:: sh - - pkg install py27-yamllint - pkg install py36-yamllint - -On Mac OS 10.11+: - -.. code:: bash - - brew install yamllint - -Alternatively using pip, the Python package manager: +Using pip, the Python package manager: .. code:: bash pip install --user yamllint +yamllint is also packaged for all major operating systems, see installation +examples (``dnf``, ``apt-get``...) `in the documentation +<https://yamllint.readthedocs.io/en/stable/quickstart.html>`_. + Usage ^^^^^ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yamllint-1.16.0/docs/configuration.rst new/yamllint-1.17.0/docs/configuration.rst --- old/yamllint-1.16.0/docs/configuration.rst 2018-12-08 11:21:22.000000000 +0100 +++ new/yamllint-1.17.0/docs/configuration.rst 2019-08-12 16:53:44.000000000 +0200 @@ -115,6 +115,21 @@ * ``1`` if one or more errors occur * ``2`` if no errors occur, but one or more warnings occur +YAML files extensions +--------------------- + +To configure what yamllint should consider as YAML files, set ``yaml-files`` +configuration option. The default is: + +.. code-block:: yaml + + yaml-files: + - '*.yaml' + - '*.yml' + +The same rules as for ignoring paths apply (``.gitignore``-style path pattern, +see below). + Ignoring paths -------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yamllint-1.16.0/docs/quickstart.rst new/yamllint-1.17.0/docs/quickstart.rst --- old/yamllint-1.16.0/docs/quickstart.rst 2019-02-14 18:17:12.000000000 +0100 +++ new/yamllint-1.17.0/docs/quickstart.rst 2019-07-16 11:14:11.000000000 +0200 @@ -4,7 +4,8 @@ Installing yamllint ------------------- -On Fedora / CentOS: +On Fedora / CentOS (note: `EPEL <https://fedoraproject.org/wiki/EPEL>`_ is +required on CentOS): .. code:: bash @@ -22,6 +23,18 @@ brew install yamllint +On FreeBSD: + +.. code:: sh + + pkg install py36-yamllint + +On OpenBSD: + +.. code:: sh + + doas pkg_add py3-yamllint + Alternatively using pip, the Python package manager: .. code:: bash diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yamllint-1.16.0/tests/test_cli.py new/yamllint-1.17.0/tests/test_cli.py --- old/yamllint-1.16.0/tests/test_cli.py 2019-02-14 18:17:12.000000000 +0100 +++ new/yamllint-1.17.0/tests/test_cli.py 2019-08-12 16:53:44.000000000 +0200 @@ -29,6 +29,7 @@ from tests.common import build_temp_workspace from yamllint import cli +from yamllint import config class CommandLineTestCase(unittest.TestCase): @@ -73,8 +74,9 @@ shutil.rmtree(cls.wd) def test_find_files_recursively(self): + conf = config.YamlLintConfig('extends: default') self.assertEqual( - sorted(cli.find_files_recursively([self.wd])), + sorted(cli.find_files_recursively([self.wd], conf)), [os.path.join(self.wd, 'a.yaml'), os.path.join(self.wd, 'empty.yml'), os.path.join(self.wd, 's/s/s/s/s/s/s/s/s/s/s/s/s/s/s/file.yaml'), @@ -85,14 +87,14 @@ items = [os.path.join(self.wd, 'sub/ok.yaml'), os.path.join(self.wd, 'empty-dir')] self.assertEqual( - sorted(cli.find_files_recursively(items)), + sorted(cli.find_files_recursively(items, conf)), [os.path.join(self.wd, 'sub/ok.yaml')], ) items = [os.path.join(self.wd, 'empty.yml'), os.path.join(self.wd, 's')] self.assertEqual( - sorted(cli.find_files_recursively(items)), + sorted(cli.find_files_recursively(items, conf)), [os.path.join(self.wd, 'empty.yml'), os.path.join(self.wd, 's/s/s/s/s/s/s/s/s/s/s/s/s/s/s/file.yaml')], ) @@ -100,11 +102,77 @@ items = [os.path.join(self.wd, 'sub'), os.path.join(self.wd, '/etc/another/file')] self.assertEqual( - sorted(cli.find_files_recursively(items)), + sorted(cli.find_files_recursively(items, conf)), [os.path.join(self.wd, '/etc/another/file'), os.path.join(self.wd, 'sub/ok.yaml')], ) + conf = config.YamlLintConfig('extends: default\n' + 'yaml-files:\n' + ' - \'*.yaml\' \n') + self.assertEqual( + sorted(cli.find_files_recursively([self.wd], conf)), + [os.path.join(self.wd, 'a.yaml'), + os.path.join(self.wd, 's/s/s/s/s/s/s/s/s/s/s/s/s/s/s/file.yaml'), + os.path.join(self.wd, 'sub/ok.yaml'), + os.path.join(self.wd, 'warn.yaml')] + ) + + conf = config.YamlLintConfig('extends: default\n' + 'yaml-files:\n' + ' - \'*.yml\'\n') + self.assertEqual( + sorted(cli.find_files_recursively([self.wd], conf)), + [os.path.join(self.wd, 'empty.yml')] + ) + + conf = config.YamlLintConfig('extends: default\n' + 'yaml-files:\n' + ' - \'*.json\'\n') + self.assertEqual( + sorted(cli.find_files_recursively([self.wd], conf)), + [os.path.join(self.wd, 'no-yaml.json')] + ) + + conf = config.YamlLintConfig('extends: default\n' + 'yaml-files:\n' + ' - \'*\'\n') + self.assertEqual( + sorted(cli.find_files_recursively([self.wd], conf)), + [os.path.join(self.wd, 'a.yaml'), + os.path.join(self.wd, 'empty.yml'), + os.path.join(self.wd, 'no-yaml.json'), + os.path.join(self.wd, 'non-ascii/utf-8'), + os.path.join(self.wd, 's/s/s/s/s/s/s/s/s/s/s/s/s/s/s/file.yaml'), + os.path.join(self.wd, 'sub/ok.yaml'), + os.path.join(self.wd, 'warn.yaml')] + ) + + conf = config.YamlLintConfig('extends: default\n' + 'yaml-files:\n' + ' - \'*.yaml\'\n' + ' - \'*\'\n' + ' - \'**\'\n') + self.assertEqual( + sorted(cli.find_files_recursively([self.wd], conf)), + [os.path.join(self.wd, 'a.yaml'), + os.path.join(self.wd, 'empty.yml'), + os.path.join(self.wd, 'no-yaml.json'), + os.path.join(self.wd, 'non-ascii/utf-8'), + os.path.join(self.wd, 's/s/s/s/s/s/s/s/s/s/s/s/s/s/s/file.yaml'), + os.path.join(self.wd, 'sub/ok.yaml'), + os.path.join(self.wd, 'warn.yaml')] + ) + + conf = config.YamlLintConfig('extends: default\n' + 'yaml-files:\n' + ' - \'s/**\'\n' + ' - \'**/utf-8\'\n') + self.assertEqual( + sorted(cli.find_files_recursively([self.wd], conf)), + [os.path.join(self.wd, 'non-ascii/utf-8')] + ) + def test_run_with_bad_arguments(self): sys.stdout, sys.stderr = StringIO(), StringIO() with self.assertRaises(SystemExit) as ctx: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yamllint-1.16.0/yamllint/__init__.py new/yamllint-1.17.0/yamllint/__init__.py --- old/yamllint-1.16.0/yamllint/__init__.py 2019-06-07 10:00:12.000000000 +0200 +++ new/yamllint-1.17.0/yamllint/__init__.py 2019-08-12 16:52:42.000000000 +0200 @@ -22,7 +22,7 @@ APP_NAME = 'yamllint' -APP_VERSION = '1.16.0' +APP_VERSION = '1.17.0' APP_DESCRIPTION = __doc__ __author__ = u'Adrien Vergé' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yamllint-1.16.0/yamllint/cli.py new/yamllint-1.17.0/yamllint/cli.py --- old/yamllint-1.16.0/yamllint/cli.py 2019-06-06 09:52:15.000000000 +0200 +++ new/yamllint-1.17.0/yamllint/cli.py 2019-08-12 16:53:44.000000000 +0200 @@ -27,13 +27,14 @@ from yamllint.linter import PROBLEM_LEVELS -def find_files_recursively(items): +def find_files_recursively(items, conf): for item in items: if os.path.isdir(item): for root, dirnames, filenames in os.walk(item): - for filename in [f for f in filenames - if f.endswith(('.yml', '.yaml'))]: - yield os.path.join(root, filename) + for f in filenames: + filepath = os.path.join(root, f) + if conf.is_yaml_file(filepath): + yield filepath else: yield item @@ -163,7 +164,7 @@ max_level = 0 - for file in find_files_recursively(args.files): + for file in find_files_recursively(args.files, conf): filepath = file[2:] if file.startswith('./') else file try: with open(file) as f: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yamllint-1.16.0/yamllint/conf/default.yaml new/yamllint-1.17.0/yamllint/conf/default.yaml --- old/yamllint-1.16.0/yamllint/conf/default.yaml 2019-01-10 10:01:44.000000000 +0100 +++ new/yamllint-1.17.0/yamllint/conf/default.yaml 2019-08-12 16:53:44.000000000 +0200 @@ -1,5 +1,9 @@ --- +yaml-files: + - '*.yaml' + - '*.yml' + rules: braces: enable brackets: enable diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yamllint-1.16.0/yamllint/config.py new/yamllint-1.17.0/yamllint/config.py --- old/yamllint-1.16.0/yamllint/config.py 2019-06-07 09:59:31.000000000 +0200 +++ new/yamllint-1.17.0/yamllint/config.py 2019-08-12 16:53:44.000000000 +0200 @@ -32,6 +32,9 @@ self.ignore = None + self.yaml_files = pathspec.PathSpec.from_lines( + 'gitwildmatch', ['*.yaml', '*.yml']) + if file is not None: with open(file) as f: content = f.read() @@ -42,6 +45,9 @@ def is_file_ignored(self, filepath): return self.ignore and self.ignore.match_file(filepath) + def is_yaml_file(self, 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() if val is not False and ( @@ -96,6 +102,15 @@ self.ignore = pathspec.PathSpec.from_lines( 'gitwildmatch', conf['ignore'].splitlines()) + if 'yaml-files' in conf: + if not (isinstance(conf['yaml-files'], list) + and all(isinstance(i, str) for i in conf['yaml-files'])): + raise YamlLintConfigError( + 'invalid config: yaml-files ' + 'should be a list of file patterns') + self.yaml_files = pathspec.PathSpec.from_lines('gitwildmatch', + conf['yaml-files']) + def validate(self): for id in self.rules: try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yamllint-1.16.0/yamllint/rules/truthy.py new/yamllint-1.17.0/yamllint/rules/truthy.py --- old/yamllint-1.16.0/yamllint/rules/truthy.py 2019-06-07 09:59:31.000000000 +0200 +++ new/yamllint-1.17.0/yamllint/rules/truthy.py 2019-08-12 16:43:39.000000000 +0200 @@ -101,7 +101,7 @@ TRUTHY = ['YES', 'Yes', 'yes', 'NO', 'No', 'no', - 'TRUE', 'True', 'true', + 'TRUE', 'True', 'true', 'FALSE', 'False', 'false', 'ON', 'On', 'on', 'OFF', 'Off', 'off'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yamllint-1.16.0/yamllint.egg-info/PKG-INFO new/yamllint-1.17.0/yamllint.egg-info/PKG-INFO --- old/yamllint-1.16.0/yamllint.egg-info/PKG-INFO 2019-06-07 10:07:07.000000000 +0200 +++ new/yamllint-1.17.0/yamllint.egg-info/PKG-INFO 2019-08-12 16:57:07.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: yamllint -Version: 1.16.0 +Version: 1.17.0 Summary: A linter for YAML files. Home-page: https://github.com/adrienverge/yamllint Author: Adrien Vergé