rubocop-itsmycargo 0.1.10.pre.alpha.0 → 0.2.0

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: be34d6e712ff5c6d0012246df89cb5f2069e76b6014af3575e864ba5091956be
4
- data.tar.gz: 2909471797fb742b7c8e86f99a92234a42c7fc521b04746eb5a9b0457f77d5a8
3
+ metadata.gz: 5d76efeab2eb535b41f40fe72abdc5d2304b53401ad2214d05bf7b67a175ea5e
4
+ data.tar.gz: e836ba195aa060c65bcca5d5dd6e9bdda43bc7136287df4047350207edf1cc59
5
5
  SHA512:
6
- metadata.gz: c2c786f5d593aa65410414e4443b084f161ab3f6b9148cdad4deac549fdd4f26b0254ce562a354777ebd5402883133536e613d647ff0b1fed8042b19e01ba74d
7
- data.tar.gz: d9e7c749a54b8cc2643613265a03258dd2a9e5662646750afefc17d0f71a26ceb128cafcc79053ab40fa4e33a16fd8244f214573b2e1bbc33c502a4b3ae8bd5d
6
+ metadata.gz: 786518bc981cf4f402fa65f6d08609ff98c356e31acefc17734b61f4cdea33a49ce2f0b8c716ea7c0fdccb1112a177c3f5d08af6b1841c4f3da4ac08e1c1f96d
7
+ data.tar.gz: 57db9bd264584a5a1cb25dce1fbb1701a87b253c5a6e2407309b719e4d68bafe96a0c34b293ac5d5b98b396d236f053976c60ea2e94f604f5c0799b68bcb9dab
data/.rubocop.yml CHANGED
@@ -1,2 +1,2 @@
1
1
  inherit_from:
2
- - config/default.yml
2
+ - config/base.yml
data/CHANGELOG.md CHANGED
@@ -1,4 +1,6 @@
1
1
  ### Next
2
+ ### v0.2.0-alpha-alpha-alpha-rc-rc - 2020-05-06
3
+ ### v0.1.8-alpha-alpha-alpha-rc-rc - 2020-02-13
2
4
  ### v0.1.10-alpha-alpha-alpha-rc-rc - 2020-02-13
3
5
  ### v0.1.9-alpha-alpha-rc-rc - 2020-02-13
4
6
  ### v0.1.8-alpha-rc-rc - 2020-02-13
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source 'https://rubygems.org'
3
+ source "https://rubygems.org"
4
4
 
5
5
  git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
6
 
data/Rakefile CHANGED
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'bump/tasks'
4
- require 'bundler/gem_tasks'
5
- require 'rspec/core/rake_task'
3
+ require "bump/tasks"
4
+ require "bundler/gem_tasks"
5
+ require "rspec/core/rake_task"
6
6
 
7
7
  Bump.tag_by_default = true
8
8
  Bump.changelog = true
data/bin/console CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'bundler/setup'
5
- require 'rubocop/itsmycargo'
4
+ require "bundler/setup"
5
+ require "rubocop/itsmycargo"
6
6
 
7
7
  # You can add fixtures and/or initialization code here to make experimenting
8
8
  # with your gem easier. You can also use a different console, if you like.
@@ -11,5 +11,5 @@ require 'rubocop/itsmycargo'
11
11
  # require "pry"
12
12
  # Pry.start
13
13
 
14
- require 'irb'
14
+ require "irb"
15
15
  IRB.start(__FILE__)
