inch 0.5.0.rc3 → 0.5.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +15 -0
- data/.rubocop_todo.yml +94 -0
- data/CHANGELOG.md +26 -2
- data/Gemfile +5 -2
- data/README.md +3 -3
- data/Rakefile +6 -2
- data/bin/inch +3 -3
- data/config/{example.yml → .inch.yml.sample} +1 -0
- data/config/base.rb +53 -0
- data/config/elixir.rb +43 -0
- data/config/nodejs.rb +10 -0
- data/config/{defaults.rb → ruby.rb} +5 -54
- data/inch.gemspec +7 -7
- data/lib/inch.rb +14 -9
- data/lib/inch/api.rb +10 -10
- data/lib/inch/api/compare.rb +2 -2
- data/lib/inch/api/compare/code_objects.rb +2 -3
- data/lib/inch/api/compare/codebases.rb +1 -1
- data/lib/inch/api/diff.rb +13 -16
- data/lib/inch/api/filter.rb +1 -1
- data/lib/inch/api/get.rb +2 -2
- data/lib/inch/api/options/base.rb +4 -4
- data/lib/inch/api/options/filter.rb +0 -4
- data/lib/inch/api/options/suggest.rb +2 -6
- data/lib/inch/api/stats.rb +0 -1
- data/lib/inch/api/suggest.rb +9 -10
- data/lib/inch/cli.rb +6 -6
- data/lib/inch/cli/arguments.rb +2 -2
- data/lib/inch/cli/command.rb +15 -15
- data/lib/inch/cli/command/base.rb +30 -9
- data/lib/inch/cli/command/base_list.rb +2 -2
- data/lib/inch/cli/command/console.rb +5 -5
- data/lib/inch/cli/command/diff.rb +9 -9
- data/lib/inch/cli/command/inspect.rb +5 -4
- data/lib/inch/cli/command/list.rb +4 -4
- data/lib/inch/cli/command/options/base.rb +17 -16
- data/lib/inch/cli/command/options/base_list.rb +9 -5
- data/lib/inch/cli/command/options/console.rb +4 -3
- data/lib/inch/cli/command/options/diff.rb +8 -6
- data/lib/inch/cli/command/options/inspect.rb +2 -2
- data/lib/inch/cli/command/options/list.rb +3 -2
- data/lib/inch/cli/command/options/show.rb +2 -2
- data/lib/inch/cli/command/options/stats.rb +2 -1
- data/lib/inch/cli/command/options/suggest.rb +6 -3
- data/lib/inch/cli/command/output/base.rb +4 -6
- data/lib/inch/cli/command/output/console.rb +6 -7
- data/lib/inch/cli/command/output/diff.rb +6 -6
- data/lib/inch/cli/command/output/inspect.rb +6 -8
- data/lib/inch/cli/command/output/list.rb +0 -1
- data/lib/inch/cli/command/output/show.rb +4 -5
- data/lib/inch/cli/command/output/stats.rb +21 -21
- data/lib/inch/cli/command/output/suggest.rb +31 -28
- data/lib/inch/cli/command/show.rb +4 -4
- data/lib/inch/cli/command/stats.rb +4 -4
- data/lib/inch/cli/command/suggest.rb +6 -6
- data/lib/inch/cli/command_parser.rb +6 -5
- data/lib/inch/cli/sparkline_helper.rb +6 -6
- data/lib/inch/cli/trace_helper.rb +1 -1
- data/lib/inch/cli/yardopts_helper.rb +4 -3
- data/lib/inch/code_object.rb +3 -3
- data/lib/inch/code_object/converter.rb +6 -8
- data/lib/inch/code_object/provider.rb +11 -11
- data/lib/inch/code_object/proxy.rb +61 -30
- data/lib/inch/codebase.rb +7 -8
- data/lib/inch/codebase/object.rb +60 -0
- data/lib/inch/codebase/objects.rb +8 -10
- data/lib/inch/codebase/objects_filter.rb +7 -5
- data/lib/inch/codebase/proxy.rb +4 -4
- data/lib/inch/codebase/serializer.rb +3 -3
- data/lib/inch/config.rb +42 -11
- data/lib/inch/config/base.rb +8 -29
- data/lib/inch/config/codebase.rb +32 -7
- data/lib/inch/config/evaluation.rb +61 -0
- data/lib/inch/core_ext.rb +1 -1
- data/lib/inch/core_ext/string.rb +1 -1
- data/lib/inch/evaluation.rb +13 -21
- data/lib/inch/evaluation/file.rb +4 -2
- data/lib/inch/evaluation/grade_list.rb +4 -4
- data/lib/inch/evaluation/priority_range.rb +3 -0
- data/lib/inch/evaluation/proxy.rb +139 -14
- data/lib/inch/evaluation/role.rb +99 -0
- data/lib/inch/language.rb +3 -0
- data/lib/inch/language/elixir/code_object/base.rb +197 -0
- data/lib/inch/language/elixir/code_object/function_object.rb +74 -0
- data/lib/inch/language/elixir/code_object/module_object.rb +23 -0
- data/lib/inch/language/elixir/code_object/type_object.rb +11 -0
- data/lib/inch/language/elixir/evaluation/base.rb +28 -0
- data/lib/inch/language/elixir/evaluation/function_object.rb +31 -0
- data/lib/inch/language/elixir/evaluation/module_object.rb +27 -0
- data/lib/inch/language/elixir/evaluation/type_object.rb +11 -0
- data/lib/inch/language/elixir/import.rb +24 -0
- data/lib/inch/language/elixir/provider/reader.rb +19 -0
- data/lib/inch/language/elixir/provider/reader/object.rb +63 -0
- data/lib/inch/language/elixir/provider/reader/object/base.rb +191 -0
- data/lib/inch/language/elixir/provider/reader/object/function_object.rb +26 -0
- data/lib/inch/language/elixir/provider/reader/object/module_object.rb +22 -0
- data/lib/inch/language/elixir/provider/reader/object/type_object.rb +15 -0
- data/lib/inch/language/elixir/provider/reader/parser.rb +55 -0
- data/lib/inch/language/elixir/roles/base.rb +32 -0
- data/lib/inch/language/elixir/roles/function.rb +112 -0
- data/lib/inch/language/elixir/roles/module.rb +64 -0
- data/lib/inch/language/elixir/roles/object.rb +76 -0
- data/lib/inch/language/elixir/roles/type.rb +13 -0
- data/lib/inch/language/nodejs/import.rb +8 -0
- data/lib/inch/language/nodejs/provider/jsdoc.rb +19 -0
- data/lib/inch/language/nodejs/provider/jsdoc/object.rb +55 -0
- data/lib/inch/language/nodejs/provider/jsdoc/object/base.rb +191 -0
- data/lib/inch/language/nodejs/provider/jsdoc/parser.rb +59 -0
- data/lib/inch/language/ruby/code_object/base.rb +197 -0
- data/lib/inch/language/ruby/code_object/class_object.rb +10 -0
- data/lib/inch/language/ruby/code_object/class_variable_object.rb +10 -0
- data/lib/inch/language/ruby/code_object/constant_object.rb +10 -0
- data/lib/inch/language/ruby/code_object/method_object.rb +85 -0
- data/lib/inch/language/ruby/code_object/method_parameter_object.rb +64 -0
- data/lib/inch/language/ruby/code_object/module_object.rb +10 -0
- data/lib/inch/language/ruby/code_object/namespace_object.rb +35 -0
- data/lib/inch/language/ruby/evaluation/base.rb +45 -0
- data/lib/inch/language/ruby/evaluation/class_object.rb +10 -0
- data/lib/inch/language/ruby/evaluation/class_variable_object.rb +21 -0
- data/lib/inch/language/ruby/evaluation/constant_object.rb +21 -0
- data/lib/inch/language/ruby/evaluation/method_object.rb +74 -0
- data/lib/inch/language/ruby/evaluation/module_object.rb +10 -0
- data/lib/inch/language/ruby/evaluation/namespace_object.rb +30 -0
- data/lib/inch/language/ruby/import.rb +34 -0
- data/lib/inch/language/ruby/provider/yard.rb +58 -0
- data/lib/inch/language/ruby/provider/yard/docstring.rb +162 -0
- data/lib/inch/language/ruby/provider/yard/nodoc_helper.rb +97 -0
- data/lib/inch/language/ruby/provider/yard/object.rb +63 -0
- data/lib/inch/language/ruby/provider/yard/object/base.rb +325 -0
- data/lib/inch/language/ruby/provider/yard/object/class_object.rb +14 -0
- data/lib/inch/language/ruby/provider/yard/object/class_variable_object.rb +14 -0
- data/lib/inch/language/ruby/provider/yard/object/constant_object.rb +14 -0
- data/lib/inch/language/ruby/provider/yard/object/method_object.rb +170 -0
- data/lib/inch/language/ruby/provider/yard/object/method_parameter_object.rb +94 -0
- data/lib/inch/language/ruby/provider/yard/object/method_signature.rb +120 -0
- data/lib/inch/language/ruby/provider/yard/object/module_object.rb +14 -0
- data/lib/inch/language/ruby/provider/yard/object/namespace_object.rb +46 -0
- data/lib/inch/language/ruby/provider/yard/object/root_object.rb +14 -0
- data/lib/inch/language/ruby/provider/yard/parser.rb +71 -0
- data/lib/inch/language/ruby/roles/base.rb +17 -0
- data/lib/inch/language/ruby/roles/class_variable.rb +53 -0
- data/lib/inch/language/ruby/roles/constant.rb +53 -0
- data/lib/inch/language/ruby/roles/method.rb +112 -0
- data/lib/inch/language/ruby/roles/method_parameter.rb +84 -0
- data/lib/inch/language/ruby/roles/missing.rb +24 -0
- data/lib/inch/language/ruby/roles/namespace.rb +89 -0
- data/lib/inch/language/ruby/roles/object.rb +120 -0
- data/lib/inch/rake.rb +2 -2
- data/lib/inch/rake/suggest.rb +7 -2
- data/lib/inch/utils/buffered_ui.rb +16 -0
- data/lib/inch/utils/shell_helper.rb +1 -1
- data/lib/inch/utils/ui.rb +5 -5
- data/lib/inch/utils/weighted_list.rb +2 -3
- data/lib/inch/version.rb +1 -1
- data/test/fixtures/{code_examples → ruby/code_examples}/lib/foo.rb +0 -0
- data/test/fixtures/{diff1 → ruby/diff1}/lib/diff1.rb +0 -0
- data/test/fixtures/{diff2 → ruby/diff2}/lib/diff2.rb +0 -0
- data/test/fixtures/{inch-yml → ruby/inch-yml}/.inch.yml +0 -0
- data/test/fixtures/{inch-yml → ruby/inch-yml}/foo/bar.rb +0 -0
- data/test/fixtures/{inch-yml → ruby/inch-yml}/foo/vendor/base.rb +0 -0
- data/test/fixtures/{parameters → ruby/parameters}/lib/foo.rb +0 -0
- data/test/fixtures/{readme → ruby/readme}/lib/foo.rb +0 -0
- data/test/fixtures/{really_good → ruby/really_good}/lib/foo.rb +0 -0
- data/test/fixtures/{really_good_pedantic → ruby/really_good_pedantic}/lib/foo.rb +0 -0
- data/test/fixtures/{simple → ruby/simple}/README +0 -0
- data/test/fixtures/{simple → ruby/simple}/lib/broken.rb +11 -19
- data/test/fixtures/ruby/simple/lib/broken_ruby_2_0_features.rb +7 -0
- data/test/fixtures/ruby/simple/lib/directives.rb +8 -0
- data/test/fixtures/{simple → ruby/simple}/lib/foo.rb +22 -1
- data/test/fixtures/{simple → ruby/simple}/lib/nodoc.rb +0 -0
- data/test/fixtures/{simple → ruby/simple}/lib/role_methods.rb +0 -0
- data/test/fixtures/{simple → ruby/simple}/lib/role_namespaces.rb +0 -0
- data/test/fixtures/{visibility → ruby/visibility}/lib/foo.rb +0 -0
- data/test/fixtures/{yardopts → ruby/yardopts}/.yardopts +0 -0
- data/test/fixtures/{yardopts → ruby/yardopts}/foo/bar.rb +0 -0
- data/test/integration/api/compare/codebases.rb +3 -3
- data/test/integration/cli/command/console_test.rb +6 -6
- data/test/integration/cli/command/diff_test.rb +62 -0
- data/test/integration/cli/command/inspect_test.rb +5 -6
- data/test/integration/cli/command/list_test.rb +4 -5
- data/test/integration/cli/command/show_test.rb +5 -5
- data/test/integration/cli/command/stats_test.rb +3 -3
- data/test/integration/cli/command/suggest_test.rb +13 -13
- data/test/integration/stats_options_test.rb +4 -4
- data/test/integration/visibility_options_test.rb +14 -14
- data/test/shared/base_list.rb +4 -3
- data/test/test_helper.rb +13 -13
- data/test/unit/api/filter_test.rb +7 -7
- data/test/unit/api/get_test.rb +1 -1
- data/test/unit/api/list_test.rb +1 -1
- data/test/unit/api/options/base_test.rb +3 -3
- data/test/unit/api/stats_test.rb +1 -1
- data/test/unit/api/suggest_test.rb +3 -3
- data/test/unit/cli/arguments_test.rb +2 -2
- data/test/unit/cli/command/base_test.rb +1 -1
- data/test/unit/cli/command/options/base_list_test.rb +2 -2
- data/test/unit/cli/command/options/base_object_test.rb +1 -1
- data/test/unit/cli/command/options/base_test.rb +1 -1
- data/test/unit/cli/command_parser_test.rb +3 -3
- data/test/unit/cli/trace_helper_test.rb +1 -1
- data/test/unit/cli/yardopts_helper_test.rb +6 -5
- data/test/unit/code_object/converter_test.rb +1 -1
- data/test/unit/code_object/provider_test.rb +2 -2
- data/test/unit/code_object/proxy_test.rb +2 -2
- data/test/unit/codebase/objects_test.rb +2 -2
- data/test/unit/codebase/proxy_test.rb +7 -5
- data/test/unit/config/codebase_test.rb +4 -4
- data/test/unit/config_test.rb +28 -0
- data/test/unit/evaluation/{role/base_test.rb → role_test.rb} +7 -7
- data/test/unit/{code_object/proxy → language/ruby/code_object}/method_object_test.rb +66 -21
- data/test/unit/{code_object → language/ruby}/provider/yard/docstring_test.rb +74 -38
- data/test/unit/{code_object → language/ruby}/provider/yard/nodoc_helper_test.rb +9 -7
- data/test/unit/{code_object → language/ruby}/provider/yard/object/method_object_test.rb +21 -11
- data/test/unit/language/ruby/provider/yard_test.rb +25 -0
- data/test/unit/utils/buffered_ui_test.rb +48 -0
- data/test/unit/utils/ui_test.rb +7 -7
- data/test/unit/utils/weighted_list_test.rb +7 -4
- metadata +139 -93
- data/lib/inch/code_object/provider/yard.rb +0 -57
- data/lib/inch/code_object/provider/yard/docstring.rb +0 -133
- data/lib/inch/code_object/provider/yard/nodoc_helper.rb +0 -93
- data/lib/inch/code_object/provider/yard/object.rb +0 -60
- data/lib/inch/code_object/provider/yard/object/base.rb +0 -302
- data/lib/inch/code_object/provider/yard/object/class_object.rb +0 -12
- data/lib/inch/code_object/provider/yard/object/class_variable_object.rb +0 -12
- data/lib/inch/code_object/provider/yard/object/constant_object.rb +0 -12
- data/lib/inch/code_object/provider/yard/object/method_object.rb +0 -153
- data/lib/inch/code_object/provider/yard/object/method_parameter_object.rb +0 -88
- data/lib/inch/code_object/provider/yard/object/method_signature.rb +0 -114
- data/lib/inch/code_object/provider/yard/object/module_object.rb +0 -12
- data/lib/inch/code_object/provider/yard/object/namespace_object.rb +0 -47
- data/lib/inch/code_object/provider/yard/object/root_object.rb +0 -12
- data/lib/inch/code_object/provider/yard/parser.rb +0 -62
- data/lib/inch/code_object/proxy/base.rb +0 -241
- data/lib/inch/code_object/proxy/class_object.rb +0 -8
- data/lib/inch/code_object/proxy/class_variable_object.rb +0 -8
- data/lib/inch/code_object/proxy/constant_object.rb +0 -8
- data/lib/inch/code_object/proxy/method_object.rb +0 -82
- data/lib/inch/code_object/proxy/method_parameter_object.rb +0 -60
- data/lib/inch/code_object/proxy/module_object.rb +0 -8
- data/lib/inch/code_object/proxy/namespace_object.rb +0 -33
- data/lib/inch/evaluation/object_schema.rb +0 -30
- data/lib/inch/evaluation/proxy/base.rb +0 -164
- data/lib/inch/evaluation/proxy/class_object.rb +0 -8
- data/lib/inch/evaluation/proxy/class_variable_object.rb +0 -19
- data/lib/inch/evaluation/proxy/constant_object.rb +0 -19
- data/lib/inch/evaluation/proxy/method_object.rb +0 -65
- data/lib/inch/evaluation/proxy/module_object.rb +0 -8
- data/lib/inch/evaluation/proxy/namespace_object.rb +0 -27
- data/lib/inch/evaluation/role/base.rb +0 -92
- data/lib/inch/evaluation/role/class_variable.rb +0 -55
- data/lib/inch/evaluation/role/constant.rb +0 -55
- data/lib/inch/evaluation/role/method.rb +0 -126
- data/lib/inch/evaluation/role/method_parameter.rb +0 -91
- data/lib/inch/evaluation/role/missing.rb +0 -20
- data/lib/inch/evaluation/role/namespace.rb +0 -85
- data/lib/inch/evaluation/role/object.rb +0 -143
- data/test/unit/code_object/provider/yard_test.rb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 204a55bbfb702da63ab9b62d8e68b6e97b46d7e8
|
4
|
+
data.tar.gz: 9237fdad678102759b3924c464718181560de4d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5e38320c4c26fcbb2bf22f67fce5f5fc1d6c8d6acd4953e069f106b6440d31b531179284611be268b26bc8cad49cd3722b9f8dd48e669ef067fbbab07b5f79f
|
7
|
+
data.tar.gz: 0c5772bcc6822ef6652611ec82ec370cb5b1f7fb122078055bcb69a53ab6efefad5fa10aa15e29312cb21a9eb2035894f7d60d56e18b43a693f5f26d9780432a
|
data/.rubocop.yml
ADDED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
# This configuration was generated by `rubocop --auto-gen-config`
|
2
|
+
# on 2014-08-09 22:59:20 +0200 using RuboCop version 0.24.1.
|
3
|
+
# The point is for the user to remove these configuration records
|
4
|
+
# one by one as the offenses are removed from the code base.
|
5
|
+
# Note that changes in the inspected code, or installation of new
|
6
|
+
# versions of RuboCop, may require this file to be generated again.
|
7
|
+
|
8
|
+
# Offense count: 2
|
9
|
+
Lint/AmbiguousOperator:
|
10
|
+
Enabled: false
|
11
|
+
|
12
|
+
# Offense count: 87
|
13
|
+
Lint/AmbiguousRegexpLiteral:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
# Offense count: 1
|
17
|
+
Lint/Debugger:
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
# Offense count: 3
|
21
|
+
# Cop supports --auto-correct.
|
22
|
+
Lint/UnusedMethodArgument:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
# Offense count: 5
|
26
|
+
Style/AccessorMethodName:
|
27
|
+
Enabled: false
|
28
|
+
|
29
|
+
# Offense count: 3
|
30
|
+
Style/AsciiComments:
|
31
|
+
Enabled: false
|
32
|
+
|
33
|
+
# Offense count: 1
|
34
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
35
|
+
Style/ClassAndModuleChildren:
|
36
|
+
Enabled: false
|
37
|
+
|
38
|
+
# Offense count: 5
|
39
|
+
# Configuration parameters: CountComments.
|
40
|
+
Style/ClassLength:
|
41
|
+
Max: 195
|
42
|
+
|
43
|
+
# Offense count: 2
|
44
|
+
Style/CyclomaticComplexity:
|
45
|
+
Max: 7
|
46
|
+
|
47
|
+
# Offense count: 85
|
48
|
+
Style/Documentation:
|
49
|
+
Enabled: false
|
50
|
+
|
51
|
+
# Offense count: 2
|
52
|
+
Style/DoubleNegation:
|
53
|
+
Enabled: false
|
54
|
+
|
55
|
+
# Offense count: 11
|
56
|
+
# Configuration parameters: MinBodyLength.
|
57
|
+
Style/GuardClause:
|
58
|
+
Enabled: false
|
59
|
+
|
60
|
+
# Offense count: 1
|
61
|
+
# Configuration parameters: MaxLineLength.
|
62
|
+
Style/IfUnlessModifier:
|
63
|
+
Enabled: false
|
64
|
+
|
65
|
+
# Offense count: 10
|
66
|
+
# Configuration parameters: AllowURI.
|
67
|
+
Style/LineLength:
|
68
|
+
Max: 111
|
69
|
+
|
70
|
+
# Offense count: 23
|
71
|
+
# Configuration parameters: CountComments.
|
72
|
+
Style/MethodLength:
|
73
|
+
Max: 34
|
74
|
+
|
75
|
+
# Offense count: 22
|
76
|
+
# Configuration parameters: NamePrefixBlacklist.
|
77
|
+
Style/PredicateName:
|
78
|
+
Enabled: false
|
79
|
+
|
80
|
+
# Offense count: 2
|
81
|
+
# Configuration parameters: Methods.
|
82
|
+
Style/SingleLineBlockParams:
|
83
|
+
Enabled: false
|
84
|
+
|
85
|
+
# Offense count: 45
|
86
|
+
# Cop supports --auto-correct.
|
87
|
+
Style/SingleSpaceBeforeFirstArg:
|
88
|
+
Enabled: false
|
89
|
+
|
90
|
+
# Offense count: 5
|
91
|
+
# Cop supports --auto-correct.
|
92
|
+
# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, Whitelist.
|
93
|
+
Style/TrivialAccessors:
|
94
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,35 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.4.11 (pre)
|
3
4
|
|
4
|
-
|
5
|
+
- Add `undefined` to the list of values used to indicate that a return value
|
6
|
+
is not intended for further use. The current list is `nil`, `nothing`,
|
7
|
+
`void`, and `undefined`.
|
8
|
+
|
9
|
+
## 0.4.10
|
10
|
+
|
11
|
+
- This patch handles cases where the docs indicate that a return value is not
|
12
|
+
intended for further use. After this patch, Inch won't suggest "Describe
|
13
|
+
what foo returns." anymore.
|
14
|
+
|
15
|
+
## 0.4.9
|
16
|
+
|
17
|
+
- Fixes bugs introduced in 0.4.8
|
18
|
+
|
19
|
+
## 0.4.8
|
20
|
+
|
21
|
+
- Fix a bug related to "CLI classes must be required seperately from now on"
|
22
|
+
Note to self: read own CHANGELOG more carefully in the future
|
23
|
+
|
24
|
+
## 0.4.7
|
5
25
|
|
6
26
|
- CLI classes must be required seperately from now on
|
7
27
|
- external data read by NoDocHelper is encoded as UTF-8
|
8
|
-
|
28
|
+
- YARD's attribute directive is now interpreted correctly
|
29
|
+
- Docs are now evaluated for class variables as well
|
30
|
+
- TomDoc support has been improved
|
31
|
+
- Method parameter name recognition has been improved for RDoc style comments
|
32
|
+
- Compliance with the Ruby Style Guide has been improved (thanks @yous)
|
9
33
|
|
10
34
|
## 0.4.6
|
11
35
|
|
data/Gemfile
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
source
|
1
|
+
source "https://rubygems.org"
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in inch.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
|
6
|
+
group :test do
|
7
|
+
gem "simplecov", require: false
|
8
|
+
gem "rubocop", require: false
|
9
|
+
end
|
data/README.md
CHANGED
@@ -267,7 +267,7 @@ Suggests places where a codebase suffers a lack of documentation.
|
|
267
267
|
# Properly documented, could be improved:
|
268
268
|
|
269
269
|
┃ B ↑ Inch::CLI::Command::BaseList#prepare_list
|
270
|
-
┃ B ↑ Inch::CodeObject::
|
270
|
+
┃ B ↑ Inch::CodeObject::Ruby::MethodParameterObject#initialize
|
271
271
|
┃ B ↗ Inch::CLI::Command::Stats#run
|
272
272
|
┃ B ↗ Inch::CLI::CommandParser#run
|
273
273
|
|
@@ -362,7 +362,7 @@ Lists all objects in your codebase with their grades.
|
|
362
362
|
# Seems really good
|
363
363
|
|
364
364
|
┃ A ↑ Inch::CLI::Command::Output::Console#object
|
365
|
-
┃ A ↗ Inch::CodeObject::Proxy
|
365
|
+
┃ A ↗ Inch::CodeObject::Proxy#depth
|
366
366
|
┃ A ↗ Inch::CLI::Command::Base#description
|
367
367
|
┃ A ↗ Inch::CodeObject::NodocHelper#nodoc?
|
368
368
|
┃ ... (omitting 75 objects)
|
@@ -370,7 +370,7 @@ Lists all objects in your codebase with their grades.
|
|
370
370
|
# Proper documentation present
|
371
371
|
|
372
372
|
┃ B ↑ Inch::CLI::Command::Suggest#run
|
373
|
-
┃ B ↑ Inch::CodeObject::
|
373
|
+
┃ B ↑ Inch::CodeObject::Ruby::MethodParameterObject#initialize
|
374
374
|
┃ B ↗ Inch::CLI::Command::Stats#run
|
375
375
|
┃ B ↗ Inch::CLI::CommandParser#run
|
376
376
|
|
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
|
3
|
-
require
|
3
|
+
require "rake/testtask"
|
4
4
|
|
5
5
|
Rake::TestTask.new do |t|
|
6
6
|
t.pattern = "test/**/*_test.rb"
|
@@ -10,8 +10,12 @@ Rake::TestTask.new(:"test:unit") do |t|
|
|
10
10
|
t.pattern = "test/unit/**/*_test.rb"
|
11
11
|
end
|
12
12
|
|
13
|
+
Rake::TestTask.new(:"test:ruby") do |t|
|
14
|
+
t.pattern = "test/unit/language/ruby/**/*_test.rb"
|
15
|
+
end
|
16
|
+
|
13
17
|
Rake::TestTask.new(:"test:integration") do |t|
|
14
18
|
t.pattern = "test/integration/**/*_test.rb"
|
15
19
|
end
|
16
20
|
|
17
|
-
task :
|
21
|
+
task default: :test
|
data/bin/inch
CHANGED
@@ -12,12 +12,12 @@ def find_lib_path
|
|
12
12
|
while File.symlink?(path)
|
13
13
|
path = File.expand_path(File.readlink(path), File.dirname(path))
|
14
14
|
end
|
15
|
-
File.join(File.dirname(File.expand_path(path)),
|
15
|
+
File.join(File.dirname(File.expand_path(path)), "..", "lib")
|
16
16
|
end
|
17
17
|
|
18
18
|
$LOAD_PATH.unshift(find_lib_path)
|
19
19
|
|
20
|
-
require
|
21
|
-
require
|
20
|
+
require "inch"
|
21
|
+
require "inch/cli"
|
22
22
|
|
23
23
|
Inch::CLI::CommandParser.run(*ARGV)
|
data/config/base.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
Inch::Config.base do
|
2
|
+
evaluation do
|
3
|
+
grade(:A) do
|
4
|
+
scores 80..100
|
5
|
+
label "Seems really good"
|
6
|
+
color :green
|
7
|
+
end
|
8
|
+
|
9
|
+
grade(:B) do
|
10
|
+
scores 50...80
|
11
|
+
label "Proper documentation present"
|
12
|
+
color :yellow
|
13
|
+
end
|
14
|
+
|
15
|
+
grade(:C) do
|
16
|
+
scores 1...50
|
17
|
+
label "Needs work"
|
18
|
+
color :red
|
19
|
+
end
|
20
|
+
|
21
|
+
grade(:U) do
|
22
|
+
scores 0..0
|
23
|
+
label "Undocumented"
|
24
|
+
color :color141
|
25
|
+
bg_color :color105
|
26
|
+
end
|
27
|
+
|
28
|
+
priority(:N) do
|
29
|
+
priorities 4..99
|
30
|
+
arrow "\u2191"
|
31
|
+
end
|
32
|
+
|
33
|
+
priority(:NE) do
|
34
|
+
priorities 2...4
|
35
|
+
arrow "\u2197"
|
36
|
+
end
|
37
|
+
|
38
|
+
priority(:E) do
|
39
|
+
priorities 0...2
|
40
|
+
arrow "\u2192"
|
41
|
+
end
|
42
|
+
|
43
|
+
priority(:SE) do
|
44
|
+
priorities -2...0
|
45
|
+
arrow "\u2198"
|
46
|
+
end
|
47
|
+
|
48
|
+
priority(:S) do
|
49
|
+
priorities -99...-2
|
50
|
+
arrow "\u2193"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
data/config/elixir.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Elixir's configuration
|
2
|
+
|
3
|
+
Inch::Config.register(:elixir) do
|
4
|
+
codebase do
|
5
|
+
object_provider :Reader
|
6
|
+
include_files []
|
7
|
+
exclude_files []
|
8
|
+
end
|
9
|
+
|
10
|
+
evaluation do
|
11
|
+
schema(:ModuleObject) do
|
12
|
+
docstring 1.0
|
13
|
+
|
14
|
+
# optional:
|
15
|
+
code_example_single 0.1
|
16
|
+
code_example_multi 0.2
|
17
|
+
unconsidered_tag 0.2
|
18
|
+
end
|
19
|
+
|
20
|
+
schema(:FunctionObject) do
|
21
|
+
docstring 0.5
|
22
|
+
parameters 0.4
|
23
|
+
return_type 0.1
|
24
|
+
return_description 0.3
|
25
|
+
|
26
|
+
if object.questioning_name?
|
27
|
+
parameters parameters + return_type
|
28
|
+
return_type 0.0
|
29
|
+
end
|
30
|
+
|
31
|
+
if !object.has_parameters? || object.setter?
|
32
|
+
return_description docstring + parameters
|
33
|
+
docstring docstring + parameters
|
34
|
+
parameters 0.0
|
35
|
+
end
|
36
|
+
|
37
|
+
# optional:
|
38
|
+
code_example_single 0.1
|
39
|
+
code_example_multi 0.25
|
40
|
+
unconsidered_tag 0.2
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/config/nodejs.rb
ADDED
@@ -1,62 +1,13 @@
|
|
1
|
-
|
2
|
-
# development!
|
1
|
+
# Ruby's configuration
|
3
2
|
|
3
|
+
Inch::Config.register(:ruby) do
|
4
4
|
codebase do
|
5
|
-
|
6
|
-
|
5
|
+
object_provider :YARD
|
6
|
+
include_files ["lib/**/*.rb", "app/**/*.rb"]
|
7
|
+
exclude_files []
|
7
8
|
end
|
8
9
|
|
9
10
|
evaluation do
|
10
|
-
grade(:A) do
|
11
|
-
scores 80..100
|
12
|
-
label "Seems really good"
|
13
|
-
color :green
|
14
|
-
end
|
15
|
-
|
16
|
-
grade(:B) do
|
17
|
-
scores 50...80
|
18
|
-
label "Proper documentation present"
|
19
|
-
color :yellow
|
20
|
-
end
|
21
|
-
|
22
|
-
grade(:C) do
|
23
|
-
scores 1...50
|
24
|
-
label "Needs work"
|
25
|
-
color :red
|
26
|
-
end
|
27
|
-
|
28
|
-
grade(:U) do
|
29
|
-
scores 0..0
|
30
|
-
label "Undocumented"
|
31
|
-
color :color141
|
32
|
-
bg_color :color105
|
33
|
-
end
|
34
|
-
|
35
|
-
priority(:N) do
|
36
|
-
priorities 4..99
|
37
|
-
arrow "\u2191"
|
38
|
-
end
|
39
|
-
|
40
|
-
priority(:NE) do
|
41
|
-
priorities 2...4
|
42
|
-
arrow "\u2197"
|
43
|
-
end
|
44
|
-
|
45
|
-
priority(:E) do
|
46
|
-
priorities 0...2
|
47
|
-
arrow "\u2192"
|
48
|
-
end
|
49
|
-
|
50
|
-
priority(:SE) do
|
51
|
-
priorities -2...0
|
52
|
-
arrow "\u2198"
|
53
|
-
end
|
54
|
-
|
55
|
-
priority(:S) do
|
56
|
-
priorities -99...-2
|
57
|
-
arrow "\u2193"
|
58
|
-
end
|
59
|
-
|
60
11
|
schema(:ConstantObject) do
|
61
12
|
docstring 1.0
|
62
13
|
|
data/inch.gemspec
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
lib = File.expand_path(
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
4
|
+
require "inch/version"
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "inch"
|
8
8
|
spec.version = Inch::VERSION
|
9
9
|
spec.authors = ["René Föhring"]
|
10
10
|
spec.email = ["rf@bamaru.de"]
|
11
|
-
spec.summary =
|
12
|
-
spec.description =
|
11
|
+
spec.summary = "Documentation measurement tool for Ruby"
|
12
|
+
spec.description = "Documentation measurement tool for Ruby, based on YARD."
|
13
13
|
spec.homepage = "http://trivelop.de/inch/"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
17
|
-
spec.executables = spec.files.grep(
|
18
|
-
spec.test_files = spec.files.grep(
|
17
|
+
spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(/^(test|spec|features)\//)
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.5"
|
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_development_dependency "minitest", "~> 5.2"
|
24
24
|
|
25
25
|
spec.add_dependency "pry"
|
26
|
-
spec.add_dependency
|
26
|
+
spec.add_dependency "sparkr", ">= 0.2.0"
|
27
27
|
spec.add_dependency "term-ansicolor"
|
28
28
|
spec.add_dependency "yard", "~> 0.8.7"
|
29
29
|
end
|