checker 0.6.6 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/CHANGELOG +8 -2
- data/Gemfile +1 -4
- data/Gemfile.lock +44 -19
- data/LICENCE +21 -0
- data/README.md +12 -12
- data/checker.gemspec +5 -3
- data/lib/checker.rb +2 -2
- data/lib/checker/modules/rubocop.rb +17 -0
- data/lib/checker/results/rubocop.rb +6 -0
- data/lib/checker/version.rb +1 -1
- data/spec/checker/fixtures/ruby/{1.9/bad.rb → bad.rb} +0 -0
- data/spec/checker/fixtures/ruby/{1.9/good.rb → good.rb} +0 -0
- data/spec/checker/modules/ruby_spec.rb +9 -32
- metadata +48 -19
- data/spec/checker/fixtures/ruby/1.8/bad.rb +0 -3
- data/spec/checker/fixtures/ruby/1.8/bad2.rb +0 -2
- data/spec/checker/fixtures/ruby/1.8/good.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 894360b4c4709d62126e69e0b01358ab2e9804a1
|
4
|
+
data.tar.gz: f0e0e368a70349ada13d3ee4d76135b4040a44ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb79267069194530f065c9d344566ef1b28659dfd1b3d6cf454f3b75371141d1df1ff754dc14096b5d0746f870c161145a1da74c7cee88fd99d72f4dd8645f15
|
7
|
+
data.tar.gz: ee42f4ce711ca0882ba7542b760d38d2f1e28c9264f30647af22ae809fd0a77157ebb9f6d80ea1b5273cfe7537aeed7c735e5f9e44889d9c464e92387d4e0b55
|
data/.travis.yml
CHANGED
data/CHANGELOG
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
=== version 0.7.0 (released 2015-03-02)
|
2
|
+
|
3
|
+
* support for ruby 1.8 and ree is now gone
|
4
|
+
* added rubocop module
|
5
|
+
* some minor changes
|
6
|
+
|
1
7
|
=== version 0.6.6 (released 2013-06-03)
|
2
8
|
|
3
9
|
* you can now check all files inside specific directory
|
@@ -21,7 +27,7 @@ CHANGES
|
|
21
27
|
* new state: warning. it is using by couple of checks (console.log, javascript)
|
22
28
|
* added two more options: commit-on-warning and rails-for-sass (see readme for docs)
|
23
29
|
* added check for console.log existance - returns warning if found
|
24
|
-
* added reinstall script for git hook
|
30
|
+
* added reinstall script for git hook
|
25
31
|
* updated sass check to use rails runner if project is using asset-pipeline
|
26
32
|
* fixed bug when checker was running from system ruby version from git hook, not current rvm one
|
27
33
|
(checker reinstall required)
|
@@ -56,7 +62,7 @@ CHANGES
|
|
56
62
|
|
57
63
|
=== version 0.0.5 (released 2012-07-09)
|
58
64
|
|
59
|
-
* depencendy message - if executable not found,
|
65
|
+
* depencendy message - if executable not found,
|
60
66
|
then proper message is displayed
|
61
67
|
where to fetch executable for module
|
62
68
|
* fix ruby module, it should check only .rb files now
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,20 +1,35 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
checker (0.6.6)
|
5
|
+
colorize (~> 0.7.0)
|
6
|
+
rubocop (~> 0.28.0)
|
7
|
+
|
1
8
|
GEM
|
2
9
|
remote: http://rubygems.org/
|
3
10
|
specs:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
+
ast (2.0.0)
|
12
|
+
astrolabe (1.3.0)
|
13
|
+
parser (>= 2.2.0.pre.3, < 3.0)
|
14
|
+
colorize (0.7.5)
|
15
|
+
coveralls (0.7.11)
|
16
|
+
multi_json (~> 1.10)
|
17
|
+
rest-client (>= 1.6.8, < 2)
|
18
|
+
simplecov (~> 0.9.1)
|
19
|
+
term-ansicolor (~> 1.3)
|
20
|
+
thor (~> 0.19.1)
|
11
21
|
diff-lcs (1.1.3)
|
12
|
-
|
13
|
-
mime-types (
|
14
|
-
multi_json (1.
|
15
|
-
|
16
|
-
|
17
|
-
|
22
|
+
docile (1.1.5)
|
23
|
+
mime-types (2.4.3)
|
24
|
+
multi_json (1.10.1)
|
25
|
+
netrc (0.10.3)
|
26
|
+
parser (2.2.0.3)
|
27
|
+
ast (>= 1.1, < 3.0)
|
28
|
+
powerpack (0.0.9)
|
29
|
+
rainbow (2.0.0)
|
30
|
+
rest-client (1.7.3)
|
31
|
+
mime-types (>= 1.16, < 3.0)
|
32
|
+
netrc (~> 0.7)
|
18
33
|
rspec (2.11.0)
|
19
34
|
rspec-core (~> 2.11.0)
|
20
35
|
rspec-expectations (~> 2.11.0)
|
@@ -23,17 +38,27 @@ GEM
|
|
23
38
|
rspec-expectations (2.11.1)
|
24
39
|
diff-lcs (~> 1.1.3)
|
25
40
|
rspec-mocks (2.11.1)
|
26
|
-
|
41
|
+
rubocop (0.28.0)
|
42
|
+
astrolabe (~> 1.3)
|
43
|
+
parser (>= 2.2.0.pre.7, < 3.0)
|
44
|
+
powerpack (~> 0.0.6)
|
45
|
+
rainbow (>= 1.99.1, < 3.0)
|
46
|
+
ruby-progressbar (~> 1.4)
|
47
|
+
ruby-progressbar (1.7.1)
|
48
|
+
simplecov (0.9.2)
|
49
|
+
docile (~> 1.1.0)
|
27
50
|
multi_json (~> 1.0)
|
28
|
-
simplecov-html (~> 0.
|
29
|
-
simplecov-html (0.
|
30
|
-
|
51
|
+
simplecov-html (~> 0.9.0)
|
52
|
+
simplecov-html (0.9.0)
|
53
|
+
term-ansicolor (1.3.0)
|
54
|
+
tins (~> 1.0)
|
55
|
+
thor (0.19.1)
|
56
|
+
tins (1.3.4)
|
31
57
|
|
32
58
|
PLATFORMS
|
33
59
|
ruby
|
34
60
|
|
35
61
|
DEPENDENCIES
|
36
|
-
|
62
|
+
checker!
|
37
63
|
coveralls
|
38
|
-
rake
|
39
64
|
rspec
|
data/LICENCE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014 netguru
|
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 all
|
13
|
+
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 THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -8,28 +8,22 @@ A collection of modules for which every is designed to check syntax in files to
|
|
8
8
|
|
9
9
|
## Compatibility
|
10
10
|
|
11
|
-
Checker works with rubies
|
11
|
+
Checker works with rubies 1.9.2, 1.9.3 and 2.x.
|
12
12
|
As for Rails with SASS - tested with RoR 3.2.x
|
13
13
|
|
14
|
-
|
15
14
|
## Usage
|
16
15
|
|
17
16
|
### Install
|
18
|
-
Checker is available in rubygems (current stable version is 0.
|
17
|
+
Checker is available in rubygems (current stable version is 0.7.0), so you just need to do:
|
19
18
|
```
|
20
19
|
gem install checker
|
21
20
|
```
|
22
21
|
|
23
|
-
If you want to install release candidate version (current rc version is 0.6.5.rc2) use the following command:
|
24
|
-
```
|
25
|
-
gem install checker --pre
|
26
|
-
```
|
27
|
-
|
28
22
|
If you are using bundler, you can add it to your project via `Gemfile` file (best to put it under `:development` group).
|
29
23
|
Since checker is a command-line utility, there is no need to load it up in the application:
|
30
24
|
```ruby
|
31
25
|
group :development do
|
32
|
-
gem 'checker', :
|
26
|
+
gem 'checker', :require => false
|
33
27
|
end
|
34
28
|
```
|
35
29
|
|
@@ -41,8 +35,8 @@ All you need to do is type in `checker install` and it will automatically instal
|
|
41
35
|
to your current git project. It will look something like this:
|
42
36
|
|
43
37
|
```
|
44
|
-
#!/bin/bash
|
45
|
-
|
38
|
+
#!/bin/bash
|
39
|
+
|
46
40
|
#### Begin of checker script
|
47
41
|
if [ -f /Users/user/.rvm/bin/rvm-shell ]; then
|
48
42
|
/Users/user/.rvm/bin/rvm-shell 'ruby-1.9.3-p286' -c 'checker'
|
@@ -54,7 +48,7 @@ if [ $? = 1 ]; then
|
|
54
48
|
exit 1
|
55
49
|
fi
|
56
50
|
|
57
|
-
text=`echo -n ':
|
51
|
+
text=`echo -n ':ok: '; cat $1`
|
58
52
|
echo "$text" > $1
|
59
53
|
#### End of checker script
|
60
54
|
```
|
@@ -133,6 +127,9 @@ Checks for correct syntax in slim files
|
|
133
127
|
#### conflict
|
134
128
|
Checks for any occurence of git conflicts when merging (looks for `<<<<<<< ` or `>>>>>>> `)
|
135
129
|
|
130
|
+
#### rubocop
|
131
|
+
Checks for if code follows the style guides ( https://github.com/bbatsov/rubocop )
|
132
|
+
|
136
133
|
### Dependencies
|
137
134
|
|
138
135
|
For various modules to work you may need to install additional dependencies:
|
@@ -140,3 +137,6 @@ For various modules to work you may need to install additional dependencies:
|
|
140
137
|
* coffeescript - `npm install -g coffee-script` - see https://github.com/jashkenas/coffee-script/
|
141
138
|
* javascript - install jsl binary - see http://www.javascriptlint.com/download.htm
|
142
139
|
* haml & sass & slim - `gem install haml sass slim`
|
140
|
+
* rubocop - `gem install rubocop`
|
141
|
+
|
142
|
+
Copyright (c) 2015 Netguru. See LICENSE for further details.
|
data/checker.gemspec
CHANGED
@@ -4,7 +4,7 @@ require File.expand_path('../lib/checker/version', __FILE__)
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = 'checker'
|
6
6
|
s.version = Checker::VERSION
|
7
|
-
s.date = '
|
7
|
+
s.date = '2015-03-02'
|
8
8
|
s.summary = "Syntax checker for various files"
|
9
9
|
s.description = "A collection of modules which every is designed to check syntax for specific files."
|
10
10
|
s.authors = ["Jacek Jakubik", "Tomasz Pewiński"]
|
@@ -13,6 +13,8 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
14
14
|
s.require_paths = ["lib"]
|
15
15
|
s.homepage = 'http://github.com/netguru/checker'
|
16
|
-
s.add_dependency 'colorize', '0.
|
17
|
-
s.
|
16
|
+
s.add_dependency 'colorize', '~> 0.7.0'
|
17
|
+
s.add_dependency 'rubocop', '~> 0.28.0'
|
18
|
+
s.add_development_dependency 'coveralls'
|
19
|
+
s.add_development_dependency 'rspec'
|
18
20
|
end
|
data/lib/checker.rb
CHANGED
@@ -10,11 +10,11 @@ require 'checker/helper'
|
|
10
10
|
require 'checker/options'
|
11
11
|
require 'checker/result'
|
12
12
|
|
13
|
-
%w[base ruby haml slim pry coffeescript javascript sass yaml conflict console_log].each do |mod|
|
13
|
+
%w[base ruby haml slim pry coffeescript javascript sass yaml conflict console_log rubocop].each do |mod|
|
14
14
|
require "checker/modules/#{mod}"
|
15
15
|
end
|
16
16
|
|
17
|
-
%w[default console_log javascript].each do |res|
|
17
|
+
%w[default console_log javascript rubocop].each do |res|
|
18
18
|
require "checker/results/#{res}"
|
19
19
|
end
|
20
20
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Checker
|
2
|
+
module Modules
|
3
|
+
class Rubocop < Base
|
4
|
+
extensions 'rb'
|
5
|
+
private
|
6
|
+
def check_one(file, opts = {})
|
7
|
+
Checker::Result.result(self, plain_command("rubocop #{file}", :bundler => false))
|
8
|
+
end
|
9
|
+
|
10
|
+
def dependency_message
|
11
|
+
str = "Executable not found\n"
|
12
|
+
str << "Install rubocop using rubygems: 'gem install rubocop'"
|
13
|
+
str
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/checker/version.rb
CHANGED
File without changes
|
File without changes
|
@@ -8,42 +8,19 @@ describe Checker::Modules::Ruby do
|
|
8
8
|
mod.should_receive(:check_one_file).with('a.rb')
|
9
9
|
mod.should_not_receive(:check_one_file).with('b.js.erb')
|
10
10
|
mod.should_not_receive(:check_one_file).with('c.r')
|
11
|
-
mod.check
|
11
|
+
mod.check
|
12
12
|
end
|
13
13
|
|
14
|
-
# 1.8
|
15
|
-
if RUBY_VERSION < "1.9"
|
16
|
-
it "should pass the syntax check" do
|
17
|
-
files = [fixture("ruby", "1.8/good.rb")]
|
18
|
-
mod = Checker::Modules::Ruby.new(files)
|
19
|
-
mod.check.should be_true
|
20
|
-
end
|
21
14
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should not pass the syntax check" do
|
29
|
-
files = [fixture("ruby", "1.8/bad2.rb")]
|
30
|
-
mod = Checker::Modules::Ruby.new(files)
|
31
|
-
mod.check.should be_false
|
32
|
-
end
|
15
|
+
it "should pass the syntax check" do
|
16
|
+
files = [fixture("ruby", "good.rb")]
|
17
|
+
mod = Checker::Modules::Ruby.new(files)
|
18
|
+
mod.check.should be_true
|
33
19
|
end
|
34
20
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
mod.check.should be_true
|
40
|
-
end
|
41
|
-
|
42
|
-
it "should not pass the syntax check" do
|
43
|
-
files = [fixture("ruby", "1.9/bad.rb")]
|
44
|
-
mod = Checker::Modules::Ruby.new(files)
|
45
|
-
mod.check.should be_false
|
46
|
-
end
|
21
|
+
it "should not pass the syntax check" do
|
22
|
+
files = [fixture("ruby", "bad.rb")]
|
23
|
+
mod = Checker::Modules::Ruby.new(files)
|
24
|
+
mod.check.should be_false
|
47
25
|
end
|
48
|
-
# 1.9
|
49
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: checker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacek Jakubik
|
@@ -9,34 +9,62 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-03-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colorize
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.
|
20
|
+
version: 0.7.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.
|
27
|
+
version: 0.7.0
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rubocop
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 0.28.0
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 0.28.0
|
28
42
|
- !ruby/object:Gem::Dependency
|
29
43
|
name: coveralls
|
30
44
|
requirement: !ruby/object:Gem::Requirement
|
31
45
|
requirements:
|
32
|
-
- -
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rspec
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
33
61
|
- !ruby/object:Gem::Version
|
34
62
|
version: '0'
|
35
63
|
type: :development
|
36
64
|
prerelease: false
|
37
65
|
version_requirements: !ruby/object:Gem::Requirement
|
38
66
|
requirements:
|
39
|
-
- -
|
67
|
+
- - ">="
|
40
68
|
- !ruby/object:Gem::Version
|
41
69
|
version: '0'
|
42
70
|
description: A collection of modules which every is designed to check syntax for specific
|
@@ -49,12 +77,13 @@ executables:
|
|
49
77
|
extensions: []
|
50
78
|
extra_rdoc_files: []
|
51
79
|
files:
|
52
|
-
- .gitignore
|
53
|
-
- .rspec
|
54
|
-
- .travis.yml
|
80
|
+
- ".gitignore"
|
81
|
+
- ".rspec"
|
82
|
+
- ".travis.yml"
|
55
83
|
- CHANGELOG
|
56
84
|
- Gemfile
|
57
85
|
- Gemfile.lock
|
86
|
+
- LICENCE
|
58
87
|
- README.md
|
59
88
|
- Rakefile
|
60
89
|
- bin/checker
|
@@ -71,6 +100,7 @@ files:
|
|
71
100
|
- lib/checker/modules/haml.rb
|
72
101
|
- lib/checker/modules/javascript.rb
|
73
102
|
- lib/checker/modules/pry.rb
|
103
|
+
- lib/checker/modules/rubocop.rb
|
74
104
|
- lib/checker/modules/ruby.rb
|
75
105
|
- lib/checker/modules/sass.rb
|
76
106
|
- lib/checker/modules/slim.rb
|
@@ -80,6 +110,7 @@ files:
|
|
80
110
|
- lib/checker/results/console_log.rb
|
81
111
|
- lib/checker/results/default.rb
|
82
112
|
- lib/checker/results/javascript.rb
|
113
|
+
- lib/checker/results/rubocop.rb
|
83
114
|
- lib/checker/rvm.rb
|
84
115
|
- lib/checker/version.rb
|
85
116
|
- spec/assets/stylesheets/empty
|
@@ -92,11 +123,8 @@ files:
|
|
92
123
|
- spec/checker/fixtures/pry/with_pry.rb
|
93
124
|
- spec/checker/fixtures/pry/with_pry_remote.rb
|
94
125
|
- spec/checker/fixtures/pry/without_pry.rb
|
95
|
-
- spec/checker/fixtures/ruby/
|
96
|
-
- spec/checker/fixtures/ruby/
|
97
|
-
- spec/checker/fixtures/ruby/1.8/good.rb
|
98
|
-
- spec/checker/fixtures/ruby/1.9/bad.rb
|
99
|
-
- spec/checker/fixtures/ruby/1.9/good.rb
|
126
|
+
- spec/checker/fixtures/ruby/bad.rb
|
127
|
+
- spec/checker/fixtures/ruby/good.rb
|
100
128
|
- spec/checker/fixtures/yaml/bad.yaml
|
101
129
|
- spec/checker/fixtures/yaml/good.yaml
|
102
130
|
- spec/checker/modules/base_spec.rb
|
@@ -121,18 +149,19 @@ require_paths:
|
|
121
149
|
- lib
|
122
150
|
required_ruby_version: !ruby/object:Gem::Requirement
|
123
151
|
requirements:
|
124
|
-
- -
|
152
|
+
- - ">="
|
125
153
|
- !ruby/object:Gem::Version
|
126
154
|
version: '0'
|
127
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
156
|
requirements:
|
129
|
-
- -
|
157
|
+
- - ">="
|
130
158
|
- !ruby/object:Gem::Version
|
131
159
|
version: '0'
|
132
160
|
requirements: []
|
133
161
|
rubyforge_project:
|
134
|
-
rubygems_version: 2.
|
162
|
+
rubygems_version: 2.2.2
|
135
163
|
signing_key:
|
136
164
|
specification_version: 4
|
137
165
|
summary: Syntax checker for various files
|
138
166
|
test_files: []
|
167
|
+
has_rdoc:
|