From baf846f0777d2b5f9b1b1402513711d35293c342 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Wed, 30 Jan 2019 11:36:32 +0100 Subject: [PATCH] >add changed empty lines guideline --- CHANGELOG.md | 8 +------- README.md | 32 +++++++++++++++----------------- ansiblelater/__init__.py | 2 +- ansiblelater/rules/yamlfiles.py | 2 +- 4 files changed, 18 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af7cb9b..7e29d2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,2 @@ -- BUGFIX - - Error while vault file classification if file is a binary [#6](https://github.com/xoxys/ansible-later/issues/6) - - Wrong line number displayed when using normalized yaml [#3](https://github.com/xoxys/ansible-later/issues/3) - ENHANCEMENT - - Exclude include_vars from tasks that has to be named [#5](https://github.com/xoxys/ansible-later/issues/5) - - New rule: force `become` is not used without `become_user` [#4](https://github.com/xoxys/ansible-later/issues/4) - - New rule: bool values should be True/False or yes/no formatted [#2](https://github.com/xoxys/ansible-later/issues/2) - - New rule: jinja2 filters should be separated by spaces [#1](https://github.com/xoxys/ansible-later/issues/1) + - Dont be too restrictive and allow max. one empty line at the end of yaml files () diff --git a/README.md b/README.md index 14cc5f5..a126f53 100644 --- a/README.md +++ b/README.md @@ -18,22 +18,20 @@ The project name is an acronym for **L**ovely **A**utomation **TE**sting f**R**m ## Table of Content -- [ansible-later](#ansible-later) - - [Table of Content](#table-of-content) - - [Setup](#setup) - - [Using pip](#using-pip) - - [From source](#from-source) - - [Usage](#usage) - - [Configuration](#configuration) - - [Review a git repositories](#review-a-git-repositories) - - [Review a list of files](#review-a-list-of-files) - - [Buildin rules](#buildin-rules) - - [Build your own](#build-your-own) - - [The standards file](#the-standards-file) - - [Candidates](#candidates) - - [Minimal standards checks](#minimal-standards-checks) - - [License](#license) - - [Maintainers and Contributors](#maintainers-and-contributors) +- [Setup](#setup) + - [Using pip](#using-pip) + - [From source](#from-source) +- [Usage](#usage) + - [Configuration](#configuration) + - [Review a git repositories](#review-a-git-repositories) + - [Review a list of files](#review-a-list-of-files) + - [Buildin rules](#buildin-rules) +- [Build your own](#build-your-own) + - [The standards file](#the-standards-file) + - [Candidates](#candidates) + - [Minimal standards checks](#minimal-standards-checks) +- [License](#license) +- [Maintainers and Contributors](#maintainers-and-contributors) --- @@ -134,7 +132,7 @@ comes with a couple of built-in checks explained in the following table. | Rule | ID | Description | Parameter | |---------------------------------|-------------|-------------------------------------------------------------------|----------------------------------------------------------------------| -| check_yaml_empty_lines | LINT0001 | YAML should not contain unnecessarily empty lines. | {max: 1, max-start: 0, max-end: 0} | +| check_yaml_empty_lines | LINT0001 | YAML should not contain unnecessarily empty lines. | {max: 1, max-start: 0, max-end: 1} | | check_yaml_indent | LINT0002 | YAML should be correctly indented. | {spaces: 2, check-multi-line-strings: false, indent-sequences: true} | | check_yaml_hyphens | LINT0003 | YAML should use consitent number of spaces after hyphens (-). | {max-spaces-after: 1} | | check_yaml_document_start | LINT0004 | YAML should contain document start marker. | {document-start: {present: true}} | diff --git a/ansiblelater/__init__.py b/ansiblelater/__init__.py index 7ff2efe..18fdc14 100644 --- a/ansiblelater/__init__.py +++ b/ansiblelater/__init__.py @@ -1,6 +1,6 @@ __author__ = "Robert Kaussow" __project__ = "ansible-later" -__version__ = "0.1.2" +__version__ = "0.1.3" __license__ = "MIT" __maintainer__ = "Robert Kaussow" __email__ = "mail@geeklabor.de" diff --git a/ansiblelater/rules/yamlfiles.py b/ansiblelater/rules/yamlfiles.py index 9db2792..d703933 100644 --- a/ansiblelater/rules/yamlfiles.py +++ b/ansiblelater/rules/yamlfiles.py @@ -45,7 +45,7 @@ def check_native_yaml(candidate, settings): def check_yaml_empty_lines(candidate, settings): - options = "rules: {empty-lines: {max: 1, max-start: 0, max-end: 0}}" + options = "rules: {empty-lines: {max: 1, max-start: 0, max-end: 1}}" errors = run_yamllint(candidate, settings, options) return Result(candidate.path, errors)