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.
Files changed (259) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +15 -0
  3. data/.rubocop_todo.yml +94 -0
  4. data/CHANGELOG.md +26 -2
  5. data/Gemfile +5 -2
  6. data/README.md +3 -3
  7. data/Rakefile +6 -2
  8. data/bin/inch +3 -3
  9. data/config/{example.yml → .inch.yml.sample} +1 -0
  10. data/config/base.rb +53 -0
  11. data/config/elixir.rb +43 -0
  12. data/config/nodejs.rb +10 -0
  13. data/config/{defaults.rb → ruby.rb} +5 -54
  14. data/inch.gemspec +7 -7
  15. data/lib/inch.rb +14 -9
  16. data/lib/inch/api.rb +10 -10
  17. data/lib/inch/api/compare.rb +2 -2
  18. data/lib/inch/api/compare/code_objects.rb +2 -3
  19. data/lib/inch/api/compare/codebases.rb +1 -1
  20. data/lib/inch/api/diff.rb +13 -16
  21. data/lib/inch/api/filter.rb +1 -1
  22. data/lib/inch/api/get.rb +2 -2
  23. data/lib/inch/api/options/base.rb +4 -4
  24. data/lib/inch/api/options/filter.rb +0 -4
  25. data/lib/inch/api/options/suggest.rb +2 -6
  26. data/lib/inch/api/stats.rb +0 -1
  27. data/lib/inch/api/suggest.rb +9 -10
  28. data/lib/inch/cli.rb +6 -6
  29. data/lib/inch/cli/arguments.rb +2 -2
  30. data/lib/inch/cli/command.rb +15 -15
  31. data/lib/inch/cli/command/base.rb +30 -9
  32. data/lib/inch/cli/command/base_list.rb +2 -2
  33. data/lib/inch/cli/command/console.rb +5 -5
  34. data/lib/inch/cli/command/diff.rb +9 -9
  35. data/lib/inch/cli/command/inspect.rb +5 -4
  36. data/lib/inch/cli/command/list.rb +4 -4
  37. data/lib/inch/cli/command/options/base.rb +17 -16
  38. data/lib/inch/cli/command/options/base_list.rb +9 -5
  39. data/lib/inch/cli/command/options/console.rb +4 -3
  40. data/lib/inch/cli/command/options/diff.rb +8 -6
  41. data/lib/inch/cli/command/options/inspect.rb +2 -2
  42. data/lib/inch/cli/command/options/list.rb +3 -2
  43. data/lib/inch/cli/command/options/show.rb +2 -2
  44. data/lib/inch/cli/command/options/stats.rb +2 -1
  45. data/lib/inch/cli/command/options/suggest.rb +6 -3
  46. data/lib/inch/cli/command/output/base.rb +4 -6
  47. data/lib/inch/cli/command/output/console.rb +6 -7
  48. data/lib/inch/cli/command/output/diff.rb +6 -6
  49. data/lib/inch/cli/command/output/inspect.rb +6 -8
  50. data/lib/inch/cli/command/output/list.rb +0 -1
  51. data/lib/inch/cli/command/output/show.rb +4 -5
  52. data/lib/inch/cli/command/output/stats.rb +21 -21
  53. data/lib/inch/cli/command/output/suggest.rb +31 -28
  54. data/lib/inch/cli/command/show.rb +4 -4
  55. data/lib/inch/cli/command/stats.rb +4 -4
  56. data/lib/inch/cli/command/suggest.rb +6 -6
  57. data/lib/inch/cli/command_parser.rb +6 -5
  58. data/lib/inch/cli/sparkline_helper.rb +6 -6
  59. data/lib/inch/cli/trace_helper.rb +1 -1
  60. data/lib/inch/cli/yardopts_helper.rb +4 -3
  61. data/lib/inch/code_object.rb +3 -3
  62. data/lib/inch/code_object/converter.rb +6 -8
  63. data/lib/inch/code_object/provider.rb +11 -11
  64. data/lib/inch/code_object/proxy.rb +61 -30
  65. data/lib/inch/codebase.rb +7 -8
  66. data/lib/inch/codebase/object.rb +60 -0
  67. data/lib/inch/codebase/objects.rb +8 -10
  68. data/lib/inch/codebase/objects_filter.rb +7 -5
  69. data/lib/inch/codebase/proxy.rb +4 -4
  70. data/lib/inch/codebase/serializer.rb +3 -3
  71. data/lib/inch/config.rb +42 -11
  72. data/lib/inch/config/base.rb +8 -29
  73. data/lib/inch/config/codebase.rb +32 -7
  74. data/lib/inch/config/evaluation.rb +61 -0
  75. data/lib/inch/core_ext.rb +1 -1
  76. data/lib/inch/core_ext/string.rb +1 -1
  77. data/lib/inch/evaluation.rb +13 -21
  78. data/lib/inch/evaluation/file.rb +4 -2
  79. data/lib/inch/evaluation/grade_list.rb +4 -4
  80. data/lib/inch/evaluation/priority_range.rb +3 -0
  81. data/lib/inch/evaluation/proxy.rb +139 -14
  82. data/lib/inch/evaluation/role.rb +99 -0
  83. data/lib/inch/language.rb +3 -0
  84. data/lib/inch/language/elixir/code_object/base.rb +197 -0
  85. data/lib/inch/language/elixir/code_object/function_object.rb +74 -0
  86. data/lib/inch/language/elixir/code_object/module_object.rb +23 -0
  87. data/lib/inch/language/elixir/code_object/type_object.rb +11 -0
  88. data/lib/inch/language/elixir/evaluation/base.rb +28 -0
  89. data/lib/inch/language/elixir/evaluation/function_object.rb +31 -0
  90. data/lib/inch/language/elixir/evaluation/module_object.rb +27 -0
  91. data/lib/inch/language/elixir/evaluation/type_object.rb +11 -0
  92. data/lib/inch/language/elixir/import.rb +24 -0
  93. data/lib/inch/language/elixir/provider/reader.rb +19 -0
  94. data/lib/inch/language/elixir/provider/reader/object.rb +63 -0
  95. data/lib/inch/language/elixir/provider/reader/object/base.rb +191 -0
  96. data/lib/inch/language/elixir/provider/reader/object/function_object.rb +26 -0
  97. data/lib/inch/language/elixir/provider/reader/object/module_object.rb +22 -0
  98. data/lib/inch/language/elixir/provider/reader/object/type_object.rb +15 -0
  99. data/lib/inch/language/elixir/provider/reader/parser.rb +55 -0
  100. data/lib/inch/language/elixir/roles/base.rb +32 -0
  101. data/lib/inch/language/elixir/roles/function.rb +112 -0
  102. data/lib/inch/language/elixir/roles/module.rb +64 -0
  103. data/lib/inch/language/elixir/roles/object.rb +76 -0
  104. data/lib/inch/language/elixir/roles/type.rb +13 -0
  105. data/lib/inch/language/nodejs/import.rb +8 -0
  106. data/lib/inch/language/nodejs/provider/jsdoc.rb +19 -0
  107. data/lib/inch/language/nodejs/provider/jsdoc/object.rb +55 -0
  108. data/lib/inch/language/nodejs/provider/jsdoc/object/base.rb +191 -0
  109. data/lib/inch/language/nodejs/provider/jsdoc/parser.rb +59 -0
  110. data/lib/inch/language/ruby/code_object/base.rb +197 -0
  111. data/lib/inch/language/ruby/code_object/class_object.rb +10 -0
  112. data/lib/inch/language/ruby/code_object/class_variable_object.rb +10 -0
  113. data/lib/inch/language/ruby/code_object/constant_object.rb +10 -0
  114. data/lib/inch/language/ruby/code_object/method_object.rb +85 -0
  115. data/lib/inch/language/ruby/code_object/method_parameter_object.rb +64 -0
  116. data/lib/inch/language/ruby/code_object/module_object.rb +10 -0
  117. data/lib/inch/language/ruby/code_object/namespace_object.rb +35 -0
  118. data/lib/inch/language/ruby/evaluation/base.rb +45 -0
  119. data/lib/inch/language/ruby/evaluation/class_object.rb +10 -0
  120. data/lib/inch/language/ruby/evaluation/class_variable_object.rb +21 -0
  121. data/lib/inch/language/ruby/evaluation/constant_object.rb +21 -0
  122. data/lib/inch/language/ruby/evaluation/method_object.rb +74 -0
  123. data/lib/inch/language/ruby/evaluation/module_object.rb +10 -0
  124. data/lib/inch/language/ruby/evaluation/namespace_object.rb +30 -0
  125. data/lib/inch/language/ruby/import.rb +34 -0
  126. data/lib/inch/language/ruby/provider/yard.rb +58 -0
  127. data/lib/inch/language/ruby/provider/yard/docstring.rb +162 -0
  128. data/lib/inch/language/ruby/provider/yard/nodoc_helper.rb +97 -0
  129. data/lib/inch/language/ruby/provider/yard/object.rb +63 -0
  130. data/lib/inch/language/ruby/provider/yard/object/base.rb +325 -0
  131. data/lib/inch/language/ruby/provider/yard/object/class_object.rb +14 -0
  132. data/lib/inch/language/ruby/provider/yard/object/class_variable_object.rb +14 -0
  133. data/lib/inch/language/ruby/provider/yard/object/constant_object.rb +14 -0
  134. data/lib/inch/language/ruby/provider/yard/object/method_object.rb +170 -0
  135. data/lib/inch/language/ruby/provider/yard/object/method_parameter_object.rb +94 -0
  136. data/lib/inch/language/ruby/provider/yard/object/method_signature.rb +120 -0
  137. data/lib/inch/language/ruby/provider/yard/object/module_object.rb +14 -0
  138. data/lib/inch/language/ruby/provider/yard/object/namespace_object.rb +46 -0
  139. data/lib/inch/language/ruby/provider/yard/object/root_object.rb +14 -0
  140. data/lib/inch/language/ruby/provider/yard/parser.rb +71 -0
  141. data/lib/inch/language/ruby/roles/base.rb +17 -0
  142. data/lib/inch/language/ruby/roles/class_variable.rb +53 -0
  143. data/lib/inch/language/ruby/roles/constant.rb +53 -0
  144. data/lib/inch/language/ruby/roles/method.rb +112 -0
  145. data/lib/inch/language/ruby/roles/method_parameter.rb +84 -0
  146. data/lib/inch/language/ruby/roles/missing.rb +24 -0
  147. data/lib/inch/language/ruby/roles/namespace.rb +89 -0
  148. data/lib/inch/language/ruby/roles/object.rb +120 -0
  149. data/lib/inch/rake.rb +2 -2
  150. data/lib/inch/rake/suggest.rb +7 -2
  151. data/lib/inch/utils/buffered_ui.rb +16 -0
  152. data/lib/inch/utils/shell_helper.rb +1 -1
  153. data/lib/inch/utils/ui.rb +5 -5
  154. data/lib/inch/utils/weighted_list.rb +2 -3
  155. data/lib/inch/version.rb +1 -1
  156. data/test/fixtures/{code_examples → ruby/code_examples}/lib/foo.rb +0 -0
  157. data/test/fixtures/{diff1 → ruby/diff1}/lib/diff1.rb +0 -0
  158. data/test/fixtures/{diff2 → ruby/diff2}/lib/diff2.rb +0 -0
  159. data/test/fixtures/{inch-yml → ruby/inch-yml}/.inch.yml +0 -0
  160. data/test/fixtures/{inch-yml → ruby/inch-yml}/foo/bar.rb +0 -0
  161. data/test/fixtures/{inch-yml → ruby/inch-yml}/foo/vendor/base.rb +0 -0
  162. data/test/fixtures/{parameters → ruby/parameters}/lib/foo.rb +0 -0
  163. data/test/fixtures/{readme → ruby/readme}/lib/foo.rb +0 -0
  164. data/test/fixtures/{really_good → ruby/really_good}/lib/foo.rb +0 -0
  165. data/test/fixtures/{really_good_pedantic → ruby/really_good_pedantic}/lib/foo.rb +0 -0
  166. data/test/fixtures/{simple → ruby/simple}/README +0 -0
  167. data/test/fixtures/{simple → ruby/simple}/lib/broken.rb +11 -19
  168. data/test/fixtures/ruby/simple/lib/broken_ruby_2_0_features.rb +7 -0
  169. data/test/fixtures/ruby/simple/lib/directives.rb +8 -0
  170. data/test/fixtures/{simple → ruby/simple}/lib/foo.rb +22 -1
  171. data/test/fixtures/{simple → ruby/simple}/lib/nodoc.rb +0 -0
  172. data/test/fixtures/{simple → ruby/simple}/lib/role_methods.rb +0 -0
  173. data/test/fixtures/{simple → ruby/simple}/lib/role_namespaces.rb +0 -0
  174. data/test/fixtures/{visibility → ruby/visibility}/lib/foo.rb +0 -0
  175. data/test/fixtures/{yardopts → ruby/yardopts}/.yardopts +0 -0
  176. data/test/fixtures/{yardopts → ruby/yardopts}/foo/bar.rb +0 -0
  177. data/test/integration/api/compare/codebases.rb +3 -3
  178. data/test/integration/cli/command/console_test.rb +6 -6
  179. data/test/integration/cli/command/diff_test.rb +62 -0
  180. data/test/integration/cli/command/inspect_test.rb +5 -6
  181. data/test/integration/cli/command/list_test.rb +4 -5
  182. data/test/integration/cli/command/show_test.rb +5 -5
  183. data/test/integration/cli/command/stats_test.rb +3 -3
  184. data/test/integration/cli/command/suggest_test.rb +13 -13
  185. data/test/integration/stats_options_test.rb +4 -4
  186. data/test/integration/visibility_options_test.rb +14 -14
  187. data/test/shared/base_list.rb +4 -3
  188. data/test/test_helper.rb +13 -13
  189. data/test/unit/api/filter_test.rb +7 -7
  190. data/test/unit/api/get_test.rb +1 -1
  191. data/test/unit/api/list_test.rb +1 -1
  192. data/test/unit/api/options/base_test.rb +3 -3
  193. data/test/unit/api/stats_test.rb +1 -1
  194. data/test/unit/api/suggest_test.rb +3 -3
  195. data/test/unit/cli/arguments_test.rb +2 -2
  196. data/test/unit/cli/command/base_test.rb +1 -1
  197. data/test/unit/cli/command/options/base_list_test.rb +2 -2
  198. data/test/unit/cli/command/options/base_object_test.rb +1 -1
  199. data/test/unit/cli/command/options/base_test.rb +1 -1
  200. data/test/unit/cli/command_parser_test.rb +3 -3
  201. data/test/unit/cli/trace_helper_test.rb +1 -1
  202. data/test/unit/cli/yardopts_helper_test.rb +6 -5
  203. data/test/unit/code_object/converter_test.rb +1 -1
  204. data/test/unit/code_object/provider_test.rb +2 -2
  205. data/test/unit/code_object/proxy_test.rb +2 -2
  206. data/test/unit/codebase/objects_test.rb +2 -2
  207. data/test/unit/codebase/proxy_test.rb +7 -5
  208. data/test/unit/config/codebase_test.rb +4 -4
  209. data/test/unit/config_test.rb +28 -0
  210. data/test/unit/evaluation/{role/base_test.rb → role_test.rb} +7 -7
  211. data/test/unit/{code_object/proxy → language/ruby/code_object}/method_object_test.rb +66 -21
  212. data/test/unit/{code_object → language/ruby}/provider/yard/docstring_test.rb +74 -38
  213. data/test/unit/{code_object → language/ruby}/provider/yard/nodoc_helper_test.rb +9 -7
  214. data/test/unit/{code_object → language/ruby}/provider/yard/object/method_object_test.rb +21 -11
  215. data/test/unit/language/ruby/provider/yard_test.rb +25 -0
  216. data/test/unit/utils/buffered_ui_test.rb +48 -0
  217. data/test/unit/utils/ui_test.rb +7 -7
  218. data/test/unit/utils/weighted_list_test.rb +7 -4
  219. metadata +139 -93
  220. data/lib/inch/code_object/provider/yard.rb +0 -57
  221. data/lib/inch/code_object/provider/yard/docstring.rb +0 -133
  222. data/lib/inch/code_object/provider/yard/nodoc_helper.rb +0 -93
  223. data/lib/inch/code_object/provider/yard/object.rb +0 -60
  224. data/lib/inch/code_object/provider/yard/object/base.rb +0 -302
  225. data/lib/inch/code_object/provider/yard/object/class_object.rb +0 -12
  226. data/lib/inch/code_object/provider/yard/object/class_variable_object.rb +0 -12
  227. data/lib/inch/code_object/provider/yard/object/constant_object.rb +0 -12
  228. data/lib/inch/code_object/provider/yard/object/method_object.rb +0 -153
  229. data/lib/inch/code_object/provider/yard/object/method_parameter_object.rb +0 -88
  230. data/lib/inch/code_object/provider/yard/object/method_signature.rb +0 -114
  231. data/lib/inch/code_object/provider/yard/object/module_object.rb +0 -12
  232. data/lib/inch/code_object/provider/yard/object/namespace_object.rb +0 -47
  233. data/lib/inch/code_object/provider/yard/object/root_object.rb +0 -12
  234. data/lib/inch/code_object/provider/yard/parser.rb +0 -62
  235. data/lib/inch/code_object/proxy/base.rb +0 -241
  236. data/lib/inch/code_object/proxy/class_object.rb +0 -8
  237. data/lib/inch/code_object/proxy/class_variable_object.rb +0 -8
  238. data/lib/inch/code_object/proxy/constant_object.rb +0 -8
  239. data/lib/inch/code_object/proxy/method_object.rb +0 -82
  240. data/lib/inch/code_object/proxy/method_parameter_object.rb +0 -60
  241. data/lib/inch/code_object/proxy/module_object.rb +0 -8
  242. data/lib/inch/code_object/proxy/namespace_object.rb +0 -33
  243. data/lib/inch/evaluation/object_schema.rb +0 -30
  244. data/lib/inch/evaluation/proxy/base.rb +0 -164
  245. data/lib/inch/evaluation/proxy/class_object.rb +0 -8
  246. data/lib/inch/evaluation/proxy/class_variable_object.rb +0 -19
  247. data/lib/inch/evaluation/proxy/constant_object.rb +0 -19
  248. data/lib/inch/evaluation/proxy/method_object.rb +0 -65
  249. data/lib/inch/evaluation/proxy/module_object.rb +0 -8
  250. data/lib/inch/evaluation/proxy/namespace_object.rb +0 -27
  251. data/lib/inch/evaluation/role/base.rb +0 -92
  252. data/lib/inch/evaluation/role/class_variable.rb +0 -55
  253. data/lib/inch/evaluation/role/constant.rb +0 -55
  254. data/lib/inch/evaluation/role/method.rb +0 -126
  255. data/lib/inch/evaluation/role/method_parameter.rb +0 -91
  256. data/lib/inch/evaluation/role/missing.rb +0 -20
  257. data/lib/inch/evaluation/role/namespace.rb +0 -85
  258. data/lib/inch/evaluation/role/object.rb +0 -143
  259. 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: ad7ddc303f887e07ca647f76f002aafed4dc120e
