Skip to content
Snippets Groups Projects
Unverified Commit 2322ff67 authored by Imran Iqbal's avatar Imran Iqbal
Browse files

ci(yamllint): add rule `empty-values` & use new `yaml-files` setting

* Semi-automated using https://github.com/myii/ssf-formula/pull/27
* Fix (or ignore) errors shown below:

```bash
mysql-formula$ yamllint -s .
./mysql/osfamilymap.yaml
  46:14     error    empty value in block mapping  (empty-values)
  66:14     error    empty value in block mapping  (empty-values)
  67:14     error    empty value in block mapping  (empty-values)
  68:16     error    empty value in block mapping  (empty-values)
  69:17     error    empty value in block mapping  (empty-values)
  70:16     error    empty value in block mapping  (empty-values)
  87:7      error    empty value in block mapping  (empty-values)
  216:14    error    empty value in block mapping  (empty-values)
  217:17    error    empty value in block mapping  (empty-values)

./mysql/defaults.yaml
  29:10     error    empty value in block mapping  (empty-values)
  30:11     error    empty value in block mapping  (empty-values)
```
parent ef367666
Branches
Tags
No related merge requests found
...@@ -56,9 +56,9 @@ jobs: ...@@ -56,9 +56,9 @@ jobs:
before_install: skip before_install: skip
script: script:
# Install and run `yamllint` # Install and run `yamllint`
- pip install --user yamllint # Need at least `v1.17.0` for the `yaml-files` setting
# yamllint disable-line rule:line-length - pip install --user yamllint>=1.17.0
- yamllint -s . .yamllint pillar.example test/salt/pillar/mysql.sls - yamllint -s .
# Install and run `commitlint` # Install and run `commitlint`
- npm install @commitlint/config-conventional -D - npm install @commitlint/config-conventional -D
- npm install @commitlint/travis-cli -D - npm install @commitlint/travis-cli -D
......
...@@ -6,12 +6,26 @@ extends: default ...@@ -6,12 +6,26 @@ extends: default
# Files to ignore completely # Files to ignore completely
# 1. All YAML files under directory `node_modules/`, introduced during the Travis run # 1. All YAML files under directory `node_modules/`, introduced during the Travis run
# 2. Any YAML files using Jinja (result in `yamllint` syntax errors) # 2. Any SLS files under directory `test/`, which are actually state files
# 3. Any YAML files using Jinja (result in `yamllint` syntax errors)
ignore: | ignore: |
node_modules/ node_modules/
test/**/states/**/*.sls
mysql/supported_sections.yaml mysql/supported_sections.yaml
yaml-files:
# Default settings
- '*.yaml'
- '*.yml'
- .yamllint
# SaltStack Formulas additional settings
- '*.example'
- test/**/*.sls
rules: rules:
empty-values:
forbid-in-block-mappings: true
forbid-in-flow-mappings: true
line-length: line-length:
# Increase from default of `80` # Increase from default of `80`
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`) # Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
......
...@@ -26,8 +26,9 @@ mysql: ...@@ -26,8 +26,9 @@ mysql:
macos: macos:
userhomes: /Users userhomes: /Users
user: # `user` and `group` are set from `map.jinja`
group: # user: ~
# group: ~
dl: dl:
tmpdir: /tmp/mysqltmp tmpdir: /tmp/mysqltmp
prefix: /usr/local prefix: /usr/local
......
...@@ -43,7 +43,7 @@ RedHat: ...@@ -43,7 +43,7 @@ RedHat:
config: config:
file: /etc/my.cnf file: /etc/my.cnf
sections: sections:
client: client: {}
mysqld_safe: mysqld_safe:
log_error: /var/log/mysql/mysqld.log log_error: /var/log/mysql/mysqld.log
pid_file: /var/run/mysql/mysqld.pid pid_file: /var/run/mysql/mysqld.pid
...@@ -63,11 +63,14 @@ Suse: ...@@ -63,11 +63,14 @@ Suse:
client: client:
socket: /var/run/mysql/mysql.sock socket: /var/run/mysql/mysql.sock
mysqld: mysqld:
# Empty values below to be resolved, disabling the rule in the meantime
# yamllint disable rule:empty-values
port: port:
user: user:
socket: socket:
datadir: datadir:
tmpdir: tmpdir:
# yamllint enable rule:empty-values
innodb_file_format: Barracuda innodb_file_format: Barracuda
innodb_file_per_table: 'ON' innodb_file_per_table: 'ON'
server-id: 1 server-id: 1
...@@ -84,6 +87,8 @@ Arch: ...@@ -84,6 +87,8 @@ Arch:
clientpkg: mariadb-clients clientpkg: mariadb-clients
service: mysqld service: mysqld
pythonpkg: mysql-python pythonpkg: mysql-python
# Empty value below to be resolved, disabling the rule in the meantime
# yamllint disable-line rule:empty-values
dev: dev:
config: config:
...@@ -213,8 +218,11 @@ FreeBSD: ...@@ -213,8 +218,11 @@ FreeBSD:
client: client:
socket: /tmp/mysql.sock socket: /tmp/mysql.sock
mysqld: mysqld:
# Empty values below to be resolved, disabling the rule in the meantime
# yamllint disable rule:empty-values
user: user:
datadir: datadir:
# yamllint enable rule:empty-values
socket: /tmp/mysql.sock socket: /tmp/mysql.sock
skip-external-locking: noarg_present skip-external-locking: noarg_present
key_buffer_size: 16M key_buffer_size: 16M
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment