code_analyzer 0.4.8 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.travis.yml +1 -2
- data/lib/code_analyzer.rb +8 -8
- data/lib/code_analyzer/checker.rb +10 -6
- data/lib/code_analyzer/checking_visitor.rb +3 -3
- data/lib/code_analyzer/checking_visitor/base.rb +1 -1
- data/lib/code_analyzer/checking_visitor/default.rb +13 -9
- data/lib/code_analyzer/sexp.rb +149 -102
- data/lib/code_analyzer/version.rb +1 -1
- data/lib/code_analyzer/warning.rb +1 -1
- data/spec/code_analyzer/checker_spec.rb +21 -17
- data/spec/code_analyzer/checking_visitor/default_spec.rb +12 -12
- data/spec/code_analyzer/checking_visitor/plain_spec.rb +4 -4
- data/spec/code_analyzer/nil_spec.rb +10 -10
- data/spec/code_analyzer/sexp_spec.rb +553 -339
- data/spec/code_analyzer/warning_spec.rb +9 -6
- data/spec/spec_helper.rb +1 -1
- metadata +3 -4
@@ -2,12 +2,15 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
module CodeAnalyzer
|
4
4
|
describe Warning do
|
5
|
-
it
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
it 'should return error with filename, line number and message' do
|
6
|
+
expect(
|
7
|
+
Warning.new(
|
8
|
+
filename: 'app/models/user.rb',
|
9
|
+
line_number: '100',
|
10
|
+
message: 'not good'
|
11
|
+
)
|
12
|
+
.to_s
|
13
|
+
).to eq 'app/models/user.rb:100 - not good'
|
11
14
|
end
|
12
15
|
end
|
13
16
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: code_analyzer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sexp_processor
|
@@ -106,8 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
- !ruby/object:Gem::Version
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
|
-
|
110
|
-
rubygems_version: 2.6.12
|
109
|
+
rubygems_version: 3.0.3
|
111
110
|
signing_key:
|
112
111
|
specification_version: 4
|
113
112
|
summary: a code analyzer helps you build your own code analyzer tool.
|