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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12143b030d02ebc1472a0bea19cc70a4e7903c37
4
- data.tar.gz: e248efbcc1dbfdc8576d2e9536b5b51963b5b33e
3
+ metadata.gz: a513f98ad5763efbc9762a830f40be4be279b10f
4
+ data.tar.gz: ddea6c5ecd4fbdcd8b9ecd5200dd4f69f8b2a1c6
5
5
  SHA512:
6
- metadata.gz: 5dcf7d227b2c43577b9ae0fa38b0737397504f5ed4aae7a0a29a6ec5367a194ef45b1941a406504292e7809e1a0bd0236062e7f38a4bcd7e42dc78ce76274605
7
- data.tar.gz: 85d5a678890979f117eca6206327c51d6084147c4ca5bcf8919ef1a276d4fa851d8a9e12c6c7a8db914fa56d2fc736995bd17401315f2edae614497f3caf3acc
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
- 80% YAML
5
- 100% Style
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 yourself as:
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
- Or to only have it lint files after the specified commit:
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
- task :reevoocop do
33
- exit 27 unless system("reevoocop #{files_that_changed_since_t_minus_0}")
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 files_that_changed_since_t_minus_0
37
- `git diff-tree --no-commit-id --name-only -r 19c297ff4a91b47c9af735a935c72ea5a2f05791 HEAD`
38
- .split("\n").select { |f| f.match(/(rb\z)/) && File.exist?(f) }.join(' ')
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
- In your shell
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 of the cop in question for the code in question, like this](https://github.com/bbatsov/rubocop#disabling-cops-within-source-code)
52
- 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/)
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/)
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module ReevooCop
4
- VERSION = "0.0.7"
4
+ VERSION = "0.0.8"
5
5
  end
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.7
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-02 00:00:00.000000000 Z
11
+ date: 2016-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop