diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..5b324a2 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,7 @@ +[run] +branch = True + +[report] +exclude_lines = + # Don't complain if non-runnable code isn't run: + if __name__ == .__main__.: diff --git a/.travis.yml b/.travis.yml index a384bc8..0a35a1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,68 +2,71 @@ dist: bionic language: python -matrix: +cache: pip + +git: + depth: 100 + +jobs: + fast_finish: true + include: - - env: TOXENV=flake8 - install: - - pip install tox - script: - - tox + - python: 3.7 + name: Running linters + script: + - flake8 + + - python: 3.8 + before_install: + - pip install distro + + - python: 3.7 + + - python: 3.6 - - python: 2.7 - env: TOXENV=py27 - install: - - pip install tox - script: - - tox + - python: 3.5 - - python: 3.5 - env: TOXENV=py35 - install: - - pip install tox - script: - - tox + - python: 2.7 - - python: 3.6 - env: TOXENV=py36 - install: - - pip install tox - script: - - tox + - language: generic + name: Running hadolint + sudo: false + env: + HADOLINT: "${HOME}/hadolint" + install: + # Download hadolint binary and set it as executable + - curl -sL -o ${HADOLINT} "https://github.com/hadolint/hadolint/releases/download/v1.16.0/hadolint-$(uname -s)-$(uname -m)" + && chmod 700 ${HADOLINT} + script: + # List files which name starts with 'Dockerfile' + # eg. Dockerfile, Dockerfile.build, etc. + - git ls-files --exclude='Dockerfile*' --ignored | xargs --max-lines=1 ${HADOLINT} - - python: 3.7 - env: TOXENV=py37 - install: - - pip install tox - script: - - tox + - python: 3.7 + stage: Deploy + name: Publishing current Git tagged version of dist to PyPI + if: repo == "warpnet/salt-lint" AND tag IS present AND branch == "master" AND type NOT IN (cron, pull_request) + before_install: [] + # Deploy a new release to PyPi for every new tag on the 'master' branch on the + # repository 'warpnet/salt-lint'. + deploy: + provider: pypi + user: __token__ + password: + # A PyPI API token can be generated by a PyPi maintainer on: + # https://pypi.org/help/#apitoken + # The API token in encrypted using `travis encrypt api-token`. + secure: "fL3/pkTaRA+cmTdC5Qxo9xoDoxXv6VbwbT3fM5JwW1F0NPbqR7Kw+oMJl2ZKQZrbRxvtPps8dYzxqC0axZ+WRFeVz+FzFeosziU/1kk1U5Bks5VK1my0kPl9jlD1kM0gS8mSm6gdNHJ6Z8quEXuYCMtMhqyCMgw0PWRaMOuuQ5Yi6/olUPjDxkMsFeh+03VIXTXGHPk7GxR3OTbOUaIaQXkbt7RQ7usDHnd1W6jeW5a1Q2h2cvugHfk6B9UYaXnIacCSejD4NJHkE+j3lbVI6QuzBO3MdaEM6V/+P3zDh0ZF9SK2BfXdNqMtCij/u8q0er+Y6ZU1LGDrRuXe6bmRr6KyJfiOsgKOCyLXSNqGGim01eJHO14DUgGrc8qWo1KKywtxagIriMcTxAOccW8RDRy3zkKYdEHgdFs6MtVL2JV+wyhdxxoU6DOZsNn6N8d9WninpAcIPtfiYzBRerQqR0OiKmpDK4Oee9IKCfRhMhWAY7Rs/RV33YluEJbv4bWPcPMPciEUp/xXxwPMWFQ45VoR4ZiwBYz0KoOMb/QrVfN8m8pdEtQpSUX51PFTFzmrreB6OvwJ5aphMrxIpvCJNZ65mfZthDKJUhSo0EG6ix/g4nOR7qlLNMVsQF4qSRCKDJlqUlzXYpQuy0u/QXoihCReO5rI6nWdV/KTfHCYgdo=" + on: + repo: warpnet/salt-lint + tags: true + branch: master + python: 3.7 - - language: generic - sudo: false - env: - HADOLINT: "${HOME}/hadolint" - install: - # Download hadolint binary and set it as executable - - curl -sL -o ${HADOLINT} "https://github.com/hadolint/hadolint/releases/download/v1.16.0/hadolint-$(uname -s)-$(uname -m)" - && chmod 700 ${HADOLINT} - script: - # List files which name starts with 'Dockerfile' - # eg. Dockerfile, Dockerfile.build, etc. - - git ls-files --exclude='Dockerfile*' --ignored | xargs --max-lines=1 ${HADOLINT} +install: + - pip install -r test-deps.txt + - pip install . -# Deploy a new release to PyPi for every new tag on the 'master' branch on the -# repository 'warpnet/salt-lint'. -deploy: - provider: pypi - user: __token__ - password: - # A PyPI API token can be generated by a PyPi maintainer on: - # https://pypi.org/help/#apitoken - # The API token in encrypted using `travis encrypt api-token`. - secure: "fL3/pkTaRA+cmTdC5Qxo9xoDoxXv6VbwbT3fM5JwW1F0NPbqR7Kw+oMJl2ZKQZrbRxvtPps8dYzxqC0axZ+WRFeVz+FzFeosziU/1kk1U5Bks5VK1my0kPl9jlD1kM0gS8mSm6gdNHJ6Z8quEXuYCMtMhqyCMgw0PWRaMOuuQ5Yi6/olUPjDxkMsFeh+03VIXTXGHPk7GxR3OTbOUaIaQXkbt7RQ7usDHnd1W6jeW5a1Q2h2cvugHfk6B9UYaXnIacCSejD4NJHkE+j3lbVI6QuzBO3MdaEM6V/+P3zDh0ZF9SK2BfXdNqMtCij/u8q0er+Y6ZU1LGDrRuXe6bmRr6KyJfiOsgKOCyLXSNqGGim01eJHO14DUgGrc8qWo1KKywtxagIriMcTxAOccW8RDRy3zkKYdEHgdFs6MtVL2JV+wyhdxxoU6DOZsNn6N8d9WninpAcIPtfiYzBRerQqR0OiKmpDK4Oee9IKCfRhMhWAY7Rs/RV33YluEJbv4bWPcPMPciEUp/xXxwPMWFQ45VoR4ZiwBYz0KoOMb/QrVfN8m8pdEtQpSUX51PFTFzmrreB6OvwJ5aphMrxIpvCJNZ65mfZthDKJUhSo0EG6ix/g4nOR7qlLNMVsQF4qSRCKDJlqUlzXYpQuy0u/QXoihCReO5rI6nWdV/KTfHCYgdo=" - on: - repo: warpnet/salt-lint - tags: true - branch: master - python: 3.6 - condition: "$TOXENV = py36" +script: + - coverage run --source=saltlint setup.py test + - coveralls diff --git a/README.md b/README.md index b1052b4..ec8a76c 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Options: -L list all the rules -r RULESDIR specify one or more rules directories using one or more -r arguments. Any -r flags override the default - rules in /path/to/salt-lint/saltlint/rules, unless + rules in /path/to/salt-lint/saltlint/rules, unless -R is also used. -R Use default rules in /path/to/salt-lint/saltlint/rules in addition to any @@ -54,6 +54,7 @@ Options: path to directories or files to skip. This option is repeatable. --json parse the output as JSON + --severity add the severity to the standard output -c C Specify configuration file to use. Defaults to ".salt-lint" ``` @@ -112,6 +113,7 @@ rules: *.jinja 210: ignore: 'exclude_this_file.sls' +severity: True ``` ## Pre-commit Setup @@ -134,7 +136,6 @@ To use salt-lint with [pre-commit](https://pre-commit.com), just add the follow # Rules - ## List of rules Rule | Description @@ -142,7 +143,7 @@ Rule | Description [201](https://github.com/warpnet/salt-lint/wiki/201) | Trailing whitespace [202](https://github.com/warpnet/salt-lint/wiki/202) | Jinja statement should have spaces before and after: `{% statement %}` [203](https://github.com/warpnet/salt-lint/wiki/203) | Most files should not contain tabs -[204](https://github.com/warpnet/salt-lint/wiki/204) | Lines should be no longer that 160 chars +[204](https://github.com/warpnet/salt-lint/wiki/204) | Lines should be no longer than 160 chars [205](https://github.com/warpnet/salt-lint/wiki/205) | Use ".sls" as a Salt State file extension [206](https://github.com/warpnet/salt-lint/wiki/206) | Jinja variables should have spaces before and after `{{ var_name }}` [207](https://github.com/warpnet/salt-lint/wiki/207) | File modes should always be encapsulated in quotation marks @@ -152,7 +153,6 @@ Rule | Description [211](https://github.com/warpnet/salt-lint/wiki/211) | `pillar.get` or `grains.get` should be formatted differently [212](https://github.com/warpnet/salt-lint/wiki/212) | Most files should not contain irregular spaces - ## False Positives: Skipping Rules Some rules are bit of a rule of thumb. To skip a specific rule for a specific task, inside your state add `# noqa [rule_id]` at the end of the line. You can skip multiple rules via a space-separated list. Example: @@ -163,6 +163,32 @@ Some rules are bit of a rule of thumb. To skip a specific rule for a specific ta - source: salt://{{unspaced_var}}/example # noqa: 206 ``` +# Plugins + +Currently, there is a `salt-lint` plugin available for the following applications: + +Application | GitHub Link | Store/Marketplace +:-:|:--|:-- +Visual Studio Code | [warpnet/vscode-salt-lint](https://github.com/warpnet/vscode-salt-lint) | [VisualStudio Marketplace](https://marketplace.visualstudio.com/items?itemName=warpnet.salt-lint) +Sublime Text | [warpnet/SublimeLinter-salt-lint](https://github.com/warpnet/SublimeLinter-salt-lint) | [Package Control](https://packagecontrol.io/packages/SublimeLinter-contrib-salt-lint) + +Wish to create a `salt-lint` extension for your favourite editor? We're always looking for [contributions](CONTRIBUTING.md)! + +# Fix common issues + +`sed` might be one of the better tools to fix common issues, as shown in commands below. + +**Note**: these commands assume your current working directory is the salt (states) directory/repository. + +Fix spacing arround `{{ var_name }}`, eg. `{{env}}` --> `{{ env }}`:\ +`sed -i -E "s/\{\{\s?([^}]*[^} ])\s?\}\}/\{\{ \1 \}\}/g" $(find . -name '*.sls')` + +Make the `dir_mode`, `file_mode` and `mode` arguments in the desired syntax:\ +`sed -i -E "s/\b(dir_|file_|)mode: 0?([0-7]{3})/\1mode: '0\2'/" $(find . -name '*.sls')` + +Add quotes arround numeric values that start with a `0`:\ +`sed -i -E "s/\b(minute|hour): (0[0-7]?)\$/\1: '\2'/" $(find . -name '*.sls')` + # Authors The project is heavily based on [ansible-lint](https://github.com/ansible/ansible-lint), with the modified work by [Warpnet B.V.](https://github.com/warpnet). [ansible-lint](https://github.com/ansible/ansible-lint) was created by [Will Thames](https://github.com/willthames) and is now maintained as part of the [Ansible](https://www.ansible.com/) by [Red Hat](https://www.redhat.com) project. diff --git a/docker/Dockerfile b/docker/Dockerfile index abc50f9..362e7d4 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -6,7 +6,7 @@ LABEL maintainer="info@warpnet.nl" RUN apk add --no-cache gcc g++ build-base libzmq musl-dev zeromq-dev # Install the salt-lint package -RUN pip install --no-cache salt-lint==v0.1.0 +RUN pip install --no-cache salt-lint==v0.2.0 # Remove development utilities RUN apk del --no-cache gcc g++ build-base libzmq musl-dev zeromq-dev \ diff --git a/saltlint/__init__.py b/saltlint/__init__.py index 086232a..1787459 100644 --- a/saltlint/__init__.py +++ b/saltlint/__init__.py @@ -5,7 +5,7 @@ """ NAME = 'salt-lint' -VERSION = '0.1.0' +VERSION = '0.2.0' DESCRIPTION = __doc__ __author__ = 'Warpnet B.V.' diff --git a/saltlint/__main__.py b/saltlint/__main__.py index 1479c67..3061793 100644 --- a/saltlint/__main__.py +++ b/saltlint/__main__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Copyright (c) 2013-2014 Will Thames -# Modified work Copyright (c) 2019 Roald Nefs +# Modified work Copyright (c) 2019 Warpnet B.V. import sys import errno diff --git a/saltlint/cli.py b/saltlint/cli.py index 8ef1de8..fd7845f 100644 --- a/saltlint/cli.py +++ b/saltlint/cli.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Copyright (c) 2013-2014 Will Thames -# Modified work Copyright (c) 2019 Roald Nefs +# Modified work Copyright (c) 2019 Warpnet B.V. from __future__ import print_function @@ -52,11 +52,11 @@ def run(args=None): parser.add_option('-x', dest='skip_list', default=[], action='append', help="only check rules whose id/tags do not " + "match these values") - parser.add_option('--nocolor', dest='colored', + parser.add_option('--nocolor', '--nocolour', dest='colored', default=hasattr(sys.stdout, 'isatty') and sys.stdout.isatty(), action='store_false', help="disable colored output") - parser.add_option('--force-color', dest='colored', + parser.add_option('--force-color', '--force-colour', dest='colored', action='store_true', help="Try force colored output (relying on salt's code)") parser.add_option('--exclude', dest='exclude_paths', action='append', @@ -65,6 +65,8 @@ def run(args=None): default=[]) parser.add_option('--json', dest='json', action='store_true', default=False, help='parse the output as JSON') + parser.add_option('--severity', dest='severity', action='store_true', default=False, + help='add the severity to the standard output') parser.add_option('-c', help='Specify configuration file to use. Defaults to ".salt-lint"') (options, parsed_args) = parser.parse_args(args if args is not None else sys.argv[1:]) @@ -111,6 +113,8 @@ def run(args=None): # Define the formatter if config.json: formatter = formatters.JsonFormatter() + elif config.severity: + formatter = formatters.SeverityFormatter() else: formatter = formatters.Formatter() diff --git a/saltlint/config.py b/saltlint/config.py index 65202f6..064491e 100644 --- a/saltlint/config.py +++ b/saltlint/config.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2019 Roald Nefs +# Copyright (c) 2019 Warpnet B.V. import yaml import os @@ -97,6 +97,13 @@ def _parse(self, content): # Parse json self.json = self._options.get('json', False) + if 'json' in config: + self.json = config['json'] + + # Parse add severity + self.severity = self._options.get('severity', False) + if 'severity' in config: + self.severity = config['severity'] # Parse rule specific configuration, the configration can be listed by # the rule ID and/or tag. diff --git a/saltlint/formatters/__init__.py b/saltlint/formatters/__init__.py index ab7abf8..f8b0a8f 100644 --- a/saltlint/formatters/__init__.py +++ b/saltlint/formatters/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (c) 2013-2018 Will Thames # Copyright (c) 2018 Ansible by Red Hat -# Modified work Copyright (c) 2019 Roald Nefs +# Modified work Copyright (c) 2019 Warpnet B.V. import json @@ -42,6 +42,39 @@ def format(self, match, colored=False): match.line) +class SeverityFormatter(object): + def process(self, matches, colored=False): + for match in matches: + print(self.format(match, colored)) + + def format(self, match, colored=False): + formatstr = u"{0} {sev} {1}\n{2}:{3}\n{4}\n" + + if colored: + color = saltcolor.get_colors() + return formatstr.format( + u'{0}[{1}]{2}'.format(color['RED'], match.rule.id, + color['ENDC']), + u'{0}{1}{2}'.format(color['LIGHT_RED'], match.message, + color['ENDC']), + u'{0}{1}{2}'.format(color['BLUE'], match.filename, + color['ENDC']), + u'{0}{1}{2}'.format(color['CYAN'], str(match.linenumber), + color['ENDC']), + u'{0}{1}{2}'.format(color['MAGENTA'], match.line, color['ENDC']), + sev=u'{0}[{1}]{2}'.format(color['RED'], match.rule.severity, + color['ENDC']) + ) + else: + return formatstr.format( + u'[{0}]'.format(match.rule.id), + match.message, + match.filename, + match.linenumber, + match.line, + sev=u'[{0}]'.format(match.rule.severity)) + + class JsonFormatter(object): def process(self, matches, *args, **kwargs): diff --git a/saltlint/linter.py b/saltlint/linter.py index 22290a8..bb818f2 100644 --- a/saltlint/linter.py +++ b/saltlint/linter.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Copyright (c) 2013-2014 Will Thames -# Modified work Copyright (c) 2019 Roald Nefs +# Modified work Copyright (c) 2019 Warpnet B.V. from __future__ import print_function @@ -100,7 +100,7 @@ def run(self, statefile, tags=set(), skip_list=frozenset()): with codecs.open(statefile['path'], mode='rb', encoding='utf-8') as f: text = f.read() except IOError as e: - print("WARNING: Coudn't open %s - %s" % + print("WARNING: Couldn't open %s - %s" % (statefile['path'], e.strerror), file=sys.stderr) return matches @@ -111,7 +111,7 @@ def run(self, statefile, tags=set(), skip_list=frozenset()): rule_definition = set(rule.tags) rule_definition.add(rule.id) - # Check if the the file is in the rule specific ignore list. + # Check if the file is in the rule specific ignore list. for definition in rule_definition: if self.config.is_file_ignored(statefile['path'], definition): skip = True diff --git a/saltlint/rules/FileExtensionRule.py b/saltlint/rules/FileExtensionRule.py index afe39f5..58255b8 100644 --- a/saltlint/rules/FileExtensionRule.py +++ b/saltlint/rules/FileExtensionRule.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2016, Tsukinowa Inc. -# Copyright (c) 2018, Ansible Project -# Modified work Copyright (c) 2019 Roald Nefs +# Copyright (c) 2016 Tsukinowa Inc. +# Copyright (c) 2018 Ansible Project +# Modified work Copyright (c) 2019 Warpnet B.V. from saltlint.linter import SaltLintRule diff --git a/saltlint/rules/FileModeLeadingZeroRule.py b/saltlint/rules/FileModeLeadingZeroRule.py index fd1a71a..aa59c37 100644 --- a/saltlint/rules/FileModeLeadingZeroRule.py +++ b/saltlint/rules/FileModeLeadingZeroRule.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2016, Will Thames and contributors -# Copyright (c) 2018, Ansible Project -# Modified work Copyright (c) 2019 Jeffrey Bouter +# Copyright (c) 2016 Will Thames and contributors +# Copyright (c) 2018 Ansible Project +# Modified work Copyright (c) 2019 Warpnet B.V. from saltlint.linter import SaltLintRule import re diff --git a/saltlint/rules/FileModeQuotationRule.py b/saltlint/rules/FileModeQuotationRule.py index 367aabb..1425d44 100644 --- a/saltlint/rules/FileModeQuotationRule.py +++ b/saltlint/rules/FileModeQuotationRule.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2016, Will Thames and contributors -# Copyright (c) 2018, Ansible Project -# Modified work Copyright (c) 2019 Jeffrey Bouter +# Copyright (c) 2016 Will Thames and contributors +# Copyright (c) 2018 Ansible Project +# Modified work Copyright (c) 2019 Warpnet B.V. from saltlint.linter import SaltLintRule import re diff --git a/saltlint/rules/JinjaCommentHasSpacesRule.py b/saltlint/rules/JinjaCommentHasSpacesRule.py index efbe7f4..9d25efb 100644 --- a/saltlint/rules/JinjaCommentHasSpacesRule.py +++ b/saltlint/rules/JinjaCommentHasSpacesRule.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2016, Will Thames and contributors -# Copyright (c) 2018, Ansible Project -# Modified work Copyright (c) 2019 Roald Nefs +# Copyright (c) 2016 Will Thames and contributors +# Copyright (c) 2018 Ansible Project +# Modified work Copyright (c) 2019 Warpnet B.V. from saltlint.linter import SaltLintRule import re diff --git a/saltlint/rules/JinjaPillarGrainsGetFormatRule.py b/saltlint/rules/JinjaPillarGrainsGetFormatRule.py index 88e8271..ff2ee59 100644 --- a/saltlint/rules/JinjaPillarGrainsGetFormatRule.py +++ b/saltlint/rules/JinjaPillarGrainsGetFormatRule.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2016, Will Thames and contributors -# Copyright (c) 2018, Ansible Project -# Modified work Copyright (c) 2019 Jeffrey Bouter +# Copyright (c) 2016 Will Thames and contributors +# Copyright (c) 2018 Ansible Project +# Modified work Copyright (c) 2019 Warpnet B.V. from saltlint.linter import SaltLintRule import re diff --git a/saltlint/rules/JinjaStatementHasSpacesRule.py b/saltlint/rules/JinjaStatementHasSpacesRule.py index da60159..bbd7e6e 100644 --- a/saltlint/rules/JinjaStatementHasSpacesRule.py +++ b/saltlint/rules/JinjaStatementHasSpacesRule.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2016, Will Thames and contributors -# Copyright (c) 2018, Ansible Project -# Modified work Copyright (c) 2019 Roald Nefs +# Copyright (c) 2016 Will Thames and contributors +# Copyright (c) 2018 Ansible Project +# Modified work Copyright (c) 2019 Warpnet B.V. from saltlint.linter import SaltLintRule import re diff --git a/saltlint/rules/JinjaVariableHasSpacesRule.py b/saltlint/rules/JinjaVariableHasSpacesRule.py index 1b447ba..3957a90 100644 --- a/saltlint/rules/JinjaVariableHasSpacesRule.py +++ b/saltlint/rules/JinjaVariableHasSpacesRule.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2016, Will Thames and contributors -# Copyright (c) 2018, Ansible Project -# Modified work Copyright (c) 2019 Roald Nefs +# Copyright (c) 2016 Will Thames and contributors +# Copyright (c) 2018 Ansible Project +# Modified work Copyright (c) 2019 Warpnet B.V. from saltlint.linter import SaltLintRule import re diff --git a/saltlint/rules/LineTooLongRule.py b/saltlint/rules/LineTooLongRule.py index c3c999f..d3b5537 100644 --- a/saltlint/rules/LineTooLongRule.py +++ b/saltlint/rules/LineTooLongRule.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2016, Will Thames and contributors -# Copyright (c) 2018, Ansible Project -# Modified work Copyright (c) 2019 Roald Nefs +# Copyright (c) 2016 Will Thames and contributors +# Copyright (c) 2018 Ansible Project +# Modified work Copyright (c) 2019 Warpnet B.V. from saltlint.linter import SaltLintRule diff --git a/saltlint/rules/NoTabsRule.py b/saltlint/rules/NoTabsRule.py index 97d4ea3..a143f52 100644 --- a/saltlint/rules/NoTabsRule.py +++ b/saltlint/rules/NoTabsRule.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2016, Will Thames and contributors -# Copyright (c) 2018, Ansible Project -# Modified work Copyright (c) 2019 Roald Nefs +# Copyright (c) 2016 Will Thames and contributors +# Copyright (c) 2018 Ansible Project +# Modified work Copyright (c) 2019 Warpnet B.V. from saltlint.linter import SaltLintRule diff --git a/saltlint/rules/TrailingWhitespaceRule.py b/saltlint/rules/TrailingWhitespaceRule.py index 2dc2828..199e3d5 100644 --- a/saltlint/rules/TrailingWhitespaceRule.py +++ b/saltlint/rules/TrailingWhitespaceRule.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Copyright (c) 2013-2014 Will Thames -# Modified work Copyright (c) 2019 Roald Nefs +# Modified work Copyright (c) 2019 Warpnet B.V. from saltlint.linter import SaltLintRule diff --git a/saltlint/rules/YamlHasOctalValueRule.py b/saltlint/rules/YamlHasOctalValueRule.py index 7100a68..1ec3c9d 100644 --- a/saltlint/rules/YamlHasOctalValueRule.py +++ b/saltlint/rules/YamlHasOctalValueRule.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2016, Will Thames and contributors -# Copyright (c) 2018, Ansible Project -# Modified work Copyright (c) 2019 Roald Nefs +# Copyright (c) 2016 Will Thames and contributors +# Copyright (c) 2018 Ansible Project +# Modified work Copyright (c) 2019 Warpnet B.V. from saltlint.linter import SaltLintRule import re diff --git a/saltlint/utils.py b/saltlint/utils.py index c9a76ab..6d01e0e 100644 --- a/saltlint/utils.py +++ b/saltlint/utils.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Copyright (c) 2013-2014 Will Thames -# Modified work Copyright (c) 2019 Roald Nefs +# Modified work Copyright (c) 2019 Warpnet B.V. import glob import imp diff --git a/test-deps.txt b/test-deps.txt index 4283f38..02187e2 100644 --- a/test-deps.txt +++ b/test-deps.txt @@ -1,2 +1,3 @@ +coveralls flake8 nose diff --git a/tests/__init__.py b/tests/__init__.py index d20be8d..316e73a 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,6 +1,6 @@ # Copyright (c) 2013-2018 Will Thames # Copyright (c) 2018 Ansible by Red Hat -# Modified work Copyright (c) 2019 Roald Nefs +# Modified work Copyright (c) 2019 Warpnet B.V. import tempfile diff --git a/tests/unit/TestConfig.py b/tests/unit/TestConfig.py index 48094ba..b23c32a 100644 --- a/tests/unit/TestConfig.py +++ b/tests/unit/TestConfig.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2019 Roald Nefs +# Copyright (c) 2019 Warpnet B.V. import unittest import tempfile diff --git a/tests/unit/TestFileExtension.py b/tests/unit/TestFileExtension.py index 8852a37..667054c 100644 --- a/tests/unit/TestFileExtension.py +++ b/tests/unit/TestFileExtension.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2019 Roald Nefs +# Copyright (c) 2019 Warpnet B.V. import unittest diff --git a/tests/unit/TestFileModeLeadingZeroRule.py b/tests/unit/TestFileModeLeadingZeroRule.py index 3ef8f05..30156bf 100644 --- a/tests/unit/TestFileModeLeadingZeroRule.py +++ b/tests/unit/TestFileModeLeadingZeroRule.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (c) 2013-2018 Will Thames # Copyright (c) 2018 Ansible by Red Hat -# Modified work Copyright (c) 2019 Jeffrey Bouter +# Modified work Copyright (c) 2019 Warpnet B.V. import unittest diff --git a/tests/unit/TestFileModeQuotationRule.py b/tests/unit/TestFileModeQuotationRule.py index b98937c..13fcff1 100644 --- a/tests/unit/TestFileModeQuotationRule.py +++ b/tests/unit/TestFileModeQuotationRule.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (c) 2013-2018 Will Thames # Copyright (c) 2018 Ansible by Red Hat -# Modified work Copyright (c) 2019 Jeffrey Bouter +# Modified work Copyright (c) 2019 Warpnet B.V. import unittest diff --git a/tests/unit/TestJinjaCommentHasSpaces.py b/tests/unit/TestJinjaCommentHasSpaces.py index da91c69..d8dae99 100644 --- a/tests/unit/TestJinjaCommentHasSpaces.py +++ b/tests/unit/TestJinjaCommentHasSpaces.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (c) 2013-2018 Will Thames # Copyright (c) 2018 Ansible by Red Hat -# Modified work Copyright (c) 2019 Roald Nefs +# Modified work Copyright (c) 2019 Warpnet B.V. import unittest diff --git a/tests/unit/TestJinjaPillarGrainsGetFormatRule.py b/tests/unit/TestJinjaPillarGrainsGetFormatRule.py index 4a843d0..84e9d7e 100644 --- a/tests/unit/TestJinjaPillarGrainsGetFormatRule.py +++ b/tests/unit/TestJinjaPillarGrainsGetFormatRule.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (c) 2013-2018 Will Thames # Copyright (c) 2018 Ansible by Red Hat -# Modified work Copyright (c) 2019 Jeffrey Bouter +# Modified work Copyright (c) 2019 Warpnet B.V. import unittest diff --git a/tests/unit/TestJinjaStatementHasSpaces.py b/tests/unit/TestJinjaStatementHasSpaces.py index 375faea..9e965af 100644 --- a/tests/unit/TestJinjaStatementHasSpaces.py +++ b/tests/unit/TestJinjaStatementHasSpaces.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (c) 2013-2018 Will Thames # Copyright (c) 2018 Ansible by Red Hat -# Modified work Copyright (c) 2019 Roald Nefs +# Modified work Copyright (c) 2019 Warpnet B.V. import unittest diff --git a/tests/unit/TestJinjaVariableHasSpaces.py b/tests/unit/TestJinjaVariableHasSpaces.py index 6f8efb9..a066818 100644 --- a/tests/unit/TestJinjaVariableHasSpaces.py +++ b/tests/unit/TestJinjaVariableHasSpaces.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (c) 2013-2018 Will Thames # Copyright (c) 2018 Ansible by Red Hat -# Modified work Copyright (c) 2019 Roald Nefs +# Modified work Copyright (c) 2019 Warpnet B.V. import unittest diff --git a/tests/unit/TestLineTooLong.py b/tests/unit/TestLineTooLong.py index 86c2a7f..07b6169 100644 --- a/tests/unit/TestLineTooLong.py +++ b/tests/unit/TestLineTooLong.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (c) 2013-2018 Will Thames # Copyright (c) 2018 Ansible by Red Hat -# Modified work Copyright (c) 2019 Roald Nefs +# Modified work Copyright (c) 2019 Warpnet B.V. import unittest diff --git a/tests/unit/TestNoTabsRule.py b/tests/unit/TestNoTabsRule.py index 3fac152..ba336ff 100644 --- a/tests/unit/TestNoTabsRule.py +++ b/tests/unit/TestNoTabsRule.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (c) 2013-2018 Will Thames # Copyright (c) 2018 Ansible by Red Hat -# Modified work Copyright (c) 2019 Roald Nefs +# Modified work Copyright (c) 2019 Warpnet B.V. import unittest diff --git a/tests/unit/TestRunner.py b/tests/unit/TestRunner.py index 8e8cad5..62eea64 100644 --- a/tests/unit/TestRunner.py +++ b/tests/unit/TestRunner.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2019 Roald Nefs +# Copyright (c) 2019 Warpnet B.V. import unittest diff --git a/tests/unit/TestSkipRule.py b/tests/unit/TestSkipRule.py index c290145..7264c29 100644 --- a/tests/unit/TestSkipRule.py +++ b/tests/unit/TestSkipRule.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (c) 2013-2018 Will Thames # Copyright (c) 2018 Ansible by Red Hat -# Modified work Copyright (c) 2019 Roald Nefs +# Modified work Copyright (c) 2019 Warpnet B.V. import unittest diff --git a/tests/unit/TestTrailingWhitespaceRule.py b/tests/unit/TestTrailingWhitespaceRule.py index e7b6dbc..6f54abf 100644 --- a/tests/unit/TestTrailingWhitespaceRule.py +++ b/tests/unit/TestTrailingWhitespaceRule.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (c) 2013-2018 Will Thames # Copyright (c) 2018 Ansible by Red Hat -# Modified work Copyright (c) 2019 Roald Nefs +# Modified work Copyright (c) 2019 Warpnet B.V. import unittest diff --git a/tests/unit/TestYamlHasOctalValueRule.py b/tests/unit/TestYamlHasOctalValueRule.py index 0921bf1..46b0495 100644 --- a/tests/unit/TestYamlHasOctalValueRule.py +++ b/tests/unit/TestYamlHasOctalValueRule.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (c) 2013-2018 Will Thames # Copyright (c) 2018 Ansible by Red Hat -# Modified work Copyright (c) 2019 Roald Nefs +# Modified work Copyright (c) 2019 Warpnet B.V. import unittest diff --git a/tox.ini b/tox.ini deleted file mode 100644 index e2a28e7..0000000 --- a/tox.ini +++ /dev/null @@ -1,19 +0,0 @@ -[tox] -minversion = 3.5.3 -envlist = flake8-py{37,36,35,27}-salt -skip_missing_interpreters = True - -[testenv] -passenv = HOME TRAVIS TRAVIS_* -deps = - salt - coveralls - -rtest-deps.txt -commands = - coverage run --source=saltlint setup.py test - coveralls - -[testenv:flake8] -deps = flake8 -commands = flake8 -usedevelop = True