exercism-analysis 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (579) hide show
  1. checksums.yaml +7 -0
  2. data/exercism-analysis.gemspec +30 -0
  3. data/lib/exercism-analysis.rb +38 -0
  4. data/lib/exercism-analysis/adapters/adapter.rb +23 -0
  5. data/lib/exercism-analysis/adapters/clojure.rb +13 -0
  6. data/lib/exercism-analysis/adapters/go.rb +19 -0
  7. data/lib/exercism-analysis/adapters/javascript.rb +13 -0
  8. data/lib/exercism-analysis/adapters/python.rb +13 -0
  9. data/lib/exercism-analysis/adapters/ruby.rb +19 -0
  10. data/lib/exercism-analysis/analysis.rb +18 -0
  11. data/lib/exercism-analysis/analyzers/analyzer.rb +54 -0
  12. data/lib/exercism-analysis/analyzers/clojure/kibit.rb +25 -0
  13. data/lib/exercism-analysis/analyzers/go/golint.rb +23 -0
  14. data/lib/exercism-analysis/analyzers/javascript/jslint.rb +24 -0
  15. data/lib/exercism-analysis/analyzers/python/pylint.rb +24 -0
  16. data/lib/exercism-analysis/analyzers/ruby/control_flow.rb +21 -0
  17. data/lib/exercism-analysis/analyzers/ruby/enumerable_condition.rb +21 -0
  18. data/lib/exercism-analysis/analyzers/ruby/for_loop.rb +29 -0
  19. data/lib/exercism-analysis/analyzers/ruby/indentation.rb +21 -0
  20. data/lib/exercism-analysis/analyzers/ruby/iter_mutation.rb +37 -0
  21. data/lib/exercism-analysis/analyzers/ruby/output.rb +20 -0
  22. data/lib/exercism-analysis/analyzers/ruby/range.rb +28 -0
  23. data/lib/exercism-analysis/analyzers/ruby/roodi.rb +19 -0
  24. data/lib/exercism-analysis/analyzers/ruby/send.rb +25 -0
  25. data/lib/exercism-analysis/analyzers/ruby/shebang.rb +23 -0
  26. data/lib/exercism-analysis/analyzers/ruby/tab.rb +38 -0
  27. data/lib/exercism-analysis/processors/call_processor.rb +39 -0
  28. data/lib/exercism-analysis/processors/control_flow_processor.rb +27 -0
  29. data/lib/exercism-analysis/processors/enumerable_condition_processor.rb +31 -0
  30. data/lib/exercism-analysis/processors/for_loop_processor.rb +21 -0
  31. data/lib/exercism-analysis/processors/indentation_processor.rb +69 -0
  32. data/lib/exercism-analysis/processors/iter_mutation_processor.rb +50 -0
  33. data/lib/exercism-analysis/processors/processor.rb +34 -0
  34. data/lib/exercism-analysis/processors/range_processor.rb +23 -0
  35. data/lib/exercism-analysis/processors/send_processor.rb +23 -0
  36. data/lib/exercism-analysis/templates/each_to_map.rb +29 -0
  37. data/lib/exercism-analysis/templates/each_to_select.rb +31 -0
  38. data/lib/exercism-analysis/templates/range_exclusive.rb +19 -0
  39. data/lib/exercism-analysis/templates/template.rb +29 -0
  40. data/vendor/clojure/kibit-runner/LICENSE +214 -0
  41. data/vendor/clojure/kibit-runner/project.clj +10 -0
  42. data/vendor/clojure/kibit-runner/src/kibit_runner/core.clj +17 -0
  43. data/vendor/clojure/kibit-runner/target/kibit-runner-0.1.0-SNAPSHOT-standalone.jar +0 -0
  44. data/vendor/clojure/kibit-runner/target/kibit-runner-0.1.0-SNAPSHOT.jar +0 -0
  45. data/vendor/clojure/kibit-runner/target/stale/extract-native.dependencies +1 -0
  46. data/vendor/go/src/github.com/golang/lint/LICENSE +27 -0
  47. data/vendor/go/src/github.com/golang/lint/README +59 -0
  48. data/vendor/go/src/github.com/golang/lint/golint/golint.go +67 -0
  49. data/vendor/go/src/github.com/golang/lint/lint.go +1061 -0
  50. data/vendor/go/src/runner/golint_runner.go +23 -0
  51. data/vendor/javascript/jshint_runner.js +6 -0
  52. data/vendor/javascript/node_modules/jshint/README.md +47 -0
  53. data/vendor/javascript/node_modules/jshint/bin/apply +6 -0
  54. data/vendor/javascript/node_modules/jshint/bin/build +36 -0
  55. data/vendor/javascript/node_modules/jshint/bin/changelog +36 -0
  56. data/vendor/javascript/node_modules/jshint/bin/jshint +3 -0
  57. data/vendor/javascript/node_modules/jshint/bin/land +34 -0
  58. data/vendor/javascript/node_modules/jshint/data/ascii-identifier-data.js +22 -0
  59. data/vendor/javascript/node_modules/jshint/data/non-ascii-identifier-part-only.js +1570 -0
  60. data/vendor/javascript/node_modules/jshint/data/non-ascii-identifier-start.js +48477 -0
  61. data/vendor/javascript/node_modules/jshint/dist/jshint-rhino.js +60642 -0
  62. data/vendor/javascript/node_modules/jshint/dist/jshint.js +60525 -0
  63. data/vendor/javascript/node_modules/jshint/node_modules/cli/README.md +196 -0
  64. data/vendor/javascript/node_modules/jshint/node_modules/cli/cli.js +1139 -0
  65. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/cat.js +17 -0
  66. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/command.js +16 -0
  67. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/echo.js +54 -0
  68. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/glob.js +6 -0
  69. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/long_desc.js +20 -0
  70. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/progress.js +11 -0
  71. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/sort.js +18 -0
  72. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/spinner.js +9 -0
  73. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/static.coffee +27 -0
  74. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/static.js +25 -0
  75. data/vendor/javascript/node_modules/jshint/node_modules/cli/index.js +1 -0
  76. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/LICENSE +27 -0
  77. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/README.md +250 -0
  78. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/examples/g.js +9 -0
  79. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/examples/usr-local.js +9 -0
  80. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/glob.js +728 -0
  81. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/LICENSE +16 -0
  82. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/README.md +42 -0
  83. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits.js +1 -0
  84. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits_browser.js +23 -0
  85. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/package.json +51 -0
  86. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/test.js +25 -0
  87. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/package.json +58 -0
  88. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/00-setup.js +176 -0
  89. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-comparison.js +63 -0
  90. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-results.json +351 -0
  91. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/cwd-test.js +55 -0
  92. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/globstar-match.js +19 -0
  93. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/mark.js +118 -0
  94. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/new-glob-optional-options.js +10 -0
  95. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/nocase-nomagic.js +113 -0
  96. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/pause-resume.js +73 -0
  97. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/readme-issue.js +36 -0
  98. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/root-nomount.js +39 -0
  99. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/root.js +46 -0
  100. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/stat.js +32 -0
  101. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/zz-cleanup.js +11 -0
  102. data/vendor/javascript/node_modules/jshint/node_modules/cli/package.json +70 -0
  103. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/LICENCE +19 -0
  104. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/README.md +33 -0
  105. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/index.js +86 -0
  106. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/LICENCE +19 -0
  107. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/README.md +45 -0
  108. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/index.js +5 -0
  109. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/package.json +89 -0
  110. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/seed.js +16 -0
  111. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/test/index.js +28 -0
  112. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/test/static/index.html +10 -0
  113. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/package.json +88 -0
  114. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/test/index.js +67 -0
  115. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/test/static/index.html +12 -0
  116. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/test/static/test-adapter.js +53 -0
  117. data/vendor/javascript/node_modules/jshint/node_modules/exit/Gruntfile.js +48 -0
  118. data/vendor/javascript/node_modules/jshint/node_modules/exit/LICENSE-MIT +22 -0
  119. data/vendor/javascript/node_modules/jshint/node_modules/exit/README.md +75 -0
  120. data/vendor/javascript/node_modules/jshint/node_modules/exit/lib/exit.js +41 -0
  121. data/vendor/javascript/node_modules/jshint/node_modules/exit/package.json +69 -0
  122. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/exit_test.js +121 -0
  123. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/10-stderr.txt +10 -0
  124. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/10-stdout-stderr.txt +20 -0
  125. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/10-stdout.txt +10 -0
  126. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/100-stderr.txt +100 -0
  127. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/100-stdout-stderr.txt +200 -0
  128. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/100-stdout.txt +100 -0
  129. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/1000-stderr.txt +1000 -0
  130. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/1000-stdout-stderr.txt +2000 -0
  131. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/1000-stdout.txt +1000 -0
  132. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/create-files.sh +8 -0
  133. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/log-broken.js +23 -0
  134. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/log.js +25 -0
  135. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/LICENSE +18 -0
  136. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/README.md +83 -0
  137. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/CollectingHandler.js +55 -0
  138. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/FeedHandler.js +95 -0
  139. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/Parser.js +337 -0
  140. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/ProxyHandler.js +27 -0
  141. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/Stream.js +35 -0
  142. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/Tokenizer.js +891 -0
  143. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/WritableStream.js +21 -0
  144. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/index.js +68 -0
  145. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/LICENSE +11 -0
  146. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/index.js +14 -0
  147. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/package.json +40 -0
  148. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/readme.md +1 -0
  149. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/LICENSE +11 -0
  150. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/index.js +211 -0
  151. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/package.json +68 -0
  152. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/readme.md +102 -0
  153. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/01-basic.json +57 -0
  154. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/02-single_tag_1.json +21 -0
  155. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/03-single_tag_2.json +21 -0
  156. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/04-unescaped_in_script.json +27 -0
  157. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/05-tags_in_comment.json +18 -0
  158. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/06-comment_in_script.json +18 -0
  159. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/07-unescaped_in_style.json +20 -0
  160. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/08-extra_spaces_in_tag.json +20 -0
  161. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/09-unquoted_attrib.json +20 -0
  162. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/10-singular_attribute.json +15 -0
  163. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/11-text_outside_tags.json +40 -0
  164. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/12-text_only.json +11 -0
  165. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/13-comment_in_text.json +19 -0
  166. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/14-comment_in_text_in_script.json +18 -0
  167. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/15-non-verbose.json +22 -0
  168. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/16-normalize_whitespace.json +47 -0
  169. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/17-xml_namespace.json +18 -0
  170. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/18-enforce_empty_tags.json +16 -0
  171. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/19-ignore_empty_tags.json +20 -0
  172. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/20-template_script_tags.json +20 -0
  173. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/21-conditional_comments.json +15 -0
  174. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/22-lowercase_tags.json +41 -0
  175. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/23-dom-lvl1.json +121 -0
  176. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/tests.js +58 -0
  177. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/LICENSE +11 -0
  178. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/index.js +14 -0
  179. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/helpers.js +141 -0
  180. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/legacy.js +87 -0
  181. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js +77 -0
  182. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/querying.js +94 -0
  183. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/stringify.js +93 -0
  184. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/traversal.js +24 -0
  185. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/package.json +71 -0
  186. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/readme.md +1 -0
  187. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/fixture.js +6 -0
  188. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/tests/helpers.js +89 -0
  189. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/tests/legacy.js +119 -0
  190. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/utils.js +9 -0
  191. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/LICENSE +11 -0
  192. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/index.js +31 -0
  193. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/lib/decode.js +72 -0
  194. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/lib/decode_codepoint.js +26 -0
  195. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/lib/encode.js +48 -0
  196. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/decode.json +1 -0
  197. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/entities.json +1 -0
  198. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/legacy.json +1 -0
  199. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/xml.json +1 -0
  200. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/package.json +79 -0
  201. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/readme.md +31 -0
  202. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/test/mocha.opts +2 -0
  203. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/test/test.js +150 -0
  204. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/LICENSE +18 -0
  205. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/README.md +15 -0
  206. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/duplex.js +1 -0
  207. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/float.patch +923 -0
  208. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_duplex.js +89 -0
  209. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_passthrough.js +46 -0
  210. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_readable.js +944 -0
  211. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_transform.js +209 -0
  212. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_writable.js +472 -0
  213. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/README.md +3 -0
  214. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/float.patch +604 -0
  215. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +107 -0
  216. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/package.json +53 -0
  217. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/util.js +106 -0
  218. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/LICENSE +16 -0
  219. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/README.md +42 -0
  220. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/inherits.js +1 -0
  221. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/inherits_browser.js +23 -0
  222. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/package.json +51 -0
  223. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/test.js +25 -0
  224. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/README.md +54 -0
  225. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/build/build.js +209 -0
  226. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/component.json +19 -0
  227. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/index.js +3 -0
  228. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/package.json +54 -0
  229. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/LICENSE +20 -0
  230. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/README.md +7 -0
  231. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/index.js +200 -0
  232. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/package.json +53 -0
  233. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/package.json +68 -0
  234. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/passthrough.js +1 -0
  235. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/readable.js +7 -0
  236. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/transform.js +1 -0
  237. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/writable.js +1 -0
  238. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/package.json +90 -0
  239. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/01-events.js +9 -0
  240. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/02-stream.js +23 -0
  241. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/03-feed.js +19 -0
  242. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/Atom_Example.xml +25 -0
  243. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/Attributes.html +16 -0
  244. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/Basic.html +1 -0
  245. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/RDF_Example.xml +63 -0
  246. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/RSS_Example.xml +48 -0
  247. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/01-simple.json +44 -0
  248. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/02-template.json +63 -0
  249. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/03-lowercase_tags.json +46 -0
  250. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/04-cdata.json +50 -0
  251. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/05-cdata-special.json +35 -0
  252. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/06-leading-lt.json +16 -0
  253. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/07-self-closing.json +67 -0
  254. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/08-implicit-close-tags.json +59 -0
  255. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/09-attributes.json +68 -0
  256. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/10-crazy-attrib.json +52 -0
  257. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/11-script_in_script.json +54 -0
  258. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/12-long-comment-end.json +20 -0
  259. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/13-long-cdata-end.json +22 -0
  260. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/14-implicit-open-tags.json +27 -0
  261. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/15-lt-whitespace.json +16 -0
  262. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/16-double_attribs.json +45 -0
  263. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/17-numeric_entities.json +16 -0
  264. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/18-legacy_entities.json +16 -0
  265. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/19-named_entities.json +16 -0
  266. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/20-xml_entities.json +16 -0
  267. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/21-entity_in_attribute.json +38 -0
  268. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/22-double_brackets.json +41 -0
  269. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/23-legacy_entity_fail.json +16 -0
  270. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/24-special_special.json +133 -0
  271. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/25-empty_tag_name.json +13 -0
  272. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/26-not-quite-closed.json +35 -0
  273. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/27-entities_in_attributes.json +62 -0
  274. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/28-cdata_in_html.json +9 -0
  275. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/29-comment_edge-cases.json +18 -0
  276. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/30-cdata_edge-cases.json +22 -0
  277. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Feeds/01-rss.js +34 -0
  278. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Feeds/02-atom.js +18 -0
  279. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Feeds/03-rdf.js +20 -0
  280. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/01-basic.json +83 -0
  281. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/02-RSS.json +1093 -0
  282. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/03-Atom.json +644 -0
  283. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/04-RDF.json +1399 -0
  284. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/05-Attributes.json +354 -0
  285. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/api.js +63 -0
  286. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/test-helper.js +83 -0
  287. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/LICENSE +23 -0
  288. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/README.md +218 -0
  289. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/minimatch.js +1061 -0
  290. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS +14 -0
  291. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/LICENSE +23 -0
  292. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/README.md +97 -0
  293. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +252 -0
  294. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/package.json +50 -0
  295. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/basic.js +369 -0
  296. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +52 -0
  297. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +50 -0
  298. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/LICENSE +27 -0
  299. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/README.md +53 -0
  300. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/bench.js +283 -0
  301. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/package.json +58 -0
  302. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/sigmund.js +39 -0
  303. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/test/basic.js +24 -0
  304. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/package.json +57 -0
  305. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/basic.js +399 -0
  306. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/brace-expand.js +33 -0
  307. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/caching.js +14 -0
  308. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/defaults.js +274 -0
  309. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/extglob-ending-with-state-char.js +8 -0
  310. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/LICENSE +26 -0
  311. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/README.md +569 -0
  312. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/bin/shjs +51 -0
  313. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/global.js +3 -0
  314. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/make.js +47 -0
  315. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/package.json +61 -0
  316. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/scripts/generate-docs.js +21 -0
  317. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/scripts/run-tests.js +50 -0
  318. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/shell.js +157 -0
  319. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/cat.js +43 -0
  320. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/cd.js +19 -0
  321. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/chmod.js +208 -0
  322. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/common.js +203 -0
  323. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/cp.js +201 -0
  324. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/dirs.js +191 -0
  325. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/echo.js +20 -0
  326. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/error.js +10 -0
  327. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/exec.js +181 -0
  328. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/find.js +51 -0
  329. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/grep.js +52 -0
  330. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/ln.js +53 -0
  331. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/ls.js +126 -0
  332. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/mkdir.js +68 -0
  333. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/mv.js +80 -0
  334. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/popd.js +1 -0
  335. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/pushd.js +1 -0
  336. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/pwd.js +11 -0
  337. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/rm.js +145 -0
  338. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/sed.js +43 -0
  339. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/tempdir.js +56 -0
  340. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/test.js +85 -0
  341. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/to.js +29 -0
  342. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/toEnd.js +29 -0
  343. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/which.js +83 -0
  344. data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/cli.js +41 -0
  345. data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/package.json +76 -0
  346. data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/readme.md +74 -0
  347. data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/strip-json-comments.js +64 -0
  348. data/vendor/javascript/node_modules/jshint/node_modules/underscore/LICENSE +23 -0
  349. data/vendor/javascript/node_modules/jshint/node_modules/underscore/README.md +22 -0
  350. data/vendor/javascript/node_modules/jshint/node_modules/underscore/package.json +66 -0
  351. data/vendor/javascript/node_modules/jshint/node_modules/underscore/underscore-min.js +6 -0
  352. data/vendor/javascript/node_modules/jshint/node_modules/underscore/underscore.js +1343 -0
  353. data/vendor/javascript/node_modules/jshint/package.json +80 -0
  354. data/vendor/javascript/node_modules/jshint/src/cli.js +731 -0
  355. data/vendor/javascript/node_modules/jshint/src/jshint.js +5023 -0
  356. data/vendor/javascript/node_modules/jshint/src/lex.js +1650 -0
  357. data/vendor/javascript/node_modules/jshint/src/messages.js +223 -0
  358. data/vendor/javascript/node_modules/jshint/src/platforms/rhino.js +115 -0
  359. data/vendor/javascript/node_modules/jshint/src/reg.js +38 -0
  360. data/vendor/javascript/node_modules/jshint/src/reporters/checkstyle.js +81 -0
  361. data/vendor/javascript/node_modules/jshint/src/reporters/default.js +34 -0
  362. data/vendor/javascript/node_modules/jshint/src/reporters/jslint_xml.js +57 -0
  363. data/vendor/javascript/node_modules/jshint/src/reporters/non_error.js +52 -0
  364. data/vendor/javascript/node_modules/jshint/src/state.js +28 -0
  365. data/vendor/javascript/node_modules/jshint/src/style.js +143 -0
  366. data/vendor/javascript/node_modules/jshint/src/vars.js +658 -0
  367. data/vendor/python/astroid/COPYING +339 -0
  368. data/vendor/python/astroid/COPYING.LESSER +510 -0
  369. data/vendor/python/astroid/ChangeLog +574 -0
  370. data/vendor/python/astroid/MANIFEST.in +9 -0
  371. data/vendor/python/astroid/README +56 -0
  372. data/vendor/python/astroid/README.Python3 +26 -0
  373. data/vendor/python/astroid/__init__.py +118 -0
  374. data/vendor/python/astroid/__init__.pyc +0 -0
  375. data/vendor/python/astroid/__pkginfo__.py +48 -0
  376. data/vendor/python/astroid/__pkginfo__.pyc +0 -0
  377. data/vendor/python/astroid/announce.txt +23 -0
  378. data/vendor/python/astroid/as_string.py +496 -0
  379. data/vendor/python/astroid/as_string.pyc +0 -0
  380. data/vendor/python/astroid/bases.py +618 -0
  381. data/vendor/python/astroid/bases.pyc +0 -0
  382. data/vendor/python/astroid/brain/py2gi.py +159 -0
  383. data/vendor/python/astroid/brain/py2gi.pyc +0 -0
  384. data/vendor/python/astroid/brain/py2mechanize.py +20 -0
  385. data/vendor/python/astroid/brain/py2mechanize.pyc +0 -0
  386. data/vendor/python/astroid/brain/py2qt4.py +25 -0
  387. data/vendor/python/astroid/brain/py2qt4.pyc +0 -0
  388. data/vendor/python/astroid/brain/py2stdlib.py +252 -0
  389. data/vendor/python/astroid/brain/py2stdlib.pyc +0 -0
  390. data/vendor/python/astroid/builder.py +238 -0
  391. data/vendor/python/astroid/builder.pyc +0 -0
  392. data/vendor/python/astroid/exceptions.py +51 -0
  393. data/vendor/python/astroid/exceptions.pyc +0 -0
  394. data/vendor/python/astroid/inference.py +393 -0
  395. data/vendor/python/astroid/inference.pyc +0 -0
  396. data/vendor/python/astroid/inspector.py +275 -0
  397. data/vendor/python/astroid/manager.py +336 -0
  398. data/vendor/python/astroid/manager.pyc +0 -0
  399. data/vendor/python/astroid/mixins.py +122 -0
  400. data/vendor/python/astroid/mixins.pyc +0 -0
  401. data/vendor/python/astroid/node_classes.py +928 -0
  402. data/vendor/python/astroid/node_classes.pyc +0 -0
  403. data/vendor/python/astroid/nodes.py +73 -0
  404. data/vendor/python/astroid/nodes.pyc +0 -0
  405. data/vendor/python/astroid/protocols.py +322 -0
  406. data/vendor/python/astroid/protocols.pyc +0 -0
  407. data/vendor/python/astroid/raw_building.py +361 -0
  408. data/vendor/python/astroid/raw_building.pyc +0 -0
  409. data/vendor/python/astroid/rebuilder.py +954 -0
  410. data/vendor/python/astroid/rebuilder.pyc +0 -0
  411. data/vendor/python/astroid/scoped_nodes.py +1118 -0
  412. data/vendor/python/astroid/scoped_nodes.pyc +0 -0
  413. data/vendor/python/astroid/setup.py +184 -0
  414. data/vendor/python/astroid/tox.ini +10 -0
  415. data/vendor/python/astroid/utils.py +236 -0
  416. data/vendor/python/astroid/utils.pyc +0 -0
  417. data/vendor/python/logilab/__init__.py +0 -0
  418. data/vendor/python/logilab/__init__.pyc +0 -0
  419. data/vendor/python/logilab/common/COPYING +339 -0
  420. data/vendor/python/logilab/common/COPYING.LESSER +510 -0
  421. data/vendor/python/logilab/common/ChangeLog +1517 -0
  422. data/vendor/python/logilab/common/MANIFEST.in +13 -0
  423. data/vendor/python/logilab/common/README +185 -0
  424. data/vendor/python/logilab/common/README.Python3 +29 -0
  425. data/vendor/python/logilab/common/__init__.py +171 -0
  426. data/vendor/python/logilab/common/__init__.pyc +0 -0
  427. data/vendor/python/logilab/common/__pkginfo__.py +53 -0
  428. data/vendor/python/logilab/common/__pkginfo__.pyc +0 -0
  429. data/vendor/python/logilab/common/announce.txt +25 -0
  430. data/vendor/python/logilab/common/bin/pytest +7 -0
  431. data/vendor/python/logilab/common/bin/pytest.bat +17 -0
  432. data/vendor/python/logilab/common/cache.py +114 -0
  433. data/vendor/python/logilab/common/changelog.py +236 -0
  434. data/vendor/python/logilab/common/changelog.pyc +0 -0
  435. data/vendor/python/logilab/common/clcommands.py +332 -0
  436. data/vendor/python/logilab/common/cli.py +208 -0
  437. data/vendor/python/logilab/common/compat.py +243 -0
  438. data/vendor/python/logilab/common/compat.pyc +0 -0
  439. data/vendor/python/logilab/common/configuration.py +1094 -0
  440. data/vendor/python/logilab/common/configuration.pyc +0 -0
  441. data/vendor/python/logilab/common/contexts.py +5 -0
  442. data/vendor/python/logilab/common/corbautils.py +117 -0
  443. data/vendor/python/logilab/common/daemon.py +100 -0
  444. data/vendor/python/logilab/common/date.py +333 -0
  445. data/vendor/python/logilab/common/dbf.py +229 -0
  446. data/vendor/python/logilab/common/debugger.py +210 -0
  447. data/vendor/python/logilab/common/decorators.py +281 -0
  448. data/vendor/python/logilab/common/decorators.pyc +0 -0
  449. data/vendor/python/logilab/common/deprecation.py +188 -0
  450. data/vendor/python/logilab/common/deprecation.pyc +0 -0
  451. data/vendor/python/logilab/common/fileutils.py +402 -0
  452. data/vendor/python/logilab/common/graph.py +276 -0
  453. data/vendor/python/logilab/common/graph.pyc +0 -0
  454. data/vendor/python/logilab/common/hg.py +130 -0
  455. data/vendor/python/logilab/common/interface.py +71 -0
  456. data/vendor/python/logilab/common/interface.pyc +0 -0
  457. data/vendor/python/logilab/common/logging_ext.py +193 -0
  458. data/vendor/python/logilab/common/modutils.py +695 -0
  459. data/vendor/python/logilab/common/modutils.pyc +0 -0
  460. data/vendor/python/logilab/common/optik_ext.py +391 -0
  461. data/vendor/python/logilab/common/optik_ext.pyc +0 -0
  462. data/vendor/python/logilab/common/optparser.py +90 -0
  463. data/vendor/python/logilab/common/proc.py +277 -0
  464. data/vendor/python/logilab/common/pyro_ext.py +180 -0
  465. data/vendor/python/logilab/common/pytest.py +1177 -0
  466. data/vendor/python/logilab/common/python-logilab-common.spec +184 -0
  467. data/vendor/python/logilab/common/registry.py +1113 -0
  468. data/vendor/python/logilab/common/setup.cfg +3 -0
  469. data/vendor/python/logilab/common/setup.py +189 -0
  470. data/vendor/python/logilab/common/shellutils.py +455 -0
  471. data/vendor/python/logilab/common/sphinx_ext.py +87 -0
  472. data/vendor/python/logilab/common/sphinxutils.py +122 -0
  473. data/vendor/python/logilab/common/table.py +925 -0
  474. data/vendor/python/logilab/common/tasksqueue.py +100 -0
  475. data/vendor/python/logilab/common/textutils.py +534 -0
  476. data/vendor/python/logilab/common/textutils.pyc +0 -0
  477. data/vendor/python/logilab/common/tree.py +369 -0
  478. data/vendor/python/logilab/common/tree.pyc +0 -0
  479. data/vendor/python/logilab/common/umessage.py +190 -0
  480. data/vendor/python/logilab/common/ureports/__init__.py +174 -0
  481. data/vendor/python/logilab/common/ureports/__init__.pyc +0 -0
  482. data/vendor/python/logilab/common/ureports/docbook_writer.py +139 -0
  483. data/vendor/python/logilab/common/ureports/html_writer.py +131 -0
  484. data/vendor/python/logilab/common/ureports/html_writer.pyc +0 -0
  485. data/vendor/python/logilab/common/ureports/nodes.py +201 -0
  486. data/vendor/python/logilab/common/ureports/nodes.pyc +0 -0
  487. data/vendor/python/logilab/common/ureports/text_writer.py +140 -0
  488. data/vendor/python/logilab/common/ureports/text_writer.pyc +0 -0
  489. data/vendor/python/logilab/common/urllib2ext.py +87 -0
  490. data/vendor/python/logilab/common/vcgutils.py +216 -0
  491. data/vendor/python/logilab/common/visitor.py +107 -0
  492. data/vendor/python/logilab/common/visitor.pyc +0 -0
  493. data/vendor/python/logilab/common/xmlrpcutils.py +131 -0
  494. data/vendor/python/logilab/common/xmlutils.py +61 -0
  495. data/vendor/python/pylint/CONTRIBUTORS.txt +38 -0
  496. data/vendor/python/pylint/COPYING +340 -0
  497. data/vendor/python/pylint/ChangeLog +1437 -0
  498. data/vendor/python/pylint/DEPENDS +3 -0
  499. data/vendor/python/pylint/MANIFEST.in +14 -0
  500. data/vendor/python/pylint/README +50 -0
  501. data/vendor/python/pylint/README.Python3 +37 -0
  502. data/vendor/python/pylint/__init__.py +44 -0
  503. data/vendor/python/pylint/__init__.pyc +0 -0
  504. data/vendor/python/pylint/__main__.py +3 -0
  505. data/vendor/python/pylint/__pkginfo__.py +74 -0
  506. data/vendor/python/pylint/__pkginfo__.pyc +0 -0
  507. data/vendor/python/pylint/bin/epylint +3 -0
  508. data/vendor/python/pylint/bin/epylint.bat +5 -0
  509. data/vendor/python/pylint/bin/pylint +3 -0
  510. data/vendor/python/pylint/bin/pylint-gui +3 -0
  511. data/vendor/python/pylint/bin/pylint-gui.bat +5 -0
  512. data/vendor/python/pylint/bin/pylint.bat +5 -0
  513. data/vendor/python/pylint/bin/pyreverse +3 -0
  514. data/vendor/python/pylint/bin/pyreverse.bat +5 -0
  515. data/vendor/python/pylint/bin/symilar +3 -0
  516. data/vendor/python/pylint/bin/symilar.bat +5 -0
  517. data/vendor/python/pylint/checkers/__init__.py +145 -0
  518. data/vendor/python/pylint/checkers/__init__.pyc +0 -0
  519. data/vendor/python/pylint/checkers/base.py +1141 -0
  520. data/vendor/python/pylint/checkers/base.pyc +0 -0
  521. data/vendor/python/pylint/checkers/classes.py +792 -0
  522. data/vendor/python/pylint/checkers/classes.pyc +0 -0
  523. data/vendor/python/pylint/checkers/design_analysis.py +367 -0
  524. data/vendor/python/pylint/checkers/design_analysis.pyc +0 -0
  525. data/vendor/python/pylint/checkers/exceptions.py +306 -0
  526. data/vendor/python/pylint/checkers/exceptions.pyc +0 -0
  527. data/vendor/python/pylint/checkers/format.py +943 -0
  528. data/vendor/python/pylint/checkers/format.pyc +0 -0
  529. data/vendor/python/pylint/checkers/imports.py +394 -0
  530. data/vendor/python/pylint/checkers/imports.pyc +0 -0
  531. data/vendor/python/pylint/checkers/logging.py +213 -0
  532. data/vendor/python/pylint/checkers/logging.pyc +0 -0
  533. data/vendor/python/pylint/checkers/misc.py +90 -0
  534. data/vendor/python/pylint/checkers/misc.pyc +0 -0
  535. data/vendor/python/pylint/checkers/newstyle.py +151 -0
  536. data/vendor/python/pylint/checkers/newstyle.pyc +0 -0
  537. data/vendor/python/pylint/checkers/raw_metrics.py +129 -0
  538. data/vendor/python/pylint/checkers/raw_metrics.pyc +0 -0
  539. data/vendor/python/pylint/checkers/similar.py +365 -0
  540. data/vendor/python/pylint/checkers/similar.pyc +0 -0
  541. data/vendor/python/pylint/checkers/stdlib.py +69 -0
  542. data/vendor/python/pylint/checkers/stdlib.pyc +0 -0
  543. data/vendor/python/pylint/checkers/strings.py +304 -0
  544. data/vendor/python/pylint/checkers/strings.pyc +0 -0
  545. data/vendor/python/pylint/checkers/typecheck.py +451 -0
  546. data/vendor/python/pylint/checkers/typecheck.pyc +0 -0
  547. data/vendor/python/pylint/checkers/utils.py +416 -0
  548. data/vendor/python/pylint/checkers/utils.pyc +0 -0
  549. data/vendor/python/pylint/checkers/variables.py +741 -0
  550. data/vendor/python/pylint/checkers/variables.pyc +0 -0
  551. data/vendor/python/pylint/config.py +156 -0
  552. data/vendor/python/pylint/config.pyc +0 -0
  553. data/vendor/python/pylint/epylint.py +175 -0
  554. data/vendor/python/pylint/gui.py +508 -0
  555. data/vendor/python/pylint/interfaces.py +72 -0
  556. data/vendor/python/pylint/interfaces.pyc +0 -0
  557. data/vendor/python/pylint/lint.py +1106 -0
  558. data/vendor/python/pylint/lint.pyc +0 -0
  559. data/vendor/python/pylint/pyreverse/__init__.py +5 -0
  560. data/vendor/python/pylint/pyreverse/diadefslib.py +233 -0
  561. data/vendor/python/pylint/pyreverse/diagrams.py +247 -0
  562. data/vendor/python/pylint/pyreverse/main.py +124 -0
  563. data/vendor/python/pylint/pyreverse/utils.py +131 -0
  564. data/vendor/python/pylint/pyreverse/writer.py +199 -0
  565. data/vendor/python/pylint/reporters/__init__.py +138 -0
  566. data/vendor/python/pylint/reporters/__init__.pyc +0 -0
  567. data/vendor/python/pylint/reporters/guireporter.py +28 -0
  568. data/vendor/python/pylint/reporters/guireporter.pyc +0 -0
  569. data/vendor/python/pylint/reporters/html.py +70 -0
  570. data/vendor/python/pylint/reporters/html.pyc +0 -0
  571. data/vendor/python/pylint/reporters/text.py +143 -0
  572. data/vendor/python/pylint/reporters/text.pyc +0 -0
  573. data/vendor/python/pylint/setup.cfg +3 -0
  574. data/vendor/python/pylint/setup.py +203 -0
  575. data/vendor/python/pylint/tox.ini +10 -0
  576. data/vendor/python/pylint/utils.py +744 -0
  577. data/vendor/python/pylint/utils.pyc +0 -0
  578. data/vendor/python/pylint_runner.py +22 -0
  579. metadata +675 -0
