shop_storm_cops 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rubocop.yml +2 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +77 -0
- data/Rakefile +9 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/shop_storm_cops/rubocop/shared_cops.yml +45 -0
- data/lib/shop_storm_cops/version.rb +3 -0
- data/lib/shop_storm_cops.rb +1 -0
- data/shop_storm_cops.gemspec +28 -0
- metadata +116 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ed7b2b5ed1e389be21ff9a8f66ff41fdd8237d03
|
4
|
+
data.tar.gz: 513d649114ade19569d56efb42e911b15204ebec
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bee5da9e744668b74e3b445a113b1ff298654726212f6ca1c15392ebe3d90664dfc87707531d049ccdd0fb9c2a42227d64844c6e5061aa8abf299af6efae0e80
|
7
|
+
data.tar.gz: 14256daf9fa5cd0cd1e6d9697b16858d7d6218170d813837157b1cefc246c4374849cc2ee5a55dbd4d4c4cb86bccdea0679a97c8bd02ec1a24222d11955d795f
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 SkyVerge
|
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,77 @@
|
|
1
|
+
# ShopStormCops
|
2
|
+
|
3
|
+
ShopStormCops is a little library that integrates [RuboCop](https://github.com/bbatsov/rubocop) into your Ruby project, configured for following the coding conventions we use at [SkyVerge](https://www.skyverge.com/) ([ShopStorm](https://shopstorm.com/) division). It is planned to add more 3rd party coding style tools in the future.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add the gem into your Gemfile’s development and test groups:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
group :development, :test do
|
11
|
+
gem ‘shop_storm_cops’
|
12
|
+
end
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
### Rubocop integration
|
23
|
+
|
24
|
+
ShopStormCops adds RuboCop as a dependency and provides you with a shared cop file based in the coding conventions of SkyVerge. For use it you should create a `.rubocop.yml` file into your root rails directory with the following content:
|
25
|
+
|
26
|
+
```yml
|
27
|
+
# .rubocop.yml file located into the root rails directory
|
28
|
+
|
29
|
+
inherit_gem:
|
30
|
+
shop_storm_cops: lib/shop_storm_cops/rubocop/shared_cops.yml
|
31
|
+
```
|
32
|
+
|
33
|
+
With `inherit_gem`, you’re configuring RuboCop for inheriting from a file inside this actual gem. You can review the shared cops in [`shared_cops.yml`](lib/shop_storm_cops/rubocop/shared_cops.yml). Now you’re free to execute the RuboCop standalone command with:
|
34
|
+
|
35
|
+
$ bundle exec rubocop
|
36
|
+
|
37
|
+
You’re free to configure your `.rubocop.yml` file for inheriting also from a local file, like from `.rubocop_todo.yml`, as it is the typical workflow. This is how it’d look:
|
38
|
+
|
39
|
+
```yml
|
40
|
+
# .rubocop.yml file located into the root rails directory
|
41
|
+
|
42
|
+
inherit_gem:
|
43
|
+
shop_storm_cops: lib/shop_storm_cops/rubocop/shared_cops.yml
|
44
|
+
|
45
|
+
inherit_from:
|
46
|
+
- .rubocop_todo.yml
|
47
|
+
```
|
48
|
+
|
49
|
+
The file inherited via `inherit_from` will have more preference than the one inherited from the gem, so the repeated Cops would be overwritten according to https://github.com/bbatsov/rubocop#inheriting-configuration-from-a-dependency-gem.
|
50
|
+
|
51
|
+
#### Common commands
|
52
|
+
|
53
|
+
* `bundle exec rubocop`: Run the conventions suite.
|
54
|
+
* `bundle exec rubocop —auto-gen-config`: Automatically generates the `.rubocop_todo.yml` according to the current offences.
|
55
|
+
* `bundle exec rubocop —auto-correct`: Auto correct the current offences automatically. Use with caution. Intensive revision of the changes and the run of the test suite will be needed after using the auto correction. Not all the Cops implement auto correction, only some of them.
|
56
|
+
|
57
|
+
Take a look at the https://github.com/bbatsov/rubocop documentation for a more advanced use.
|
58
|
+
|
59
|
+
## Future platforms to integrate
|
60
|
+
|
61
|
+
* [Rails best practices](https://github.com/railsbp/rails_best_practices)
|
62
|
+
|
63
|
+
## Contributing
|
64
|
+
|
65
|
+
We follow the [GitHub Flow](https://guides.github.com/introduction/flow/index.html) model:
|
66
|
+
|
67
|
+
1. Check for issues of your interest or create a new one.
|
68
|
+
1. Fork the repo ( http://github.com/skyverge/shopstorm-cops/fork ).
|
69
|
+
1. Create your branch with a descriptive name, prefixed with the type (feature, chore, bug, release) and the related issue number. (`git checkout -b feature/my-new-feature`).
|
70
|
+
1. Implement a test covering what you’re going to develop.
|
71
|
+
1. Push your branch with your changes and send us a pull request.
|
72
|
+
|
73
|
+
Many thanks! :)
|
74
|
+
|
75
|
+
## License
|
76
|
+
|
77
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'shop_storm_cops'
|
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
|
data/bin/setup
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Rubocop config file with the fundamentals SkyVerge's coding conventions which
|
2
|
+
# need to be overwriten from the standard Rubocop conventions. This config file
|
3
|
+
# is the one to inherit from on apps using this gem.
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
RunRailsCops: true
|
7
|
+
DisplayStyleGuide: true
|
8
|
+
DisplayCopNames: true
|
9
|
+
|
10
|
+
# Lint Cops
|
11
|
+
|
12
|
+
Lint/AmbiguousRegexpLiteral:
|
13
|
+
Enabled: false
|
14
|
+
|
15
|
+
Lint/HandleExceptions:
|
16
|
+
Enabled: false
|
17
|
+
|
18
|
+
# Style Cops
|
19
|
+
|
20
|
+
Style/AccessModifierIndentation:
|
21
|
+
EnforcedStyle: outdent
|
22
|
+
|
23
|
+
Style/Documentation:
|
24
|
+
Enabled: false
|
25
|
+
|
26
|
+
# Allow compact `Module::Class` style inside tests.
|
27
|
+
Style/ClassAndModuleChildren:
|
28
|
+
Exclude:
|
29
|
+
- 'test/**/*'
|
30
|
+
|
31
|
+
Style/FormatString:
|
32
|
+
EnforcedStyle: sprintf
|
33
|
+
|
34
|
+
# Disabled regex literal style cop which seems to not work properly. Forcing
|
35
|
+
# 'EnforcedStyle: slashes' keeps raising offeses advising the use of '%r'.
|
36
|
+
Style/RegexpLiteral:
|
37
|
+
Enabled: false
|
38
|
+
|
39
|
+
Style/SignalException:
|
40
|
+
EnforcedStyle: only_raise
|
41
|
+
|
42
|
+
# Sometimes we align first args when many related methods are called together
|
43
|
+
# like in /config/routes.rb
|
44
|
+
Style/SingleSpaceBeforeFirstArg:
|
45
|
+
Enabled: false
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'shop_storm_cops/version'
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'shop_storm_cops/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'shop_storm_cops'
|
8
|
+
spec.version = ShopStormCops::VERSION
|
9
|
+
spec.authors = ['Daniel Madrid', 'Hannes Benson', 'Jory Hatton',
|
10
|
+
'Justin Stern', 'Max Rice']
|
11
|
+
spec.email = ['help@shopstorm.com']
|
12
|
+
spec.summary = 'Ruby coding convention tools used in ShopStorm'
|
13
|
+
spec.homepage = 'https://github.com/skyverge/shopstorm-cops'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^test/}) }
|
17
|
+
spec.bindir = 'exe'
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.required_ruby_version = '>= 2.0.0'
|
22
|
+
|
23
|
+
spec.add_runtime_dependency 'rubocop', '~> 0.35'
|
24
|
+
|
25
|
+
spec.add_development_dependency 'bundler', '~> 1.10'
|
26
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
27
|
+
spec.add_development_dependency 'minitest', '~> 5.8'
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: shop_storm_cops
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Daniel Madrid
|
8
|
+
- Hannes Benson
|
9
|
+
- Jory Hatton
|
10
|
+
- Justin Stern
|
11
|
+
- Max Rice
|
12
|
+
autorequire:
|
13
|
+
bindir: exe
|
14
|
+
cert_chain: []
|
15
|
+
date: 2015-11-13 00:00:00.000000000 Z
|
16
|
+
dependencies:
|
17
|
+
- !ruby/object:Gem::Dependency
|
18
|
+
name: rubocop
|
19
|
+
requirement: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - "~>"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '0.35'
|
24
|
+
type: :runtime
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
28
|
+
- - "~>"
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0.35'
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: bundler
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - "~>"
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '1.10'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - "~>"
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '1.10'
|
45
|
+
- !ruby/object:Gem::Dependency
|
46
|
+
name: rake
|
47
|
+
requirement: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - "~>"
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '10.0'
|
52
|
+
type: :development
|
53
|
+
prerelease: false
|
54
|
+
version_requirements: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - "~>"
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '10.0'
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: minitest
|
61
|
+
requirement: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - "~>"
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '5.8'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - "~>"
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '5.8'
|
73
|
+
description:
|
74
|
+
email:
|
75
|
+
- help@shopstorm.com
|
76
|
+
executables: []
|
77
|
+
extensions: []
|
78
|
+
extra_rdoc_files: []
|
79
|
+
files:
|
80
|
+
- ".gitignore"
|
81
|
+
- ".rubocop.yml"
|
82
|
+
- Gemfile
|
83
|
+
- LICENSE.txt
|
84
|
+
- README.md
|
85
|
+
- Rakefile
|
86
|
+
- bin/console
|
87
|
+
- bin/setup
|
88
|
+
- lib/shop_storm_cops.rb
|
89
|
+
- lib/shop_storm_cops/rubocop/shared_cops.yml
|
90
|
+
- lib/shop_storm_cops/version.rb
|
91
|
+
- shop_storm_cops.gemspec
|
92
|
+
homepage: https://github.com/skyverge/shopstorm-cops
|
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: 2.0.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.4.5
|
113
|
+
signing_key:
|
114
|
+
specification_version: 4
|
115
|
+
summary: Ruby coding convention tools used in ShopStorm
|
116
|
+
test_files: []
|