Ver código fonte

feat(yamllint): include for this repo and apply rules throughout

* Semi-automated using `ssf-formula` (v0.5.0)
* Fix errors shown below:

```bash
syslog-ng-formula$ $(grep "\- yamllint" .travis.yml | sed -e "s:^\s\+-\s\(.*\):\1:")
./syslog_ng/defaults.yml
  4:1       warning  missing document start "---"  (document-start)

./syslog_ng/os_family_map.yml
  4:1       warning  missing document start "---"  (document-start)

./syslog_ng/os_codename_map.yml
  5:1       warning  missing document start "---"  (document-start)

pillar.example
  1:1       warning  missing document start "---"  (document-start)
  3:3       error    wrong indentation: expected 4 but found 2  (indentation)
  5:3       error    wrong indentation: expected 4 but found 2  (indentation)
  7:3       error    wrong indentation: expected 4 but found 2  (indentation)
  10:3      error    wrong indentation: expected 4 but found 2  (indentation)
  10:15     warning  truthy value should be one of [false, true]  (truthy)
  11:14     warning  truthy value should be one of [false, true]  (truthy)
  12:15     warning  truthy value should be one of [false, true]  (truthy)
  13:20     warning  truthy value should be one of [false, true]  (truthy)
  14:22     warning  truthy value should be one of [false, true]  (truthy)
  15:21     warning  truthy value should be one of [false, true]  (truthy)
  17:3      error    wrong indentation: expected 4 but found 2  (indentation)
  18:5      error    wrong indentation: expected 6 but found 4  (indentation)
  20:5      error    wrong indentation: expected 6 but found 4  (indentation)
  22:7      error    wrong indentation: expected 8 but found 6  (indentation)
  25:3      error    wrong indentation: expected 4 but found 2  (indentation)
  26:5      error    wrong indentation: expected 6 but found 4  (indentation)
  27:7      error    wrong indentation: expected 8 but found 6  (indentation)
  29:5      error    wrong indentation: expected 6 but found 4  (indentation)
  31:5      error    wrong indentation: expected 6 but found 4  (indentation)
  33:5      error    wrong indentation: expected 6 but found 4  (indentation)
  35:5      error    wrong indentation: expected 6 but found 4  (indentation)
  37:3      error    wrong indentation: expected 4 but found 2  (indentation)
  38:5      error    wrong indentation: expected 6 but found 4  (indentation)
  40:5      error    wrong indentation: expected 6 but found 4  (indentation)
  42:5      error    wrong indentation: expected 6 but found 4  (indentation)
  45:3      error    wrong indentation: expected 4 but found 2  (indentation)

pillar.debian.example
  1:1       warning  missing document start "---"  (document-start)
  3:24      warning  truthy value should be one of [false, true]  (truthy)
  5:16      warning  truthy value should be one of [false, true]  (truthy)
  6:17      warning  truthy value should be one of [false, true]  (truthy)
  15:7      error    wrong indentation: expected 8 but found 6  (indentation)
  21:7      error    wrong indentation: expected 8 but found 6  (indentation)
  24:7      error    wrong indentation: expected 8 but found 6  (indentation)
  27:7      error    wrong indentation: expected 8 but found 6  (indentation)
  30:7      error    wrong indentation: expected 8 but found 6  (indentation)
  33:7      error    wrong indentation: expected 8 but found 6  (indentation)
  36:7      error    wrong indentation: expected 8 but found 6  (indentation)
  39:7      error    wrong indentation: expected 8 but found 6  (indentation)
  42:7      error    wrong indentation: expected 8 but found 6  (indentation)
  45:7      error    wrong indentation: expected 8 but found 6  (indentation)
  50:7      error    wrong indentation: expected 8 but found 6  (indentation)
  51:9      error    wrong indentation: expected 10 but found 8  (indentation)
  53:7      error    wrong indentation: expected 8 but found 6  (indentation)
  54:9      error    wrong indentation: expected 10 but found 8  (indentation)
  56:7      error    wrong indentation: expected 8 but found 6  (indentation)
  57:9      error    wrong indentation: expected 10 but found 8  (indentation)
  61:7      error    wrong indentation: expected 8 but found 6  (indentation)
  62:9      error    wrong indentation: expected 10 but found 8  (indentation)
  64:7      error    wrong indentation: expected 8 but found 6  (indentation)
  65:9      error    wrong indentation: expected 10 but found 8  (indentation)
  67:7      error    wrong indentation: expected 8 but found 6  (indentation)
  68:9      error    wrong indentation: expected 10 but found 8  (indentation)
  72:7      error    wrong indentation: expected 8 but found 6  (indentation)
  73:9      error    wrong indentation: expected 10 but found 8  (indentation)
  75:7      error    wrong indentation: expected 8 but found 6  (indentation)
  76:9      error    wrong indentation: expected 10 but found 8  (indentation)
  78:7      error    wrong indentation: expected 8 but found 6  (indentation)
  79:9      error    wrong indentation: expected 10 but found 8  (indentation)
  83:7      error    wrong indentation: expected 8 but found 6  (indentation)
  84:9      error    wrong indentation: expected 10 but found 8  (indentation)
  88:7      error    wrong indentation: expected 8 but found 6  (indentation)
  89:9      error    wrong indentation: expected 10 but found 8  (indentation)
  93:7      error    wrong indentation: expected 8 but found 6  (indentation)
  94:9      error    wrong indentation: expected 10 but found 8  (indentation)
  98:7      error    wrong indentation: expected 8 but found 6  (indentation)
  99:9      error    wrong indentation: expected 10 but found 8  (indentation)
  103:7     error    wrong indentation: expected 8 but found 6  (indentation)
  105:7     error    wrong indentation: expected 8 but found 6  (indentation)
  107:7     error    wrong indentation: expected 8 but found 6  (indentation)
  109:7     error    wrong indentation: expected 8 but found 6  (indentation)
  111:7     error    wrong indentation: expected 8 but found 6  (indentation)
  113:7     error    wrong indentation: expected 8 but found 6  (indentation)
  115:7     error    wrong indentation: expected 8 but found 6  (indentation)
  117:7     error    wrong indentation: expected 8 but found 6  (indentation)
  120:7     error    wrong indentation: expected 8 but found 6  (indentation)
  122:7     error    wrong indentation: expected 8 but found 6  (indentation)
  125:7     error    wrong indentation: expected 8 but found 6  (indentation)
  127:7     error    wrong indentation: expected 8 but found 6  (indentation)
  129:7     error    wrong indentation: expected 8 but found 6  (indentation)
  131:7     error    wrong indentation: expected 8 but found 6  (indentation)
  133:7     error    wrong indentation: expected 8 but found 6  (indentation)
  135:7     error    wrong indentation: expected 8 but found 6  (indentation)
  135:89    error    line too long (97 > 88 characters)  (line-length)
  137:7     error    wrong indentation: expected 8 but found 6  (indentation)
  139:7     error    wrong indentation: expected 8 but found 6  (indentation)
  141:7     error    wrong indentation: expected 8 but found 6  (indentation)
  143:7     error    wrong indentation: expected 8 but found 6  (indentation)
  145:7     error    wrong indentation: expected 8 but found 6  (indentation)
  147:7     error    wrong indentation: expected 8 but found 6  (indentation)
  149:7     error    wrong indentation: expected 8 but found 6  (indentation)
  151:7     error    wrong indentation: expected 8 but found 6  (indentation)
```
tags/v0.3.0
Imran Iqbal 5 anos atrás
pai
commit
a81ae52971
Nenhuma conta vinculada ao e-mail do autor do commit
8 arquivos alterados com 162 adições e 131 exclusões
  1. +9
    -4
      .travis.yml
  2. +16
    -0
      .yamllint
  3. +77
    -73
      pillar.debian.example
  4. +54
    -51
      pillar.example
  5. +1
    -1
      syslog_ng/defaults.yml
  6. +1
    -1
      syslog_ng/os_codename_map.yml
  7. +1
    -1
      syslog_ng/os_family_map.yml
  8. +3
    -0
      test/integration/default/inspec.yml

