rubocop-itamae 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de50a2f8296050f2ebc28763202b5dddd5e604eef64938a38298d049ac7e31fe
4
- data.tar.gz: 76cc076b47e4c29a28d39c65b07aa758fe84c236ff529618b53dd02ba73ae73b
3
+ metadata.gz: 67e536a274f4c88ae9d0b18095a4e82f3d899943a505527471e6ac609b993a88
4
+ data.tar.gz: 4813442b27ccc9cd5f038db98ba50b5d59687cfc44df720d648b6466efce9ac0
5
5
  SHA512:
6
- metadata.gz: 446808bcde60e9d235890ac299828c08c7541442719d224a4ea102cfaac75eb7163203dbfd1cdb0e586816456190c4bc9e16e53d4539d8260a46de803d13e0d7
7
- data.tar.gz: 56548023458bad444acee82dc608857210918e24d16a927c1b9dac1db0f6d9efed41cc91bf9bd30605754c33e2ed892cabead7a3da3104b9f200d7a82cb32fb5
6
+ metadata.gz: a62bc0ec04985dabe2a245c7fef5af0b94856d2461c51fc63bb4e50bf1ddf3be4620dc72867fb3170ae90108bc50ac7a011f8606d266c3b499cc401c697e90ea
7
+ data.tar.gz: 6307e1794b5a6c48008a7b8d554bd1020d770c91757518d0be4b71ebe196efb295aa5113431773c3fc1a87f333b8cc2f30fc379cd9584462fb788c07b8fe0dff
@@ -0,0 +1,109 @@
1
+ name: test
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ types:
9
+ - opened
10
+ - synchronize
11
+ - reopened
12
+ schedule:
13
+ - cron: "0 10 * * 5" # JST 19:00 (Fri)
14
+
15
+ env:
16
+ CI: "true"
17
+
18
+ jobs:
19
+ test:
20
+ runs-on: ubuntu-latest
21
+
22
+ container: ${{ matrix.ruby }}
23
+
24
+ strategy:
25
+ fail-fast: false
26
+
27
+ matrix:
28
+ ruby:
29
+ - ruby:2.4
30
+ - ruby:2.5
31
+ - ruby:2.6
32
+ - ruby:2.7
33
+ - rubylang/ruby:master-nightly-bionic
34
+ include:
35
+ - ruby: rubylang/ruby:master-nightly-bionic
36
+ allow_failures: "true"
37
+
38
+ steps:
39
+ - uses: actions/checkout@v2
40
+
41
+
42
+ - name: Cache vendor/bundle
43
+ uses: actions/cache@v1
44
+ id: cache_gem
45
+ with:
46
+ path: vendor/bundle
47
+ key: v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ github.sha }}
48
+ restore-keys: |
49
+ v1-gem-${{ runner.os }}-${{ matrix.ruby }}-
50
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
51
+
52
+ - name: bundle update
53
+ run: |
54
+ set -xe
55
+ bundle config path vendor/bundle
56
+ bundle update --jobs $(nproc) --retry 3
57
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
58
+
59
+ - name: Setup Code Climate Test Reporter
60
+ uses: aktions/codeclimate-test-reporter@v1
61
+ with:
62
+ codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
63
+ command: before-build
64
+ if: matrix.ruby >= 'ruby:2.4'
65
+ continue-on-error: true
66
+
67
+ - name: Run test
68
+ run: |
69
+ set -xe
70
+ bundle exec rspec
71
+ bundle exec rubocop -P
72
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
73
+
74
+ - name: Teardown Code Climate Test Reporter
75
+ uses: aktions/codeclimate-test-reporter@v1
76
+ with:
77
+ codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
78
+ command: after-build
79
+ if: matrix.ruby >= 'ruby:2.4' && always()
80
+ continue-on-error: true
81
+
82
+ - name: Slack Notification (not success)
83
+ uses: homoluctus/slatify@master
84
+ if: "! success()"
85
+ continue-on-error: true
86
+ with:
87
+ job_name: ${{ format('*build* ({0})', matrix.ruby) }}
88
+ type: ${{ job.status }}
89
+ icon_emoji: ":octocat:"
90
+ url: ${{ secrets.SLACK_WEBHOOK }}
91
+ token: ${{ secrets.GITHUB_TOKEN }}
92
+
93
+ notify:
94
+ needs:
95
+ - test
96
+
97
+ runs-on: ubuntu-latest
98
+
99
+ steps:
100
+ - name: Slack Notification (success)
101
+ uses: homoluctus/slatify@master
102
+ if: always()
103
+ continue-on-error: true
104
+ with:
105
+ job_name: '*build*'
106
+ type: ${{ job.status }}
107
+ icon_emoji: ":octocat:"
108
+ url: ${{ secrets.SLACK_WEBHOOK }}
109
+ token: ${{ secrets.GITHUB_TOKEN }}
data/.rubocop.yml CHANGED
@@ -1,15 +1,19 @@
1
1
  AllCops:
