optimum-energy-rubocop 0.0.8 → 0.1.4
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 +37 -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: 898bb526143b7e8eb0597fd82d98e7c51fecc27882b640c5104b72e519f2b68c
|
4
|
+
data.tar.gz: a06de13a281fb2697b5f280cd8bf6beaa1df05f7310280a0d20b1290ea025d95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b67b9ce2551e529e68c98534043872f46381f422a00d6c43f4b50231f5ec3e9f1bd87849ad4c77888b18215685145723d6143bf64e4e027781430486ff0e3de4
|
7
|
+
data.tar.gz: becabb5135450f4874222130618dc3c87f8b16b1ccaa5260dce8ebd4e7f8a17a9134b6c12b760fed52ebea9ab42ccc85dd4038adbc46a75e2986fc827ee5666a
|
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.4
|
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
@@ -4,6 +4,7 @@
|
|
4
4
|
AllCops:
|
5
5
|
Exclude:
|
6
6
|
- 'db/schema.rb'
|
7
|
+
- 'bin/*'
|
7
8
|
|
8
9
|
Rails:
|
9
10
|
Enabled: true
|
@@ -20,6 +21,9 @@ Layout/AlignParameters:
|
|
20
21
|
Layout/CaseIndentation:
|
21
22
|
EnforcedStyle: end
|
22
23
|
|
24
|
+
Layout/EmptyLineAfterGuardClause:
|
25
|
+
Enabled: false
|
26
|
+
|
23
27
|
# Ideally, I would like to insert empty lines at the beginning on a class definition, but not at the
|
24
28
|
# end. https://github.com/bbatsov/rubocop/issues/4812
|
25
29
|
Layout/EmptyLinesAroundClassBody:
|
@@ -35,6 +39,7 @@ Layout/EmptyLineBetweenDefs:
|
|
35
39
|
AllowAdjacentOneLineDefs: true
|
36
40
|
NumberOfEmptyLines: 1
|
37
41
|
|
42
|
+
|
38
43
|
Layout/EndOfLine:
|
39
44
|
EnforcedStyle: lf
|
40
45
|
|
@@ -75,6 +80,14 @@ Naming/FileName:
|
|
75
80
|
- 'bin/**/*'
|
76
81
|
- 'db/**/*'
|
77
82
|
- 'spec/**/*'
|
83
|
+
- '**/config.ru'
|
84
|
+
- 'lib/tasks/**'
|
85
|
+
|
86
|
+
Rails/BulkChangeTable:
|
87
|
+
Enabled: false
|
88
|
+
|
89
|
+
Style/AccessModifierDeclarations:
|
90
|
+
EnforcedStyle: inline
|
78
91
|
|
79
92
|
Style/ConditionalAssignment:
|
80
93
|
EnforcedStyle: assign_to_condition
|
@@ -87,21 +100,35 @@ Style/Copyright:
|
|
87
100
|
Style/Documentation:
|
88
101
|
Enabled: false
|
89
102
|
|
103
|
+
Style/DoubleNegation:
|
104
|
+
Enabled: false
|
105
|
+
|
90
106
|
Style/FormatString:
|
91
107
|
EnforcedStyle: percent
|
92
108
|
|
93
109
|
# 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
|
110
|
+
# every file, we should not mutate strings.
|
95
111
|
Style/FrozenStringLiteralComment:
|
96
112
|
EnforcedStyle: never
|
97
113
|
|
98
|
-
Style/
|
99
|
-
|
100
|
-
|
114
|
+
Style/MultilineBlockChain:
|
115
|
+
Enabled: false
|
116
|
+
|
117
|
+
Style/MultilineTernaryOperator:
|
118
|
+
Enabled: false
|
119
|
+
|
120
|
+
Style/PercentLiteralDelimiters:
|
121
|
+
Enabled: false
|
122
|
+
|
123
|
+
Style/RegexpLiteral:
|
124
|
+
Enabled: false
|
101
125
|
|
102
126
|
Style/ReturnNil:
|
103
127
|
Enabled: true
|
104
128
|
|
129
|
+
Style/StringLiterals:
|
130
|
+
EnforcedStyle: double_quotes
|
131
|
+
|
105
132
|
Style/SymbolArray:
|
106
133
|
MinSize: 3
|
107
134
|
|
@@ -138,15 +165,9 @@ Layout/BlockAlignment:
|
|
138
165
|
Layout/EndAlignment:
|
139
166
|
EnforcedStyleAlignWith: start_of_line
|
140
167
|
|
141
|
-
Rails/RequestReferer:
|
142
|
-
EnforcedStyle: referrer
|
143
|
-
|
144
168
|
Rails/Date:
|
145
169
|
EnforcedStyle: strict
|
146
170
|
|
147
|
-
Rails/TimeZone:
|
148
|
-
EnforcedStyle: flexible
|
149
|
-
|
150
171
|
Rails/FilePath:
|
151
172
|
Enabled: false
|
152
173
|
|
@@ -154,8 +175,11 @@ Rails/FilePath:
|
|
154
175
|
Rails/InverseOf:
|
155
176
|
Enabled: false
|
156
177
|
|
157
|
-
Style/MultilineTernaryOperator:
|
158
|
-
Enabled: false
|
159
|
-
|
160
178
|
Rails/NotNullColumn:
|
161
179
|
Enabled: false
|
180
|
+
|
181
|
+
Rails/RequestReferer:
|
182
|
+
EnforcedStyle: referrer
|
183
|
+
|
184
|
+
Rails/TimeZone:
|
185
|
+
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.4
|
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-
|
11
|
+
date: 2019-02-05 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
|