4
- data.tar.gz: 7c0c21ee7be201462be99951d70c7544e9a4bc52
3
+ metadata.gz: 204a55bbfb702da63ab9b62d8e68b6e97b46d7e8
4
+ data.tar.gz: 9237fdad678102759b3924c464718181560de4d9
5
5
  SHA512:
6
- metadata.gz: 582a2edf65d9d3d3bd8c95ffee5c55d94a07718a2cc94bcc9c594ffe2b106ed616755d15710ef575cdd312963e54cdd92893955d0c178eeb90a7c35940003f3c
7
- data.tar.gz: b97da1277e2c3b2644ca49250288ff9031a4fee69463b11cbae485739d6aededf536f02e7892ed365d87067ffccc2c99a63eb97baf97d838a85429333a7b4924
6
+ metadata.gz: d5e38320c4c26fcbb2bf22f67fce5f5fc1d6c8d6acd4953e069f106b6440d31b531179284611be268b26bc8cad49cd3722b9f8dd48e669ef067fbbab07b5f79f
7
+ data.tar.gz: 0c5772bcc6822ef6652611ec82ec370cb5b1f7fb122078055bcb69a53ab6efefad5fa10aa15e29312cb21a9eb2035894f7d60d56e18b43a693f5f26d9780432a
@@ -0,0 +1,15 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ AllCops:
4
+ Include:
5
+ - '**/*.gemspec'
6
+ - '**/Gemfile'
7
+ - '**/Rakefile'
8
+ Exclude:
9
+ - 'test/fixtures/**/*'
10
+
11
+ Style/Encoding:
12
+ Enabled: true
13
+
14
+ Style/StringLiterals:
15
+ EnforcedStyle: double_quotes
@@ -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
@@ -1,11 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.11 (pre)
3
4
 
