rt_rubocop_defaults 1.0.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
+ SHA1:
3
+ metadata.gz: 686dd9932e1ca8b0c5f09edf264a158316b016d0
4
+ data.tar.gz: 7a3eaa418d2a5d964f4d40cea980c26dbf84b77e
5
+ SHA512:
6
+ metadata.gz: cdffa79c03c1cd00b0748d9b30c8344f85c0b542ececd324fb5926a5284decac7b951e84f59276b3f91ea1a48788e55d72d5c8e34af1e9aa82f624e079fc9823
7
+ data.tar.gz: 58dc52bb45a6a09ccca667e560676e19952ff73b19a5ccad7b390ffc0cf8a53540d35e7ef735a0f533bc15d19e4e193b0e1afae56ed435644845bfe0e64476bf
data/.gitignore ADDED
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ .ruby-version
data/.rubocop.yml ADDED
@@ -0,0 +1 @@
1
+ require: rt_rubocop_defaults
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+ source "https://rubygems.org"
3
+
4
+ # Specify your gem's dependencies in rt_rubocop_defaults.gemspec
5
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 Runtastic
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # Runtastic Rubocop Defaults
2
+
3
+ opinionenated and sharable default rubocop config used at [runtastic](https://runtastic.com)
4
+
5
+ Inspired by how [rubocop-rspec](https://github.com/backus/rubocop-rspec) delivers and injects it's configuration.
6
+
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ ```ruby
13
+ gem 'rt_rubocop_defaults', "~> 1.0", require: false
14
+ ```
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install rt_rubocop_defaults
23
+
24
+ ## Usage
25
+
26
+ You need to tell RuboCop to load the RSpec extension. There are three ways to do this:
27
+
28
+ ### RuboCop configuration file
29
+
30
+ Put this into your .rubocop.yml.
31
+
32
+ ```yml
33
+ require: rt_rubocop_defaults
34
+ ```
35
+
36
+ Now you can run rubocop and it will automatically load the RuboCop RSpec cops together with the standard cops.
37
+
38
+ ### Command line
39
+
40
+ ```sh
41
+ rubocop --require rt_rubocop_defaults
42
+ ```
43
+
44
+ ## Development
45
+
46
+ To install this gem onto your local machine, run `bundle exec rake install`. To
47
+ release a new version, update the version number in `version.rb`, and then run
48
+ `bundle exec rake release`, which will create a git tag for the version, push
49
+ git commits and tags, and push the `.gem` file
50
+ to [rubygems.org](https://rubygems.org).
51
+
52
+ ## Contributing
53
+
54
+ Bug reports and pull requests are welcome on GitHub at
55
+ https://github.com/runtastic/rt_rubocop_defaults. This project is intended to be a safe,
56
+ welcoming space for collaboration, and contributors are expected to adhere to
57
+ the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
58
+
59
+ ## License
60
+
61
+ The gem is available as open source under the terms of
62
+ the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ # frozen_string_literal: true
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,121 @@
1
+ AllCops:
2
+ DisplayCopNames: true
3
+ CacheRootDirectory: '.git'
4
+ Exclude:
5
+ - coverage/**/*
6
+ TargetRubyVersion: 2.3
7
+
8
+
9
+ ### Lint
10
+
11
+ Lint/NestedMethodDefinition:
12
+ Exclude:
13
+ - api/sinatra/**/*
14
+
15
+ ### Metrics
16
+
17
+ Metrics/LineLength:
18
+ Max: 119
19
+ Exclude:
20
+ - Guardfile
21
+ - Gemfile
22
+
23
+ Metrics/MethodLength:
24
+ Enabled: true
25
+ CountComments: false # count full line comments?
26
+ Max: 10
27
+ Severity: refactor
28
+ Exclude:
29
+ - api/sinatra/**/*
30
+
31
+ Metrics/AbcSize:
32
+ Exclude:
33
+ - api/sinatra/**/*
34
+
35
+ Metrics/BlockLength:
36
+ Exclude:
37
+ - '*.gemspec'
38
+ - '**/*.rake'
39
+ - 'spec/**/*.rb'
40
+
41
+ ### Style
42
+ Style/ExtraSpacing:
43
+ Enabled: false
44
+
45
+ Style/AlignHash:
46
+ EnforcedColonStyle: table
47
+ EnforcedHashRocketStyle: table
48
+
49
+ Style/HashSyntax:
50
+ EnforcedStyle: ruby19
51
+
52
+ Style/MultilineOperationIndentation:
53
+ Description: Checks indentation of binary operations that span more than one line.
54
+ EnforcedStyle: indented
55
+
56
+ Style/RaiseArgs:
57
+ EnforcedStyle: compact
58
+
59
+ Style/SignalException:
60
+ EnforcedStyle: only_raise
61
+
62
+ Style/StringLiterals:
63
+ EnforcedStyle: double_quotes
64
+
65
+ Style/DoubleNegation:
66
+ Enabled: false
67
+
68
+ Style/RegexpLiteral:
69
+ Enabled: false
70
+
71
+ Style/PerlBackrefs:
72
+ Enabled: false
73
+
74
+ Style/Documentation:
75
+ Enabled: false
76
+
77
+ Style/NumericLiterals:
78
+ Description: Add underscores to large numeric literals to improve their readability.
79
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics
80
+ Enabled: false
81
+
82
+ ### Specs
83
+
84
+ Metrics/ClassLength:
85
+ Exclude:
86
+ - spec/**/*
87
+
88
+ Metrics/ModuleLength:
89
+ Exclude:
90
+ - spec/requests/**/*
91
+
92
+ ### RSpec
93
+
94
+ RSpec/ExampleWording:
95
+ IgnoredWords:
96
+ - only
97
+ CustomTransform:
98
+ have: has
99
+
100
+ RSpec/FilePath:
101
+ Exclude:
102
+ - spec/**/*
103
+
104
+ RSpec/DescribeClass:
105
+ Exclude:
106
+ - spec/integration/**/*
107
+
108
+ RSpec/ExampleLength:
109
+ Enabled: false
110
+
111
+ RSpec/NamedSubject:
112
+ Enabled: false
113
+
114
+ RSpec/NestedGroups:
115
+ Enabled: false
116
+
117
+ RSpec/MultipleExpectations:
118
+ Enabled: false
119
+
120
+ RSpec/MessageExpectation:
121
+ Enabled: false
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+ require "rt_rubocop_defaults/version"
3
+ require "rt_rubocop_defaults/inject"
4
+
5
+ RTRuboCopDefaults::Inject.defaults!
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+ require "yaml"
3
+ require "rubocop"
4
+
5
+ module RTRuboCopDefaults
6
+ # Because RuboCop doesn't yet support plugins, we have to monkey patch in a
7
+ # bit of our configuration.
8
+ module Inject
9
+ DEFAULT_FILE = File.expand_path(
10
+ "../../../config/default.yml", __FILE__
11
+ )
12
+
13
+ def self.defaults!
14
+ path = File.absolute_path(DEFAULT_FILE)
15
+ hash = RuboCop::ConfigLoader.send(:load_yaml_configuration, path)
16
+ config = RuboCop::Config.new(hash, path)
17
+ puts "configuration from #{DEFAULT_FILE}" if RuboCop::ConfigLoader.debug?
18
+ config = RuboCop::ConfigLoader.merge_with_default(config, path)
19
+
20
+ RuboCop::ConfigLoader.instance_variable_set(:@default_configuration, config)
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+ module RTRuboCopDefaults
3
+ VERSION = "1.0.0"
4
+ end
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ # frozen_string_literal: true
3
+ lib = File.expand_path("../lib", __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require "rt_rubocop_defaults/version"
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "rt_rubocop_defaults"
9
+ spec.version = RTRuboCopDefaults::VERSION
10
+ spec.authors = ["Andreas Eger"]
11
+ spec.email = ["andreas.eger@runtastic.com"]
12
+ spec.summary = "rubocop defaults used at runtastic"
13
+ spec.description = "rubocop defaults used at runtastic"
14
+ spec.license = "MIT"
15
+ spec.homepage = "https://github.com/runtastic/rt_rubocop_defaults"
16
+ spec.required_ruby_version = "~> 2.2"
17
+
18
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
19
+ f.match(%r{^(test|spec|features)/})
20
+ end
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.46"
26
+ spec.add_development_dependency "bundler", "~> 1.13"
27
+ spec.add_development_dependency "rake", "~> 10.0"
28
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rt_rubocop_defaults
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Andreas Eger
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-01-10 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.46'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.46'
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.13'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.13'
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
+ description: rubocop defaults used at runtastic
56
+ email:
57
+ - andreas.eger@runtastic.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".rubocop.yml"
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - config/default.yml
69
+ - lib/rt_rubocop_defaults.rb
70
+ - lib/rt_rubocop_defaults/inject.rb
71
+ - lib/rt_rubocop_defaults/version.rb
72
+ - rt_rubocop_defaults.gemspec
73
+ homepage: https://github.com/runtastic/rt_rubocop_defaults
74
+ licenses:
75
+ - MIT
76
+ metadata: {}
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - "~>"
84
+ - !ruby/object:Gem::Version
85
+ version: '2.2'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.5.2
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: rubocop defaults used at runtastic
97
+ test_files: []