+ 9
- 4
.travis.yml Ver arquivo

@@ -2,22 +2,27 @@
# vim: ft=yaml
---
stages:
- commitlint
- lint
- name: release
if: branch = master AND type != pull_request

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 pillar.debian.example
# 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/*

+ 16
- 0
.yamllint Ver arquivo

@@ -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

+ 77
- 73
pillar.debian.example Ver arquivo

@@ -1,9 +1,12 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
syslog_ng:
options:
- chain_hostnames: no
- chain_hostnames: false
- flush_lines: 0
- use_dns: no
- use_fqdn: no
- use_dns: false
- use_fqdn: false
- owner: root
- group: adm
- perm: =0640
@@ -12,143 +15,144 @@ syslog_ng:

source:
- s_src:
- system: null
- internal: null
- system: null
- internal: null

destination:
# First some standard logfile
- d_auth:
- file:
- /var/log/auth.log
- file:
- /var/log/auth.log
- d_cron:
- file:
- /var/log/cron.log
- file:
- /var/log/cron.log
- d_daemon:
- file:
- /var/log/daemon.log
- file:
- /var/log/daemon.log
- d_kern:
- file:
- /var/log/kern.log
- file:
- /var/log/kern.log
- d_lpr:
- file:
- /var/log/lpr.log
- file:
- /var/log/lpr.log
- d_mail:
- file:
- /var/log/mail.log
- file:
- /var/log/mail.log
- d_syslog:
- file:
- /var/log/syslog
- file:
- /var/log/syslog
- d_user:
- file:
- /var/log/user.log
- file:
- /var/log/user.log
- d_uucp:
- file:
- /var/log/uucp.log
- file:
- /var/log/uucp.log

