cane 1.4.0 → 2.0.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.
- data/HISTORY.md +12 -0
- data/README.md +9 -25
- data/lib/cane.rb +7 -18
- data/lib/cane/abc_check.rb +85 -22
- data/lib/cane/cli.rb +3 -5
- data/lib/cane/cli/spec.rb +59 -53
- data/lib/cane/doc_check.rb +30 -16
- data/lib/cane/encoding_aware_iterator.rb +35 -0
- data/lib/cane/file.rb +22 -0
- data/lib/cane/rake_task.rb +12 -41
- data/lib/cane/style_check.rb +36 -8
- data/lib/cane/threshold_check.rb +47 -22
- data/lib/cane/version.rb +1 -1
- data/lib/cane/violation_formatter.rb +33 -25
- data/spec/abc_check_spec.rb +53 -21
- data/spec/cane_spec.rb +21 -12
- data/spec/doc_check_spec.rb +30 -9
- data/spec/encoding_aware_iterator_spec.rb +24 -0
- data/spec/rake_task_spec.rb +13 -0
- data/spec/style_check_spec.rb +10 -4
- data/spec/threshold_check_spec.rb +4 -3
- data/spec/violation_formatter_spec.rb +4 -5
- metadata +8 -7
- data/lib/cane/abc_max_violation.rb +0 -15
- data/lib/cane/cli/translator.rb +0 -71
- data/lib/cane/style_violation.rb +0 -10
- data/lib/cane/syntax_violation.rb +0 -20
- data/lib/cane/threshold_violation.rb +0 -15
data/lib/cane/style_violation.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
module Cane
|
2
|
-
|
3
|
-
# Value object used by AbcCheck for a file that cannot be parsed. This is
|
4
|
-
# handled by AbcCheck rather than a separate class since it is a low value
|
5
|
-
# violation (syntax errors should have been picked up by specs) but we still
|
6
|
-
# have to deal with the edge case.
|
7
|
-
class SyntaxViolation < Struct.new(:file_name)
|
8
|
-
def columns
|
9
|
-
[file_name]
|
10
|
-
end
|
11
|
-
|
12
|
-
def description
|
13
|
-
"Files contained invalid syntax"
|
14
|
-
end
|
15
|
-
|
16
|
-
def sort_index
|
17
|
-
0
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# Value object used by ThresholdCheck.
|
2
|
-
class ThresholdViolation < Struct.new(:name, :operator, :value, :limit)
|
3
|
-
def description
|
4
|
-
"Quality threshold crossed"
|
5
|
-
end
|
6
|
-
|
7
|
-
def columns
|
8
|
-
["%s is %s, should be %s %s" % [
|
9
|
-
name,
|
10
|
-
value,
|
11
|
-
operator,
|
12
|
-
limit
|
13
|
-
]]
|
14
|
-
end
|
15
|
-
end
|