syntaxer 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +20 -7
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/bin/syntaxer +19 -1
- data/features/plain_check.feature +1 -1
- data/features/printer_check.feature +24 -0
- data/features/rails_check.feature +12 -0
- data/features/repository_check.feature +4 -0
- data/features/step_definitions/plain_checker.rb +21 -0
- data/features/step_definitions/rails_checker.rb +29 -0
- data/features/step_definitions/repository_checker.rb +18 -2
- data/features/support/hooks.rb +2 -2
- data/features/syntaxer_check.feature +19 -1
- data/lib/syntaxer.rb +17 -6
- data/lib/syntaxer/checker.rb +38 -17
- data/lib/syntaxer/file_status.rb +6 -5
- data/lib/syntaxer/language_definition.rb +5 -3
- data/lib/syntaxer/printer.rb +43 -16
- data/lib/syntaxer/progress_bar.rb +13 -0
- data/lib/syntaxer/railtie.rb +1 -1
- data/lib/syntaxer/reader.rb +2 -0
- data/lib/tasks/syntaxer.rake +9 -0
- data/rails/init.rb +1 -1
- data/spec/checker_spec.rb +12 -10
- data/spec/fixtures/ruby/correct.rb.example +5 -1
- data/spec/fixtures/ruby/subfolder/wrong.rb.example +2 -0
- data/spec/fixtures/syntaxer_rules.rb +3 -2
- data/spec/language_rules_spec.rb +1 -1
- data/spec/printer_spec.rb +2 -2
- data/spec/reader_spec.rb +5 -6
- data/spec/spec_helper.rb +12 -1
- data/spec/syntaxer_spec.rb +7 -1
- data/syntaxer.gemspec +8 -2
- data/syntaxer_rails_rules.dist.rb +20 -0
- data/syntaxer_rules.dist.rb +2 -2
- metadata +33 -65
data/README.rdoc
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
== Overview
|
4
4
|
|
5
5
|
Syntaxer make possible check syntax of scripts. It may be used in standalone mode and with git repository for checking changed and added files only.
|
6
|
-
It is useful for for rails team, because you need to store only
|
6
|
+
It is useful for for rails team, because you need to store only file with rules, and git hook will be generated for you.
|
7
7
|
|
8
8
|
== Installation
|
9
9
|
|
@@ -11,11 +11,24 @@ To install syntaxer run
|
|
11
11
|
|
12
12
|
[sudo] gem install syntaxer
|
13
13
|
|
14
|
-
|
14
|
+
|
15
|
+
== Usage with rails
|
16
|
+
|
17
|
+
1) Add to Gemfile
|
18
|
+
|
19
|
+
gem "syntaxer"
|
20
|
+
|
21
|
+
2)
|
15
22
|
|
16
|
-
|
23
|
+
bundle install
|
17
24
|
|
18
|
-
|
25
|
+
3)
|
26
|
+
|
27
|
+
rake syntaxer:install
|
28
|
+
|
29
|
+
It creates config/syntaxer.rb file with common rails options, you may edit it as you wish, and .git/hooks/pre-commit script, which will run syntax checking before every commit.
|
30
|
+
|
31
|
+
== Standalone usage
|
19
32
|
|
20
33
|
Example of usage:
|
21
34
|
|
@@ -36,8 +49,6 @@ Indicate custom config file
|
|
36
49
|
syntaxer -c config.rb
|
37
50
|
|
38
51
|
|
39
|
-
Describe your rules in syntaxer.rb file and put in "initializers" folder for rails
|
40
|
-
|
41
52
|
Example of syntaxer.rb file:
|
42
53
|
|
43
54
|
syntaxer do
|
@@ -75,6 +86,8 @@ Options for usage
|
|
75
86
|
-r, --repo indicate type of repository. Available git and svn at this time.
|
76
87
|
-i, --install generates pre-commit hook and put it in .git/hooks folder. It checks syntax of languages what are indicated in options file before every commit
|
77
88
|
-q, --quite disable information messages. Is needed when you only want to know the result: 1 or 0
|
89
|
+
-l, --loud informate about every checked file
|
90
|
+
-W, --warnings show warning messages
|
78
91
|
-h, --help show help and options describe above.
|
79
92
|
|
80
93
|
== Contributing to syntaxer
|
@@ -107,4 +120,4 @@ Artem Melnikov (ignar) Svitla Systems Inc (www.svitla.com)
|
|
107
120
|
|
108
121
|
== Copyright
|
109
122
|
|
110
|
-
See LICENSE.txt for further details.
|
123
|
+
See LICENSE.txt for further details.
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/bin/syntaxer
CHANGED
@@ -15,6 +15,8 @@ class SyntaxerCLI
|
|
15
15
|
options.config_file = Syntaxer::SYNTAXER_RULES_FILE
|
16
16
|
options.root_path = Dir.getwd
|
17
17
|
options.languages = :all
|
18
|
+
options.warnings = false
|
19
|
+
options.rails = false
|
18
20
|
|
19
21
|
opts = OptionParser.new do |opts|
|
20
22
|
opts.banner = "Usage: syntaxer [options]"
|
@@ -40,14 +42,30 @@ class SyntaxerCLI
|
|
40
42
|
options.repository = r
|
41
43
|
end
|
42
44
|
|
43
|
-
opts.on("-q", "--quite", "Run in
|
45
|
+
opts.on("-q", "--quite", "Run in quite mode") do |r|
|
44
46
|
options.quite = true
|
45
47
|
end
|
46
48
|
|
49
|
+
opts.on("-l", "--loud", "Run in loud mode") do |r|
|
50
|
+
options.loud = true
|
51
|
+
end
|
52
|
+
|
47
53
|
opts.on("-i", "--install", "Write hooks to git") do |r|
|
48
54
|
options.generate = true
|
49
55
|
end
|
50
56
|
|
57
|
+
opts.on("-W", "--warnings", "Turn warning messages on") do |r|
|
58
|
+
options.warnings = true
|
59
|
+
end
|
60
|
+
|
61
|
+
opts.on("-H", "--hook", "Use syntaxer in hook context") do |r|
|
62
|
+
options.hook = true
|
63
|
+
end
|
64
|
+
|
65
|
+
opts.on("-R", "--rails", "Use syntaxer with rails") do |r|
|
66
|
+
options.rails = true
|
67
|
+
end
|
68
|
+
|
51
69
|
opts.separator ""
|
52
70
|
opts.separator "Common options:"
|
53
71
|
|
@@ -8,7 +8,7 @@ Feature: Check syntax in plain mode
|
|
8
8
|
@plain
|
9
9
|
Scenario: Run checker in directory
|
10
10
|
Given directory contains two files
|
11
|
-
When I run
|
11
|
+
When I run 'syntaxer'
|
12
12
|
Then the exit status should not be 0
|
13
13
|
And the output should not contain "Syntax OK"
|
14
14
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
@announce
|
2
|
+
Feature: Check output of script
|
3
|
+
|
4
|
+
In order to check outut of script
|
5
|
+
A user who used gem
|
6
|
+
Should to see errors in files
|
7
|
+
|
8
|
+
@plain @output
|
9
|
+
Scenario: Run checker with verbose mode
|
10
|
+
Given a file named "wrong.rb" with:
|
11
|
+
"""
|
12
|
+
class A
|
13
|
+
"""
|
14
|
+
And a file named "correct.rb" with:
|
15
|
+
"""
|
16
|
+
class B; end;
|
17
|
+
"""
|
18
|
+
Then I run 'syntaxer -l'
|
19
|
+
And the output should contain:
|
20
|
+
"""
|
21
|
+
correct.rb OK
|
22
|
+
"""
|
23
|
+
|
24
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
@announce
|
2
|
+
Feature: Check git repository before commit
|
3
|
+
|
4
|
+
@repo @rails
|
5
|
+
Scenario: Installation hook in rails environment
|
6
|
+
Given rails project
|
7
|
+
And some lib with wrong syntax
|
8
|
+
And installed hook in rails context
|
9
|
+
When I run `git commit -m "some message"`
|
10
|
+
Then the syntaxer shoud stop commit
|
11
|
+
And the output should contain "Errors:"
|
12
|
+
And the output should contain "EE"
|
@@ -1,7 +1,28 @@
|
|
1
|
+
Given /^I'am using a clean gemset test$/ do
|
2
|
+
Aruba::Api::DEFAULT_TIMEOUT_SECONDS = 20
|
3
|
+
use_clean_gemset("test")
|
4
|
+
end
|
5
|
+
|
1
6
|
Given /^directory contains two files$/ do
|
2
7
|
create_temp_plain_work_dir
|
3
8
|
end
|
4
9
|
|
10
|
+
When /^I run 'syntaxer'$/ do
|
11
|
+
run_simple(unescape("#{File.join(File.dirname(__FILE__),'..','..','bin','syntaxer')}"), false)
|
12
|
+
end
|
13
|
+
|
14
|
+
Then /^I run 'syntaxer \-l'$/ do
|
15
|
+
run_simple(unescape("#{File.join(File.dirname(__FILE__),'..','..','bin','syntaxer')} -l"), false)
|
16
|
+
end
|
17
|
+
|
18
|
+
Then /^I run 'syntaxer \-W'$/ do
|
19
|
+
run_simple(unescape("#{File.join(File.dirname(__FILE__),'..','..','bin','syntaxer')} -W"), false)
|
20
|
+
end
|
21
|
+
|
22
|
+
Then /^I run 'syntaxer \-v'$/ do
|
23
|
+
run_simple(unescape("#{File.join(File.dirname(__FILE__),'..','..','bin','syntaxer')} -v"), false)
|
24
|
+
end
|
25
|
+
|
5
26
|
When /^I cd to working directory$/ do
|
6
27
|
cd(@tmp_dir)
|
7
28
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
Given /^rails project$/ do
|
2
|
+
in_current_dir do
|
3
|
+
FileUtils.mkdir("config")
|
4
|
+
FileUtils.mkdir("app")
|
5
|
+
end
|
6
|
+
write_file('app/correct.rb','class C;end;')
|
7
|
+
run_simple(unescape("git init"), false)
|
8
|
+
run_simple(unescape("git add ."), false)
|
9
|
+
run_simple(unescape("git commit -m'first commit'"), false)
|
10
|
+
end
|
11
|
+
|
12
|
+
Given /^some lib with wrong syntax$/ do
|
13
|
+
write_file('lib/wrong.rb', "mod A;end")
|
14
|
+
write_file('app/wrong.rb', "mod A;end")
|
15
|
+
run_simple(unescape("git add ."), false)
|
16
|
+
end
|
17
|
+
|
18
|
+
Given /^installed hook in rails context$/ do
|
19
|
+
run_simple("#{File.join(File.dirname(__FILE__),'..','..','bin','syntaxer')} -i -r git --hook --rails")
|
20
|
+
in_current_dir do
|
21
|
+
FileUtils.cp(File.join(File.dirname(__FILE__),'..','..',"syntaxer_rails_rules.dist.rb"),"config/syntaxer.rb")
|
22
|
+
end
|
23
|
+
run_simple('chmod 755 .git/hooks/pre-commit')
|
24
|
+
end
|
25
|
+
|
26
|
+
Then /^the syntaxer shoud stop commit$/ do
|
27
|
+
@last_exit_status.should eql(1)
|
28
|
+
end
|
29
|
+
|
@@ -3,15 +3,31 @@ Given /^git repository$/ do
|
|
3
3
|
end
|
4
4
|
|
5
5
|
Given /^some file with wrong syntax$/ do
|
6
|
-
in_current_dir do
|
6
|
+
#in_current_dir do
|
7
7
|
add_fixtures_files
|
8
|
-
end
|
8
|
+
#end
|
9
9
|
end
|
10
10
|
|
11
11
|
When /^run `git commit \-m \"some message\"` interactively$/ do
|
12
12
|
add_hook
|
13
13
|
end
|
14
14
|
|
15
|
+
Then /^I run 'syntaxer \-i \-r git'$/ do
|
16
|
+
run_simple(unescape("#{File.join(File.dirname(__FILE__),'..','..','bin','syntaxer')} -i -r git"), false)
|
17
|
+
end
|
18
|
+
|
19
|
+
|
15
20
|
Then /^the syntaxer should stop commit$/ do
|
16
21
|
lambda{make_git_commit}.should raise_exception
|
17
22
|
end
|
23
|
+
|
24
|
+
Given /^I init empty repository$/ do
|
25
|
+
run_simple(unescape("git init"), false)
|
26
|
+
end
|
27
|
+
|
28
|
+
Given /^I make first commit$/ do
|
29
|
+
run_simple(unescape("git add ."), false)
|
30
|
+
run_simple(unescape("git commit -m 'first commit'"), false)
|
31
|
+
end
|
32
|
+
|
33
|
+
|
data/features/support/hooks.rb
CHANGED
@@ -7,7 +7,25 @@ Feature: Test options
|
|
7
7
|
|
8
8
|
@plain
|
9
9
|
Scenario: Run version checking
|
10
|
-
When I run
|
10
|
+
When I run 'syntaxer -v'
|
11
11
|
Then the exit status should be 0
|
12
12
|
And the output should be the same as in "VERSION" file
|
13
13
|
|
14
|
+
@plain
|
15
|
+
Scenario: Run syntaxer with warning option and ruby files
|
16
|
+
Given a file named "correct.rb" with:
|
17
|
+
"""
|
18
|
+
Method /^I love ruby$/ do
|
19
|
+
end
|
20
|
+
"""
|
21
|
+
When I run 'syntaxer -W'
|
22
|
+
Then the output should contain "warning: ambiguous first argument;"
|
23
|
+
|
24
|
+
@plain
|
25
|
+
Scenario: Run syntaxer with warning option and non ruby files
|
26
|
+
Given a file named "correct.php" with:
|
27
|
+
"""
|
28
|
+
<%php echo 1; %>
|
29
|
+
"""
|
30
|
+
When I run 'syntaxer -W'
|
31
|
+
Then the output should contain "Syntax OK"
|
data/lib/syntaxer.rb
CHANGED
@@ -3,20 +3,24 @@ require "rake"
|
|
3
3
|
require "open3"
|
4
4
|
require "forwardable"
|
5
5
|
require "git"
|
6
|
+
require "rainbow"
|
7
|
+
require 'progress_bar'
|
6
8
|
require File.join(%w{syntaxer reader})
|
7
9
|
require File.join(%w{syntaxer file_status})
|
8
10
|
require File.join(%w{syntaxer checker})
|
9
11
|
require File.join(%w{syntaxer repository})
|
10
12
|
require File.join(%w{syntaxer language_definition})
|
11
13
|
require File.join(%w{syntaxer printer})
|
12
|
-
require
|
14
|
+
require File.join(%w{syntaxer progress_bar})
|
15
|
+
|
16
|
+
require File.join(%w{syntaxer railtie}) if defined?(Rails)
|
13
17
|
|
14
18
|
module Syntaxer
|
15
19
|
DEFAULT_FILES_MASK = "**/*"
|
16
20
|
SYNTAXER_RULES_FILE = File.join(File.dirname(__FILE__), "..", "syntaxer_rules.dist.rb")
|
17
21
|
|
18
22
|
class << self
|
19
|
-
attr_reader :reader, :repository, :root_path, :
|
23
|
+
attr_reader :reader, :repository, :root_path, :results, :warnings, :hook
|
20
24
|
|
21
25
|
def configure
|
22
26
|
yield(self) if block_given?
|
@@ -35,13 +39,16 @@ module Syntaxer
|
|
35
39
|
def check_syntax(options = {})
|
36
40
|
@root_path = options[:root_path]
|
37
41
|
Printer.quite = options[:quite] || false
|
42
|
+
Printer.loud = options[:loud] || false
|
43
|
+
@warnings = options[:warnings]
|
44
|
+
@hook = options[:hook]
|
38
45
|
|
39
46
|
@reader = Reader::DSLReader.load(options[:config_file])
|
40
47
|
@repository = Repository.factory(@root_path, options[:repository]) if options[:repository]
|
41
48
|
|
42
|
-
|
43
|
-
Printer.print_result
|
44
|
-
exit(1) unless error_files.empty?
|
49
|
+
checker = Checker.process(self)
|
50
|
+
Printer.print_result checker
|
51
|
+
exit(1) unless checker.error_files.empty?
|
45
52
|
end
|
46
53
|
|
47
54
|
# This method generate and put hook to .git/hooks
|
@@ -56,10 +63,14 @@ module Syntaxer
|
|
56
63
|
@root_path = options[:root_path]
|
57
64
|
raise ArgumentError, 'Indicate repository type' unless options.include?(:repository)
|
58
65
|
raise ArgumentError, "SVN is temporarily not supported" if options[:repository].to_sym == :svn
|
66
|
+
|
59
67
|
repo = Repository.factory(@root_path, options[:repository])
|
60
68
|
hook_file = "#{@root_path}/.git/hooks/pre-commit"
|
69
|
+
hook_string = "syntaxer -r git --hook"
|
70
|
+
hook_string += " -c config/syntaxer.rb" if options[:rails]
|
71
|
+
|
61
72
|
File.open(hook_file, 'w') do |f|
|
62
|
-
f.puts
|
73
|
+
f.puts hook_string
|
63
74
|
end
|
64
75
|
File.chmod(0755, hook_file)
|
65
76
|
rescue Exception => e
|
data/lib/syntaxer/checker.rb
CHANGED
@@ -6,12 +6,16 @@ module Syntaxer
|
|
6
6
|
include Observable
|
7
7
|
extend Forwardable
|
8
8
|
|
9
|
-
def_delegators Syntaxer::FileStatus, :error_files, :
|
10
|
-
|
9
|
+
def_delegators Syntaxer::FileStatus, :error_files, :all_files
|
10
|
+
|
11
11
|
attr_accessor :syntaxer, :reader
|
12
12
|
|
13
13
|
def initialize(syntaxer, count)
|
14
|
-
Printer.
|
14
|
+
Printer.setup do |p|
|
15
|
+
p.count_of_files = count
|
16
|
+
p.mode = syntaxer.hook ? :hook : :default
|
17
|
+
end
|
18
|
+
|
15
19
|
add_observer(Printer)
|
16
20
|
@syntaxer = syntaxer
|
17
21
|
@reader = @syntaxer.reader
|
@@ -31,7 +35,23 @@ module Syntaxer
|
|
31
35
|
end
|
32
36
|
|
33
37
|
protected
|
38
|
+
|
34
39
|
def check rule, file
|
40
|
+
changed
|
41
|
+
unless rule.exec_existence
|
42
|
+
# notify if not exists
|
43
|
+
notify_observers({:rule => rule})
|
44
|
+
else
|
45
|
+
if @syntaxer.warnings && rule.name == :ruby
|
46
|
+
rule.exec_rule = rule.exec_rule.gsub(/(-\S+)\s/,'\1w ')
|
47
|
+
end
|
48
|
+
errors = run_exec_rule(rule, file)
|
49
|
+
FileStatus.build(file, errors)
|
50
|
+
notify_observers({:file_status => errors.empty?})
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def run_exec_rule rule, file
|
35
55
|
popen3(rule.exec_rule.gsub('%filename%', file)) do |stdin, stdout, stderr, wait_thr|
|
36
56
|
stderr.read.split("\n")
|
37
57
|
end
|
@@ -53,26 +73,29 @@ module Syntaxer
|
|
53
73
|
|
54
74
|
def process
|
55
75
|
checked_files = Set.new
|
76
|
+
rule_files = {}
|
77
|
+
|
56
78
|
@reader.rules.each do |rule|
|
57
|
-
|
79
|
+
rule_files[rule.name] = {}
|
80
|
+
rule_files[rule.name][:rule] = rule
|
81
|
+
rule_files[rule.name][:files] = []
|
58
82
|
rule.extensions.each do |ext|
|
59
83
|
files.each do |file|
|
60
|
-
if file.
|
61
|
-
|
62
|
-
|
84
|
+
if File.extname(file).gsub(/\./,'') == ext || \
|
85
|
+
(!rule.specific_files.nil? && !rule_files[rule.name][:files].include?(file) && rule.specific_files.include?(file))
|
86
|
+
rule_files[rule.name][:files].push(file)
|
63
87
|
end
|
64
88
|
end
|
65
89
|
end
|
90
|
+
end
|
66
91
|
|
67
|
-
|
92
|
+
rule_files.each do |rule_name, rule|
|
93
|
+
rule[:files].each do |file|
|
68
94
|
full_path = File.join(@syntaxer.root_path,file)
|
69
|
-
|
70
|
-
FileStatus.build(file, errors)
|
71
|
-
changed
|
72
|
-
notify_observers(errors.empty?)
|
95
|
+
check(rule[:rule], full_path)
|
73
96
|
end
|
74
97
|
end
|
75
|
-
|
98
|
+
|
76
99
|
self
|
77
100
|
end
|
78
101
|
|
@@ -94,11 +117,9 @@ module Syntaxer
|
|
94
117
|
|
95
118
|
def process
|
96
119
|
@reader.rules.each do |rule|
|
120
|
+
# check if executor exists
|
97
121
|
rule.files_list(@syntaxer.root_path).each do |file|
|
98
|
-
|
99
|
-
FileStatus.build(file, errors)
|
100
|
-
changed
|
101
|
-
notify_observers(errors.empty?)
|
122
|
+
check(rule, file)
|
102
123
|
end
|
103
124
|
end
|
104
125
|
|
data/lib/syntaxer/file_status.rb
CHANGED
@@ -4,7 +4,7 @@ module Syntaxer
|
|
4
4
|
|
5
5
|
class FileStatus
|
6
6
|
@@error_files = []
|
7
|
-
@@
|
7
|
+
@@all_files = []
|
8
8
|
|
9
9
|
attr_reader :file_name, :status, :errors
|
10
10
|
|
@@ -17,15 +17,16 @@ module Syntaxer
|
|
17
17
|
class << self
|
18
18
|
def build(file_name, errors = [])
|
19
19
|
file_status = new(file_name, errors)
|
20
|
-
|
20
|
+
@@all_files << file_status
|
21
|
+
@@error_files << file_status unless errors.empty?
|
21
22
|
end
|
22
23
|
|
23
24
|
def error_files
|
24
|
-
|
25
|
+
@@error_files
|
25
26
|
end
|
26
27
|
|
27
|
-
def
|
28
|
-
@@
|
28
|
+
def all_files
|
29
|
+
@@all_files
|
29
30
|
end
|
30
31
|
|
31
32
|
end
|
@@ -1,19 +1,21 @@
|
|
1
1
|
module Syntaxer
|
2
2
|
class LanguageDefinitionException < Exception; end
|
3
3
|
|
4
|
-
LanguageDefinition = Struct.new(:name, :extensions, :specific_files, :folders, :ignore_folders, :exec_rule) do
|
4
|
+
LanguageDefinition = Struct.new(:name, :extensions, :specific_files, :folders, :ignore_folders, :exec_rule, :executor, :exec_existence) do
|
5
5
|
def initialize(*args)
|
6
|
-
super(*args)
|
6
|
+
super(*args)
|
7
7
|
raise LanguageDefinitionException.new "name can't be blank" unless self.name
|
8
8
|
end
|
9
9
|
|
10
10
|
|
11
11
|
def files_list(root_path)
|
12
|
+
root_path += "/" if root_path.match(/\/$/).nil?
|
12
13
|
main_rule = folders.map{|f| root_path + f + ".\{#{extensions.join(',')}\}"}
|
13
14
|
list = Rake::FileList.new(main_rule) do |fl|
|
14
|
-
#fl.add(specific_files) if specific_files TODO:fix this
|
15
15
|
fl.exclude(ignore_folders) if ignore_folders
|
16
16
|
end
|
17
|
+
all_files = Rake::FileList.new(root_path+'*')
|
18
|
+
list += all_files.find_all {|f| f if !File.directory?(f) && !specific_files.nil? && specific_files.include?(File.basename(f)) }
|
17
19
|
list
|
18
20
|
end
|
19
21
|
end
|
data/lib/syntaxer/printer.rb
CHANGED
@@ -1,46 +1,73 @@
|
|
1
|
-
require "rainbow"
|
2
1
|
module Syntaxer
|
3
2
|
|
4
3
|
# Print system messages
|
5
4
|
|
6
5
|
class Printer
|
7
6
|
class << self
|
7
|
+
NON_EXISTENT_RULE_MESSAGE = "exec_rule `%s` for language %s not exists. Skip"
|
8
|
+
|
8
9
|
@@bar = nil
|
9
|
-
|
10
|
+
@@not_exists_rules = []
|
11
|
+
attr_accessor :quite, :loud, :mode, :count_of_files
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
def setup &block
|
14
|
+
yield self if block_given?
|
15
|
+
if @mode == :hook
|
16
|
+
@@bar = Syntaxer::ProgressBar.new
|
17
|
+
else
|
18
|
+
@@bar = ::ProgressBar.new(@count_of_files, :bar, :counter)
|
19
|
+
end
|
17
20
|
end
|
18
21
|
|
19
22
|
# Show progress
|
20
23
|
#
|
21
24
|
# @param [Boolean] (true|false)
|
22
25
|
|
23
|
-
def update status
|
24
|
-
|
26
|
+
def update *args #not_exists_rule = nil, file_status = (status=true;)
|
27
|
+
args = args.first
|
28
|
+
@@not_exists_rules << args[:rule] if args.include?(:rule) && !@@not_exists_rules.include?(args[:rule])
|
29
|
+
return if @quite
|
30
|
+
if args.include?(:file_status)
|
31
|
+
@mode == :hook ? @@bar.increment!(args[:file_status]) : @@bar.increment!
|
32
|
+
# @@bar.increment!(args[:file_status]) if @mode == :hook
|
33
|
+
# @@bar.increment! unless @mode == :hook
|
34
|
+
end
|
35
|
+
true
|
25
36
|
end
|
26
37
|
|
27
38
|
# Print error message for each if file
|
28
39
|
#
|
29
40
|
# @param [Array, #each] files
|
30
41
|
|
31
|
-
def print_result
|
42
|
+
def print_result checker
|
32
43
|
return if @quite
|
33
44
|
puts "\n"
|
34
|
-
puts "Syntax OK".color(:green) if
|
35
|
-
puts "Errors:".color(:red) unless files.empty?
|
45
|
+
puts "Syntax OK".color(:green) if checker.error_files.empty?
|
36
46
|
|
47
|
+
@loud ? (files = checker.all_files) : (files = checker.error_files)
|
37
48
|
files.each do |file|
|
38
|
-
|
39
|
-
|
40
|
-
|
49
|
+
print_message(file)
|
50
|
+
end
|
51
|
+
|
52
|
+
unless @@not_exists_rules.empty?
|
53
|
+
puts "\n"
|
54
|
+
@@not_exists_rules.each do |rule|
|
55
|
+
puts (NON_EXISTENT_RULE_MESSAGE % [rule.executor, rule.name]).color(:yellow)
|
41
56
|
end
|
42
57
|
end
|
43
58
|
end
|
59
|
+
|
60
|
+
def print_message filestatus
|
61
|
+
return if @quite
|
62
|
+
puts "\n"
|
63
|
+
print filestatus.file_name
|
64
|
+
puts " OK".color(:green) if filestatus.status == :ok && @loud
|
65
|
+
puts "\nErrors:".color(:red) if filestatus.status == :failed
|
66
|
+
filestatus.errors.each do |error|
|
67
|
+
puts "\t #{error}".color(:red)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
44
71
|
end
|
45
72
|
end
|
46
73
|
end
|
data/lib/syntaxer/railtie.rb
CHANGED
data/lib/syntaxer/reader.rb
CHANGED
@@ -125,6 +125,8 @@ module Syntaxer
|
|
125
125
|
end
|
126
126
|
|
127
127
|
def exec_rule(exec_string)
|
128
|
+
current_rule.executor = exec_string.scan(/\w+/).first
|
129
|
+
current_rule.exec_existence = system("which #{current_rule.executor} > /dev/null")
|
128
130
|
current_rule.exec_rule = exec_string
|
129
131
|
end
|
130
132
|
|
data/lib/tasks/syntaxer.rake
CHANGED
@@ -0,0 +1,9 @@
|
|
1
|
+
namespace :syntaxer do
|
2
|
+
desc 'my plugins rake task'
|
3
|
+
task :install => :environment do
|
4
|
+
system('syntaxer -i -r git --hook --rails')
|
5
|
+
FileUtils.cp(File.join(File.dirname(__FILE__),'..','..','syntaxer_rails_rules.dist.rb'),\
|
6
|
+
File.join(Rails.root,'config','syntaxer.rb'))
|
7
|
+
puts "Syntaxer hook installed. Look to the config/syntaxer.rb to change configuration.".color(:green)
|
8
|
+
end
|
9
|
+
end
|
data/rails/init.rb
CHANGED
data/spec/checker_spec.rb
CHANGED
@@ -6,28 +6,29 @@ describe "Syntaxer::Checker" do
|
|
6
6
|
|
7
7
|
before(:each) do
|
8
8
|
reader = mock('Reader')
|
9
|
-
reader.stub!(:rules).and_return([Syntaxer::LanguageDefinition.new(:ruby, ["rb.example", "rake"], ["Rakefile", "Thorfile"], ["**/*"], nil, "ruby -
|
10
|
-
reader.stub!(:files_count).and_return(
|
9
|
+
reader.stub!(:rules).and_return([Syntaxer::LanguageDefinition.new(:ruby, ["rb.example", "rake"], ["Rakefile", "Thorfile"], ["**/*"], nil, "ruby -c %filename%", "ruby", true)])
|
10
|
+
reader.stub!(:files_count).and_return(3)
|
11
11
|
Syntaxer.should_receive(:reader).any_number_of_times.and_return(reader)
|
12
12
|
Syntaxer.stub!(:root_path).and_return(fixtures_path(:ruby))
|
13
13
|
|
14
14
|
Syntaxer::Printer.stub!(:print_result)
|
15
|
-
Syntaxer::Printer.stub!(:
|
15
|
+
Syntaxer::Printer.stub!(:print_message)
|
16
|
+
Syntaxer::Printer.stub!(:update)
|
16
17
|
end
|
17
18
|
|
18
19
|
subject {Syntaxer::PlainChecker.new(Syntaxer)}
|
19
20
|
|
20
21
|
it {should respond_to(:error_files)}
|
21
|
-
it {should respond_to(:
|
22
|
+
it {should respond_to(:all_files)}
|
22
23
|
|
23
24
|
it "should return correct error_files " do
|
24
25
|
subject.process
|
25
|
-
subject.
|
26
|
-
subject.error_files.size.should ==
|
26
|
+
subject.all_files.size.should == 3
|
27
|
+
subject.error_files.size.should == 2
|
27
28
|
end
|
28
29
|
|
29
30
|
it "should send to FileStatus" do
|
30
|
-
Syntaxer::FileStatus.should_receive(:build).
|
31
|
+
Syntaxer::FileStatus.should_receive(:build).exactly(3).times
|
31
32
|
subject.process
|
32
33
|
end
|
33
34
|
end
|
@@ -40,7 +41,8 @@ describe "Syntaxer::Checker" do
|
|
40
41
|
|
41
42
|
before(:all) do
|
42
43
|
Syntaxer::Printer.stub!(:print_result)
|
43
|
-
Syntaxer::Printer.stub!(:
|
44
|
+
Syntaxer::Printer.stub!(:print_message)
|
45
|
+
Syntaxer::Printer.stub!(:update)
|
44
46
|
end
|
45
47
|
|
46
48
|
before(:each) do
|
@@ -51,7 +53,7 @@ describe "Syntaxer::Checker" do
|
|
51
53
|
make_git_add(@repo_dir)
|
52
54
|
|
53
55
|
reader = mock('Reader')
|
54
|
-
reader.stub!(:rules).and_return([Syntaxer::LanguageDefinition.new(:ruby, ["
|
56
|
+
reader.stub!(:rules).and_return([Syntaxer::LanguageDefinition.new(:ruby, ["example", "rake"], ["Rakefile", "Thorfile"], ["**/*"], nil, "ruby -c %filename%", "ruby", true)])
|
55
57
|
Syntaxer.should_receive(:reader).and_return(reader)
|
56
58
|
Syntaxer.stub!(:root_path).and_return(@repo_dir)
|
57
59
|
repo = Syntaxer::Repository.factory(@repo_dir, :git)
|
@@ -62,7 +64,7 @@ describe "Syntaxer::Checker" do
|
|
62
64
|
|
63
65
|
it "should return correct error_files" do
|
64
66
|
subject.process
|
65
|
-
subject.
|
67
|
+
subject.all_files.size.should_not eql(0)
|
66
68
|
subject.error_files.size.should_not eql(0)
|
67
69
|
end
|
68
70
|
|
@@ -1,11 +1,12 @@
|
|
1
1
|
syntaxer do
|
2
2
|
|
3
3
|
languages :ruby do
|
4
|
-
|
4
|
+
extensions "example"
|
5
|
+
folders '**/*'
|
5
6
|
end
|
6
7
|
|
7
8
|
languages :haml do
|
8
|
-
folders '
|
9
|
+
folders '**/*'
|
9
10
|
end
|
10
11
|
|
11
12
|
#ignore_folders "app/models/**" # this folders will be deleted from all languages
|
data/spec/language_rules_spec.rb
CHANGED
@@ -27,7 +27,7 @@ describe "LanguageRules" do
|
|
27
27
|
|
28
28
|
context "LanguageDefinition" do
|
29
29
|
it "#file_list should return correct file list based on rules" do
|
30
|
-
correct_array = Rake::FileList.new(File.dirname(__FILE__) + '/fixtures/ruby
|
30
|
+
correct_array = Rake::FileList.new(File.dirname(__FILE__) + '/fixtures/ruby/**/*.example')
|
31
31
|
ld = Syntaxer::LanguageDefinition.new(:ruby, ["rb.example", "rake"], ["Rakefile", "Thorfile"], ["**/*"], nil, "`ruby -wc %filename%`")
|
32
32
|
ld.files_list(File.dirname(__FILE__) + '/fixtures/').should == correct_array
|
33
33
|
end
|
data/spec/printer_spec.rb
CHANGED
@@ -9,9 +9,9 @@ describe "Syntaxer" do
|
|
9
9
|
subject{Syntaxer::Printer}
|
10
10
|
|
11
11
|
it "should be quite if passed --quite option" do
|
12
|
-
ProgressBar.new.should_not_receive(:update)
|
12
|
+
::ProgressBar.new.should_not_receive(:update)
|
13
13
|
subject.quite = true
|
14
|
-
subject.update
|
14
|
+
subject.update({})
|
15
15
|
subject.print_result ['a','b']
|
16
16
|
end
|
17
17
|
end
|
data/spec/reader_spec.rb
CHANGED
@@ -5,10 +5,9 @@ describe "Syntaxer::Reader::DSLReader" do
|
|
5
5
|
context "#build" do
|
6
6
|
it "should build from default distr rules files" do
|
7
7
|
@reader = Syntaxer::Reader::DSLReader.build
|
8
|
-
|
9
|
-
@reader.rules.find(:
|
10
|
-
@reader.rules.find(:
|
11
|
-
@reader.rules.find(:sass).should == Syntaxer::LanguageDefinition.new(:sass, ["sass"], nil, ["**/*"], nil, "sass -c %filename%")
|
8
|
+
@reader.rules.find(:ruby).should == Syntaxer::LanguageDefinition.new(:ruby, ["rb", "rake"], ["Rakefile", "Thorfile", "Gemfile"], ["**/*"], nil, "ruby -c %filename%", "ruby", true)
|
9
|
+
@reader.rules.find(:haml).should == Syntaxer::LanguageDefinition.new(:haml, ["haml"], nil, ["**/*"], nil, "haml -c %filename%", "haml", system("which haml 2>&1 > /dev/null"))
|
10
|
+
@reader.rules.find(:sass).should == Syntaxer::LanguageDefinition.new(:sass, ["sass"], nil, ["**/*"], nil, "sass -c %filename%", "sass", system("which haml 2>&1 > /dev/null"))
|
12
11
|
|
13
12
|
end
|
14
13
|
end
|
@@ -36,8 +35,8 @@ describe "Syntaxer::Reader::DSLReader" do
|
|
36
35
|
|
37
36
|
it "should load from file" do
|
38
37
|
reader = Syntaxer::Reader::DSLReader.load(syntaxer_rules_example_file)
|
39
|
-
reader.rules.find(:ruby).folders.should == ["
|
40
|
-
reader.rules.find(:haml).folders.should == ["
|
38
|
+
reader.rules.find(:ruby).folders.should == ["**/*"]
|
39
|
+
reader.rules.find(:haml).folders.should == ["**/*"]
|
41
40
|
end
|
42
41
|
|
43
42
|
it "should do substitution for the same rules" do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
2
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rubygems'
|
3
4
|
require 'rspec'
|
4
5
|
require 'git'
|
5
6
|
require 'syntaxer'
|
6
7
|
require "tmpdir"
|
8
|
+
require 'aruba/api'
|
7
9
|
|
8
10
|
# Requires supporting files with custom matchers and macros, etc,
|
9
11
|
# in ./support/ and its subdirectories.
|
@@ -67,7 +69,7 @@ def add_hook(ruby_repo_dir)
|
|
67
69
|
hook_file = File.join(ruby_repo_dir,'.git/hooks/pre-commit')
|
68
70
|
|
69
71
|
File.open(hook_file, 'w') do |f|
|
70
|
-
f.puts "#{bin_file} -c #{syntaxer_rules_example_file
|
72
|
+
f.puts "#{bin_file} -c #{syntaxer_rules_example_file} -r git -p #{ruby_repo_dir} --hook"
|
71
73
|
end
|
72
74
|
|
73
75
|
File.chmod(0755, hook_file)
|
@@ -83,3 +85,12 @@ def syntaxer_rules_example_file file = ''
|
|
83
85
|
File.join(fixtures_path, "#{file.empty? ? 'syntaxer_rules': file}.rb" )
|
84
86
|
end
|
85
87
|
|
88
|
+
class ArubaHelper
|
89
|
+
include Aruba::Api
|
90
|
+
class << self
|
91
|
+
def method_missing method, *args
|
92
|
+
ArubaHelper.new.send(method, *args)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
data/spec/syntaxer_spec.rb
CHANGED
@@ -6,13 +6,19 @@ describe "Syntaxer" do
|
|
6
6
|
it {should respond_to(:check_syntax)}
|
7
7
|
|
8
8
|
context "in plain mode" do
|
9
|
+
before(:all) do
|
10
|
+
Syntaxer::Printer.stub!(:print_result)
|
11
|
+
Syntaxer::Printer.stub!(:print_message)
|
12
|
+
Syntaxer::Printer.stub!(:update)
|
13
|
+
end
|
14
|
+
|
9
15
|
it "should exit with error if where is syntax mistake" do
|
10
16
|
lambda{ subject.check_syntax({:root_path => fixtures_path, :config_file => syntaxer_rules_example_file}) }.should raise_exception
|
11
17
|
end
|
12
18
|
end
|
13
19
|
|
14
20
|
context "checking GIT repo" do
|
15
|
-
|
21
|
+
|
16
22
|
before(:each) do
|
17
23
|
@repo_dir = create_temp_ruby_project
|
18
24
|
make_initial_commit(@repo_dir)
|
data/syntaxer.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{syntaxer}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.4.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["artemk"]
|
12
|
-
s.date = %q{2011-04-
|
12
|
+
s.date = %q{2011-04-23}
|
13
13
|
s.default_executable = %q{syntaxer}
|
14
14
|
s.description = %q{Syntax checker for ruby and other languages}
|
15
15
|
s.email = %q{kramarenko.artyom@gmail.com}
|
@@ -27,8 +27,11 @@ Gem::Specification.new do |s|
|
|
27
27
|
"VERSION",
|
28
28
|
"bin/syntaxer",
|
29
29
|
"features/plain_check.feature",
|
30
|
+
"features/printer_check.feature",
|
31
|
+
"features/rails_check.feature",
|
30
32
|
"features/repository_check.feature",
|
31
33
|
"features/step_definitions/plain_checker.rb",
|
34
|
+
"features/step_definitions/rails_checker.rb",
|
32
35
|
"features/step_definitions/repository_checker.rb",
|
33
36
|
"features/support/env.rb",
|
34
37
|
"features/support/hooks.rb",
|
@@ -40,6 +43,7 @@ Gem::Specification.new do |s|
|
|
40
43
|
"lib/syntaxer/file_status.rb",
|
41
44
|
"lib/syntaxer/language_definition.rb",
|
42
45
|
"lib/syntaxer/printer.rb",
|
46
|
+
"lib/syntaxer/progress_bar.rb",
|
43
47
|
"lib/syntaxer/railtie.rb",
|
44
48
|
"lib/syntaxer/reader.rb",
|
45
49
|
"lib/syntaxer/repository.rb",
|
@@ -49,6 +53,7 @@ Gem::Specification.new do |s|
|
|
49
53
|
"spec/fixtures/haml/correct.html.haml",
|
50
54
|
"spec/fixtures/haml/wrong.html.haml",
|
51
55
|
"spec/fixtures/ruby/correct.rb.example",
|
56
|
+
"spec/fixtures/ruby/subfolder/wrong.rb.example",
|
52
57
|
"spec/fixtures/ruby/wrong.rb.example",
|
53
58
|
"spec/fixtures/syntaxer_rules.rb",
|
54
59
|
"spec/fixtures/syntaxer_rules_git.rb",
|
@@ -59,6 +64,7 @@ Gem::Specification.new do |s|
|
|
59
64
|
"spec/spec_helper.rb",
|
60
65
|
"spec/syntaxer_spec.rb",
|
61
66
|
"syntaxer.gemspec",
|
67
|
+
"syntaxer_rails_rules.dist.rb",
|
62
68
|
"syntaxer_rules.dist.rb"
|
63
69
|
]
|
64
70
|
s.homepage = %q{http://github.com/artemk/syntaxer}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
syntaxer do
|
2
|
+
languages :ruby do
|
3
|
+
folders "app/*", "app/**/*", "lib/*", "lib/**/*"
|
4
|
+
extensions "rb", "rake"
|
5
|
+
specific_files "Rakefile", "Thorfile", "Gemfile"
|
6
|
+
exec_rule "ruby -c %filename%"
|
7
|
+
end
|
8
|
+
|
9
|
+
lang :sass do
|
10
|
+
folders "public/stylesheets/**/*"
|
11
|
+
extensions "sass"
|
12
|
+
exec_rule "sass -c %filename%"
|
13
|
+
end
|
14
|
+
|
15
|
+
lang :haml do
|
16
|
+
folders "app/views/**/*", "app/views/*"
|
17
|
+
extensions "haml"
|
18
|
+
exec_rule "haml -c %filename%"
|
19
|
+
end
|
20
|
+
end
|
data/syntaxer_rules.dist.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syntaxer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 19
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 0
|
8
|
-
- 3
|
9
|
-
- 0
|
10
|
-
version: 0.3.0
|
5
|
+
version: 0.4.0
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- artemk
|
@@ -15,127 +10,97 @@ autorequire:
|
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
12
|
|
18
|
-
date: 2011-04-
|
13
|
+
date: 2011-04-23 00:00:00 +03:00
|
19
14
|
default_executable: syntaxer
|
20
15
|
dependencies:
|
21
16
|
- !ruby/object:Gem::Dependency
|
22
|
-
|
17
|
+
name: git
|
23
18
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
19
|
none: false
|
25
20
|
requirements:
|
26
21
|
- - ">="
|
27
22
|
- !ruby/object:Gem::Version
|
28
|
-
hash: 3
|
29
|
-
segments:
|
30
|
-
- 0
|
31
23
|
version: "0"
|
32
|
-
|
33
|
-
version_requirements: *id001
|
24
|
+
type: :runtime
|
34
25
|
prerelease: false
|
26
|
+
version_requirements: *id001
|
35
27
|
- !ruby/object:Gem::Dependency
|
36
|
-
|
28
|
+
name: rainbow
|
37
29
|
requirement: &id002 !ruby/object:Gem::Requirement
|
38
30
|
none: false
|
39
31
|
requirements:
|
40
32
|
- - ">="
|
41
33
|
- !ruby/object:Gem::Version
|
42
|
-
hash: 3
|
43
|
-
segments:
|
44
|
-
- 0
|
45
34
|
version: "0"
|
46
|
-
|
47
|
-
version_requirements: *id002
|
35
|
+
type: :runtime
|
48
36
|
prerelease: false
|
37
|
+
version_requirements: *id002
|
49
38
|
- !ruby/object:Gem::Dependency
|
50
|
-
|
39
|
+
name: progress_bar
|
51
40
|
requirement: &id003 !ruby/object:Gem::Requirement
|
52
41
|
none: false
|
53
42
|
requirements:
|
54
43
|
- - ">="
|
55
44
|
- !ruby/object:Gem::Version
|
56
|
-
hash: 3
|
57
|
-
segments:
|
58
|
-
- 0
|
59
45
|
version: "0"
|
60
|
-
|
61
|
-
version_requirements: *id003
|
46
|
+
type: :runtime
|
62
47
|
prerelease: false
|
48
|
+
version_requirements: *id003
|
63
49
|
- !ruby/object:Gem::Dependency
|
64
|
-
|
50
|
+
name: rspec
|
65
51
|
requirement: &id004 !ruby/object:Gem::Requirement
|
66
52
|
none: false
|
67
53
|
requirements:
|
68
54
|
- - ">="
|
69
55
|
- !ruby/object:Gem::Version
|
70
|
-
hash: 27
|
71
|
-
segments:
|
72
|
-
- 2
|
73
|
-
- 5
|
74
|
-
- 0
|
75
56
|
version: 2.5.0
|
76
|
-
|
77
|
-
version_requirements: *id004
|
57
|
+
type: :development
|
78
58
|
prerelease: false
|
59
|
+
version_requirements: *id004
|
79
60
|
- !ruby/object:Gem::Dependency
|
80
|
-
|
61
|
+
name: yard
|
81
62
|
requirement: &id005 !ruby/object:Gem::Requirement
|
82
63
|
none: false
|
83
64
|
requirements:
|
84
65
|
- - ~>
|
85
66
|
- !ruby/object:Gem::Version
|
86
|
-
hash: 7
|
87
|
-
segments:
|
88
|
-
- 0
|
89
|
-
- 6
|
90
|
-
- 0
|
91
67
|
version: 0.6.0
|
92
|
-
|
93
|
-
version_requirements: *id005
|
68
|
+
type: :development
|
94
69
|
prerelease: false
|
70
|
+
version_requirements: *id005
|
95
71
|
- !ruby/object:Gem::Dependency
|
96
|
-
|
72
|
+
name: jeweler
|
97
73
|
requirement: &id006 !ruby/object:Gem::Requirement
|
98
74
|
none: false
|
99
75
|
requirements:
|
100
76
|
- - ~>
|
101
77
|
- !ruby/object:Gem::Version
|
102
|
-
hash: 7
|
103
|
-
segments:
|
104
|
-
- 1
|
105
|
-
- 5
|
106
|
-
- 2
|
107
78
|
version: 1.5.2
|
108
|
-
|
109
|
-
version_requirements: *id006
|
79
|
+
type: :development
|
110
80
|
prerelease: false
|
81
|
+
version_requirements: *id006
|
111
82
|
- !ruby/object:Gem::Dependency
|
112
|
-
|
83
|
+
name: cucumber
|
113
84
|
requirement: &id007 !ruby/object:Gem::Requirement
|
114
85
|
none: false
|
115
86
|
requirements:
|
116
87
|
- - ">="
|
117
88
|
- !ruby/object:Gem::Version
|
118
|
-
hash: 3
|
119
|
-
segments:
|
120
|
-
- 0
|
121
89
|
version: "0"
|
122
|
-
|
123
|
-
version_requirements: *id007
|
90
|
+
type: :development
|
124
91
|
prerelease: false
|
92
|
+
version_requirements: *id007
|
125
93
|
- !ruby/object:Gem::Dependency
|
126
|
-
|
94
|
+
name: aruba
|
127
95
|
requirement: &id008 !ruby/object:Gem::Requirement
|
128
96
|
none: false
|
129
97
|
requirements:
|
130
98
|
- - ">="
|
131
99
|
- !ruby/object:Gem::Version
|
132
|
-
hash: 3
|
133
|
-
segments:
|
134
|
-
- 0
|
135
100
|
version: "0"
|
136
|
-
|
137
|
-
version_requirements: *id008
|
101
|
+
type: :development
|
138
102
|
prerelease: false
|
103
|
+
version_requirements: *id008
|
139
104
|
description: Syntax checker for ruby and other languages
|
140
105
|
email: kramarenko.artyom@gmail.com
|
141
106
|
executables:
|
@@ -154,8 +119,11 @@ files:
|
|
154
119
|
- VERSION
|
155
120
|
- bin/syntaxer
|
156
121
|
- features/plain_check.feature
|
122
|
+
- features/printer_check.feature
|
123
|
+
- features/rails_check.feature
|
157
124
|
- features/repository_check.feature
|
158
125
|
- features/step_definitions/plain_checker.rb
|
126
|
+
- features/step_definitions/rails_checker.rb
|
159
127
|
- features/step_definitions/repository_checker.rb
|
160
128
|
- features/support/env.rb
|
161
129
|
- features/support/hooks.rb
|
@@ -167,6 +135,7 @@ files:
|
|
167
135
|
- lib/syntaxer/file_status.rb
|
168
136
|
- lib/syntaxer/language_definition.rb
|
169
137
|
- lib/syntaxer/printer.rb
|
138
|
+
- lib/syntaxer/progress_bar.rb
|
170
139
|
- lib/syntaxer/railtie.rb
|
171
140
|
- lib/syntaxer/reader.rb
|
172
141
|
- lib/syntaxer/repository.rb
|
@@ -176,6 +145,7 @@ files:
|
|
176
145
|
- spec/fixtures/haml/correct.html.haml
|
177
146
|
- spec/fixtures/haml/wrong.html.haml
|
178
147
|
- spec/fixtures/ruby/correct.rb.example
|
148
|
+
- spec/fixtures/ruby/subfolder/wrong.rb.example
|
179
149
|
- spec/fixtures/ruby/wrong.rb.example
|
180
150
|
- spec/fixtures/syntaxer_rules.rb
|
181
151
|
- spec/fixtures/syntaxer_rules_git.rb
|
@@ -186,6 +156,7 @@ files:
|
|
186
156
|
- spec/spec_helper.rb
|
187
157
|
- spec/syntaxer_spec.rb
|
188
158
|
- syntaxer.gemspec
|
159
|
+
- syntaxer_rails_rules.dist.rb
|
189
160
|
- syntaxer_rules.dist.rb
|
190
161
|
has_rdoc: true
|
191
162
|
homepage: http://github.com/artemk/syntaxer
|
@@ -201,7 +172,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
201
172
|
requirements:
|
202
173
|
- - ">="
|
203
174
|
- !ruby/object:Gem::Version
|
204
|
-
hash:
|
175
|
+
hash: -199843106065902149
|
205
176
|
segments:
|
206
177
|
- 0
|
207
178
|
version: "0"
|
@@ -210,9 +181,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
210
181
|
requirements:
|
211
182
|
- - ">="
|
212
183
|
- !ruby/object:Gem::Version
|
213
|
-
hash: 3
|
214
|
-
segments:
|
215
|
-
- 0
|
216
184
|
version: "0"
|
217
185
|
requirements: []
|
218
186
|
|