reevoocop 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +28 -14
- data/lib/reevoocop/version.rb +1 -1
- data/lib/reevoocop.yml +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a513f98ad5763efbc9762a830f40be4be279b10f
|
4
|
+
data.tar.gz: ddea6c5ecd4fbdcd8b9ecd5200dd4f69f8b2a1c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2578d214ad53032cadcec9db2dafd6baa3531e98bcb508809f61640d70ff60af4ac8376f1f77081420beb39a9f51b1ebea3d8d3a04bc538f985956407c29c146
|
7
|
+
data.tar.gz: aeb805789b2550176bc37419a47c24d04f296e0e4d5c082a59876d068d724a002899e2da6098e9f6cdbc8e15c7ca806caeca56eb32710d0c595410a5ae768fa6
|
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# Reevoocop
|
2
2
|
|
3
|
-
20% MonkeyPatch
|
4
|
-
|
5
|
-
|
3
|
+
*20% MonkeyPatch, 80% YAML, 100% Style*
|
4
|
+
|
5
|
+
Reevoocop uses [RuboCop](https://github.com/bbatsov/rubocop) to enforce Reevoo's style guidelines.
|
6
|
+
|
7
|
+
"What are the guidelines?", I hear you bellow. Well, [check out our commented settings file](https://github.com/reevoo/reevoocop/blob/master/lib/reevoocop.yml) for more information.
|
6
8
|
|
7
9
|
## Installation
|
8
10
|
|
@@ -14,39 +16,51 @@ And then execute:
|
|
14
16
|
|
15
17
|
$ bundle
|
16
18
|
|
17
|
-
Or install it
|
19
|
+
Or install it globally with:
|
18
20
|
|
19
21
|
$ gem install reevoocop
|
20
22
|
|
21
23
|
## Usage
|
22
24
|
|
23
|
-
In a Rakefile
|
25
|
+
In a Rakefile:
|
26
|
+
|
24
27
|
```ruby
|
25
28
|
require 'reevoocop/rake_task'
|
26
29
|
ReevooCop::RakeTask.new(:reevoocop)
|
27
30
|
```
|
28
31
|
|
29
|
-
|
32
|
+
This can be quite dramatic if you haven't been using a style checker previously and you have, say, 10 years of code written. Why not only lint files changed in the last N commits? This also makes reevoocop much faster in large codebases as you only have to lint recently changed files.
|
30
33
|
|
31
34
|
```ruby
|
32
|
-
|
33
|
-
|
35
|
+
require 'reevoocop/rake_task'
|
36
|
+
ReevooCop::RakeTask.new(:reevoocop) do |task|
|
37
|
+
task.patterns = reevoocop_files(5)
|
38
|
+
task.options = ['-D'] # Dispays name of failing cop in output.
|
39
|
+
exit if task.patterns == []
|
34
40
|
end
|
35
41
|
|
36
|
-
def
|
37
|
-
`git diff-tree --no-commit-id --name-only -r
|
38
|
-
.split("\n").select { |f| f.match(/(rb\z)/) && File.exist?(f)
|
42
|
+
def reevoocop_files(pedantry)
|
43
|
+
`git diff-tree --no-commit-id --name-only -r HEAD~#{pedantry} HEAD`
|
44
|
+
.split("\n").select { |f| f.match(/(\.rb\z)|Rakefile/) && File.exist?(f) && !f.match(/db/) }
|
39
45
|
end
|
40
46
|
```
|
41
47
|
|
42
|
-
|
48
|
+
You can also use Reevoocop stand-alone:
|
49
|
+
|
43
50
|
```
|
44
51
|
$ reevoocop
|
45
52
|
```
|
46
53
|
|
54
|
+
If you are introducing reevoocop to an existing project, or bumping the reevoocop version try:
|
55
|
+
|
56
|
+
```
|
57
|
+
$ reevoocop -a
|
58
|
+
```
|
59
|
+
Anything that can be auto corrected will be, this will save you a lot of time!
|
60
|
+
|
47
61
|
## Configuring / Contributing
|
48
62
|
|
49
63
|
1. You can't configure this, thats the point.
|
50
64
|
2. If you need to change our style guidelines, update the `lib/reevoocop.yml` file and open a pull request.
|
51
|
-
3. If you have a good reason to break the guidelines, you can [switch
|
52
|
-
4. Please don't open a pull request unless you work at
|
65
|
+
3. If you have a good reason to break the guidelines, you can [switch off the cop for the code like this.](https://github.com/bbatsov/rubocop#disabling-cops-within-source-code)
|
66
|
+
4. Please don't open a pull request unless you work at Reevoo, if you don't but would like to, [look at our website!](http://reevoo.github.io/)
|
data/lib/reevoocop/version.rb
CHANGED
data/lib/reevoocop.yml
CHANGED
@@ -62,6 +62,12 @@ TrailingComma:
|
|
62
62
|
- comma
|
63
63
|
- no_comma
|
64
64
|
|
65
|
+
# See https://github.com/reevoo/reevoocop/issues/18
|
66
|
+
# We are fine with using double negation to to force
|
67
|
+
# something truthy or falsy to true or false
|
68
|
+
Style/DoubleNegation:
|
69
|
+
Enabled: false
|
70
|
+
|
65
71
|
AllCops:
|
66
72
|
Exclude:
|
67
73
|
- !ruby/regexp /node_modules/
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reevoocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ed Robinson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|