2
- # rubocop requires ruby 2.2+
3
- # https://github.com/rubocop-hq/rubocop/pull/5990
4
- TargetRubyVersion: 2.2
2
+ # rubocop 0.82.0+ requires ruby 2.4+
3
+ TargetRubyVersion: 2.4
4
+
5
+ Layout/LineLength:
6
+ Exclude:
7
+ - "spec/spec_helper.rb"
5
8
 
6
9
  Metrics/BlockLength:
7
10
  Exclude:
8
11
  - "spec/**/*.rb"
9
12
 
10
- Metrics/LineLength:
13
+ Naming/FileName:
11
14
  Exclude:
12
- - "spec/spec_helper.rb"
15
+ - "lib/rubocop-itamae.rb"
16
+ - "rubocop-itamae.gemspec"
13
17
 
14
18
  Style/HashSyntax:
15
19
  Exclude:
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## master
2
- [full changelog](http://github.com/sue445/rubocop-itamae/compare/v0.1.1...master)
2
+ [full changelog](http://github.com/sue445/rubocop-itamae/compare/v0.1.2...master)
3
+
4
+ ## v0.1.2
5
+ [full changelog](http://github.com/sue445/rubocop-itamae/compare/v0.1.1...v0.1.2)
6
+
7
+ * Upgrade rubocop and drop ruby 2.3
8
+ * https://github.com/sue445/rubocop-itamae/pull/43
3
9
 
4
10
  ## v0.1.1
5
11
  [full changelog](http://github.com/sue445/rubocop-itamae/compare/v0.1.0...v0.1.1)
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Code style checking for [itamae](https://github.com/itamae-kitchen/itamae) recipes
4
4
 
5
5
  [![Gem Version](https://badge.fury.io/rb/rubocop-itamae.svg)](https://badge.fury.io/rb/rubocop-itamae)
6
- [![Build Status](https://travis-ci.org/sue445/rubocop-itamae.svg?branch=master)](https://travis-ci.org/sue445/rubocop-itamae)
6
+ [![Build Status](https://github.com/sue445/rubocop-itamae/workflows/test/badge.svg?branch=master)](https://github.com/sue445/rubocop-itamae/actions?query=workflow%3Atest)
7
7
  [![Coverage Status](https://coveralls.io/repos/github/sue445/rubocop-itamae/badge.svg?branch=master)](https://coveralls.io/github/sue445/rubocop-itamae?branch=master)
8
8
  [![Maintainability](https://api.codeclimate.com/v1/badges/bf2f4b2cbf9c2cfc0e92/maintainability)](https://codeclimate.com/github/sue445/rubocop-itamae/maintainability)
9
9
 
@@ -14,7 +14,7 @@ module RuboCop
14
14
  # cwd '/tmp'
15
15
  # end
16
16
  class CdInExecute < Cop
17
- MSG = "Insert `cwd '%<dir>s'` and remove this.".freeze
17
+ MSG = "Insert `cwd '%<dir>s'` and remove this."
18
18
 
19
19
  def_node_search :find_execute_with_block, <<-PATTERN
20
20
  (block
@@ -51,14 +51,14 @@ module RuboCop
51
51
  end
52
52
 
53
53
  def on_send(node)
54
- return if node.parent && node.parent.block_type?
54
+ return if node.parent&.block_type?
55
55
 
56
56
  find_execute_without_block(node) do |name|
57
57
  add_offense_for_execute_name(node, name)
58
58
  end
59
59
  end
60
60
 
61
- # rubocop:disable Metrics/LineLength
61
+ # rubocop:disable Layout/LineLength
62
62
  # def autocorrect(node)
63
63
  # if node.block_type?
64
64
  # lambda do |corrector|
@@ -103,7 +103,7 @@ module RuboCop
103
103
  # end
104
104
  # end
105
105
  # end
106
- # rubocop:enable Metrics/LineLength
106
+ # rubocop:enable Layout/LineLength
107
107
 
108
108
  private
109
109
 
@@ -21,7 +21,7 @@ module RuboCop
21
21
  include RangeHelp
22
22
 
23
23
  MSG = 'Prefer to omit `command` if `command` equals to ' \
24
- 'name of `execute`'.freeze
24
+ 'name of `execute`'
25
25
 
26
26
  def_node_search :find_execute, <<-PATTERN
27
27
  (block
@@ -20,24 +20,24 @@ module RuboCop
20
20
  class NeedlessDefaultAction < Cop
21
21
  include RangeHelp
22
22
 
23
- MSG = 'Prefer to omit the default action.'.freeze
23
+ MSG = 'Prefer to omit the default action.'
24
24
 
25
25
  RESOURCE_DEFAULT_ACTIONS = {
26
- directory: :create,
27
- execute: :run,
28
- file: :create,
29
- gem_package: :install,
30
- git: :sync,
31
- group: :create,
32
- http_request: :create,
33
- link: :create,
26
+ directory: :create,
27
+ execute: :run,
28
+ file: :create,
29
+ gem_package: :install,
30
+ git: :sync,
31
+ group: :create,
32
+ http_request: :create,
33
+ link: :create,
34
34
  local_ruby_block: :run,
35
- package: :install,
35
+ package: :install,
36
36
  remote_directory: :create,
37
- remote_file: :create,
38
- service: :nothing,
39
- template: :create,
40
- user: :create
37
+ remote_file: :create,
38
+ service: :nothing,
39
+ template: :create,
40
+ user: :create
41
41
  }.freeze
42
42
 
43
43
  def_node_search :find_resource, <<-PATTERN
@@ -21,7 +21,7 @@ module RuboCop
21
21
  include RangeHelp
22
22
 
23
23
  MSG = 'Prefer recipe to placed under `cookbooks` dir' \
24
- ' or `roles` dir.'.freeze
24
+ ' or `roles` dir.'
25
25
 
26
26
  def investigate(processed_source)
27
27
  file_path = processed_source.file_path
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Itamae
5
- VERSION = '0.1.1'.freeze
5
+ VERSION = '0.1.2'
6
6
  end
7
7
  end
@@ -22,14 +22,15 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
24
 
25
- spec.add_dependency 'rubocop', '>= 0.53.0'
25
+ spec.required_ruby_version = '>= 2.4.0'
26
26
 
27
- spec.add_development_dependency 'bundler', '~> 1.16'
28
- spec.add_development_dependency 'codeclimate-test-reporter', '~> 1.0.0'
27
+ spec.add_dependency 'rubocop', '>= 0.82.0'
28
+
29
+ spec.add_development_dependency 'bundler', '>= 1.16'
29
30
  spec.add_development_dependency 'coveralls'
30
- spec.add_development_dependency 'pry-byebug'
31
31
  spec.add_development_dependency 'rake', '>= 11.0'
32
32
  spec.add_development_dependency 'rspec', '~> 3.0'
33
- spec.add_development_dependency 'simplecov'
33
+ spec.add_development_dependency 'rubocop_auto_corrector'
34
+ spec.add_development_dependency 'simplecov', '< 0.18.0'
34
35
  spec.add_development_dependency 'yard'
35
36
  end
data/tasks/new_cop.rake CHANGED
@@ -20,7 +20,7 @@ task :new_cop, [:cop] do |_task, args|
20
20
 
21
21
  begin
22
22
  generator.inject_config(config_file_path: 'config/default.yml')
23
- rescue TypeError # rubocop:disable Lint/HandleExceptions
23
+ rescue TypeError
24
24
  # nop
25
25
  end
26
26
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-itamae
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-18 00:00:00.000000000 Z
11
+ date: 2020-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -16,42 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.53.0
19
+ version: 0.82.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.53.0
26
+ version: 0.82.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.16'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.16'
41
- - !ruby/object:Gem::Dependency
42
- name: codeclimate-test-reporter
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: 1.0.0
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: 1.0.0
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: coveralls
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -66,20 +52,6 @@ dependencies:
66
52
  - - ">="
67
53
  - !ruby/object:Gem::Version
68
54
  version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: pry-byebug
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
55
  - !ruby/object:Gem::Dependency
84
56
  name: rake
85
57
  requirement: !ruby/object:Gem::Requirement
@@ -109,7 +81,7 @@ dependencies:
109
81
  - !ruby/object:Gem::Version
110
82
  version: '3.0'
111
83
  - !ruby/object:Gem::Dependency
112
- name: simplecov
84
+ name: rubocop_auto_corrector
113
85
  requirement: !ruby/object:Gem::Requirement
114
86
  requirements:
115
87
  - - ">="
@@ -122,6 +94,20 @@ dependencies:
122
94
  - - ">="
123
95
  - !ruby/object:Gem::Version
124
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: simplecov
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "<"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.18.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "<"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.18.0
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: yard
127
113
  requirement: !ruby/object:Gem::Requirement
@@ -144,10 +130,10 @@ extensions: []
144
130
  extra_rdoc_files: []
145
131
  files:
146
132
  - ".coveralls.yml"
133
+ - ".github/workflows/test.yml"
147
134
  - ".gitignore"
148
135
  - ".rspec"
149
136
  - ".rubocop.yml"
150
- - ".travis.yml"
151
137
  - ".yardopts"
152
138
  - CHANGELOG.md
153
139
  - Gemfile
@@ -179,15 +165,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
179
165
  requirements:
180
166
  - - ">="
181
167
  - !ruby/object:Gem::Version
182
- version: '0'
168
+ version: 2.4.0
183
169
  required_rubygems_version: !ruby/object:Gem::Requirement
184
170
  requirements:
185
171
  - - ">="
186
172
  - !ruby/object:Gem::Version
187
173
  version: '0'
188
174
  requirements: []
189
- rubyforge_project:
190
- rubygems_version: 2.7.6
175
+ rubygems_version: 3.1.2
191
176
  signing_key:
192
177
  specification_version: 4
193
178
  summary: Code style checking for itamae recipes
data/.travis.yml DELETED
@@ -1,30 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.2
5
- - 2.3
6
- - 2.4
7
- - 2.5
8
- - ruby-head
9
- bundler_args: "--jobs=4"
10
- cache: bundler
11
- before_install:
12
- - gem update --system --no-document
13
- - gem install bundler --no-document
14
- before_script:
15
- - export CODECLIMATE_REPO_TOKEN=7e9993b9f657bb33552e76a7b9c8292541cf9a5d8d6811f585f6cfbc0785c820
16
- before_script:
17
- script:
18
- - bundle exec rspec
19
- - bundle exec codeclimate-test-reporter
20
- - bundle exec rubocop
21
- branches:
22
- only:
23
- - master
24
- notifications:
25
- email: false
26
- slack:
27
- secure: eKV6s6mQEb3T9qeatHvUMvAQPVOn+hjvdPl+v+1RYQaC/kgTMpLkCwRPokrDYiK51/HgMSH1cPGVl6QfoqaJvdHKdZtuAmikVeqhygablFPdLYuseMTHTr9zT9MOoEzSbyzO9tUTL3jIHeLIrXdBhVJ/YCw/9uWIlA10iFDE0KZ8WiPIIAJ34GORnzIqIASHY5zGKhiIqer1xeNecXXhTBcnUYzOhN7qBYCRl0yYL11NIy7xh50DLcKSYYAIUr6oBYOI6QeSe/0cZGOGst0JfHE5jQvT/3O6wMK2lGnrXovXuL4JIbFT6bODo9XyzSSkyy/P1wqPe8hpY7Thh4qyt1r+tRdO8oBdkxdzQTopRgemyc3wOa/5mE7keEXJh8V1TPCi4yfa/rfXxLSXmXYGXa3q8TBwDkxmWFd1Ej2KV3e3c1AVVqp7cqflq12HH6v2XHPXHyX6zZszOKpDjELCc2SZ49jx+D1tg15YHJ+Q8FIyUVAvyjD1bW7z+v8fsXqViyhwrue11jVsdpfSy0ZaXwtiSC7RyUwX7u/TdnHbMKRaGNQ9GHyqfirT+f7tcnHxGqBIpR5oqnnFnNEfVTxm+k1YmX4VY5q2kVn0jT8GDyRygUHAhFMOxGg2g85/sFxSx1bJD9pRUDTX3cHgxMhmEj7z0aI7gfEZW+NrqJO5AX8=
28
- matrix:
29
- allow_failures:
30
- - rvm: ruby-head