theforeman-rubocop 0.0.1 → 0.1.0.pre.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 633cdf0eb394a5155ae66be68a4d18cbe50aa35c60c1e8745e0a5b8928d5aeda
4
- data.tar.gz: bbe63990108e77aad4bbf1b17ff03c65ec5127c1e72ae3f6fdd6f32c99d4b853
3
+ metadata.gz: 303949ac39cb6a1dc5269b09c318beb190888c6e1ae5e639dc337670741dbeaf
4
+ data.tar.gz: 81383fa08b725ba13fe5250cac9362a72bc4f79b021efb63ce7742921d784f25
5
5
  SHA512:
6
- metadata.gz: 0ebdd11030075ce8a68f59d81f1bf8bd50998e4dd9edc349ac0044297c7729d0331b9bfd5dd81af5faeb87cd9aecd378764269bf1f2e8cb0c5a2294c6e6859ab
7
- data.tar.gz: c2c8c441e88edb36b024b43142e1c72574836067a7aa441f7314b57bc53ac67f8273cbc69f37edd12fa54ca6d7267f045f307a5cd242bd6649cb99d7910c30b6
6
+ metadata.gz: 95f106807f8b3f33bd993cd51dd9693270363ef1c4c05e1f2913ee87399615d67504f8d8ce1b9089d56d5a26cddf1cbd1156e8025b676a90105d8201ea825fc6
7
+ data.tar.gz: 1025ce9baee07dd289407d0bccc914f0ae1ec83d732350a031fdb121ebc31aa31da29bfc8f0b63023b04a2cfa854afc7fc43255769b2f262521c83637efee61c
@@ -5,8 +5,8 @@ on:
5
5
  - v*
6
6
 
7
7
  jobs:
8
- build:
9
- name: Build + Publish
8
+ publish_ghp:
9
+ name: Build + Publish on GHP
10
10
  runs-on: ubuntu-latest
11
11
 
12
12
  steps:
@@ -28,13 +28,23 @@ jobs:
28
28
  GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
29
29
  OWNER: ${{ github.repository_owner }}
30
30
 
31
+ publish_rubygems:
32
+ name: Build + Publish on RubyGems
33
+ runs-on: ubuntu-latest
34
+ steps:
35
+ - uses: actions/checkout@v2
36
+ - name: Set up Ruby 2.6
37
+ uses: actions/setup-ruby@v1
38
+ with:
39
+ ruby-version: 2.6.x
31
40
 
32
- - name: Publish to RubyGems
33
- run: |
34
- mkdir -p $HOME/.gem
35
- touch $HOME/.gem/credentials
36
- chmod 0600 $HOME/.gem/credentials
37
- printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
38
- gem push *.gem
39
- env:
40
- GEM_HOST_API_KEY: "Bearer ${{secrets.RUBYGEM_API_KEY}}"
41
+ - run: gem build *.gemspec
42
+ - name: Publish to RubyGems
43
+ run: |
44
+ mkdir -p $HOME/.gem
45
+ touch $HOME/.gem/credentials
46
+ chmod 0600 $HOME/.gem/credentials
47
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
48
+ gem push *.gem
49
+ env:
50
+ GEM_HOST_API_KEY: "Bearer ${{secrets.RUBYGEM_API_KEY}}"
data/README.md CHANGED
@@ -16,33 +16,44 @@ Instead of defining the rules for plugin per plugin, plugins can include default
16
16
 
17
17
  ```ruby
18
18
  # Gemfile
19
- source 'https://ezr-ondrej:dc069ebb028fa13cf880764491a921ef28724340@rubygems.pkg.github.com/ezr-ondrej/theforeman-rubocop' do
20
- gem 'theforeman-rubocop', '~> 0.0.1'
21
- end
19
+ gem 'theforeman-rubocop', '~> 0.0.4'
22
20
  ```
23
21
 
24
22
  And configure in the `.rubocop.yml`.
25
23
 
26
- ### Easiest config - get all
24
+ ### Easiest config - all opinionated Cops `strict`
27
25
 
28
26
  ```yaml
29
27
  inherit_gem:
30
28
  theforeman-rubocop:
31
- - all.yml
29
+ - strict.yml
32
30
  ```
33
31
 
34
- ### Basic style and performance cops
32
+ ### Basic style - `default`, performance and rails cops
35
33
  ```yaml
36
34
  inherit_gem:
37
35
  theforeman-rubocop:
38
- - all.yml
36
+ - default.yml
39
37
  ```
40
38
 
