optimum-energy-rubocop 0.0.8 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.ruby-version +1 -0
- data/Dockerfile +12 -0
- data/Gemfile +3 -1
- data/Gemfile.lock +5 -2
- data/LICENSE.txt +1 -1
- data/README.md +9 -4
- data/VERSION.txt +1 -0
- data/bin/publish +16 -0
- data/codeship-services.yml +9 -0
- data/codeship-steps.yml +14 -0
- data/deployment.env.encrypted +2 -0
- data/optimum-energy-rubocop.gemspec +7 -7
- data/optimum_energy_rubocop.yml +36 -13
- metadata +11 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7a9ce45359f66881a361b5bd465906d84f3f6901933f7baaa5bab4afdd57fea
|
4
|
+
data.tar.gz: 56b1fd0c19ef4d20a3cafed1a9401e937db8badd0b41fb621b533c68111d1206
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1637fa4601572e88d7408d58bff9f2d2d5275e5a9c7a7ce1320f53f8dcc30f69fe525ff63050e147d40ea2e1bb9743b9e47411d9d1c505ba53445f6890fe1c9b
|
7
|
+
data.tar.gz: 657ea757a1df2a43c486213ec5eeb60bfdaf8f9b866238a20d71227017b04b16012cf3d718cc49bc79a93291b95e4d1439bb101a6c9fc31f8d1b9d9a44369d03
|
data/.gitignore
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.6.0
|
data/Dockerfile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
FROM ruby:2.6.0
|
2
|
+
|
3
|
+
# Install the dependencies
|
4
|
+
ADD Gemfile Gemfile.lock .ruby-version optimum-energy-rubocop.gemspec VERSION.txt /app/
|
5
|
+
WORKDIR /app
|
6
|
+
RUN bundle install
|
7
|
+
|
8
|
+
# Add the app
|
9
|
+
ADD . /app
|
10
|
+
|
11
|
+
# Add the bin directory to the $PATH
|
12
|
+
ENV PATH="/app/bin:${PATH}"
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
optimum-energy-rubocop (0.
|
4
|
+
optimum-energy-rubocop (0.1.3)
|
5
5
|
rubocop (~> 0.50)
|
6
6
|
|
7
7
|
GEM
|
@@ -31,5 +31,8 @@ PLATFORMS
|
|
31
31
|
DEPENDENCIES
|
32
32
|
optimum-energy-rubocop!
|
33
33
|
|
34
|
+
RUBY VERSION
|
35
|
+
ruby 2.6.0p0
|
36
|
+
|
34
37
|
BUNDLED WITH
|
35
|
-
1.
|
38
|
+
1.17.2
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -3,11 +3,10 @@
|
|
3
3
|
This is the [shared](https://rubocop.readthedocs.io/en/latest/configuration/) team Rubocop
|
4
4
|
configuration for [Optimum Energy](http://optimumenergyco.com/).
|
5
5
|
|
6
|
+
## Installation
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
First, add the gem to your Gemfile. We recommend not locking in the version of the gem because we
|
10
|
-
regularly update this repo as we come across new rules.
|
8
|
+
First, add `optimum-energy-rubocop` to your `Gemfile` and run `bundle install`. We recommend not
|
9
|
+
locking in the version of the gem because we regularly update this repo as we come across new rules.
|
11
10
|
|
12
11
|
```
|
13
12
|
gem 'optimum-energy-rubocop'
|
@@ -23,6 +22,12 @@ inherit_from:
|
|
23
22
|
- optimum_energy_rubocop.yml
|
24
23
|
```
|
25
24
|
|
25
|
+
## Updating This Gem
|
26
|
+
|
27
|
+
After making changes to the rules in the [default.yml](default.yml) file, be sure that the version
|
28
|
+
is bumped in both the [VERSION.txt](VERSION.txt) and [Gemfile.lock](Gemfile.lock) files. If the
|
29
|
+
version is not changed, repos consuming this gem will not get the updates.
|
30
|
+
|
26
31
|
## Running Rubocop
|
27
32
|
|
28
33
|
To run the cops, run `rubocop` from the command line.
|
data/VERSION.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.3
|
data/bin/publish
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
set -euo pipefail
|
4
|
+
|
5
|
+
# This script publishes this gem to rubygems.org. It is intended to be run in the CI only. Running
|
6
|
+
# this locally will have global side effects.
|
7
|
+
|
8
|
+
# Create the credentials file
|
9
|
+
mkdir -p "$HOME/.gem"
|
10
|
+
echo -e "---\\r\\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
|
11
|
+
chmod 0600 "$HOME/.gem/credentials"
|
12
|
+
|
13
|
+
# Publish the gem
|
14
|
+
GEM_NAME="optimum-energy-rubocop"
|
15
|
+
gem build "$GEM_NAME.gemspec"
|
16
|
+
gem push "$GEM_NAME-$(cat VERSION.txt).gem"
|
data/codeship-steps.yml
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
-
|
2
|
+
name: run-shellcheck
|
3
|
+
service: shellcheck
|
4
|
+
command: sh -c "cd /app && shellcheck -x bin/*"
|
5
|
+
|
6
|
+
-
|
7
|
+
name: rubocop
|
8
|
+
service: optimum-energy-rubocop
|
9
|
+
command: rubocop
|
10
|
+
-
|
11
|
+
name: publish-to-rubygems
|
12
|
+
service: optimum-energy-rubocop
|
13
|
+
command: publish
|
14
|
+
tag: master
|
@@ -1,13 +1,13 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
|
-
spec.name =
|
3
|
-
spec.version = File.read(
|
4
|
-
spec.authors = [
|
2
|
+
spec.name = "optimum-energy-rubocop"
|
3
|
+
spec.version = File.read("VERSION.txt")
|
4
|
+
spec.authors = [ "Optimum Energy" ]
|
5
5
|
|
6
|
-
spec.summary =
|
7
|
-
spec.homepage =
|
8
|
-
spec.license =
|
6
|
+
spec.summary = "The shared Rubocop configuration for Optimum Energy"
|
7
|
+
spec.homepage = "https://github.com/optimiumenergyco/optimum-energy-rubocop"
|
8
|
+
spec.license = "MIT"
|
9
9
|
|
10
10
|
spec.files = `git ls-files -z`.split("\x0")
|
11
11
|
|
12
|
-
spec.add_dependency
|
12
|
+
spec.add_dependency "rubocop", "~> 0.50"
|
13
13
|
end
|
data/optimum_energy_rubocop.yml
CHANGED
@@ -20,6 +20,9 @@ Layout/AlignParameters:
|
|
20
20
|
Layout/CaseIndentation:
|
21
21
|
EnforcedStyle: end
|
22
22
|
|
23
|
+
Layout/EmptyLineAfterGuardClause:
|
24
|
+
Enabled: false
|
25
|
+
|
23
26
|
# Ideally, I would like to insert empty lines at the beginning on a class definition, but not at the
|
24
27
|
# end. https://github.com/bbatsov/rubocop/issues/4812
|
25
28
|
Layout/EmptyLinesAroundClassBody:
|
@@ -35,6 +38,7 @@ Layout/EmptyLineBetweenDefs:
|
|
35
38
|
AllowAdjacentOneLineDefs: true
|
36
39
|
NumberOfEmptyLines: 1
|
37
40
|
|
41
|
+
|
38
42
|
Layout/EndOfLine:
|
39
43
|
EnforcedStyle: lf
|
40
44
|
|
@@ -75,6 +79,14 @@ Naming/FileName:
|
|
75
79
|
- 'bin/**/*'
|
76
80
|
- 'db/**/*'
|
77
81
|
- 'spec/**/*'
|
82
|
+
- '**/config.ru'
|
83
|
+
- 'lib/tasks/**'
|
84
|
+
|
85
|
+
Rails/BulkChangeTable:
|
86
|
+
Enabled: false
|
87
|
+
|
88
|
+
Style/AccessModifierDeclarations:
|
89
|
+
EnforcedStyle: inline
|
78
90
|
|
79
91
|
Style/ConditionalAssignment:
|
80
92
|
EnforcedStyle: assign_to_condition
|
@@ -87,21 +99,35 @@ Style/Copyright:
|
|
87
99
|
Style/Documentation:
|
88
100
|
Enabled: false
|
89
101
|
|
102
|
+
Style/DoubleNegation:
|
103
|
+
Enabled: false
|
104
|
+
|
90
105
|
Style/FormatString:
|
91
106
|
EnforcedStyle: percent
|
92
107
|
|
93
108
|
# This won't be necessary when we upgrade to Ruby 3.0. Until then, rather than adding a comment to
|
94
|
-
# every file, we should
|
109
|
+
# every file, we should not mutate strings.
|
95
110
|
Style/FrozenStringLiteralComment:
|
96
111
|
EnforcedStyle: never
|
97
112
|
|
98
|
-
Style/
|
99
|
-
|
100
|
-
|
113
|
+
Style/MultilineBlockChain:
|
114
|
+
Enabled: false
|
115
|
+
|
116
|
+
Style/MultilineTernaryOperator:
|
117
|
+
Enabled: false
|
118
|
+
|
119
|
+
Style/PercentLiteralDelimiters:
|
120
|
+
Enabled: false
|
121
|
+
|
122
|
+
Style/RegexpLiteral:
|
123
|
+
Enabled: false
|
101
124
|
|
102
125
|
Style/ReturnNil:
|
103
126
|
Enabled: true
|
104
127
|
|
128
|
+
Style/StringLiterals:
|
129
|
+
EnforcedStyle: double_quotes
|
130
|
+
|
105
131
|
Style/SymbolArray:
|
106
132
|
MinSize: 3
|
107
133
|
|
@@ -138,15 +164,9 @@ Layout/BlockAlignment:
|
|
138
164
|
Layout/EndAlignment:
|
139
165
|
EnforcedStyleAlignWith: start_of_line
|
140
166
|
|
141
|
-
Rails/RequestReferer:
|
142
|
-
EnforcedStyle: referrer
|
143
|
-
|
144
167
|
Rails/Date:
|
145
168
|
EnforcedStyle: strict
|
146
169
|
|
147
|
-
Rails/TimeZone:
|
148
|
-
EnforcedStyle: flexible
|
149
|
-
|
150
170
|
Rails/FilePath:
|
151
171
|
Enabled: false
|
152
172
|
|
@@ -154,8 +174,11 @@ Rails/FilePath:
|
|
154
174
|
Rails/InverseOf:
|
155
175
|
Enabled: false
|
156
176
|
|
157
|
-
Style/MultilineTernaryOperator:
|
158
|
-
Enabled: false
|
159
|
-
|
160
177
|
Rails/NotNullColumn:
|
161
178
|
Enabled: false
|
179
|
+
|
180
|
+
Rails/RequestReferer:
|
181
|
+
EnforcedStyle: referrer
|
182
|
+
|
183
|
+
Rails/TimeZone:
|
184
|
+
EnforcedStyle: flexible
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: optimum-energy-rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Optimum Energy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -30,11 +30,19 @@ executables: []
|
|
30
30
|
extensions: []
|
31
31
|
extra_rdoc_files: []
|
32
32
|
files:
|
33
|
+
- ".gitignore"
|
33
34
|
- ".rubocop.yml"
|
35
|
+
- ".ruby-version"
|
36
|
+
- Dockerfile
|
34
37
|
- Gemfile
|
35
38
|
- Gemfile.lock
|
36
39
|
- LICENSE.txt
|
37
40
|
- README.md
|
41
|
+
- VERSION.txt
|
42
|
+
- bin/publish
|
43
|
+
- codeship-services.yml
|
44
|
+
- codeship-steps.yml
|
45
|
+
- deployment.env.encrypted
|
38
46
|
- optimum-energy-rubocop.gemspec
|
39
47
|
- optimum_energy_rubocop.yml
|
40
48
|
homepage: https://github.com/optimiumenergyco/optimum-energy-rubocop
|
@@ -56,8 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
64
|
- !ruby/object:Gem::Version
|
57
65
|
version: '0'
|
58
66
|
requirements: []
|
59
|
-
|
60
|
-
rubygems_version: 2.7.3
|
67
|
+
rubygems_version: 3.0.1
|
61
68
|
signing_key:
|
62
69
|
specification_version: 4
|
63
70
|
summary: The shared Rubocop configuration for Optimum Energy
|