# This files are the log come from the mail subsystem.
- d_mailinfo:
- file:
- /var/log/mail.info
- file:
- /var/log/mail.info
- d_mailwarn:
- file:
- /var/log/mail.warn
- file:
- /var/log/mail.warn
- d_mailerr:
- file:
- /var/log/mail.err
- file:
- /var/log/mail.err

# Logging for INN news system
- d_newscrit:
- file:
- /var/log/news/news.crit
- file:
- /var/log/news/news.crit
- d_newserr:
- file:
- /var/log/news/news.err
- file:
- /var/log/news/news.err
- d_newsnotice:
- file:
- /var/log/news/news.notice
- file:
- /var/log/news/news.notice

# Some 'catch-all' logfiles
- d_debug:
- file:
- /var/log/debug
- file:
- /var/log/debug
- d_error:
- file:
- /var/log/error
- file:
- /var/log/error
- d_messages:
- file:
- /var/log/messages
- file:
- /var/log/messages

# The root's console.
- d_console:
- usertty:
- root
- usertty:
- root

# Virtual console.
- d_console_all:
- file:
- '`tty10`'
- file:
- '`tty10`'

# The named pipe /dev/xconsole is for the nsole' utility.
- d_xconsole:
- pipe:
- /dev/xconsole
- pipe:
- /dev/xconsole

# Debian only
- d_ppp:
- file:
- /var/log/ppp.log
- file:
- /var/log/ppp.log

filter:
- f_dbg:
- level: =debug
- level: =debug
- f_info:
- level: =info
- level: =info
- f_notice:
- level: =notice
- level: =notice
- f_warn:
- level: =warn
- level: =warn
- f_err:
- level: =err
- level: =err
- f_crit:
- level: =crit .. emerg
- level: =crit .. emerg
- f_error:
- level: =err .. emerg
- level: =err .. emerg
- f_console:
- level: =warn .. emerg
- level: =warn .. emerg

- f_debug:
- =level(debug) and not facility(auth, authpriv, news, mail)
- =level(debug) and not facility(auth, authpriv, news, mail)
- f_messages:
- =level(info,notice,warn) and not facility(auth,authpriv,cron,daemon,mail,news)
- =level(info,notice,warn) and not facility(auth,authpriv,cron,daemon,mail,news)