data/config/base.yml ADDED
@@ -0,0 +1,19 @@
1
+ inherit_mode:
2
+ merge:
3
+ - Exclude
4
+
5
+ require:
6
+ - rubocop-performance
7
+ - standard/cop/semantic_blocks
8
+
9
+ inherit_gem:
10
+ standard: config/base.yml
11
+
12
+ # Allow longer line length for bigger screens
13
+ Layout/LineLength:
14
+ Max: 120
15
+ StyleGuide: 'https://github.com/itsmycargo/rubocop-itsmycargo/blob/master/docs/Guide.adoc#maximum-line-length'
16
+
17
+ Style/Documentation:
18
+ Enabled: false
19
+ StyleGuide: 'https://github.com/itsmycargo/rubocop-itsmycargo/blob/master/docs/Guide.adoc#classmodule-documentation'
data/config/legacy.yml ADDED
@@ -0,0 +1,5 @@
1
+ inherit_from:
2
+ - config/base.yml
3
+
4
+ Style/StringLiterals:
5
+ EnforcedStyle: 'single_quotes'
data/config/rails.yml ADDED
@@ -0,0 +1,202 @@
1
+ # Based on removed standard configuration:
2
+ # https://github.com/testdouble/standard/commit/94d133f477a5694084ac974d5ee01e8a66ce777e#diff-65478e10d5b2ef41c7293a110c0e6b7c
3
+
4
+ require:
5
+ - rubocop-rails
6
+
7
+ Naming/FileName:
8
+ Exclude:
9
+ - config/initializers/*.rb
10
+
11
+ Rails/ActionFilter:
12
+ Enabled: true
13
+ EnforcedStyle: action
14
+ Include:
15
+ - app/controllers/**/*.rb
16
+
17
+ Rails/ActiveRecordAliases:
18
+ Enabled: true
19
+
20
+ Rails/ActiveSupportAliases:
21
+ Enabled: true
22
+
23
+ Rails/ApplicationJob:
24
+ Enabled: true
25
+
26
+ Rails/ApplicationRecord:
27
+ Enabled: true
28
+
29
+ Rails/AssertNot:
30
+ Enabled: true
31
+ Include:
32
+ - '**/test/**/*'
33
+
34
+ Rails/Blank:
35
+ Enabled: true
36
+ # Convert usages of `nil? || empty?` to `blank?`
37
+ NilOrEmpty: true
38
+ # Convert usages of `!present?` to `blank?`
39
+ NotPresent: true
40
+ # Convert usages of `unless present?` to `if blank?`
41
+ UnlessPresent: true
42
+
43
+ Rails/BulkChangeTable:
44
+ Enabled: true
45
+ Database: null
46
+ Include:
47
+ - db/migrate/*.rb
48
+
49
+ Rails/CreateTableWithTimestamps:
50
+ Enabled: true
51
+ Include:
52
+ - db/migrate/*.rb
53
+
54
+ Rails/Date:
55
+ Enabled: true
56
+ EnforcedStyle: flexible
57
+
58
+ Rails/Delegate:
59
+ Enabled: true
60
+ EnforceForPrefixed: true
61
+
62
+ Rails/DelegateAllowBlank:
63
+ Enabled: true
64
+
65
+ Rails/DynamicFindBy:
66
+ Enabled: true
67
+ Whitelist:
68
+ - find_by_sql
69
+
70
+ Rails/EnumUniqueness:
71
+ Enabled: true
72
+ Include:
73
+ - app/models/**/*.rb
74
+
75
+ Rails/EnvironmentComparison:
76
+ Enabled: true
77
+
78
+ Rails/Exit:
79
+ Enabled: true
80
+ Include:
81
+ - app/**/*.rb
82
+ - config/**/*.rb
83
+ - lib/**/*.rb
84
+ Exclude:
85
+ - lib/**/*.rake
86
+
87
+ Rails/FilePath:
88
+ Enabled: true
89
+ EnforcedStyle: arguments
90
+
91
+ Rails/FindBy:
92
+ Enabled: true
93
+ Include:
94
+ - app/models/**/*.rb
95
+
96
+ Rails/FindEach:
97
+ Enabled: true
98
+ Include:
99
+ - app/models/**/*.rb
100
+
101
+ Rails/HasAndBelongsToMany:
102
+ Enabled: true
103
+ Include:
104
+ - app/models/**/*.rb
105
+
106
+ Rails/HttpPositionalArguments:
107
+ Enabled: true
108
+ Include:
109
+ - 'spec/**/*'
110
+ - 'test/**/*'
111
+
112
+ Rails/HttpStatus:
113
+ Enabled: true
114
+ EnforcedStyle: symbolic
115
+
116
+ Rails/InverseOf:
117
+ Enabled: true
118
+ Include:
119
+ - app/models/**/*.rb
120
+
121
+ Rails/LexicallyScopedActionFilter:
122
+ Enabled: true
123
+ Safe: false
124
+ Include:
125
+ - app/controllers/**/*.rb
126
+
127
+ Rails/NotNullColumn:
128
+ Enabled: true
129
+ Include:
130
+ - db/migrate/*.rb
131
+
132
+ Rails/Output:
133
+ Enabled: true
134
+ Include:
135
+ - app/**/*.rb
136
+ - config/**/*.rb
137
+ - db/**/*.rb
138
+ - lib/**/*.rb
139
+
140
+ Rails/OutputSafety:
141
+ Enabled: true
142
+
143
+ Rails/PluralizationGrammar:
144
+ Enabled: true
145
+
146
+ Rails/Presence:
147
+ Enabled: true
148
+
149
+ Rails/Present:
150
+ Enabled: true
151
+ NotNilAndNotEmpty: true
152
+ NotBlank: true
153
+ UnlessBlank: true
154
+
155
+ Rails/ReadWriteAttribute:
156
+ Enabled: true
157
+ Include:
158
+ - app/models/**/*.rb
159
+
160
+ Rails/RedundantReceiverInWithOptions:
161
+ Enabled: true
162
+
163
+ Rails/RefuteMethods:
164
+ Enabled: true
165
+ Include:
166
+ - '**/test/**/*'
167
+
168
+ Rails/RelativeDateConstant:
169
+ Enabled: true
170
+ AutoCorrect: false
171
+
172
+ Rails/RequestReferer:
173
+ Enabled: true
174
+ EnforcedStyle: referer
175
+
176
+ Rails/ReversibleMigration:
177
+ Enabled: true
178
+ Include:
179
+ - db/migrate/*.rb
180
+
181
+ Rails/SafeNavigation:
182
+ Enabled: true
183
+ ConvertTry: false
184
+
185
+ Rails/ScopeArgs:
186
+ Enabled: true
187
+ Include:
188
+ - app/models/**/*.rb
189
+
190
+ Rails/TimeZone:
191
+ Enabled: true
192
+ EnforcedStyle: flexible
193
+
194
+ Rails/UniqBeforePluck:
195
+ Enabled: true
196
+ EnforcedStyle: conservative
197
+ AutoCorrect: false
198
+
199
+ Rails/Validation:
200
+ Enabled: true
201
+ Include:
202
+ - app/models/**/*.rb
data/config/rspec.yml ADDED
@@ -0,0 +1,50 @@
1
+ require:
2
+ - rubocop-rspec
3
+
4
+ RSpec/Focus:
5
+ Enabled: true
6
+
7
+ RSpec/EmptyExampleGroup:
8
+ Enabled: true
9
+
10
+ RSpec/EmptyLineAfterExampleGroup:
11
+ Enabled: true
12
+
13
+ RSpec/EmptyLineAfterFinalLet:
14
+ Enabled: true
15
+
16
+ RSpec/EmptyLineAfterHook:
17
+ Enabled: true
18
+
19
+ RSpec/EmptyLineAfterSubject:
20
+ Enabled: true
21
+
22
+ RSpec/HookArgument:
23
+ Enabled: true
24
+
25
+ RSpec/HooksBeforeExamples:
26
+ Enabled: true
27
+
28
+ RSpec/ImplicitExpect:
29
+ Enabled: true
30
+
31
+ RSpec/IteratedExpectation:
32
+ Enabled: true
33
+
34
+ RSpec/LetBeforeExamples:
35
+ Enabled: true
36
+
37
+ RSpec/MissingExampleGroupArgument:
38
+ Enabled: true
39
+
40
+ RSpec/ReceiveCounts:
41
+ Enabled: true
42
+
43
+ Capybara/CurrentPathExpectation:
44
+ Enabled: true
45
+
46
+ FactoryBot/AttributeDefinedStatically:
47
+ Enabled: true
48
+
49
+ FactoryBot/CreateList:
50
+ Enabled: true
data/docs/Guide.adoc CHANGED
@@ -2,11 +2,6 @@
2
2
 