41
- ### All cops, including newly introduced ones
39
+ ### Not intrusive style - `lenient`
40
+ It is similar to default, but has some not as important cops disabled.
41
+ See `rules/style_lenient.yml` for disabled cops.
42
+
42
43
  ```yaml
43
44
  inherit_gem:
44
45
  theforeman-rubocop:
45
- - edge.yml
46
+ - lenient.yml
47
+ ```
48
+
49
+ ### All opinionated cops with new ones - `strictest`
50
+ If you want to closely follow what RuboCop introduces in its new versions, use this level.
51
+ It is the same as `strict`, but enables the newly introduced cops.
52
+
53
+ ```yaml
54
+ inherit_gem:
55
+ theforeman-rubocop:
56
+ - strictest.yml
46
57
  ```
47
58
 
48
59
  ### Choose just some cops
@@ -53,11 +64,14 @@ Cops are splited in categories for your convenience, so you can opt-out some cop
53
64
  ```yaml
54
65
  inherit_gem:
55
66
  theforeman-rubocop:
56
- - rules/style.yml
67
+ - rules/base.yml
57
68
  - rules/ruby_target.yml
69
+ - rules/style.yml
70
+ - rules/metrics.yml
58
71
  - rules/performance.yml
59
72
  - rules/rails.yml
60
73
  - rules/minitest.yml
74
+ - rules/style_lenient.yml
61
75
 
62
76
  AllCops:
63
77
  NewCops: disable
@@ -1,8 +1,9 @@
1
1
  inherit_from:
2
+ - rules/base.yml
3
+ - rules/ruby_target.yml
2
4
  - rules/style.yml
3
5
  - rules/performance.yml
6
+ - rules/rails.yml
4
7
 
5
8
  AllCops:
6
9
  NewCops: disable
7
- Exclude:
8
- - 'node_modules/**/*'
@@ -0,0 +1,3 @@
1
+ inherit_from:
2
+ - default.yml
3
+ - rules/style_lenient.yml
@@ -1,5 +1,5 @@
1
1
  module Theforeman
2
2
  module Rubocop
3
- VERSION = '0.0.1'.freeze
3
+ VERSION = '0.1.0.pre.1'.freeze
4
4
  end
5
5
  end
@@ -0,0 +1,2 @@
1
+ inherit_from:
2
+ - rules/minitest.yml
@@ -0,0 +1,5 @@
1
+ AllCops:
2
+ Exclude:
3
+ - 'db/schema.rb'
4
+ - 'node_modules/**/*'
5
+ - 'vendor/**/*'
@@ -0,0 +1,8 @@
1
+ Metrics/BlockLength:
2
+ Exclude:
3
+ - 'spec/**/*'
4
+ - 'test/**/*'
5
+
6
+ Metrics/ClassLength:
7
+ Exclude:
8
+ - 'test/**/*'
@@ -1,6 +1,10 @@
1
1
  Layout/EmptyLineAfterGuardClause:
2
2
  Enabled: false
3
3
 
4
+ Layout/ArgumentAlignment:
5
+ EnforcedStyle: with_fixed_indentation
6
+ IndentationWidth: 2
7
+
4
8
  Layout/FirstArgumentIndentation:
5
9
  EnforcedStyle: consistent
6
10
 
@@ -10,6 +14,10 @@ Style/Alias:
10
14
  Style/AndOr:
11
15
  EnforcedStyle: conditionals
12
16
 
17
+ Style/ClassAndModuleChildren:
18
+ Exclude:
19
+ - 'app/controllers/concerns/**/parameters/*.rb'
20
+
13
21
  # Don't enforce documentation
14
22
  Style/Documentation:
15
23
  Enabled: false
@@ -17,13 +25,9 @@ Style/Documentation:
17
25
  Style/EmptyMethod:
18
26
  EnforcedStyle: expanded
19
27
 
20
- # Support both, Ruby 1.9 hashmap and hash-rocket syntax
28
+ # Enforce ruby19 style
21
29
  Style/HashSyntax:
22
- EnforcedStyle: no_mixed_keys
23
-
24
- # Both double and single quotes are OK
25
- Style/StringLiterals:
26
- Enabled: false
30
+ EnforcedStyle: ruby19_no_mixed_keys
27
31
 
28
32
  Style/TernaryParentheses:
29
33
  EnforcedStyle: require_parentheses_when_complex
@@ -0,0 +1,31 @@
1
+ Naming/VariableNumber:
2
+ Enabled: false
3
+
4
+ # Don't prefer is_a? over kind_of?
5
+ Style/ClassCheck:
6
+ Enabled: false
7
+
8
+ Style/HashAsLastArrayItem:
9
+ Enabled: false
10
+
11
+ # Support both, Ruby 1.9 hashmap and hash-rocket syntax
12
+ Style/HashSyntax:
13
+ EnforcedStyle: no_mixed_keys
14
+
15
+ # disabled until we can configure "+" as concat sign
16
+ Style/LineEndConcatenation:
17
+ Enabled: false
18
+
19
+ # Both double and single quotes are OK
20
+ Style/StringLiterals:
21
+ Enabled: false
22
+
23
+ Style/StringConcatenation:
24
+ Enabled: false
25
+
26
+ Style/SymbolArray:
27
+ EnforcedStyle: brackets
28
+ MinSize: 1
29
+
30
+ Style/WordArray:
31
+ Enabled: false
@@ -0,0 +1,11 @@
1
+ inherit_from:
2
+ - rules/base.yml
3
+ - rules/ruby_target.yml
4
+ - rules/style.yml
5
+ - rules/performance.yml
6
+ - rules/metrics.yml
7
+ - rules/rails.yml
8
+ - rules/minitest.yml
9
+
10
+ AllCops:
11
+ NewCops: disable
@@ -1,5 +1,5 @@
1
1
  inherit_from:
2
- - all.yml
2
+ - strict.yml
3
3
 
4
4
  AllCops:
5
5
  NewCops: enable
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.authors = IO.readlines('AUTHORS', encoding: 'utf-8').map(&:strip)
11
11
  spec.email = ['foreman-dev@googlegroups.com']
12
12
 
13
- spec.summary = 'This gem guides and shares rubocop style configs.'
13
+ spec.summary = 'Shared Rubocop configuration for theforeman.org family of projects.'
14
14
  spec.homepage = 'https://github.com/theforeman/theforeman-rubocop'
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -20,11 +20,12 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ['lib']
22
22
 
23
- spec.add_dependency 'rubocop', '~> 0.89.0'
24
- spec.add_dependency 'rubocop-rspec', '~> 1.43.2'
23
+ spec.add_dependency 'rubocop', '~> 1.5'
24
+ spec.add_dependency 'rubocop-checkstyle_formatter', '~> 0.4.0'
25
+ spec.add_dependency 'rubocop-rspec', '~> 2.0'
25
26
  spec.add_dependency 'rubocop-minitest', '~> 0.10.1'
26
27
  spec.add_dependency 'rubocop-performance', '~> 1.8.1'
27
- spec.add_dependency 'rubocop-rails', '~> 2.5.2'
28
+ spec.add_dependency 'rubocop-rails', '~> 2.8.1'
28
29
  spec.add_development_dependency 'bundler', '~> 2.1'
29
30
  spec.add_development_dependency 'rake', '~> 13.0'
30
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: theforeman-rubocop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Ezr
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-22 00:00:00.000000000 Z
11
+ date: 2020-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -16,28 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.89.0
19
+ version: '1.5'
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.89.0
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop-checkstyle_formatter
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.4.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.4.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rubocop-rspec
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: 1.43.2
47
+ version: '2.0'
34
48
  type: :runtime
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: 1.43.2
54
+ version: '2.0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rubocop-minitest
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +86,14 @@ dependencies:
72
86
  requirements:
73
87
  - - "~>"
74
88
  - !ruby/object:Gem::Version
75
- version: 2.5.2
89
+ version: 2.8.1
76
90
  type: :runtime
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
94
  - - "~>"
81
95
  - !ruby/object:Gem::Version
82
- version: 2.5.2
96
+ version: 2.8.1
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: bundler
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -118,15 +132,20 @@ files:
118
132
  - ".github/workflows/gem-push.yml"
119
133
  - AUTHORS
120
134
  - README.md
121
- - all.yml
122
135
  - default.yml
123
- - edge.yml
136
+ - lenient.yml
124
137
  - lib/theforeman/rubocop/version.rb
138
+ - minitest.yml
139
+ - rules/base.yml
140
+ - rules/metrics.yml
125
141
  - rules/minitest.yml
126
142
  - rules/performance.yml
127
143
  - rules/rails.yml
128
144
  - rules/ruby_target.yml
129
145
  - rules/style.yml
146
+ - rules/style_lenient.yml
147
+ - strict.yml
148
+ - strictest.yml
130
149
  - theforeman-rubocop.gemspec
131
150
  homepage: https://github.com/theforeman/theforeman-rubocop
132
151
  licenses: []
@@ -142,12 +161,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
142
161
  version: '0'
143
162
  required_rubygems_version: !ruby/object:Gem::Requirement
144
163
  requirements:
145
- - - ">="
164
+ - - ">"
146
165
  - !ruby/object:Gem::Version
147
- version: '0'
166
+ version: 1.3.1
148
167
  requirements: []
149
- rubygems_version: 3.1.2
168
+ rubygems_version: 3.1.4
150
169
  signing_key:
151
170
  specification_version: 4
152
- summary: This gem guides and shares rubocop style configs.
171
+ summary: Shared Rubocop configuration for theforeman.org family of projects.
153
172
  test_files: []
data/all.yml DELETED
@@ -1,6 +0,0 @@
1
- inherit_from:
2
- - default.yml
3
- - rules/ruby_target.yml
4
- - rules/rails.yml
5
- - rules/minitest.yml
6
-