Skip to content

Commit

Permalink
feat(yamllint): include for this repo and apply rules throughout
Browse files Browse the repository at this point in the history
* Semi-automated using `ssf-formula` (v0.5.0)
* Fix errors shown below:

```bash
influxdb-formula$ $(grep "\- yamllint" .travis.yml | sed -e "s:^\s\+-\s\(.*\):\1:")
./influxdb/config_defaults.yaml
  1:1       warning  missing document start "---"  (document-start)

./influxdb/defaults.yaml
  1:1       warning  missing document start "---"  (document-start)
  17:24     warning  truthy value should be one of [false, true]  (truthy)

pillar.example
  1:1       warning  missing document start "---"  (document-start)
  4:24      warning  truthy value should be one of [false, true]  (truthy)

test/salt/default/pillar/influxdb.sls
  5:24      warning  truthy value should be one of [false, true]  (truthy)
```
  • Loading branch information
myii committed Aug 25, 2019
1 parent 70f8d6f commit f9e638c
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 11 deletions.
13 changes: 9 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
---
stages:
- test
- commitlint
- lint
- name: release
if: branch = master AND type != pull_request

Expand Down Expand Up @@ -45,16 +45,21 @@ script:

jobs:
include:
# Define the commitlint stage
- stage: commitlint
# Define the `lint` stage (runs `yamllint` and `commitlint`)
- stage: lint
language: node_js
node_js: lts/*
before_install: skip
script:
# Install and run `yamllint`
- pip install --user yamllint
# yamllint disable-line rule:line-length
- yamllint -s . .yamllint pillar.example test/salt/pillar/influxdb.sls
# Install and run `commitlint`
- npm install @commitlint/config-conventional -D
- npm install @commitlint/travis-cli -D
- commitlint-travis
# Define the release stage that runs semantic-release
# Define the release stage that runs `semantic-release`
- stage: release
language: node_js
node_js: lts/*
Expand Down
16 changes: 16 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# Extend the `default` configuration provided by `yamllint`
extends: default

# Files to ignore completely
# 1. All YAML files under directory `node_modules/`, introduced during the Travis run
ignore: |
node_modules/
rules:
line-length:
# Increase from default of `80`
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
max: 88
10 changes: 6 additions & 4 deletions docs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ influxdb-formula
:scale: 100%
:target: https://github.com/semantic-release/semantic-release

Formula to set up and configure influxdb
Formula to set up and configure influxdb.

.. contents:: **Table of Contents**

Expand Down Expand Up @@ -47,7 +47,7 @@ Available states

``influxdb``
^^^^^^^^^^^^
Installs InfluxDB from [provided packages](http://influxdb.com/download/)
Installs InfluxDB from [provided packages](http://influxdb.com/download/).

At the moment you **have** to specify the InfluxDB version in the
``influxdb:version`` pillar.
Expand Down Expand Up @@ -83,12 +83,13 @@ Requirements
* Docker

.. code-block:: bash
$ gem install bundler
$ bundle install
$ bin/kitchen test [platform]
Where ``[platform]`` is the platform name defined in ``kitchen.yml``, e.g. ``debian-9-2019-2-py3``.

Where ``[platform]`` is the platform name defined in ``kitchen.yml``,
e.g. ``debian-9-2019-2-py3``.

``bin/kitchen converge``
^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -114,3 +115,4 @@ Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``veri
^^^^^^^^^^^^^^^^^^^^^

Gives you SSH access to the instance for manual testing.

3 changes: 3 additions & 0 deletions influxdb/config_defaults.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
'0':
'13':
admin:
Expand Down
5 changes: 4 additions & 1 deletion influxdb/defaults.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
influxdb:
config: '/etc/influxdb/influxdb.conf'
conf: {}
Expand All @@ -14,7 +17,7 @@ influxdb:
system_group: 'influxdb'
system_user: 'influxdb'
toml_module: toml
use_wget_on_install: True
use_wget_on_install: true
tmpl:
config: 'salt://influxdb/files/influxdb.config.jinja'
etc_default: 'salt://influxdb/files/influxdb.etc_default'
Expand Down
5 changes: 4 additions & 1 deletion pillar.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
influxdb:
version: 0.12.0
no_conf_defaults: false
use_wget_on_install: True
use_wget_on_install: true
logging:
directory: '/var/log/influxdb'
file: 'influxd.log'
Expand Down
4 changes: 3 additions & 1 deletion test/salt/pillar/influxdb.sls
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
influxdb:
version: 0.12.0
no_conf_defaults: false
use_wget_on_install: True
use_wget_on_install: true
logging:
directory: '/var/log/influxdb'
file: 'influxd.log'
Expand Down

0 comments on commit f9e638c

Please sign in to comment.