4
- ## 0.5.0 (pre)
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 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in inch.gemspec
4
4
  gemspec
5
5
 
6
- gem 'simplecov', :require => false, :group => :test
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::Proxy::MethodParameterObject#initialize
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::Base#depth
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::Proxy::MethodParameterObject#initialize
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 'rake/testtask'
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 :default => :test
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)), '..', 'lib')
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 'inch'
21
- require 'inch/cli'
20
+ require "inch"
21
+ require "inch/cli"
22
22
 
23
23
  Inch::CLI::CommandParser.run(*ARGV)
@@ -1,3 +1,4 @@
1
+ language: ruby
1
2
  files:
2
3
  included:
3
4
  - lib/**/*.rb
@@ -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
@@ -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
@@ -0,0 +1,10 @@
1
+ # NodeJS's configuration
2
+ # Node will be treated as a separate programming language for now
3
+
4
+ Inch::Config.register(:nodejs) do
5
+ codebase do
6
+ object_provider :JSDoc
7
+ include_files ["src/**/*.js"]
8
+ exclude_files []
9
+ end
10
+ end
@@ -1,62 +1,13 @@
1
- Inch::Config.run do
2
- # development!
1
+ # Ruby's configuration
3
2
 
3
+ Inch::Config.register(:ruby) do
4
4
  codebase do
5
- include_files ["lib/**/*.rb", "app/**/*.rb"]
6
- exclude_files []
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
 
@@ -1,21 +1,21 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'inch/version'
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 = %q{Documentation measurement tool for Ruby}
12
- spec.description = %q{Documentation measurement tool for Ruby, based on YARD.}
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(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
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 'sparkr', ">= 0.2.0"
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