Skip to content

Commit ddd1693

Browse files
authored
Merge pull request #292 from myii/ci/merge-rubocop-linter
ci(travis): merge `rubocop` linter into main `lint` job
2 parents 911317c + 2c82872 commit ddd1693

File tree

4 files changed

+20
-23
lines changed

4 files changed

+20
-23
lines changed

.travis.yml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,14 @@ stages:
2121
- name: release
2222
if: branch = master AND type != pull_request
2323
jobs:
24-
allow_failures:
25-
- env: Lint_rubocop
26-
fast_finish: true
2724
include:
2825
## Define the test stage that runs the linters (and testing matrix, if applicable)
2926

30-
# Run all of the linters in a single job (except `rubocop`)
27+
# Run all of the linters in a single job
3128
- language: node_js
3229
node_js: lts/*
3330
env: Lint
34-
name: 'Lint: salt-lint, yamllint & commitlint'
31+
name: 'Lint: salt-lint, yamllint, rubocop & commitlint'
3532
before_install: skip
3633
script:
3734
# Install and run `salt-lint`
@@ -42,21 +39,13 @@ jobs:
4239
# Need at least `v1.17.0` for the `yaml-files` setting
4340
- pip install --user yamllint>=1.17.0
4441
- yamllint -s .
42+
# Install and run `rubocop`
43+
- gem install rubocop
44+
- rubocop -d
4545
# Install and run `commitlint`
4646
- npm install @commitlint/config-conventional -D
4747
- npm install @commitlint/travis-cli -D
4848
- commitlint-travis
49-
# Run the `rubocop` linter in a separate job that is allowed to fail
50-
# Once these lint errors are fixed, this can be merged into a single job
51-
- language: node_js
52-
node_js: lts/*
53-
env: Lint_rubocop
54-
name: 'Lint: rubocop'
55-
before_install: skip
56-
script:
57-
# Install and run `rubocop`
58-
- gem install rubocop
59-
- rubocop -d
6049

6150
## Define the rest of the matrix based on Kitchen testing
6251
# Make sure the instances listed below match up with
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1+
# frozen_string_literal: true
2+
13
# Overide by Platform
24
pg_port = '5432'
3-
if platform[:family] == 'debian' or platform[:family] == 'suse'
4-
pg_port = '5433'
5-
end
5+
pg_port = '5433' if (platform[:family] == 'debian') || (platform[:family] == 'suse')
66

77
control 'Postgres command' do
88
title 'should match desired lines'
99

1010
# Can't use `%Q` here due to the `\`
11-
describe command(%q{su - postgres -c 'psql -p} + pg_port + %q{ -qtc "\l+ db2"'}) do
12-
its(:stdout) { should match(%r{db2.*remoteUser.*UTF8.*en_US.UTF-8.*en_US.UTF-8.*my_space}) }
11+
describe command("su - postgres -c 'psql -p" + pg_port + %q( -qtc "\l+ db2"')) do
12+
its(:stdout) do
13+
should match(
14+
/db2.*remoteUser.*UTF8.*en_US.UTF-8.*en_US.UTF-8.*my_space/
15+
)
16+
end
1317
end
1418
end

test/integration/default/controls/config_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
control 'Postgres configuration' do
24
title 'should include the directory'
35

test/integration/default/controls/services_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
# frozen_string_literal: true
2+
13
# Overide by Platform
24
service_name = 'postgresql'
35
pg_port = 5432
4-
if platform[:name] == 'centos' and platform[:release].start_with?('6')
6+
if (platform[:name] == 'centos') && platform[:release].start_with?('6')
57
service_name = 'postgresql-9.6'
6-
elsif platform[:family] == 'debian' or platform[:family] == 'suse'
8+
elsif (platform[:family] == 'debian') || (platform[:family] == 'suse')
79
pg_port = 5433
810
end
911

0 commit comments

Comments
 (0)