3
3
  Limit lines to 120 characters.
4
4
 
5
- === Snake Case Files [[snake-case-files]]
6
-
7
- Use `snake_case` for naming files, e.g. `hello_world.rb`.
8
- For Rails initialisers this naming rule is not enforced.
9
-
10
5
  === Class/Module Documentation [[class-documentation]]
11
6
 
12
7
  Top-level classes and modules are not required to have documentation.
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rubocop
4
4
  module Itsmycargo
5
- VERSION = '0.1.10-alpha.0'
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rubocop/itsmycargo/version'
3
+ require "rubocop/itsmycargo/version"
4
4
 
5
5
  module Rubocop
6
6
  module Itsmycargo
@@ -1,38 +1,39 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('lib', __dir__)
3
+ lib = File.expand_path("lib", __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'rubocop/itsmycargo/version'
5
+ require "rubocop/itsmycargo/version"
6
6
 
7
7
  Gem::Specification.new do |spec|
8
- spec.name = 'rubocop-itsmycargo'
9
- spec.version = Rubocop::Itsmycargo::VERSION
10
- spec.authors = ['Mikko Kokkonen']
11
- spec.email = ['oss@itsmycargo.com']
8
+ spec.name = "rubocop-itsmycargo"
9
+ spec.version = Rubocop::Itsmycargo::VERSION
10
+ spec.authors = ["Mikko Kokkonen"]
11
+ spec.email = ["oss@itsmycargo.com"]
12
12
 
13
- spec.summary = 'RuboCop Styles and Configuration for ItsMyCargo.'
14
- spec.homepage = 'https://github.com/itsmycargo/rubocop-itsmycargo'
15
- spec.license = 'MIT'
13
+ spec.summary = "RuboCop Styles and Configuration for ItsMyCargo."
14
+ spec.homepage = "https://github.com/itsmycargo/rubocop-itsmycargo"
15
+ spec.license = "MIT"
16
16
 
17
- spec.metadata['homepage_uri'] = spec.homepage
18
- spec.metadata['source_code_uri'] = spec.homepage
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = spec.homepage
19
19
 
20
20
  # Specify which files should be added to the gem when it is released.
21
21
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
22
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
23
23
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
24
  end
25
- spec.bindir = 'exe'
26
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
- spec.require_paths = ['lib']
25
+ spec.bindir = "exe"
26
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ["lib"]
28
28
 
29
- spec.add_dependency 'rubocop'
30
- spec.add_dependency 'rubocop-performance'
31
- spec.add_dependency 'rubocop-rails'
32
- spec.add_dependency 'rubocop-rspec'
29
+ spec.add_dependency "rubocop"
30
+ spec.add_dependency "rubocop-performance"
31
+ spec.add_dependency "rubocop-rails"
32
+ spec.add_dependency "rubocop-rspec"
33
+ spec.add_dependency "standard"
33
34
 
34
- spec.add_development_dependency 'bump', '~> 0.9'
35
- spec.add_development_dependency 'bundler', '~> 2.1'
36
- spec.add_development_dependency 'rake', '~> 13.0'
37
- spec.add_development_dependency 'rspec', '~> 3.0'
35
+ spec.add_development_dependency "bump", "~> 0.9"
36
+ spec.add_development_dependency "bundler", "~> 2.1"
37
+ spec.add_development_dependency "rake", "~> 13.0"
38
+ spec.add_development_dependency "rspec", "~> 3.0"
38
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-itsmycargo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10.pre.alpha.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikko Kokkonen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-13 00:00:00.000000000 Z
11
+ date: 2020-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: standard
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: bump
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -129,7 +143,6 @@ executables: []
129
143
  extensions: []
130
144
  extra_rdoc_files: []
131
145
  files:
132
- - ".github/workflows/bump.yml"
133
146
  - ".gitignore"
134
147
  - ".rspec"
135
148
  - ".rubocop.yml"
@@ -141,7 +154,10 @@ files:
141
154
  - Rakefile
142
155
  - bin/console
143
156
  - bin/setup
144
- - config/default.yml
157
+ - config/base.yml
158
+ - config/legacy.yml
159
+ - config/rails.yml
160
+ - config/rspec.yml
145
161
  - docs/Guide.adoc
146
162
  - lib/rubocop/itsmycargo.rb
147
163
  - lib/rubocop/itsmycargo/version.rb
@@ -163,9 +179,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
163
179
  version: '0'
164
180
  required_rubygems_version: !ruby/object:Gem::Requirement
165
181
  requirements:
166
- - - ">"
182
+ - - ">="
167
183
  - !ruby/object:Gem::Version
168
- version: 1.3.1
184
+ version: '0'
169
185
  requirements: []
170
186
  rubygems_version: 3.1.2
171
187
  signing_key:
@@ -1,45 +0,0 @@
1
- name: Ruby Gems
2
-
3
- on:
4
- push:
5
- branches:
6
- - master
7
-
8
- jobs:
9
- build:
10
- name: Build & Publish
11
- runs-on: ubuntu-latest
12
-
13
- steps:
14
- - uses: actions/checkout@v2
15
- - uses: actions/setup-ruby@v1
16
- with:
17
- ruby-version: '2.7'
18
- - run: |
19
- git config --local user.email "dev-services@itsmycargo.com"
20
- git config --local user.name "ItsMyCargo"
21
- - run: bundle
22
- - run: rake bump:patch
23
- - run: git push --follow-tags
24
-
25
- - name: Publish to RubyGems
26
- run: |
27
- mkdir -p $HOME/.gem
28
- touch $HOME/.gem/credentials
29
- chmod 0600 $HOME/.gem/credentials
30
- printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
31
- gem build *.gemspec
32
- gem push *.gem
33
- env:
34
- GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
35
-
36
- - name: Publish to GitHub Package Registry
37
- run: |
38
- mkdir -p $HOME/.gem
39
- touch $HOME/.gem/credentials
40
- chmod 0600 $HOME/.gem/credentials
41
- printf -- "---\n:github: Bearer ${GH_TOKEN}\n" > $HOME/.gem/credentials
42
- gem build *.gemspec
43
- gem push --key github --host https://rubygems.pkg.github.com/itsmycargo *.gem
44
- env:
45
- GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
data/config/default.yml DELETED
@@ -1,35 +0,0 @@
1
- require:
2
- - rubocop-performance
3
- - rubocop-rails
4
- - rubocop-rspec
5
-
6
- AllCops:
7
- TargetRubyVersion: 2.6
8
-
9
- # Allow longer line length for bigger screens
10
- Layout/LineLength:
11
- Max: 120
12
- StyleGuide: 'https://github.com/mikian/itsmycargo/blob/master/docs/Guide.adoc#maximum-line-length'
13
-
14
- Lint/UnusedMethodArgument:
15
- AllowUnusedKeywordArguments: true
16
-
17
- # Allow Ignoring filename requirements for initializers
18
- Naming/FileName:
19
- Exclude:
20
- - config/initializers/*.rb
21
- StyleGuide: 'https://github.com/mikian/itsmycargo/blob/master/docs/Guide.adoc#snake-case-files'
22
-
23
- Style/Documentation:
24
- Enabled: false
25
- StyleGuide: 'https://github.com/mikian/itsmycargo/blob/master/docs/Guide.adoc#classmodule-documentation'
26
-
27
- Style/MethodCalledOnDoEndBlock:
28
- Enabled: true
29
-
30
- # RSpec
31
- RSpec/MultipleExpectations:
32
- AggregateFailuresByDefault: true
33
-
34
- RSpec/ExampleLength:
35
- Max: 8