@@ -0,0 +1,10 @@
1
+ [tox]
2
+ # official list is
3
+ #envlist = py25, py26, py27, py32, py33
4
+ # though 2.5 support is known to be broken...
5
+ envlist = py27, py33
6
+ [testenv]
7
+ deps =
8
+ logilab-common
9
+ hg+https://bitbucket.org/logilab/astroid/
10
+ commands = pytest -t {envsitepackagesdir}/pylint/test/
@@ -0,0 +1,744 @@
1
+ # Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE).
2
+ # http://www.logilab.fr/ -- mailto:contact@logilab.fr
3
+ #
4
+ # This program is free software; you can redistribute it and/or modify it under
5
+ # the terms of the GNU General Public License as published by the Free Software
6
+ # Foundation; either version 2 of the License, or (at your option) any later
7
+ # version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful, but WITHOUT
10
+ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
+ # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details
12
+ #
13
+ # You should have received a copy of the GNU General Public License along with
14
+ # this program; if not, write to the Free Software Foundation, Inc.,
15
+ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
+ """some various utilities and helper classes, most of them used in the
17
+ main pylint class
18
+ """
19
+
20
+ import re
21
+ import sys
22
+ import tokenize
23
+ import os
24
+ from warnings import warn
25
+ from os.path import dirname, basename, splitext, exists, isdir, join, normpath
26
+
27
+ from logilab.common.interface import implements
28
+ from logilab.common.modutils import modpath_from_file, get_module_files, \
29
+ file_from_modpath, load_module_from_file
30
+ from logilab.common.textutils import normalize_text
31
+ from logilab.common.configuration import rest_format_section
32
+ from logilab.common.ureports import Section
33
+
34
+ from astroid import nodes, Module
35
+
36
+ from pylint.interfaces import IRawChecker, ITokenChecker
37
+
38
+
39
+ class UnknownMessage(Exception):
40
+ """raised when a unregistered message id is encountered"""
41
+
42
+ class EmptyReport(Exception):
43
+ """raised when a report is empty and so should not be displayed"""
44
+
45
+
46
+ MSG_TYPES = {
47
+ 'I' : 'info',
48
+ 'C' : 'convention',
49
+ 'R' : 'refactor',
50
+ 'W' : 'warning',
51
+ 'E' : 'error',
52
+ 'F' : 'fatal'
53
+ }
54
+ MSG_TYPES_LONG = dict([(v, k) for k, v in MSG_TYPES.iteritems()])
55
+
56
+ MSG_TYPES_STATUS = {
57
+ 'I' : 0,
58
+ 'C' : 16,
59
+ 'R' : 8,
60
+ 'W' : 4,
61
+ 'E' : 2,
62
+ 'F' : 1
63
+ }
64
+
65
+ _MSG_ORDER = 'EWRCIF'
66
+ MSG_STATE_SCOPE_CONFIG = 0
67
+ MSG_STATE_SCOPE_MODULE = 1
68
+
69
+ OPTION_RGX = re.compile(r'\s*#.*\bpylint:(.*)')
70
+
71
+ # The line/node distinction does not apply to fatal errors and reports.
72
+ _SCOPE_EXEMPT = 'FR'
73
+
74
+ class WarningScope(object):
75
+ LINE = 'line-based-msg'
76
+ NODE = 'node-based-msg'
77
+
78
+
79
+ def get_module_and_frameid(node):
80
+ """return the module name and the frame id in the module"""
81
+ frame = node.frame()
82
+ module, obj = '', []
83
+ while frame:
84
+ if isinstance(frame, Module):
85
+ module = frame.name
86
+ else:
87
+ obj.append(getattr(frame, 'name', '<lambda>'))
88
+ try:
89
+ frame = frame.parent.frame()
90
+ except AttributeError:
91
+ frame = None
92
+ obj.reverse()
93
+ return module, '.'.join(obj)
94
+
95
+ def category_id(id):
96
+ id = id.upper()
97
+ if id in MSG_TYPES:
98
+ return id
99
+ return MSG_TYPES_LONG.get(id)
100
+
101
+
102
+ def tokenize_module(module):
103
+ stream = module.file_stream
104
+ stream.seek(0)
105
+ readline = stream.readline
106
+ if sys.version_info < (3, 0):
107
+ if module.file_encoding is not None:
108
+ readline = lambda: stream.readline().decode(module.file_encoding,
109
+ 'replace')
110
+ return list(tokenize.generate_tokens(readline))
111
+ return list(tokenize.tokenize(readline))
112
+
113
+ def build_message_def(checker, msgid, msg_tuple):
114
+ if implements(checker, (IRawChecker, ITokenChecker)):
115
+ default_scope = WarningScope.LINE
116
+ else:
117
+ default_scope = WarningScope.NODE
118
+ options = {}
119
+ if len(msg_tuple) > 3:
120
+ (msg, symbol, descr, options) = msg_tuple
121
+ elif len(msg_tuple) > 2:
122
+ (msg, symbol, descr) = msg_tuple[:3]
123
+ else:
124
+ # messages should have a symbol, but for backward compatibility
125
+ # they may not.
126
+ (msg, descr) = msg_tuple
127
+ warn("[pylint 0.26] description of message %s doesn't include "
128
+ "a symbolic name" % msgid, DeprecationWarning)
129
+ symbol = None
130
+ options.setdefault('scope', default_scope)
131
+ return MessageDefinition(checker, msgid, msg, descr, symbol, **options)
132
+
133
+
134
+ class MessageDefinition(object):
135
+ def __init__(self, checker, msgid, msg, descr, symbol, scope,
136
+ minversion=None, maxversion=None, old_names=None):
137
+ self.checker = checker
138
+ assert len(msgid) == 5, 'Invalid message id %s' % msgid
139
+ assert msgid[0] in MSG_TYPES, \
140
+ 'Bad message type %s in %r' % (msgid[0], msgid)
141
+ self.msgid = msgid
142
+ self.msg = msg
143
+ self.descr = descr
144
+ self.symbol = symbol
145
+ self.scope = scope
146
+ self.minversion = minversion
147
+ self.maxversion = maxversion
148
+ self.old_names = old_names or []
149
+
150
+ def may_be_emitted(self):
151
+ """return True if message may be emitted using the current interpreter"""
152
+ if self.minversion is not None and self.minversion > sys.version_info:
153
+ return False
154
+ if self.maxversion is not None and self.maxversion <= sys.version_info:
155
+ return False
156
+ return True
157
+
158
+ def format_help(self, checkerref=False):
159
+ """return the help string for the given message id"""
160
+ desc = self.descr
161
+ if checkerref:
162
+ desc += ' This message belongs to the %s checker.' % \
163
+ self.checker.name
164
+ title = self.msg
165
+ if self.symbol:
166
+ msgid = '%s (%s)' % (self.symbol, self.msgid)
167
+ else:
168
+ msgid = self.msgid
169
+ if self.minversion or self.maxversion:
170
+ restr = []
171
+ if self.minversion:
172
+ restr.append('< %s' % '.'.join([str(n) for n in self.minversion]))
173
+ if self.maxversion:
174
+ restr.append('>= %s' % '.'.join([str(n) for n in self.maxversion]))
175
+ restr = ' or '.join(restr)
176
+ if checkerref:
177
+ desc += " It can't be emitted when using Python %s." % restr
178
+ else:
179
+ desc += " This message can't be emitted when using Python %s." % restr
180
+ desc = normalize_text(' '.join(desc.split()), indent=' ')
181
+ if title != '%s':
182
+ title = title.splitlines()[0]
183
+ return ':%s: *%s*\n%s' % (msgid, title, desc)
184
+ return ':%s:\n%s' % (msgid, desc)
185
+
186
+
187
+ class MessagesHandlerMixIn(object):
188
+ """a mix-in class containing all the messages related methods for the main
189
+ lint class
190
+ """
191
+
192
+ def __init__(self):
193
+ # Primary registry for all active messages (i.e. all messages
194
+ # that can be emitted by pylint for the underlying Python
195
+ # version). It contains the 1:1 mapping from symbolic names
196
+ # to message definition objects.
197
+ self._messages = {}
198
+ # Maps alternative names (numeric IDs, deprecated names) to
199
+ # message definitions. May contain several names for each definition
200
+ # object.
201
+ self._alternative_names = {}
202
+ self._msgs_state = {}
203
+ self._module_msgs_state = {} # None
204
+ self._raw_module_msgs_state = {}
205
+ self._msgs_by_category = {}
206
+ self.msg_status = 0
207
+ self._ignored_msgs = {}
208
+ self._suppression_mapping = {}
209
+
210
+ def add_renamed_message(self, old_id, old_symbol, new_symbol):
211
+ """Register the old ID and symbol for a warning that was renamed.
212
+
213
+ This allows users to keep using the old ID/symbol in suppressions.
214
+ """
215
+ msg = self.check_message_id(new_symbol)
216
+ msg.old_names.append((old_id, old_symbol))
217
+ self._alternative_names[old_id] = msg
218
+ self._alternative_names[old_symbol] = msg
219
+
220
+ def register_messages(self, checker):
221
+ """register a dictionary of messages
222
+
223
+ Keys are message ids, values are a 2-uple with the message type and the
224
+ message itself
225
+
226
+ message ids should be a string of len 4, where the two first characters
227
+ are the checker id and the two last the message id in this checker
228
+ """
229
+ chkid = None
230
+ for msgid, msg_tuple in checker.msgs.iteritems():
231
+ msg = build_message_def(checker, msgid, msg_tuple)
232
+ assert msg.symbol not in self._messages, \
233
+ 'Message symbol %r is already defined' % msg.symbol
234
+ # avoid duplicate / malformed ids
235
+ assert msg.msgid not in self._alternative_names, \
236
+ 'Message id %r is already defined' % msgid
237
+ assert chkid is None or chkid == msg.msgid[1:3], \
238
+ 'Inconsistent checker part in message id %r' % msgid
239
+ chkid = msg.msgid[1:3]
240
+ if not msg.may_be_emitted():
241
+ self._msgs_state[msg.msgid] = False
242
+ self._messages[msg.symbol] = msg
243
+ self._alternative_names[msg.msgid] = msg
244
+ for old_id, old_symbol in msg.old_names:
245
+ self._alternative_names[old_id] = msg
246
+ self._alternative_names[old_symbol] = msg
247
+ self._msgs_by_category.setdefault(msg.msgid[0], []).append(msg.msgid)
248
+
249
+ def disable(self, msgid, scope='package', line=None, ignore_unknown=False):
250
+ """don't output message of the given id"""
251
+ assert scope in ('package', 'module')
252
+ # handle disable=all by disabling all categories
253
+ if msgid == 'all':
254
+ for msgid in MSG_TYPES:
255
+ self.disable(msgid, scope, line)
256
+ return
257
+ # msgid is a category?
258
+ catid = category_id(msgid)
259
+ if catid is not None:
260
+ for _msgid in self._msgs_by_category.get(catid):
261
+ self.disable(_msgid, scope, line)
262
+ return
263
+ # msgid is a checker name?
264
+ if msgid.lower() in self._checkers:
265
+ for checker in self._checkers[msgid.lower()]:
266
+ for _msgid in checker.msgs:
267
+ if _msgid in self._alternative_names:
268
+ self.disable(_msgid, scope, line)
269
+ return
270
+ # msgid is report id?
271
+ if msgid.lower().startswith('rp'):
272
+ self.disable_report(msgid)
273
+ return
274
+
275
+ try:
276
+ # msgid is a symbolic or numeric msgid.
277
+ msg = self.check_message_id(msgid)
278
+ except UnknownMessage:
279
+ if ignore_unknown:
280
+ return
281
+ raise
282
+
283
+ if scope == 'module':
284
+ assert line > 0
285
+ try:
286
+ self._module_msgs_state[msg.msgid][line] = False
287
+ except KeyError:
288
+ self._module_msgs_state[msg.msgid] = {line: False}
289
+ if msg.symbol != 'locally-disabled':
290
+ self.add_message('locally-disabled', line=line,
291
+ args=(msg.symbol, msg.msgid))
292
+
293
+ else:
294
+ msgs = self._msgs_state
295
+ msgs[msg.msgid] = False
296
+ # sync configuration object
297
+ self.config.disable_msg = [mid for mid, val in msgs.iteritems()
298
+ if not val]
299
+
300
+ def enable(self, msgid, scope='package', line=None, ignore_unknown=False):
301
+ """reenable message of the given id"""
302
+ assert scope in ('package', 'module')
303
+ catid = category_id(msgid)
304
+ # msgid is a category?
305
+ if catid is not None:
306
+ for msgid in self._msgs_by_category.get(catid):
307
+ self.enable(msgid, scope, line)
308
+ return
309
+ # msgid is a checker name?
310
+ if msgid.lower() in self._checkers:
311
+ for checker in self._checkers[msgid.lower()]:
312
+ for msgid_ in checker.msgs:
313
+ self.enable(msgid_, scope, line)
314
+ return
315
+ # msgid is report id?
316
+ if msgid.lower().startswith('rp'):
317
+ self.enable_report(msgid)
318
+ return
319
+
320
+ try:
321
+ # msgid is a symbolic or numeric msgid.
322
+ msg = self.check_message_id(msgid)
323
+ except UnknownMessage:
324
+ if ignore_unknown:
325
+ return
326
+ raise
327
+
328
+ if scope == 'module':
329
+ assert line > 0
330
+ try:
331
+ self._module_msgs_state[msg.msgid][line] = True
332
+ except KeyError:
333
+ self._module_msgs_state[msg.msgid] = {line: True}
334
+ self.add_message('locally-enabled', line=line, args=(msg.symbol, msg.msgid))
335
+ else:
336
+ msgs = self._msgs_state
337
+ msgs[msg.msgid] = True
338
+ # sync configuration object
339
+ self.config.enable = [mid for mid, val in msgs.iteritems() if val]
340
+
341
+ def check_message_id(self, msgid):
342
+ """returns the Message object for this message.
343
+
344
+ msgid may be either a numeric or symbolic id.
345
+
346
+ Raises UnknownMessage if the message id is not defined.
347
+ """
348
+ if msgid[1:].isdigit():
349
+ msgid = msgid.upper()
350
+ for source in (self._alternative_names, self._messages):
351
+ try:
352
+ return source[msgid]
353
+ except KeyError:
354
+ pass
355
+ raise UnknownMessage('No such message id %s' % msgid)
356
+
357
+ def get_msg_display_string(self, msgid):
358
+ """Generates a user-consumable representation of a message.
359
+
360
+ Can be just the message ID or the ID and the symbol.
361
+ """
362
+ return repr(self.check_message_id(msgid).symbol)
363
+
364
+ def get_message_state_scope(self, msgid, line=None):
365
+ """Returns the scope at which a message was enabled/disabled."""
366
+ try:
367
+ if line in self._module_msgs_state[msgid]:
368
+ return MSG_STATE_SCOPE_MODULE
369
+ except (KeyError, TypeError):
370
+ return MSG_STATE_SCOPE_CONFIG
371
+
372
+ def is_message_enabled(self, msg_descr, line=None):
373
+ """return true if the message associated to the given message id is
374
+ enabled
375
+
376
+ msgid may be either a numeric or symbolic message id.
377
+ """
378
+ try:
379
+ msgid = self.check_message_id(msg_descr).msgid
380
+ except UnknownMessage:
381
+ # The linter checks for messages that are not registered
382
+ # due to version mismatch, just treat them as message IDs
383
+ # for now.
384
+ msgid = msg_descr
385
+ if line is None:
386
+ return self._msgs_state.get(msgid, True)
387
+ try:
388
+ return self._module_msgs_state[msgid][line]
389
+ except (KeyError, TypeError):
390
+ return self._msgs_state.get(msgid, True)
391
+
392
+ def handle_ignored_message(self, state_scope, msgid, line, node, args):
393
+ """Report an ignored message.
394
+
395
+ state_scope is either MSG_STATE_SCOPE_MODULE or MSG_STATE_SCOPE_CONFIG,
396
+ depending on whether the message was disabled locally in the module,
397
+ or globally. The other arguments are the same as for add_message.
398
+ """
399
+ if state_scope == MSG_STATE_SCOPE_MODULE:
400
+ try:
401
+ orig_line = self._suppression_mapping[(msgid, line)]
402
+ self._ignored_msgs.setdefault((msgid, orig_line), set()).add(line)
403
+ except KeyError:
404
+ pass
405
+
406
+ def add_message(self, msg_descr, line=None, node=None, args=None):
407
+ """Adds a message given by ID or name.
408
+
409
+ If provided, the message string is expanded using args
410
+
411
+ AST checkers should must the node argument (but may optionally
412
+ provide line if the line number is different), raw and token checkers
413
+ must provide the line argument.
414
+ """
415
+ msg_info = self.check_message_id(msg_descr)
416
+ msgid = msg_info.msgid
417
+ # backward compatibility, message may not have a symbol
418
+ symbol = msg_info.symbol or msgid
419
+ # Fatal messages and reports are special, the node/scope distinction
420
+ # does not apply to them.
421
+ if msgid[0] not in _SCOPE_EXEMPT:
422
+ if msg_info.scope == WarningScope.LINE:
423
+ assert node is None and line is not None, (
424
+ 'Message %s must only provide line, got line=%s, node=%s' % (msgid, line, node))
425
+ elif msg_info.scope == WarningScope.NODE:
426
+ # Node-based warnings may provide an override line.
427
+ assert node is not None, 'Message %s must provide Node, got None'
428
+
429
+ if line is None and node is not None:
430
+ line = node.fromlineno
431
+ if hasattr(node, 'col_offset'):
432
+ col_offset = node.col_offset # XXX measured in bytes for utf-8, divide by two for chars?
433
+ else:
434
+ col_offset = None
435
+ # should this message be displayed
436
+ if not self.is_message_enabled(msgid, line):
437
+ self.handle_ignored_message(
438
+ self.get_message_state_scope(msgid, line), msgid, line, node, args)
439
+ return
440
+ # update stats
441
+ msg_cat = MSG_TYPES[msgid[0]]
442
+ self.msg_status |= MSG_TYPES_STATUS[msgid[0]]
443
+ self.stats[msg_cat] += 1
444
+ self.stats['by_module'][self.current_name][msg_cat] += 1
445
+ try:
446
+ self.stats['by_msg'][symbol] += 1
447
+ except KeyError:
448
+ self.stats['by_msg'][symbol] = 1
449
+ # expand message ?
450
+ msg = msg_info.msg
451
+ if args:
452
+ msg %= args
453
+ # get module and object
454
+ if node is None:
455
+ module, obj = self.current_name, ''
456
+ path = self.current_file
457
+ else:
458
+ module, obj = get_module_and_frameid(node)
459
+ path = node.root().file
460
+ # add the message
461
+ self.reporter.add_message(msgid, (path, module, obj, line or 1, col_offset or 0), msg)
462
+
463
+ def help_message(self, msgids):
464
+ """display help messages for the given message identifiers"""
465
+ for msgid in msgids:
466
+ try:
467
+ print self.check_message_id(msgid).format_help(checkerref=True)
468
+ print
469
+ except UnknownMessage, ex:
470
+ print ex
471
+ print
472
+ continue
473
+
474
+ def print_full_documentation(self):
475
+ """output a full documentation in ReST format"""
476
+ by_checker = {}
477
+ for checker in self.get_checkers():
478
+ if checker.name == 'master':
479
+ prefix = 'Main '
480
+ print "Options"
481
+ print '-------\n'
482
+ if checker.options:
483
+ for section, options in checker.options_by_section():
484
+ if section is None:
485
+ title = 'General options'
486
+ else:
487
+ title = '%s options' % section.capitalize()
488
+ print title
489
+ print '~' * len(title)
490
+ rest_format_section(sys.stdout, None, options)
491
+ print
492
+ else:
493
+ try:
494
+ by_checker[checker.name][0] += checker.options_and_values()
495
+ by_checker[checker.name][1].update(checker.msgs)
496
+ by_checker[checker.name][2] += checker.reports
497
+ except KeyError:
498
+ by_checker[checker.name] = [list(checker.options_and_values()),
499
+ dict(checker.msgs),
500
+ list(checker.reports)]
501
+ for checker, (options, msgs, reports) in by_checker.iteritems():
502
+ prefix = ''
503
+ title = '%s checker' % checker
504
+ print title
505
+ print '-' * len(title)
506
+ print
507
+ if options:
508
+ title = 'Options'
509
+ print title
510
+ print '~' * len(title)
511
+ rest_format_section(sys.stdout, None, options)
512
+ print
513
+ if msgs:
514
+ title = ('%smessages' % prefix).capitalize()
515
+ print title
516
+ print '~' * len(title)
517
+ for msgid, msg in sorted(msgs.iteritems(),
518
+ key=lambda (k, v): (_MSG_ORDER.index(k[0]), k)):
519
+ msg = build_message_def(checker, msgid, msg)
520
+ print msg.format_help(checkerref=False)
521
+ print
522
+ if reports:
523
+ title = ('%sreports' % prefix).capitalize()
524
+ print title
525
+ print '~' * len(title)
526
+ for report in reports:
527
+ print ':%s: %s' % report[:2]
528
+ print
529
+ print
530
+
531
+ @property
532
+ def messages(self):
533
+ """The list of all active messages."""
534
+ return self._messages.itervalues()
535
+
536
+ def list_messages(self):
537
+ """output full messages list documentation in ReST format"""
538
+ msgs = sorted(self._messages.itervalues(), key=lambda msg: msg.msgid)
539
+ for msg in msgs:
540
+ if not msg.may_be_emitted():
541
+ continue
542
+ print msg.format_help(checkerref=False)
543
+ print
544
+
545
+
546
+ class ReportsHandlerMixIn(object):
547
+ """a mix-in class containing all the reports and stats manipulation
548
+ related methods for the main lint class
549
+ """
550
+ def __init__(self):
551
+ self._reports = {}
552
+ self._reports_state = {}
553
+
554
+ def register_report(self, reportid, r_title, r_cb, checker):
555
+ """register a report
556
+
557
+ reportid is the unique identifier for the report
558
+ r_title the report's title
559
+ r_cb the method to call to make the report
560
+ checker is the checker defining the report
561
+ """
562
+ reportid = reportid.upper()
563
+ self._reports.setdefault(checker, []).append((reportid, r_title, r_cb))
564
+
565
+ def enable_report(self, reportid):
566
+ """disable the report of the given id"""
567
+ reportid = reportid.upper()
568
+ self._reports_state[reportid] = True
569
+
570
+ def disable_report(self, reportid):
571
+ """disable the report of the given id"""
572
+ reportid = reportid.upper()
573
+ self._reports_state[reportid] = False
574
+
575
+ def report_is_enabled(self, reportid):
576
+ """return true if the report associated to the given identifier is
577
+ enabled
578
+ """
579
+ return self._reports_state.get(reportid, True)
580
+
581
+ def make_reports(self, stats, old_stats):
582
+ """render registered reports"""
583
+ sect = Section('Report',
584
+ '%s statements analysed.'% (self.stats['statement']))
585
+ for checker in self._reports:
586
+ for reportid, r_title, r_cb in self._reports[checker]:
587
+ if not self.report_is_enabled(reportid):
588
+ continue
589
+ report_sect = Section(r_title)
590
+ try:
591
+ r_cb(report_sect, stats, old_stats)
592
+ except EmptyReport:
593
+ continue
594
+ report_sect.report_id = reportid
595
+ sect.append(report_sect)
596
+ return sect
597
+
598
+ def add_stats(self, **kwargs):
599
+ """add some stats entries to the statistic dictionary
600
+ raise an AssertionError if there is a key conflict
601
+ """
602
+ for key, value in kwargs.iteritems():
603
+ if key[-1] == '_':
604
+ key = key[:-1]
605
+ assert key not in self.stats
606
+ self.stats[key] = value
607
+ return self.stats
608
+
609
+
610
+ def expand_modules(files_or_modules, black_list):
611
+ """take a list of files/modules/packages and return the list of tuple
612
+ (file, module name) which have to be actually checked
613
+ """
614
+ result = []
615
+ errors = []
616
+ for something in files_or_modules:
617
+ if exists(something):
618
+ # this is a file or a directory
619
+ try:
620
+ modname = '.'.join(modpath_from_file(something))
621
+ except ImportError:
622
+ modname = splitext(basename(something))[0]
623
+ if isdir(something):
624
+ filepath = join(something, '__init__.py')
625
+ else:
626
+ filepath = something
627
+ else:
628
+ # suppose it's a module or package
629
+ modname = something
630
+ try:
631
+ filepath = file_from_modpath(modname.split('.'))
632
+ if filepath is None:
633
+ errors.append({'key' : 'ignored-builtin-module', 'mod': modname})
634
+ continue
635
+ except (ImportError, SyntaxError), ex:
636
+ # FIXME p3k : the SyntaxError is a Python bug and should be
637
+ # removed as soon as possible http://bugs.python.org/issue10588
638
+ errors.append({'key': 'fatal', 'mod': modname, 'ex': ex})
639
+ continue
640
+ filepath = normpath(filepath)
641
+ result.append({'path': filepath, 'name': modname, 'isarg': True,
642
+ 'basepath': filepath, 'basename': modname})
643
+ if not (modname.endswith('.__init__') or modname == '__init__') \
644
+ and '__init__.py' in filepath:
645
+ for subfilepath in get_module_files(dirname(filepath), black_list):
646
+ if filepath == subfilepath:
647
+ continue
648
+ submodname = '.'.join(modpath_from_file(subfilepath))
649
+ result.append({'path': subfilepath, 'name': submodname,
650
+ 'isarg': False,
651
+ 'basepath': filepath, 'basename': modname})
652
+ return result, errors
653
+
654
+
655
+ class PyLintASTWalker(object):
656
+
657
+ def __init__(self, linter):
658
+ # callbacks per node types
659
+ self.nbstatements = 1
660
+ self.visit_events = {}
661
+ self.leave_events = {}
662
+ self.linter = linter
663
+
664
+ def _is_method_enabled(self, method):
665
+ if not hasattr(method, 'checks_msgs'):
666
+ return True
667
+ for msg_desc in method.checks_msgs:
668
+ if self.linter.is_message_enabled(msg_desc):
669
+ return True
670
+ return False
671
+
672
+ def add_checker(self, checker):
673
+ """walk to the checker's dir and collect visit and leave methods"""
674
+ # XXX : should be possible to merge needed_checkers and add_checker
675
+ vcids = set()
676
+ lcids = set()
677
+ visits = self.visit_events
678
+ leaves = self.leave_events
679
+ for member in dir(checker):
680
+ cid = member[6:]
681
+ if cid == 'default':
682
+ continue
683
+ if member.startswith('visit_'):
684
+ v_meth = getattr(checker, member)
685
+ # don't use visit_methods with no activated message:
686
+ if self._is_method_enabled(v_meth):
687
+ visits.setdefault(cid, []).append(v_meth)
688
+ vcids.add(cid)
689
+ elif member.startswith('leave_'):
690
+ l_meth = getattr(checker, member)
691
+ # don't use leave_methods with no activated message:
692
+ if self._is_method_enabled(l_meth):
693
+ leaves.setdefault(cid, []).append(l_meth)
694
+ lcids.add(cid)
695
+ visit_default = getattr(checker, 'visit_default', None)
696
+ if visit_default:
697
+ for cls in nodes.ALL_NODE_CLASSES:
698
+ cid = cls.__name__.lower()
699
+ if cid not in vcids:
700
+ visits.setdefault(cid, []).append(visit_default)
701
+ # for now we have no "leave_default" method in Pylint
702
+
703
+ def walk(self, astroid):
704
+ """call visit events of astroid checkers for the given node, recurse on
705
+ its children, then leave events.
706
+ """
707
+ cid = astroid.__class__.__name__.lower()
708
+ if astroid.is_statement:
709
+ self.nbstatements += 1
710
+ # generate events for this node on each checker
711
+ for cb in self.visit_events.get(cid, ()):
712
+ cb(astroid)
713
+ # recurse on children
714
+ for child in astroid.get_children():
715
+ self.walk(child)
716
+ for cb in self.leave_events.get(cid, ()):
717
+ cb(astroid)
718
+
719
+
720
+ PY_EXTS = ('.py', '.pyc', '.pyo', '.pyw', '.so', '.dll')
721
+
722
+ def register_plugins(linter, directory):
723
+ """load all module and package in the given directory, looking for a
724
+ 'register' function in each one, used to register pylint checkers
725
+ """
726
+ imported = {}
727
+ for filename in os.listdir(directory):
728
+ base, extension = splitext(filename)
729
+ if base in imported or base == '__pycache__':
730
+ continue
731
+ if extension in PY_EXTS and base != '__init__' or (
732
+ not extension and isdir(join(directory, base))):
733
+ try:
734
+ module = load_module_from_file(join(directory, filename))
735
+ except ValueError:
736
+ # empty module name (usually emacs auto-save files)
737
+ continue
738
+ except ImportError, exc:
739
+ print >> sys.stderr, "Problem importing module %s: %s" % (filename, exc)
740
+ else:
741
+ if hasattr(module, 'register'):
742
+ module.register(linter)
743
+ imported[base] = 1
744
+