Skip to content

Commit 058e0a5

Browse files
authored
Support linting YAML files (#2272)
* Support linting YAML files Refer to rubocop/rubocop#10392 * Address yamllint warnings and errors ``` $ yamllint . ./.travis.yml 17:31 warning missing starting space in comment (comments) 18:31 warning missing starting space in comment (comments) 59:5 error wrong indentation: expected 2 but found 4 (indentation) ./.rubocop.yml 282:4 error wrong indentation: expected 2 but found 3 (indentation) ./.github/workflows/test.yml 51:5 error wrong indentation: expected 6 but found 4 (indentation) ./.github/workflows/ruby.yml 15:5 error wrong indentation: expected 6 but found 4 (indentation) ```
1 parent f0521e2 commit 058e0a5

File tree

6 files changed

+88
-64
lines changed

6 files changed

+88
-64
lines changed

.github/workflows/linting.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Linting
2+
on:
3+
- pull_request
4+
jobs:
5+
yamllint:
6+
name: Yamllint
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Yamllint
11+
uses: karancode/yamllint-github-action@master
12+
with:
13+
yamllint_comment: true
14+
env:
15+
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ruby.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,26 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v1
16-
- name: Set up Ruby 3.1
17-
uses: ruby/setup-ruby@v1
18-
with:
19-
ruby-version: 3.1
20-
- name: Install required package
21-
run: |
22-
sudo apt-get install alien
23-
- name: Download Oracle instant client
24-
run: |
25-
wget -q https://download.oracle.com/otn_software/linux/instantclient/211000/oracle-instantclient-basic-21.1.0.0.0-1.x86_64.rpm
26-
wget -q https://download.oracle.com/otn_software/linux/instantclient/211000/oracle-instantclient-sqlplus-21.1.0.0.0-1.x86_64.rpm
27-
wget -q https://download.oracle.com/otn_software/linux/instantclient/211000/oracle-instantclient-devel-21.1.0.0.0-1.x86_64.rpm
28-
- name: Install Oracle instant client
29-
run: |
30-
sudo alien -i oracle-instantclient-basic-21.1.0.0.0-1.x86_64.rpm
31-
sudo alien -i oracle-instantclient-sqlplus-21.1.0.0.0-1.x86_64.rpm
32-
sudo alien -i oracle-instantclient-devel-21.1.0.0.0-1.x86_64.rpm
15+
- uses: actions/checkout@v1
16+
- name: Set up Ruby 3.1
17+
uses: ruby/setup-ruby@v1
18+
with:
19+
ruby-version: 3.1
20+
- name: Install required package
21+
run: |
22+
sudo apt-get install alien
23+
- name: Download Oracle instant client
24+
run: |
25+
wget -q https://download.oracle.com/otn_software/linux/instantclient/211000/oracle-instantclient-basic-21.1.0.0.0-1.x86_64.rpm
26+
wget -q https://download.oracle.com/otn_software/linux/instantclient/211000/oracle-instantclient-sqlplus-21.1.0.0.0-1.x86_64.rpm
27+
wget -q https://download.oracle.com/otn_software/linux/instantclient/211000/oracle-instantclient-devel-21.1.0.0.0-1.x86_64.rpm
28+
- name: Install Oracle instant client
29+
run: |
30+
sudo alien -i oracle-instantclient-basic-21.1.0.0.0-1.x86_64.rpm
31+
sudo alien -i oracle-instantclient-sqlplus-21.1.0.0.0-1.x86_64.rpm
32+
sudo alien -i oracle-instantclient-devel-21.1.0.0.0-1.x86_64.rpm
3333
34-
- name: Build and run RuboCop
35-
run: |
36-
bundle install --jobs 4 --retry 3
37-
bundle exec rubocop
34+
- name: Build and run RuboCop
35+
run: |
36+
bundle install --jobs 4 --retry 3
37+
bundle exec rubocop

.github/workflows/test.yml

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -48,41 +48,41 @@ jobs:
4848
--health-timeout 5s
4949
--health-retries 10
5050
steps:
51-
- uses: actions/checkout@v2
52-
- name: Set up Ruby
53-
uses: ruby/setup-ruby@v1
54-
with:
55-
ruby-version: ${{ matrix.ruby }}
56-
- name: Install required package
57-
run: |
58-
sudo apt-get install alien
59-
- name: Download Oracle client
60-
run: |
61-
wget -q https://download.oracle.com/otn_software/linux/instantclient/214000/oracle-instantclient-basic-21.4.0.0.0-1.x86_64.rpm
62-
wget -q https://download.oracle.com/otn_software/linux/instantclient/214000/oracle-instantclient-sqlplus-21.4.0.0.0-1.x86_64.rpm
63-
wget -q https://download.oracle.com/otn_software/linux/instantclient/214000/oracle-instantclient-devel-21.4.0.0.0-1.x86_64.rpm
64-
- name: Install Oracle client
65-
run: |
66-
sudo alien -i oracle-instantclient-basic-21.4.0.0.0-1.x86_64.rpm
67-
sudo alien -i oracle-instantclient-sqlplus-21.4.0.0.0-1.x86_64.rpm
68-
sudo alien -i oracle-instantclient-devel-21.4.0.0.0-1.x86_64.rpm
69-
- name: Install JDBC Driver
70-
run: |
71-
wget -q https://download.oracle.com/otn-pub/otn_software/jdbc/211/ojdbc11.jar -O ./lib/ojdbc11.jar
72-
- name: Create database user
73-
run: |
74-
./ci/setup_accounts.sh
75-
- name: Bundle install
76-
run: |
77-
bundle install --jobs 4 --retry 3
78-
- name: Run RSpec
79-
run: |
80-
bundle exec rspec
81-
- name: Workaround jruby-head failure by removing Gemfile.lock
82-
run: |
83-
rm Gemfile.lock
84-
- name: Run bug report templates
85-
run: |
86-
cd guides/bug_report_templates
87-
ruby active_record_gem.rb
88-
ruby active_record_gem_spec.rb
51+
- uses: actions/checkout@v2
52+
- name: Set up Ruby
53+
uses: ruby/setup-ruby@v1
54+
with:
55+
ruby-version: ${{ matrix.ruby }}
56+
- name: Install required package
57+
run: |
58+
sudo apt-get install alien
59+
- name: Download Oracle client
60+
run: |
61+
wget -q https://download.oracle.com/otn_software/linux/instantclient/214000/oracle-instantclient-basic-21.4.0.0.0-1.x86_64.rpm
62+
wget -q https://download.oracle.com/otn_software/linux/instantclient/214000/oracle-instantclient-sqlplus-21.4.0.0.0-1.x86_64.rpm
63+
wget -q https://download.oracle.com/otn_software/linux/instantclient/214000/oracle-instantclient-devel-21.4.0.0.0-1.x86_64.rpm
64+
- name: Install Oracle client
65+
run: |
66+
sudo alien -i oracle-instantclient-basic-21.4.0.0.0-1.x86_64.rpm
67+
sudo alien -i oracle-instantclient-sqlplus-21.4.0.0.0-1.x86_64.rpm
68+
sudo alien -i oracle-instantclient-devel-21.4.0.0.0-1.x86_64.rpm
69+
- name: Install JDBC Driver
70+
run: |
71+
wget -q https://download.oracle.com/otn-pub/otn_software/jdbc/211/ojdbc11.jar -O ./lib/ojdbc11.jar
72+
- name: Create database user
73+
run: |
74+
./ci/setup_accounts.sh
75+
- name: Bundle install
76+
run: |
77+
bundle install --jobs 4 --retry 3
78+
- name: Run RSpec
79+
run: |
80+
bundle exec rspec
81+
- name: Workaround jruby-head failure by removing Gemfile.lock
82+
run: |
83+
rm Gemfile.lock
84+
- name: Run bug report templates
85+
run: |
86+
cd guides/bug_report_templates
87+
ruby active_record_gem.rb
88+
ruby active_record_gem_spec.rb

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,4 +279,4 @@ Performance/DeleteSuffix:
279279
Enabled: true
280280

281281
Performance/OpenStruct:
282-
Enabled: true
282+
Enabled: true

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ env:
1414
- DATABASE_VERSION=11.2.0.1
1515
- ORACLE_SID=XE
1616
- DATABASE_NAME=XE
17-
- ORA_SDTZ='Europe/Riga' #Needed as a client parameter
18-
- TZ='Europe/Riga' #Needed as a DB Server parameter
17+
- ORA_SDTZ='Europe/Riga' # Needed as a client parameter
18+
- TZ='Europe/Riga' # Needed as a DB Server parameter
1919
- "JRUBY_OPTS='--debug --dev -J-Xmx1024M'"
2020

2121
before_install:
@@ -56,4 +56,4 @@ rvm:
5656
# - rvm: jruby-head
5757

5858
notifications:
59-
email: false
59+
email: false

.yamllint.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends: default
2+
3+
rules:
4+
comments:
5+
min-spaces-from-content: 1
6+
document-start: disable
7+
line-length: disable
8+
truthy:
9+
check-keys: false

0 commit comments

Comments
 (0)