bloom_rubocop 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9c6aa97d2ddf5796a3302214280b84252053d0e7c6dfc6f8551fcd99c3829a21
4
+ data.tar.gz: 331187320a93fbfe725555e19eaf166a7a1754a7768d33e8a0fb70d425bb59d3
5
+ SHA512:
6
+ metadata.gz: 7795165cf98fa5fb1b2fd4cda66056fbe5536a164e6f6b138323e476b3774b408b5e5ff7bbea545d295a60600e2a6d6c771fbd5433a8febdbc680f0cdeddee4a
7
+ data.tar.gz: 4f1318c2ff49faec34b2790b0135eabd291ed9d143da2b084d1885c1634fea515a848d002c71e8de05b99132fd30195134185720367f3936b4fa4e3007c47222
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rubocop.yml ADDED
@@ -0,0 +1,194 @@
1
+ Rails:
2
+ Enabled: true
3
+
4
+ AllCops:
5
+ Exclude:
6
+ - "db/schema.rb"
7
+
8
+ # Bloom: Exclude RSpec and db/schema
9
+ Metrics/BlockLength:
10
+ Exclude:
11
+ - "Gemfile"
12
+ - "Rakefile"
13
+ - "**/*.rake"
14
+ - "spec/**/*.rb"
15
+
16
+ Metrics/ModuleLength:
17
+ Exclude:
18
+ - "Gemfile"
19
+ - "Rakefile"
20
+ - "**/*.rake"
21
+ - "spec/**/*.rb"
22
+
23
+ # For gemspec
24
+ Style/ExpandPathArguments:
25
+ Exclude:
26
+ - "**/*.gemspec"
27
+
28
+ # Bloom prefers empty lines on classes
29
+ Layout/EmptyLinesAroundClassBody:
30
+ EnforcedStyle: empty_lines
31
+
32
+ # Bloom prefers the literal -> () call
33
+ Style/Lambda:
34
+ EnforcedStyle: literal
35
+
36
+ # Bloom prefers space in the literal -> () call
37
+ Layout/SpaceInLambdaLiteral:
38
+ EnforcedStyle: require_space
39
+
40
+ # Bloom prefers the () call
41
+ Style/LambdaCall:
42
+ Enabled: false
43
+
44
+ # Bloom: hashes/arrays look more readable if indented on the same as the hash literal
45
+ Layout/IndentHash:
46
+ EnforcedStyle: consistent
47
+ Layout/IndentArray:
48
+ EnforcedStyle: consistent
49
+
50
+ Lint/UnusedMethodArgument:
51
+ Enabled: false
52
+ Lint/UnusedBlockArgument:
53
+ Enabled: false
54
+
55
+ # Bloom: Prefer leaving trailing commas, lessens git commits
56
+ Style/TrailingCommaInArguments:
57
+ EnforcedStyleForMultiline: comma
58
+ Style/TrailingCommaInArrayLiteral:
59
+ EnforcedStyleForMultiline: comma
60
+ Style/TrailingCommaInHashLiteral:
61
+ EnforcedStyleForMultiline: comma
62
+
63
+ # Bloom: Frozen literals don't offer that much improvement for the amount of changes
64
+ # we'll need to benefit
65
+ Style/FrozenStringLiteralComment:
66
+ Enabled: false
67
+
68
+ # Bloom: Too explicit
69
+ Rails/HasManyOrHasOneDependent:
70
+ Enabled: false
71
+
72
+ # Bloom: Most methods, like factory_bot factory methods, look more readable
73
+ # when supplying attributes via a hash
74
+ Style/BracesAroundHashParameters:
75
+ Enabled: false
76
+
77
+ Metrics/LineLength:
78
+ Max: 80
79
+
80
+ Metrics/AbcSize:
81
+ Max: 25
82
+
83
+ # Too short methods lead to extraction of single-use methods, which can make
84
+ # the code easier to read (by naming things), but can also clutter the class
85
+ Metrics/MethodLength:
86
+ Max: 25
87
+
88
+ # The guiding principle of classes is SRP, SRP can't be accurately measured by LoC
89
+ Metrics/ClassLength:
90
+ Max: 1500
91
+
92
+ # Single quotes being faster is hardly measurable and only affects parse time.
93
+ # Enforcing double quotes reduces the times where you need to change them
94
+ # when introducing an interpolation. Use single quotes only if their semantics
95
+ # are needed.
96
+ Style/StringLiterals:
97
+ EnforcedStyle: double_quotes
98
+
99
+ # We do not need to support Ruby 1.9, so this is good to use.
100
+ Style/SymbolArray:
101
+ Enabled: true
102
+
103
+ # Mixing the styles looks just silly.
104
+ Style/HashSyntax:
105
+ EnforcedStyle: ruby19_no_mixed_keys
106
+
107
+ # has_key? and has_value? are far more readable than key? and value?
108
+ Style/PreferredHashMethods:
109
+ Enabled: false
110
+
111
+ # String#% is by far the least verbose and only object oriented variant.
112
+ Style/FormatString:
113
+ EnforcedStyle: percent
114
+
115
+ Style/CollectionMethods:
116
+ Enabled: true
117
+ PreferredMethods:
118
+ # inject seems more common in the community.
119
+ reduce: "inject"
120
+
121
+ # Either allow this style or don't. Marking it as safe with parenthesis
122
+ # is silly. Let's try to live without them for now.
123
+ Style/ParenthesesAroundCondition:
124
+ AllowSafeAssignment: false
125
+ Lint/AssignmentInCondition:
126
+ AllowSafeAssignment: false
127
+
128
+ # A specialized exception class will take one or more arguments and construct the message from it.
129
+ # So both variants make sense.
130
+ Style/RaiseArgs:
131
+ Enabled: false
132
+
133
+ # Indenting the chained dots beneath each other is not supported by this cop,
134
+ # see https://github.com/bbatsov/rubocop/issues/1633
135
+ Layout/MultilineOperationIndentation:
136
+ Enabled: false
137
+
138
+ # Fail is an alias of raise. Avoid aliases, it's more cognitive load for no gain.
139
+ # The argument that fail should be used to abort the program is wrong too,
140
+ # there's Kernel#abort for that.
141
+ Style/SignalException:
142
+ EnforcedStyle: only_raise
143
+
144
+ # Suppressing exceptions can be perfectly fine, and be it to avoid to
145
+ # explicitly type nil into the rescue since that's what you want to return,
146
+ # or suppressing LoadError for optional dependencies
147
+ Lint/HandleExceptions:
148
+ Enabled: false
149
+
150
+ Layout/SpaceInsideBlockBraces:
151
+ # The space here provides no real gain in readability while consuming
152
+ # horizontal space that could be used for a better parameter name.
153
+ # Also {| differentiates better from a hash than { | does.
154
+ SpaceBeforeBlockParameters: false
155
+
156
+ Layout/MultilineMethodCallIndentation:
157
+ EnforcedStyle: indented
158
+
159
+ # { ... } for multi-line blocks is okay, follow Weirichs rule instead:
160
+ # https://web.archive.org/web/20140221124509/http://onestepback.org/index.cgi/Tech/Ruby/BraceVsDoEnd.rdoc
161
+ Style/BlockDelimiters:
162
+ Enabled: false
163
+
164
+ # do / end blocks should be used for side effects,
165
+ # methods that run a block for side effects and have
166
+ # a useful return value are rare, assign the return
167
+ # value to a local variable for those cases.
168
+ Style/MethodCalledOnDoEndBlock:
169
+ Enabled: true
170
+
171
+ # Enforcing the names of variables? To single letter ones? Just no.
172
+ Style/SingleLineBlockParams:
173
+ Enabled: false
174
+
175
+ # Shadowing outer local variables with block parameters is often useful
176
+ # to not reinvent a new name for the same thing, it highlights the relation
177
+ # between the outer variable and the parameter. The cases where it's actually
178
+ # confusing are rare, and usually bad for other reasons already, for example
179
+ # because the method is too long.
180
+ Lint/ShadowingOuterLocalVariable:
181
+ Enabled: false
182
+
183
+ # Check with yard instead.
184
+ Style/Documentation:
185
+ Enabled: false
186
+
187
+ # This is just silly. Calling the argument `other` in all cases makes no sense.
188
+ Naming/BinaryOperatorParameterName:
189
+ Enabled: false
190
+
191
+ # There are valid cases, for example debugging Cucumber steps,
192
+ # also they'll fail CI anyway
193
+ Lint/Debugger:
194
+ Enabled: false
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.5.1
data/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [0.1.0]
8
+
9
+ ### Added
10
+ - Initial commit
11
+
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at ace.subido@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in bloom_rubocop.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,53 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ bloom_rubocop (0.1.0)
5
+ rubocop (= 0.58.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.0)
11
+ diff-lcs (1.3)
12
+ jaro_winkler (1.5.1)
13
+ parallel (1.12.1)
14
+ parser (2.5.1.2)
15
+ ast (~> 2.4.0)
16
+ powerpack (0.1.2)
17
+ rainbow (3.0.0)
18
+ rake (10.5.0)
19
+ rspec (3.8.0)
20
+ rspec-core (~> 3.8.0)
21
+ rspec-expectations (~> 3.8.0)
22
+ rspec-mocks (~> 3.8.0)
23
+ rspec-core (3.8.0)
24
+ rspec-support (~> 3.8.0)
25
+ rspec-expectations (3.8.1)
26
+ diff-lcs (>= 1.2.0, < 2.0)
27
+ rspec-support (~> 3.8.0)
28
+ rspec-mocks (3.8.0)
29
+ diff-lcs (>= 1.2.0, < 2.0)
30
+ rspec-support (~> 3.8.0)
31
+ rspec-support (3.8.0)
32
+ rubocop (0.58.2)
33
+ jaro_winkler (~> 1.5.1)
34
+ parallel (~> 1.10)
35
+ parser (>= 2.5, != 2.5.1.1)
36
+ powerpack (~> 0.1)
37
+ rainbow (>= 2.2.2, < 4.0)
38
+ ruby-progressbar (~> 1.7)
39
+ unicode-display_width (~> 1.0, >= 1.0.1)
40
+ ruby-progressbar (1.10.0)
41
+ unicode-display_width (1.4.0)
42
+
43
+ PLATFORMS
44
+ ruby
45
+
46
+ DEPENDENCIES
47
+ bloom_rubocop!
48
+ bundler (~> 1.16)
49
+ rake (~> 10.0)
50
+ rspec (~> 3.0)
51
+
52
+ BUNDLED WITH
53
+ 1.16.2
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Ace Subido
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,22 @@
1
+ ## bloom_rubocop
2
+
3
+ Bloom's Ruby style preferences
4
+
5
+ ### Installation
6
+
7
+ Add this to your Gemfile
8
+
9
+ ```
10
+ group :development, :test do
11
+ gem "bloom_rubocop"
12
+ end
13
+ ```
14
+
15
+ Create/Edit your `.rubocop.yml` in your project with this changes:
16
+
17
+ ```
18
+ inherit_gem:
19
+ bloom_rubocop: default.yml
20
+ ```
21
+
22
+ Now your rubocop linter will use the `bloom_rubocop` styles
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "bloom_rubocop"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,30 @@
1
+ lib = File.expand_path("lib", __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "bloom_rubocop/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "bloom_rubocop"
7
+ spec.version = BloomRubocop::VERSION
8
+ spec.authors = ["Ace Subido"]
9
+ spec.email = ["ace.subido@gmail.com"]
10
+ spec.summary = "Bloom's Rubocop Configuration"
11
+ spec.description = "Bloom's Rubocop Configuration"
12
+ spec.homepage = "https://github.com/bloom-solutions/dotfiles"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
16
+ `git ls-files -z`.split("\x0").reject do |f|
17
+ f.match(%r{^(test|spec|features)/})
18
+ end
19
+ end
20
+
21
+ spec.bindir = "exe"
22
+ spec.executables = spec.files.grep(%r{^exe/}) {|f| File.basename(f) }
23
+ spec.require_paths = ["lib"]
24
+
25
+ spec.add_dependency "rubocop", "0.58.2"
26
+
27
+ spec.add_development_dependency "bundler", "~> 1.16"
28
+ spec.add_development_dependency "rake", "~> 10.0"
29
+ spec.add_development_dependency "rspec", "~> 3.0"
30
+ end
data/default.yml ADDED
@@ -0,0 +1,2 @@
1
+ inherit_from:
2
+ - .rubocop.yml
@@ -0,0 +1,4 @@
1
+ require "bloom_rubocop/version"
2
+
3
+ module BloomRubocop
4
+ end
@@ -0,0 +1,3 @@
1
+ module BloomRubocop
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,116 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bloom_rubocop
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ace Subido
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-10-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rubocop
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 0.58.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.58.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.16'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.16'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
69
+ description: Bloom's Rubocop Configuration
70
+ email:
71
+ - ace.subido@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".rubocop.yml"
78
+ - ".ruby-version"
79
+ - CHANGELOG.md
80
+ - CODE_OF_CONDUCT.md
81
+ - Gemfile
82
+ - Gemfile.lock
83
+ - LICENSE.txt
84
+ - README.md
85
+ - Rakefile
86
+ - bin/console
87
+ - bin/setup
88
+ - bloom_rubocop.gemspec
89
+ - default.yml
90
+ - lib/bloom_rubocop.rb
91
+ - lib/bloom_rubocop/version.rb
92
+ homepage: https://github.com/bloom-solutions/dotfiles
93
+ licenses:
94
+ - MIT
95
+ metadata: {}
96
+ post_install_message:
97
+ rdoc_options: []
98
+ require_paths:
99
+ - lib
100
+ required_ruby_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ requirements: []
111
+ rubyforge_project:
112
+ rubygems_version: 2.7.6
113
+ signing_key:
114
+ specification_version: 4
115
+ summary: Bloom's Rubocop Configuration
116
+ test_files: []