exercism-analysis 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,122 @@
1
+ # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
2
+ # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
3
+ #
4
+ # This file is part of astroid.
5
+ #
6
+ # astroid is free software: you can redistribute it and/or modify it
7
+ # under the terms of the GNU Lesser General Public License as published by the
8
+ # Free Software Foundation, either version 2.1 of the License, or (at your
9
+ # option) any later version.
10
+ #
11
+ # astroid is distributed in the hope that it will be useful, but
12
+ # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
+ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
14
+ # for more details.
15
+ #
16
+ # You should have received a copy of the GNU Lesser General Public License along
17
+ # with astroid. If not, see <http://www.gnu.org/licenses/>.
18
+ """This module contains some mixins for the different nodes.
19
+ """
20
+
21
+ from astroid.exceptions import (AstroidBuildingException, InferenceError,
22
+ NotFoundError)
23
+
24
+
25
+ class BlockRangeMixIn(object):
26
+ """override block range """
27
+ def set_line_info(self, lastchild):
28
+ self.fromlineno = self.lineno
29
+ self.tolineno = lastchild.tolineno
30
+ self.blockstart_tolineno = self._blockstart_toline()
31
+
32
+ def _elsed_block_range(self, lineno, orelse, last=None):
33
+ """handle block line numbers range for try/finally, for, if and while
34
+ statements
35
+ """
36
+ if lineno == self.fromlineno:
37
+ return lineno, lineno
38
+ if orelse:
39
+ if lineno >= orelse[0].fromlineno:
40
+ return lineno, orelse[-1].tolineno
41
+ return lineno, orelse[0].fromlineno - 1
42
+ return lineno, last or self.tolineno
43
+
44
+
45
+ class FilterStmtsMixin(object):
46
+ """Mixin for statement filtering and assignment type"""
47
+
48
+ def _get_filtered_stmts(self, _, node, _stmts, mystmt):
49
+ """method used in _filter_stmts to get statemtents and trigger break"""
50
+ if self.statement() is mystmt:
51
+ # original node's statement is the assignment, only keep
52
+ # current node (gen exp, list comp)
53
+ return [node], True
54
+ return _stmts, False
55
+
56
+ def ass_type(self):
57
+ return self
58
+
59
+
60
+ class AssignTypeMixin(object):
61
+
62
+ def ass_type(self):
63
+ return self
64
+
65
+ def _get_filtered_stmts(self, lookup_node, node, _stmts, mystmt):
66
+ """method used in filter_stmts"""
67
+ if self is mystmt:
68
+ return _stmts, True
69
+ if self.statement() is mystmt:
70
+ # original node's statement is the assignment, only keep
71
+ # current node (gen exp, list comp)
72
+ return [node], True
73
+ return _stmts, False
74
+
75
+
76
+ class ParentAssignTypeMixin(AssignTypeMixin):
77
+
78
+ def ass_type(self):
79
+ return self.parent.ass_type()
80
+
81
+
82
+ class FromImportMixIn(FilterStmtsMixin):
83
+ """MixIn for From and Import Nodes"""
84
+
85
+ def _infer_name(self, frame, name):
86
+ return name
87
+
88
+ def do_import_module(self, modname):
89
+ """return the ast for a module whose name is <modname> imported by <self>
90
+ """
91
+ # handle special case where we are on a package node importing a module
92
+ # using the same name as the package, which may end in an infinite loop
93
+ # on relative imports
94
+ # XXX: no more needed ?
95
+ mymodule = self.root()
96
+ level = getattr(self, 'level', None) # Import as no level
97
+ # XXX we should investigate deeper if we really want to check
98
+ # importing itself: modname and mymodule.name be relative or absolute
99
+ if mymodule.relative_to_absolute_name(modname, level) == mymodule.name:
100
+ # FIXME: we used to raise InferenceError here, but why ?
101
+ return mymodule
102
+ try:
103
+ return mymodule.import_module(modname, level=level)
104
+ except AstroidBuildingException:
105
+ raise InferenceError(modname)
106
+ except SyntaxError, ex:
107
+ raise InferenceError(str(ex))
108
+
109
+ def real_name(self, asname):
110
+ """get name from 'as' name"""
111
+ for name, _asname in self.names:
112
+ if name == '*':
113
+ return asname
114
+ if not _asname:
115
+ name = name.split('.', 1)[0]
116
+ _asname = name
117
+ if asname == _asname:
118
+ return name
119
+ raise NotFoundError(asname)
120
+
121
+
122
+
@@ -0,0 +1,928 @@
1
+ # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
2
+ # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
3
+ #
4
+ # This file is part of astroid.
5
+ #
6
+ # astroid is free software: you can redistribute it and/or modify it
7
+ # under the terms of the GNU Lesser General Public License as published by the
8
+ # Free Software Foundation, either version 2.1 of the License, or (at your
9
+ # option) any later version.
10
+ #
11
+ # astroid is distributed in the hope that it will be useful, but
12
+ # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
+ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
14
+ # for more details.
15
+ #
16
+ # You should have received a copy of the GNU Lesser General Public License along
17
+ # with astroid. If not, see <http://www.gnu.org/licenses/>.
18
+ """Module for some node classes. More nodes in scoped_nodes.py
19
+ """
20
+
21
+ import sys
22
+
23
+ from astroid.exceptions import NoDefault
24
+ from astroid.bases import (NodeNG, Statement, Instance, InferenceContext,
25
+ _infer_stmts, YES, BUILTINS)
26
+ from astroid.mixins import BlockRangeMixIn, AssignTypeMixin, \
27
+ ParentAssignTypeMixin, FromImportMixIn
28
+
29
+
30
+ def unpack_infer(stmt, context=None):
31
+ """recursively generate nodes inferred by the given statement.
32
+ If the inferred value is a list or a tuple, recurse on the elements
33
+ """
34
+ if isinstance(stmt, (List, Tuple)):
35
+ for elt in stmt.elts:
36
+ for infered_elt in unpack_infer(elt, context):
37
+ yield infered_elt
38
+ return
39
+ # if infered is a final node, return it and stop
40
+ infered = stmt.infer(context).next()
41
+ if infered is stmt:
42
+ yield infered
43
+ return
44
+ # else, infer recursivly, except YES object that should be returned as is
45
+ for infered in stmt.infer(context):
46
+ if infered is YES:
47
+ yield infered
48
+ else:
49
+ for inf_inf in unpack_infer(infered, context):
50
+ yield inf_inf
51
+
52
+
53
+ def are_exclusive(stmt1, stmt2, exceptions=None):
54
+ """return true if the two given statements are mutually exclusive
55
+
56
+ `exceptions` may be a list of exception names. If specified, discard If
57
+ branches and check one of the statement is in an exception handler catching
58
+ one of the given exceptions.
59
+
60
+ algorithm :
61
+ 1) index stmt1's parents
62
+ 2) climb among stmt2's parents until we find a common parent
63
+ 3) if the common parent is a If or TryExcept statement, look if nodes are
64
+ in exclusive branches
65
+ """
66
+ # index stmt1's parents
67
+ stmt1_parents = {}
68
+ children = {}
69
+ node = stmt1.parent
70
+ previous = stmt1
71
+ while node:
72
+ stmt1_parents[node] = 1
73
+ children[node] = previous
74
+ previous = node
75
+ node = node.parent
76
+ # climb among stmt2's parents until we find a common parent
77
+ node = stmt2.parent
78
+ previous = stmt2
79
+ while node:
80
+ if node in stmt1_parents:
81
+ # if the common parent is a If or TryExcept statement, look if
82
+ # nodes are in exclusive branches
83
+ if isinstance(node, If) and exceptions is None:
84
+ if (node.locate_child(previous)[1]
85
+ is not node.locate_child(children[node])[1]):
86
+ return True
87
+ elif isinstance(node, TryExcept):
88
+ c2attr, c2node = node.locate_child(previous)
89
+ c1attr, c1node = node.locate_child(children[node])
90
+ if c1node is not c2node:
91
+ if ((c2attr == 'body' and c1attr == 'handlers' and children[node].catch(exceptions)) or
92
+ (c2attr == 'handlers' and c1attr == 'body' and previous.catch(exceptions)) or
93
+ (c2attr == 'handlers' and c1attr == 'orelse') or
94
+ (c2attr == 'orelse' and c1attr == 'handlers')):
95
+ return True
96
+ elif c2attr == 'handlers' and c1attr == 'handlers':
97
+ return previous is not children[node]
98
+ return False
99
+ previous = node
100
+ node = node.parent
101
+ return False
102
+
103
+
104
+ class LookupMixIn(object):
105
+ """Mixin looking up a name in the right scope
106
+ """
107
+
108
+ def lookup(self, name):
109
+ """lookup a variable name
110
+
111
+ return the scope node and the list of assignments associated to the given
112
+ name according to the scope where it has been found (locals, globals or
113
+ builtin)
114
+
115
+ The lookup is starting from self's scope. If self is not a frame itself and
116
+ the name is found in the inner frame locals, statements will be filtered
117
+ to remove ignorable statements according to self's location
118
+ """
119
+ return self.scope().scope_lookup(self, name)
120
+
121
+ def ilookup(self, name):
122
+ """infered lookup
123
+
124
+ return an iterator on infered values of the statements returned by
125
+ the lookup method
126
+ """
127
+ frame, stmts = self.lookup(name)
128
+ context = InferenceContext()
129
+ return _infer_stmts(stmts, context, frame)
130
+
131
+ def _filter_stmts(self, stmts, frame, offset):
132
+ """filter statements to remove ignorable statements.
133
+
134
+ If self is not a frame itself and the name is found in the inner
135
+ frame locals, statements will be filtered to remove ignorable
136
+ statements according to self's location
137
+ """
138
+ # if offset == -1, my actual frame is not the inner frame but its parent
139
+ #
140
+ # class A(B): pass
141
+ #
142
+ # we need this to resolve B correctly
143
+ if offset == -1:
144
+ myframe = self.frame().parent.frame()
145
+ else:
146
+ myframe = self.frame()
147
+ if not myframe is frame or self is frame:
148
+ return stmts
149
+ mystmt = self.statement()
150
+ # line filtering if we are in the same frame
151
+ #
152
+ # take care node may be missing lineno information (this is the case for
153
+ # nodes inserted for living objects)
154
+ if myframe is frame and mystmt.fromlineno is not None:
155
+ assert mystmt.fromlineno is not None, mystmt
156
+ mylineno = mystmt.fromlineno + offset
157
+ else:
158
+ # disabling lineno filtering
159
+ mylineno = 0
160
+ _stmts = []
161
+ _stmt_parents = []
162
+ for node in stmts:
163
+ stmt = node.statement()
164
+ # line filtering is on and we have reached our location, break
165
+ if mylineno > 0 and stmt.fromlineno > mylineno:
166
+ break
167
+ assert hasattr(node, 'ass_type'), (node, node.scope(),
168
+ node.scope().locals)
169
+ ass_type = node.ass_type()
170
+
171
+ if node.has_base(self):
172
+ break
173
+
174
+ _stmts, done = ass_type._get_filtered_stmts(self, node, _stmts, mystmt)
175
+ if done:
176
+ break
177
+
178
+ optional_assign = ass_type.optional_assign
179
+ if optional_assign and ass_type.parent_of(self):
180
+ # we are inside a loop, loop var assigment is hidding previous
181
+ # assigment
182
+ _stmts = [node]
183
+ _stmt_parents = [stmt.parent]
184
+ continue
185
+
186
+ # XXX comment various branches below!!!
187
+ try:
188
+ pindex = _stmt_parents.index(stmt.parent)
189
+ except ValueError:
190
+ pass
191
+ else:
192
+ # we got a parent index, this means the currently visited node
193
+ # is at the same block level as a previously visited node
194
+ if _stmts[pindex].ass_type().parent_of(ass_type):
195
+ # both statements are not at the same block level
196
+ continue
197
+ # if currently visited node is following previously considered
198
+ # assignement and both are not exclusive, we can drop the
199
+ # previous one. For instance in the following code ::
200
+ #
201
+ # if a:
202
+ # x = 1
203
+ # else:
204
+ # x = 2
205
+ # print x
206
+ #
207
+ # we can't remove neither x = 1 nor x = 2 when looking for 'x'
208
+ # of 'print x'; while in the following ::
209
+ #
210
+ # x = 1
211
+ # x = 2
212
+ # print x
213
+ #
214
+ # we can remove x = 1 when we see x = 2
215
+ #
216
+ # moreover, on loop assignment types, assignment won't
217
+ # necessarily be done if the loop has no iteration, so we don't
218
+ # want to clear previous assigments if any (hence the test on
219
+ # optional_assign)
220
+ if not (optional_assign or are_exclusive(_stmts[pindex], node)):
221
+ del _stmt_parents[pindex]
222
+ del _stmts[pindex]
223
+ if isinstance(node, AssName):
224
+ if not optional_assign and stmt.parent is mystmt.parent:
225
+ _stmts = []
226
+ _stmt_parents = []
227
+ elif isinstance(node, DelName):
228
+ _stmts = []
229
+ _stmt_parents = []
230
+ continue
231
+ if not are_exclusive(self, node):
232
+ _stmts.append(node)
233
+ _stmt_parents.append(stmt.parent)
234
+ return _stmts
235
+
236
+ # Name classes
237
+
238
+ class AssName(LookupMixIn, ParentAssignTypeMixin, NodeNG):
239
+ """class representing an AssName node"""
240
+
241
+
242
+ class DelName(LookupMixIn, ParentAssignTypeMixin, NodeNG):
243
+ """class representing a DelName node"""
244
+
245
+
246
+ class Name(LookupMixIn, NodeNG):
247
+ """class representing a Name node"""
248
+
249
+
250
+
251
+
252
+ ##################### node classes ########################################
253
+
254
+ class Arguments(NodeNG, AssignTypeMixin):
255
+ """class representing an Arguments node"""
256
+ _astroid_fields = ('args', 'defaults', 'kwonlyargs', 'kw_defaults')
257
+ args = None
258
+ defaults = None
259
+ kwonlyargs = None
260
+ kw_defaults = None
261
+
262
+ def __init__(self, vararg=None, kwarg=None):
263
+ self.vararg = vararg
264
+ self.kwarg = kwarg
265
+
266
+ def _infer_name(self, frame, name):
267
+ if self.parent is frame:
268
+ return name
269
+ return None
270
+
271
+ def format_args(self):
272
+ """return arguments formatted as string"""
273
+ result = []
274
+ if self.args:
275
+ result.append(_format_args(self.args, self.defaults))
276
+ if self.vararg:
277
+ result.append('*%s' % self.vararg)
278
+ if self.kwarg:
279
+ result.append('**%s' % self.kwarg)
280
+ if self.kwonlyargs:
281
+ if not self.vararg:
282
+ result.append('*')
283
+ result.append(_format_args(self.kwonlyargs, self.kw_defaults))
284
+ return ', '.join(result)
285
+
286
+ def default_value(self, argname):
287
+ """return the default value for an argument
288
+
289
+ :raise `NoDefault`: if there is no default value defined
290
+ """
291
+ i = _find_arg(argname, self.args)[0]
292
+ if i is not None:
293
+ idx = i - (len(self.args) - len(self.defaults))
294
+ if idx >= 0:
295
+ return self.defaults[idx]
296
+ i = _find_arg(argname, self.kwonlyargs)[0]
297
+ if i is not None and self.kw_defaults[i] is not None:
298
+ return self.kw_defaults[i]
299
+ raise NoDefault()
300
+
301
+ def is_argument(self, name):
302
+ """return True if the name is defined in arguments"""
303
+ if name == self.vararg:
304
+ return True
305
+ if name == self.kwarg:
306
+ return True
307
+ return self.find_argname(name, True)[1] is not None
308
+
309
+ def find_argname(self, argname, rec=False):
310
+ """return index and Name node with given name"""
311
+ if self.args: # self.args may be None in some cases (builtin function)
312
+ return _find_arg(argname, self.args, rec)
313
+ return None, None
314
+
315
+ def get_children(self):
316
+ """override get_children to skip over None elements in kw_defaults"""
317
+ for child in super(Arguments, self).get_children():
318
+ if child is not None:
319
+ yield child
320
+
321
+
322
+ def _find_arg(argname, args, rec=False):
323
+ for i, arg in enumerate(args):
324
+ if isinstance(arg, Tuple):
325
+ if rec:
326
+ found = _find_arg(argname, arg.elts)
327
+ if found[0] is not None:
328
+ return found
329
+ elif arg.name == argname:
330
+ return i, arg
331
+ return None, None
332
+
333
+
334
+ def _format_args(args, defaults=None):
335
+ values = []
336
+ if args is None:
337
+ return ''
338
+ if defaults is not None:
339
+ default_offset = len(args) - len(defaults)
340
+ for i, arg in enumerate(args):
341
+ if isinstance(arg, Tuple):
342
+ values.append('(%s)' % _format_args(arg.elts))
343
+ else:
344
+ values.append(arg.name)
345
+ if defaults is not None and i >= default_offset:
346
+ if defaults[i-default_offset] is not None:
347
+ values[-1] += '=' + defaults[i-default_offset].as_string()
348
+ return ', '.join(values)
349
+
350
+
351
+ class AssAttr(NodeNG, ParentAssignTypeMixin):
352
+ """class representing an AssAttr node"""
353
+ _astroid_fields = ('expr',)
354
+ expr = None
355
+
356
+ class Assert(Statement):
357
+ """class representing an Assert node"""
358
+ _astroid_fields = ('test', 'fail',)
359
+ test = None
360
+ fail = None
361
+
362
+ class Assign(Statement, AssignTypeMixin):
363
+ """class representing an Assign node"""
364
+ _astroid_fields = ('targets', 'value',)
365
+ targets = None
366
+ value = None
367
+
368
+ class AugAssign(Statement, AssignTypeMixin):
369
+ """class representing an AugAssign node"""
370
+ _astroid_fields = ('target', 'value',)
371
+ target = None
372
+ value = None
373
+
374
+ class Backquote(NodeNG):
375
+ """class representing a Backquote node"""
376
+ _astroid_fields = ('value',)
377
+ value = None
378
+
379
+ class BinOp(NodeNG):
380
+ """class representing a BinOp node"""
381
+ _astroid_fields = ('left', 'right',)
382
+ left = None
383
+ right = None
384
+
385
+ class BoolOp(NodeNG):
386
+ """class representing a BoolOp node"""
387
+ _astroid_fields = ('values',)
388
+ values = None
389
+
390
+ class Break(Statement):
391
+ """class representing a Break node"""
392
+
393
+
394
+ class CallFunc(NodeNG):
395
+ """class representing a CallFunc node"""
396
+ _astroid_fields = ('func', 'args', 'starargs', 'kwargs')
397
+ func = None
398
+ args = None
399
+ starargs = None
400
+ kwargs = None
401
+
402
+ def __init__(self):
403
+ self.starargs = None
404
+ self.kwargs = None
405
+
406
+ class Compare(NodeNG):
407
+ """class representing a Compare node"""
408
+ _astroid_fields = ('left', 'ops',)
409
+ left = None
410
+ ops = None
411
+
412
+ def get_children(self):
413
+ """override get_children for tuple fields"""
414
+ yield self.left
415
+ for _, comparator in self.ops:
416
+ yield comparator # we don't want the 'op'
417
+
418
+ def last_child(self):
419
+ """override last_child"""
420
+ # XXX maybe if self.ops:
421
+ return self.ops[-1][1]
422
+ #return self.left
423
+
424
+ class Comprehension(NodeNG):
425
+ """class representing a Comprehension node"""
426
+ _astroid_fields = ('target', 'iter' ,'ifs')
427
+ target = None
428
+ iter = None
429
+ ifs = None
430
+
431
+ optional_assign = True
432
+ def ass_type(self):
433
+ return self
434
+
435
+ def _get_filtered_stmts(self, lookup_node, node, stmts, mystmt):
436
+ """method used in filter_stmts"""
437
+ if self is mystmt:
438
+ if isinstance(lookup_node, (Const, Name)):
439
+ return [lookup_node], True
440
+
441
+ elif self.statement() is mystmt:
442
+ # original node's statement is the assignment, only keeps
443
+ # current node (gen exp, list comp)
444
+
445
+ return [node], True
446
+
447
+ return stmts, False
448
+
449
+
450
+ class Const(NodeNG, Instance):
451
+ """represent a constant node like num, str, bool, None, bytes"""
452
+
453
+ def __init__(self, value=None):
454
+ self.value = value
455
+
456
+ def getitem(self, index, context=None):
457
+ if isinstance(self.value, basestring):
458
+ return Const(self.value[index])
459
+ raise TypeError('%r (value=%s)' % (self, self.value))
460
+
461
+ def has_dynamic_getattr(self):
462
+ return False
463
+
464
+ def itered(self):
465
+ if isinstance(self.value, basestring):
466
+ return self.value
467
+ raise TypeError()
468
+
469
+ def pytype(self):
470
+ return self._proxied.qname()
471
+
472
+
473
+ class Continue(Statement):
474
+ """class representing a Continue node"""
475
+
476
+
477
+ class Decorators(NodeNG):
478
+ """class representing a Decorators node"""
479
+ _astroid_fields = ('nodes',)
480
+ nodes = None
481
+
482
+ def __init__(self, nodes=None):
483
+ self.nodes = nodes
484
+
485
+ def scope(self):
486
+ # skip the function node to go directly to the upper level scope
487
+ return self.parent.parent.scope()
488
+
489
+ class DelAttr(NodeNG, ParentAssignTypeMixin):
490
+ """class representing a DelAttr node"""
491
+ _astroid_fields = ('expr',)
492
+ expr = None
493
+
494
+
495
+ class Delete(Statement, AssignTypeMixin):
496
+ """class representing a Delete node"""
497
+ _astroid_fields = ('targets',)
498
+ targets = None
499
+
500
+
501
+ class Dict(NodeNG, Instance):
502
+ """class representing a Dict node"""
503
+ _astroid_fields = ('items',)
504
+
505
+ def __init__(self, items=None):
506
+ if items is None:
507
+ self.items = []
508
+ else:
509
+ self.items = [(const_factory(k), const_factory(v))
510
+ for k,v in items.iteritems()]
511
+
512
+ def pytype(self):
513
+ return '%s.dict' % BUILTINS
514
+
515
+ def get_children(self):
516
+ """get children of a Dict node"""
517
+ # overrides get_children
518
+ for key, value in self.items:
519
+ yield key
520
+ yield value
521
+
522
+ def last_child(self):
523
+ """override last_child"""
524
+ if self.items:
525
+ return self.items[-1][1]
526
+ return None
527
+
528
+ def itered(self):
529
+ return self.items[::2]
530
+
531
+ def getitem(self, lookup_key, context=None):
532
+ for key, value in self.items:
533
+ for inferedkey in key.infer(context):
534
+ if inferedkey is YES:
535
+ continue
536
+ if isinstance(inferedkey, Const) and inferedkey.value == lookup_key:
537
+ return value
538
+ # This should raise KeyError, but all call sites only catch
539
+ # IndexError. Let's leave it like that for now.
540
+ raise IndexError(lookup_key)
541
+
542
+
543
+ class Discard(Statement):
544
+ """class representing a Discard node"""
545
+ _astroid_fields = ('value',)
546
+ value = None
547
+
548
+
549
+ class Ellipsis(NodeNG):
550
+ """class representing an Ellipsis node"""
551
+
552
+
553
+ class EmptyNode(NodeNG):
554
+ """class representing an EmptyNode node"""
555
+
556
+
557
+ class ExceptHandler(Statement, AssignTypeMixin):
558
+ """class representing an ExceptHandler node"""
559
+ _astroid_fields = ('type', 'name', 'body',)
560
+ type = None
561
+ name = None
562
+ body = None
563
+
564
+ def _blockstart_toline(self):
565
+ if self.name:
566
+ return self.name.tolineno
567
+ elif self.type:
568
+ return self.type.tolineno
569
+ else:
570
+ return self.lineno
571
+
572
+ def set_line_info(self, lastchild):
573
+ self.fromlineno = self.lineno
574
+ self.tolineno = lastchild.tolineno
575
+ self.blockstart_tolineno = self._blockstart_toline()
576
+
577
+ def catch(self, exceptions):
578
+ if self.type is None or exceptions is None:
579
+ return True
580
+ for node in self.type.nodes_of_class(Name):
581
+ if node.name in exceptions:
582
+ return True
583
+
584
+
585
+ class Exec(Statement):
586
+ """class representing an Exec node"""
587
+ _astroid_fields = ('expr', 'globals', 'locals',)
588
+ expr = None
589
+ globals = None
590
+ locals = None
591
+
592
+
593
+ class ExtSlice(NodeNG):
594
+ """class representing an ExtSlice node"""
595
+ _astroid_fields = ('dims',)
596
+ dims = None
597
+
598
+ class For(BlockRangeMixIn, AssignTypeMixin, Statement):
599
+ """class representing a For node"""
600
+ _astroid_fields = ('target', 'iter', 'body', 'orelse',)
601
+ target = None
602
+ iter = None
603
+ body = None
604
+ orelse = None
605
+
606
+ optional_assign = True
607
+ def _blockstart_toline(self):
608
+ return self.iter.tolineno
609
+
610
+
611
+ class From(FromImportMixIn, Statement):
612
+ """class representing a From node"""
613
+
614
+ def __init__(self, fromname, names, level=0):
615
+ self.modname = fromname
616
+ self.names = names
617
+ self.level = level
618
+
619
+ class Getattr(NodeNG):
620
+ """class representing a Getattr node"""
621
+ _astroid_fields = ('expr',)
622
+ expr = None
623
+
624
+
625
+ class Global(Statement):
626
+ """class representing a Global node"""
627
+
628
+ def __init__(self, names):
629
+ self.names = names
630
+
631
+ def _infer_name(self, frame, name):
632
+ return name
633
+
634
+
635
+ class If(BlockRangeMixIn, Statement):
636
+ """class representing an If node"""
637
+ _astroid_fields = ('test', 'body', 'orelse')
638
+ test = None
639
+ body = None
640
+ orelse = None
641
+
642
+ def _blockstart_toline(self):
643
+ return self.test.tolineno
644
+
645
+ def block_range(self, lineno):
646
+ """handle block line numbers range for if statements"""
647
+ if lineno == self.body[0].fromlineno:
648
+ return lineno, lineno
649
+ if lineno <= self.body[-1].tolineno:
650
+ return lineno, self.body[-1].tolineno
651
+ return self._elsed_block_range(lineno, self.orelse,
652
+ self.body[0].fromlineno - 1)
653
+
654
+
655
+ class IfExp(NodeNG):
656
+ """class representing an IfExp node"""
657
+ _astroid_fields = ('test', 'body', 'orelse')
658
+ test = None
659
+ body = None
660
+ orelse = None
661
+
662
+
663
+ class Import(FromImportMixIn, Statement):
664
+ """class representing an Import node"""
665
+
666
+
667
+ class Index(NodeNG):
668
+ """class representing an Index node"""
669
+ _astroid_fields = ('value',)
670
+ value = None
671
+
672
+
673
+ class Keyword(NodeNG):
674
+ """class representing a Keyword node"""
675
+ _astroid_fields = ('value',)
676
+ value = None
677
+
678
+
679
+ class List(NodeNG, Instance, ParentAssignTypeMixin):
680
+ """class representing a List node"""
681
+ _astroid_fields = ('elts',)
682
+
683
+ def __init__(self, elts=None):
684
+ if elts is None:
685
+ self.elts = []
686
+ else:
687
+ self.elts = [const_factory(e) for e in elts]
688
+
689
+ def pytype(self):
690
+ return '%s.list' % BUILTINS
691
+
692
+ def getitem(self, index, context=None):
693
+ return self.elts[index]
694
+
695
+ def itered(self):
696
+ return self.elts
697
+
698
+
699
+ class Nonlocal(Statement):
700
+ """class representing a Nonlocal node"""
701
+
702
+ def __init__(self, names):
703
+ self.names = names
704
+
705
+ def _infer_name(self, frame, name):
706
+ return name
707
+
708
+
709
+ class Pass(Statement):
710
+ """class representing a Pass node"""
711
+
712
+
713
+ class Print(Statement):
714
+ """class representing a Print node"""
715
+ _astroid_fields = ('dest', 'values',)
716
+ dest = None
717
+ values = None
718
+
719
+
720
+ class Raise(Statement):
721
+ """class representing a Raise node"""
722
+ exc = None
723
+ if sys.version_info < (3, 0):
724
+ _astroid_fields = ('exc', 'inst', 'tback')
725
+ inst = None
726
+ tback = None
727
+ else:
728
+ _astroid_fields = ('exc', 'cause')
729
+ exc = None
730
+ cause = None
731
+
732
+ def raises_not_implemented(self):
733
+ if not self.exc:
734
+ return
735
+ for name in self.exc.nodes_of_class(Name):
736
+ if name.name == 'NotImplementedError':
737
+ return True
738
+
739
+
740
+ class Return(Statement):
741
+ """class representing a Return node"""
742
+ _astroid_fields = ('value',)
743
+ value = None
744
+
745
+
746
+ class Set(NodeNG, Instance, ParentAssignTypeMixin):
747
+ """class representing a Set node"""
748
+ _astroid_fields = ('elts',)
749
+
750
+ def __init__(self, elts=None):
751
+ if elts is None:
752
+ self.elts = []
753
+ else:
754
+ self.elts = [const_factory(e) for e in elts]
755
+
756
+ def pytype(self):
757
+ return '%s.set' % BUILTINS
758
+
759
+ def itered(self):
760
+ return self.elts
761
+
762
+
763
+ class Slice(NodeNG):
764
+ """class representing a Slice node"""
765
+ _astroid_fields = ('lower', 'upper', 'step')
766
+ lower = None
767
+ upper = None
768
+ step = None
769
+
770
+ class Starred(NodeNG, ParentAssignTypeMixin):
771
+ """class representing a Starred node"""
772
+ _astroid_fields = ('value',)
773
+ value = None
774
+
775
+
776
+ class Subscript(NodeNG):
777
+ """class representing a Subscript node"""
778
+ _astroid_fields = ('value', 'slice')
779
+ value = None
780
+ slice = None
781
+
782
+
783
+ class TryExcept(BlockRangeMixIn, Statement):
784
+ """class representing a TryExcept node"""
785
+ _astroid_fields = ('body', 'handlers', 'orelse',)
786
+ body = None
787
+ handlers = None
788
+ orelse = None
789
+
790
+ def _infer_name(self, frame, name):
791
+ return name
792
+
793
+ def _blockstart_toline(self):
794
+ return self.lineno
795
+
796
+ def block_range(self, lineno):
797
+ """handle block line numbers range for try/except statements"""
798
+ last = None
799
+ for exhandler in self.handlers:
800
+ if exhandler.type and lineno == exhandler.type.fromlineno:
801
+ return lineno, lineno
802
+ if exhandler.body[0].fromlineno <= lineno <= exhandler.body[-1].tolineno:
803
+ return lineno, exhandler.body[-1].tolineno
804
+ if last is None:
805
+ last = exhandler.body[0].fromlineno - 1
806
+ return self._elsed_block_range(lineno, self.orelse, last)
807
+
808
+
809
+ class TryFinally(BlockRangeMixIn, Statement):
810
+ """class representing a TryFinally node"""
811
+ _astroid_fields = ('body', 'finalbody',)
812
+ body = None
813
+ finalbody = None
814
+
815
+ def _blockstart_toline(self):
816
+ return self.lineno
817
+
818
+ def block_range(self, lineno):
819
+ """handle block line numbers range for try/finally statements"""
820
+ child = self.body[0]
821
+ # py2.5 try: except: finally:
822
+ if (isinstance(child, TryExcept) and child.fromlineno == self.fromlineno
823
+ and lineno > self.fromlineno and lineno <= child.tolineno):
824
+ return child.block_range(lineno)
825
+ return self._elsed_block_range(lineno, self.finalbody)
826
+
827
+
828
+ class Tuple(NodeNG, Instance, ParentAssignTypeMixin):
829
+ """class representing a Tuple node"""
830
+ _astroid_fields = ('elts',)
831
+
832
+ def __init__(self, elts=None):
833
+ if elts is None:
834
+ self.elts = []
835
+ else:
836
+ self.elts = [const_factory(e) for e in elts]
837
+
838
+ def pytype(self):
839
+ return '%s.tuple' % BUILTINS
840
+
841
+ def getitem(self, index, context=None):
842
+ return self.elts[index]
843
+
844
+ def itered(self):
845
+ return self.elts
846
+
847
+
848
+ class UnaryOp(NodeNG):
849
+ """class representing an UnaryOp node"""
850
+ _astroid_fields = ('operand',)
851
+ operand = None
852
+
853
+
854
+ class While(BlockRangeMixIn, Statement):
855
+ """class representing a While node"""
856
+ _astroid_fields = ('test', 'body', 'orelse',)
857
+ test = None
858
+ body = None
859
+ orelse = None
860
+
861
+ def _blockstart_toline(self):
862
+ return self.test.tolineno
863
+
864
+ def block_range(self, lineno):
865
+ """handle block line numbers range for for and while statements"""
866
+ return self. _elsed_block_range(lineno, self.orelse)
867
+
868
+
869
+ class With(BlockRangeMixIn, AssignTypeMixin, Statement):
870
+ """class representing a With node"""
871
+ _astroid_fields = ('items', 'body')
872
+ items = None
873
+ body = None
874
+
875
+ def _blockstart_toline(self):
876
+ return self.items[-1][0].tolineno
877
+
878
+ def get_children(self):
879
+ for expr, var in self.items:
880
+ yield expr
881
+ if var:
882
+ yield var
883
+ for elt in self.body:
884
+ yield elt
885
+
886
+ class Yield(NodeNG):
887
+ """class representing a Yield node"""
888
+ _astroid_fields = ('value',)
889
+ value = None
890
+
891
+ class YieldFrom(Yield):
892
+ """ Class representing a YieldFrom node. """
893
+
894
+ # constants ##############################################################
895
+
896
+ CONST_CLS = {
897
+ list: List,
898
+ tuple: Tuple,
899
+ dict: Dict,
900
+ set: Set,
901
+ type(None): Const,
902
+ }
903
+
904
+ def _update_const_classes():
905
+ """update constant classes, so the keys of CONST_CLS can be reused"""
906
+ klasses = (bool, int, float, complex, str)
907
+ if sys.version_info < (3, 0):
908
+ klasses += (unicode, long)
909
+ if sys.version_info >= (2, 6):
910
+ klasses += (bytes,)
911
+ for kls in klasses:
912
+ CONST_CLS[kls] = Const
913
+ _update_const_classes()
914
+
915
+ def const_factory(value):
916
+ """return an astroid node for a python value"""
917
+ # XXX we should probably be stricter here and only consider stuff in
918
+ # CONST_CLS or do better treatment: in case where value is not in CONST_CLS,
919
+ # we should rather recall the builder on this value than returning an empty
920
+ # node (another option being that const_factory shouldn't be called with something
921
+ # not in CONST_CLS)
922
+ assert not isinstance(value, NodeNG)
923
+ try:
924
+ return CONST_CLS[value.__class__](value)
925
+ except (KeyError, AttributeError):
926
+ node = EmptyNode()
927
+ node.object = value
928
+ return node