- f_auth:
- =facility(auth, authpriv) and not filter(f_debug)
- =facility(auth, authpriv) and not filter(f_debug)
- f_cron:
- =facility(cron) and not filter(f_debug)
- =facility(cron) and not filter(f_debug)
- f_daemon:
- =facility(daemon) and not filter(f_debug)
- =facility(daemon) and not filter(f_debug)
- f_kern:
- =facility(kern) and not filter(f_debug)
- =facility(kern) and not filter(f_debug)
- f_lpr:
- =facility(lpr) and not filter(f_debug)
- =facility(lpr) and not filter(f_debug)
- f_local:
- =facility(local0, local1, local3, local4, local5, local6, local7) and not filter(f_debug)
# yamllint disable-line rule:line-length
- =facility(local0, local1, local3, local4, local5, local6, local7) and not filter(f_debug)
- f_mail:
- =facility(mail) and not filter(f_debug)
- =facility(mail) and not filter(f_debug)
- f_news:
- =facility(news) and not filter(f_debug)
- =facility(news) and not filter(f_debug)
- f_syslog3:
- =not facility(auth, authpriv, mail) and not filter(f_debug)
- =not facility(auth, authpriv, mail) and not filter(f_debug)
- f_user:
- =facility(user) and not filter(f_debug)
- =facility(user) and not filter(f_debug)
- f_uucp:
- =facility(uucp) and not filter(f_debug)
- =facility(uucp) and not filter(f_debug)
- f_cnews:
- =level(notice, err, crit) and facility(news)
- =level(notice, err, crit) and facility(news)
- f_cother:
- =level(debug, info, notice, warn) or facility(daemon, mail)
- =level(debug, info, notice, warn) or facility(daemon, mail)
- f_ppp:
- =facility(local2) and not filter(f_debug)
- =facility(local2) and not filter(f_debug)

log:
-

+ 54
- 51
pillar.example Ver arquivo

@@ -1,61 +1,64 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
syslog_ng:
module:
- tfson
- tfson
include:
- scl.conf
- scl.conf
last_include:
- /etc/syslog-ng/conf.d/*.conf
- /etc/syslog-ng/conf.d/*.conf
version: 3.5
options:
- threaded: yes
- use_dns: no
- use_fqdn: yes
- keep_hostname: yes
- chain_hostnames: no
- check_hostname: no
- threaded: true
- use_dns: false
- use_fqdn: true
- keep_hostname: true
- chain_hostnames: false
- check_hostname: false
source:
- s_internal:
- internal: null
- s_local:
- unix-stream: /dev/log
- file:
- /proc/kmsg
- program_override: kernel
- s_internal:
- internal: null
- s_local:
- unix-stream: /dev/log
- file:
- /proc/kmsg
- program_override: kernel
destination:
- df_messages:
- file:
- /var/log/messages
- df_secure:
- file: /var/log/secure
- df_console:
- usertty: root
- dp_devnull:
- program: /bin/cat >/dev/null
- dr_central:
- syslog: my-remote.example.com
- df_messages:
- file:
- /var/log/messages
- df_secure:
- file: /var/log/secure
- df_console:
- usertty: root
- dp_devnull:
- program: /bin/cat >/dev/null
- dr_central:
- syslog: my-remote.example.com
filter:
- f_messages:
- level: =info..emerg
- f_secure:
- facility: =authpriv
- f_emerg:
- level: =emerg
- facility: =uucp, news
- f_messages:
- level: =info..emerg
- f_secure:
- facility: =authpriv
- f_emerg:
- level: =emerg
- facility: =uucp, news
log:
-
- source: =s_internal
- source: =s_local
- destination: =dr_central
-
- source: =s_local
- filter: =f_emerg
- destination: =df_console
-
- source: =s_local
- filter: =f_secure
- destination: =df_secure
- flags: =final
-
- source: =s_local
- filter: =f_messages
- destination: =df_messages
-
- source: =s_internal
- source: =s_local
- destination: =dr_central
-
- source: =s_local
- filter: =f_emerg
- destination: =df_console
-
- source: =s_local
- filter: =f_secure
- destination: =df_secure
- flags: =final
-
- source: =s_local
- filter: =f_messages
- destination: =df_messages

+ 1
- 1
syslog_ng/defaults.yml Ver arquivo

@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
syslog_ng: {}

+ 1
- 1
syslog_ng/os_codename_map.yml Ver arquivo

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# Debian
wheezy:
version: 3.3

+ 1
- 1
syslog_ng/os_family_map.yml Ver arquivo

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
Debian:
package: syslog-ng
service: syslog-ng

+ 3
- 0
test/integration/default/inspec.yml Ver arquivo

@@ -1,3 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
name: default
title: syslog_ng formula
maintainer: SaltStack Formulas

Carregando…
Cancelar
Salvar