exercism-analysis 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/exercism-analysis.gemspec +30 -0
- data/lib/exercism-analysis.rb +38 -0
- data/lib/exercism-analysis/adapters/adapter.rb +23 -0
- data/lib/exercism-analysis/adapters/clojure.rb +13 -0
- data/lib/exercism-analysis/adapters/go.rb +19 -0
- data/lib/exercism-analysis/adapters/javascript.rb +13 -0
- data/lib/exercism-analysis/adapters/python.rb +13 -0
- data/lib/exercism-analysis/adapters/ruby.rb +19 -0
- data/lib/exercism-analysis/analysis.rb +18 -0
- data/lib/exercism-analysis/analyzers/analyzer.rb +54 -0
- data/lib/exercism-analysis/analyzers/clojure/kibit.rb +25 -0
- data/lib/exercism-analysis/analyzers/go/golint.rb +23 -0
- data/lib/exercism-analysis/analyzers/javascript/jslint.rb +24 -0
- data/lib/exercism-analysis/analyzers/python/pylint.rb +24 -0
- data/lib/exercism-analysis/analyzers/ruby/control_flow.rb +21 -0
- data/lib/exercism-analysis/analyzers/ruby/enumerable_condition.rb +21 -0
- data/lib/exercism-analysis/analyzers/ruby/for_loop.rb +29 -0
- data/lib/exercism-analysis/analyzers/ruby/indentation.rb +21 -0
- data/lib/exercism-analysis/analyzers/ruby/iter_mutation.rb +37 -0
- data/lib/exercism-analysis/analyzers/ruby/output.rb +20 -0
- data/lib/exercism-analysis/analyzers/ruby/range.rb +28 -0
- data/lib/exercism-analysis/analyzers/ruby/roodi.rb +19 -0
- data/lib/exercism-analysis/analyzers/ruby/send.rb +25 -0
- data/lib/exercism-analysis/analyzers/ruby/shebang.rb +23 -0
- data/lib/exercism-analysis/analyzers/ruby/tab.rb +38 -0
- data/lib/exercism-analysis/processors/call_processor.rb +39 -0
- data/lib/exercism-analysis/processors/control_flow_processor.rb +27 -0
- data/lib/exercism-analysis/processors/enumerable_condition_processor.rb +31 -0
- data/lib/exercism-analysis/processors/for_loop_processor.rb +21 -0
- data/lib/exercism-analysis/processors/indentation_processor.rb +69 -0
- data/lib/exercism-analysis/processors/iter_mutation_processor.rb +50 -0
- data/lib/exercism-analysis/processors/processor.rb +34 -0
- data/lib/exercism-analysis/processors/range_processor.rb +23 -0
- data/lib/exercism-analysis/processors/send_processor.rb +23 -0
- data/lib/exercism-analysis/templates/each_to_map.rb +29 -0
- data/lib/exercism-analysis/templates/each_to_select.rb +31 -0
- data/lib/exercism-analysis/templates/range_exclusive.rb +19 -0
- data/lib/exercism-analysis/templates/template.rb +29 -0
- data/vendor/clojure/kibit-runner/LICENSE +214 -0
- data/vendor/clojure/kibit-runner/project.clj +10 -0
- data/vendor/clojure/kibit-runner/src/kibit_runner/core.clj +17 -0
- data/vendor/clojure/kibit-runner/target/kibit-runner-0.1.0-SNAPSHOT-standalone.jar +0 -0
- data/vendor/clojure/kibit-runner/target/kibit-runner-0.1.0-SNAPSHOT.jar +0 -0
- data/vendor/clojure/kibit-runner/target/stale/extract-native.dependencies +1 -0
- data/vendor/go/src/github.com/golang/lint/LICENSE +27 -0
- data/vendor/go/src/github.com/golang/lint/README +59 -0
- data/vendor/go/src/github.com/golang/lint/golint/golint.go +67 -0
- data/vendor/go/src/github.com/golang/lint/lint.go +1061 -0
- data/vendor/go/src/runner/golint_runner.go +23 -0
- data/vendor/javascript/jshint_runner.js +6 -0
- data/vendor/javascript/node_modules/jshint/README.md +47 -0
- data/vendor/javascript/node_modules/jshint/bin/apply +6 -0
- data/vendor/javascript/node_modules/jshint/bin/build +36 -0
- data/vendor/javascript/node_modules/jshint/bin/changelog +36 -0
- data/vendor/javascript/node_modules/jshint/bin/jshint +3 -0
- data/vendor/javascript/node_modules/jshint/bin/land +34 -0
- data/vendor/javascript/node_modules/jshint/data/ascii-identifier-data.js +22 -0
- data/vendor/javascript/node_modules/jshint/data/non-ascii-identifier-part-only.js +1570 -0
- data/vendor/javascript/node_modules/jshint/data/non-ascii-identifier-start.js +48477 -0
- data/vendor/javascript/node_modules/jshint/dist/jshint-rhino.js +60642 -0
- data/vendor/javascript/node_modules/jshint/dist/jshint.js +60525 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/README.md +196 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/cli.js +1139 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/cat.js +17 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/command.js +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/echo.js +54 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/glob.js +6 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/long_desc.js +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/progress.js +11 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/sort.js +18 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/spinner.js +9 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/static.coffee +27 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/static.js +25 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/index.js +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/LICENSE +27 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/README.md +250 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/examples/g.js +9 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/examples/usr-local.js +9 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/glob.js +728 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/LICENSE +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/README.md +42 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits.js +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits_browser.js +23 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/package.json +51 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/test.js +25 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/package.json +58 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/00-setup.js +176 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-comparison.js +63 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-results.json +351 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/cwd-test.js +55 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/globstar-match.js +19 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/mark.js +118 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/new-glob-optional-options.js +10 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/nocase-nomagic.js +113 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/pause-resume.js +73 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/readme-issue.js +36 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/root-nomount.js +39 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/root.js +46 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/stat.js +32 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/zz-cleanup.js +11 -0
- data/vendor/javascript/node_modules/jshint/node_modules/cli/package.json +70 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/LICENCE +19 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/README.md +33 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/index.js +86 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/LICENCE +19 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/README.md +45 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/index.js +5 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/package.json +89 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/seed.js +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/test/index.js +28 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/test/static/index.html +10 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/package.json +88 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/test/index.js +67 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/test/static/index.html +12 -0
- data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/test/static/test-adapter.js +53 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/Gruntfile.js +48 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/LICENSE-MIT +22 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/README.md +75 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/lib/exit.js +41 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/package.json +69 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/exit_test.js +121 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/10-stderr.txt +10 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/10-stdout-stderr.txt +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/10-stdout.txt +10 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/100-stderr.txt +100 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/100-stdout-stderr.txt +200 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/100-stdout.txt +100 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/1000-stderr.txt +1000 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/1000-stdout-stderr.txt +2000 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/1000-stdout.txt +1000 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/create-files.sh +8 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/log-broken.js +23 -0
- data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/log.js +25 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/LICENSE +18 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/README.md +83 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/CollectingHandler.js +55 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/FeedHandler.js +95 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/Parser.js +337 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/ProxyHandler.js +27 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/Stream.js +35 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/Tokenizer.js +891 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/WritableStream.js +21 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/index.js +68 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/LICENSE +11 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/index.js +14 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/package.json +40 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/readme.md +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/LICENSE +11 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/index.js +211 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/package.json +68 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/readme.md +102 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/01-basic.json +57 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/02-single_tag_1.json +21 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/03-single_tag_2.json +21 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/04-unescaped_in_script.json +27 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/05-tags_in_comment.json +18 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/06-comment_in_script.json +18 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/07-unescaped_in_style.json +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/08-extra_spaces_in_tag.json +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/09-unquoted_attrib.json +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/10-singular_attribute.json +15 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/11-text_outside_tags.json +40 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/12-text_only.json +11 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/13-comment_in_text.json +19 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/14-comment_in_text_in_script.json +18 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/15-non-verbose.json +22 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/16-normalize_whitespace.json +47 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/17-xml_namespace.json +18 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/18-enforce_empty_tags.json +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/19-ignore_empty_tags.json +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/20-template_script_tags.json +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/21-conditional_comments.json +15 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/22-lowercase_tags.json +41 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/23-dom-lvl1.json +121 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/tests.js +58 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/LICENSE +11 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/index.js +14 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/helpers.js +141 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/legacy.js +87 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js +77 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/querying.js +94 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/stringify.js +93 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/traversal.js +24 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/package.json +71 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/readme.md +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/fixture.js +6 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/tests/helpers.js +89 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/tests/legacy.js +119 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/utils.js +9 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/LICENSE +11 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/index.js +31 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/lib/decode.js +72 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/lib/decode_codepoint.js +26 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/lib/encode.js +48 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/decode.json +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/entities.json +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/legacy.json +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/xml.json +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/package.json +79 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/readme.md +31 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/test/mocha.opts +2 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/test/test.js +150 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/LICENSE +18 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/README.md +15 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/duplex.js +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/float.patch +923 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_duplex.js +89 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_passthrough.js +46 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_readable.js +944 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_transform.js +209 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_writable.js +472 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/README.md +3 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/float.patch +604 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +107 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/package.json +53 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/util.js +106 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/LICENSE +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/README.md +42 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/inherits.js +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/inherits_browser.js +23 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/package.json +51 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/test.js +25 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/README.md +54 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/build/build.js +209 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/component.json +19 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/index.js +3 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/package.json +54 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/LICENSE +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/README.md +7 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/index.js +200 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/package.json +53 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/package.json +68 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/passthrough.js +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/readable.js +7 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/transform.js +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/writable.js +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/package.json +90 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/01-events.js +9 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/02-stream.js +23 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/03-feed.js +19 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/Atom_Example.xml +25 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/Attributes.html +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/Basic.html +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/RDF_Example.xml +63 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/RSS_Example.xml +48 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/01-simple.json +44 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/02-template.json +63 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/03-lowercase_tags.json +46 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/04-cdata.json +50 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/05-cdata-special.json +35 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/06-leading-lt.json +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/07-self-closing.json +67 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/08-implicit-close-tags.json +59 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/09-attributes.json +68 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/10-crazy-attrib.json +52 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/11-script_in_script.json +54 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/12-long-comment-end.json +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/13-long-cdata-end.json +22 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/14-implicit-open-tags.json +27 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/15-lt-whitespace.json +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/16-double_attribs.json +45 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/17-numeric_entities.json +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/18-legacy_entities.json +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/19-named_entities.json +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/20-xml_entities.json +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/21-entity_in_attribute.json +38 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/22-double_brackets.json +41 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/23-legacy_entity_fail.json +16 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/24-special_special.json +133 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/25-empty_tag_name.json +13 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/26-not-quite-closed.json +35 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/27-entities_in_attributes.json +62 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/28-cdata_in_html.json +9 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/29-comment_edge-cases.json +18 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/30-cdata_edge-cases.json +22 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Feeds/01-rss.js +34 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Feeds/02-atom.js +18 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Feeds/03-rdf.js +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/01-basic.json +83 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/02-RSS.json +1093 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/03-Atom.json +644 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/04-RDF.json +1399 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/05-Attributes.json +354 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/api.js +63 -0
- data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/test-helper.js +83 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/LICENSE +23 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/README.md +218 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/minimatch.js +1061 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS +14 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/LICENSE +23 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/README.md +97 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +252 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/package.json +50 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/basic.js +369 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +52 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +50 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/LICENSE +27 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/README.md +53 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/bench.js +283 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/package.json +58 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/sigmund.js +39 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/test/basic.js +24 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/package.json +57 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/basic.js +399 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/brace-expand.js +33 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/caching.js +14 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/defaults.js +274 -0
- data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/extglob-ending-with-state-char.js +8 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/LICENSE +26 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/README.md +569 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/bin/shjs +51 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/global.js +3 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/make.js +47 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/package.json +61 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/scripts/generate-docs.js +21 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/scripts/run-tests.js +50 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/shell.js +157 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/cat.js +43 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/cd.js +19 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/chmod.js +208 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/common.js +203 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/cp.js +201 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/dirs.js +191 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/echo.js +20 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/error.js +10 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/exec.js +181 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/find.js +51 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/grep.js +52 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/ln.js +53 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/ls.js +126 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/mkdir.js +68 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/mv.js +80 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/popd.js +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/pushd.js +1 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/pwd.js +11 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/rm.js +145 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/sed.js +43 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/tempdir.js +56 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/test.js +85 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/to.js +29 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/toEnd.js +29 -0
- data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/which.js +83 -0
- data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/cli.js +41 -0
- data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/package.json +76 -0
- data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/readme.md +74 -0
- data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/strip-json-comments.js +64 -0
- data/vendor/javascript/node_modules/jshint/node_modules/underscore/LICENSE +23 -0
- data/vendor/javascript/node_modules/jshint/node_modules/underscore/README.md +22 -0
- data/vendor/javascript/node_modules/jshint/node_modules/underscore/package.json +66 -0
- data/vendor/javascript/node_modules/jshint/node_modules/underscore/underscore-min.js +6 -0
- data/vendor/javascript/node_modules/jshint/node_modules/underscore/underscore.js +1343 -0
- data/vendor/javascript/node_modules/jshint/package.json +80 -0
- data/vendor/javascript/node_modules/jshint/src/cli.js +731 -0
- data/vendor/javascript/node_modules/jshint/src/jshint.js +5023 -0
- data/vendor/javascript/node_modules/jshint/src/lex.js +1650 -0
- data/vendor/javascript/node_modules/jshint/src/messages.js +223 -0
- data/vendor/javascript/node_modules/jshint/src/platforms/rhino.js +115 -0
- data/vendor/javascript/node_modules/jshint/src/reg.js +38 -0
- data/vendor/javascript/node_modules/jshint/src/reporters/checkstyle.js +81 -0
- data/vendor/javascript/node_modules/jshint/src/reporters/default.js +34 -0
- data/vendor/javascript/node_modules/jshint/src/reporters/jslint_xml.js +57 -0
- data/vendor/javascript/node_modules/jshint/src/reporters/non_error.js +52 -0
- data/vendor/javascript/node_modules/jshint/src/state.js +28 -0
- data/vendor/javascript/node_modules/jshint/src/style.js +143 -0
- data/vendor/javascript/node_modules/jshint/src/vars.js +658 -0
- data/vendor/python/astroid/COPYING +339 -0
- data/vendor/python/astroid/COPYING.LESSER +510 -0
- data/vendor/python/astroid/ChangeLog +574 -0
- data/vendor/python/astroid/MANIFEST.in +9 -0
- data/vendor/python/astroid/README +56 -0
- data/vendor/python/astroid/README.Python3 +26 -0
- data/vendor/python/astroid/__init__.py +118 -0
- data/vendor/python/astroid/__init__.pyc +0 -0
- data/vendor/python/astroid/__pkginfo__.py +48 -0
- data/vendor/python/astroid/__pkginfo__.pyc +0 -0
- data/vendor/python/astroid/announce.txt +23 -0
- data/vendor/python/astroid/as_string.py +496 -0
- data/vendor/python/astroid/as_string.pyc +0 -0
- data/vendor/python/astroid/bases.py +618 -0
- data/vendor/python/astroid/bases.pyc +0 -0
- data/vendor/python/astroid/brain/py2gi.py +159 -0
- data/vendor/python/astroid/brain/py2gi.pyc +0 -0
- data/vendor/python/astroid/brain/py2mechanize.py +20 -0
- data/vendor/python/astroid/brain/py2mechanize.pyc +0 -0
- data/vendor/python/astroid/brain/py2qt4.py +25 -0
- data/vendor/python/astroid/brain/py2qt4.pyc +0 -0
- data/vendor/python/astroid/brain/py2stdlib.py +252 -0
- data/vendor/python/astroid/brain/py2stdlib.pyc +0 -0
- data/vendor/python/astroid/builder.py +238 -0
- data/vendor/python/astroid/builder.pyc +0 -0
- data/vendor/python/astroid/exceptions.py +51 -0
- data/vendor/python/astroid/exceptions.pyc +0 -0
- data/vendor/python/astroid/inference.py +393 -0
- data/vendor/python/astroid/inference.pyc +0 -0
- data/vendor/python/astroid/inspector.py +275 -0
- data/vendor/python/astroid/manager.py +336 -0
- data/vendor/python/astroid/manager.pyc +0 -0
- data/vendor/python/astroid/mixins.py +122 -0
- data/vendor/python/astroid/mixins.pyc +0 -0
- data/vendor/python/astroid/node_classes.py +928 -0
- data/vendor/python/astroid/node_classes.pyc +0 -0
- data/vendor/python/astroid/nodes.py +73 -0
- data/vendor/python/astroid/nodes.pyc +0 -0
- data/vendor/python/astroid/protocols.py +322 -0
- data/vendor/python/astroid/protocols.pyc +0 -0
- data/vendor/python/astroid/raw_building.py +361 -0
- data/vendor/python/astroid/raw_building.pyc +0 -0
- data/vendor/python/astroid/rebuilder.py +954 -0
- data/vendor/python/astroid/rebuilder.pyc +0 -0
- data/vendor/python/astroid/scoped_nodes.py +1118 -0
- data/vendor/python/astroid/scoped_nodes.pyc +0 -0
- data/vendor/python/astroid/setup.py +184 -0
- data/vendor/python/astroid/tox.ini +10 -0
- data/vendor/python/astroid/utils.py +236 -0
- data/vendor/python/astroid/utils.pyc +0 -0
- data/vendor/python/logilab/__init__.py +0 -0
- data/vendor/python/logilab/__init__.pyc +0 -0
- data/vendor/python/logilab/common/COPYING +339 -0
- data/vendor/python/logilab/common/COPYING.LESSER +510 -0
- data/vendor/python/logilab/common/ChangeLog +1517 -0
- data/vendor/python/logilab/common/MANIFEST.in +13 -0
- data/vendor/python/logilab/common/README +185 -0
- data/vendor/python/logilab/common/README.Python3 +29 -0
- data/vendor/python/logilab/common/__init__.py +171 -0
- data/vendor/python/logilab/common/__init__.pyc +0 -0
- data/vendor/python/logilab/common/__pkginfo__.py +53 -0
- data/vendor/python/logilab/common/__pkginfo__.pyc +0 -0
- data/vendor/python/logilab/common/announce.txt +25 -0
- data/vendor/python/logilab/common/bin/pytest +7 -0
- data/vendor/python/logilab/common/bin/pytest.bat +17 -0
- data/vendor/python/logilab/common/cache.py +114 -0
- data/vendor/python/logilab/common/changelog.py +236 -0
- data/vendor/python/logilab/common/changelog.pyc +0 -0
- data/vendor/python/logilab/common/clcommands.py +332 -0
- data/vendor/python/logilab/common/cli.py +208 -0
- data/vendor/python/logilab/common/compat.py +243 -0
- data/vendor/python/logilab/common/compat.pyc +0 -0
- data/vendor/python/logilab/common/configuration.py +1094 -0
- data/vendor/python/logilab/common/configuration.pyc +0 -0
- data/vendor/python/logilab/common/contexts.py +5 -0
- data/vendor/python/logilab/common/corbautils.py +117 -0
- data/vendor/python/logilab/common/daemon.py +100 -0
- data/vendor/python/logilab/common/date.py +333 -0
- data/vendor/python/logilab/common/dbf.py +229 -0
- data/vendor/python/logilab/common/debugger.py +210 -0
- data/vendor/python/logilab/common/decorators.py +281 -0
- data/vendor/python/logilab/common/decorators.pyc +0 -0
- data/vendor/python/logilab/common/deprecation.py +188 -0
- data/vendor/python/logilab/common/deprecation.pyc +0 -0
- data/vendor/python/logilab/common/fileutils.py +402 -0
- data/vendor/python/logilab/common/graph.py +276 -0
- data/vendor/python/logilab/common/graph.pyc +0 -0
- data/vendor/python/logilab/common/hg.py +130 -0
- data/vendor/python/logilab/common/interface.py +71 -0
- data/vendor/python/logilab/common/interface.pyc +0 -0
- data/vendor/python/logilab/common/logging_ext.py +193 -0
- data/vendor/python/logilab/common/modutils.py +695 -0
- data/vendor/python/logilab/common/modutils.pyc +0 -0
- data/vendor/python/logilab/common/optik_ext.py +391 -0
- data/vendor/python/logilab/common/optik_ext.pyc +0 -0
- data/vendor/python/logilab/common/optparser.py +90 -0
- data/vendor/python/logilab/common/proc.py +277 -0
- data/vendor/python/logilab/common/pyro_ext.py +180 -0
- data/vendor/python/logilab/common/pytest.py +1177 -0
- data/vendor/python/logilab/common/python-logilab-common.spec +184 -0
- data/vendor/python/logilab/common/registry.py +1113 -0
- data/vendor/python/logilab/common/setup.cfg +3 -0
- data/vendor/python/logilab/common/setup.py +189 -0
- data/vendor/python/logilab/common/shellutils.py +455 -0
- data/vendor/python/logilab/common/sphinx_ext.py +87 -0
- data/vendor/python/logilab/common/sphinxutils.py +122 -0
- data/vendor/python/logilab/common/table.py +925 -0
- data/vendor/python/logilab/common/tasksqueue.py +100 -0
- data/vendor/python/logilab/common/textutils.py +534 -0
- data/vendor/python/logilab/common/textutils.pyc +0 -0
- data/vendor/python/logilab/common/tree.py +369 -0
- data/vendor/python/logilab/common/tree.pyc +0 -0
- data/vendor/python/logilab/common/umessage.py +190 -0
- data/vendor/python/logilab/common/ureports/__init__.py +174 -0
- data/vendor/python/logilab/common/ureports/__init__.pyc +0 -0
- data/vendor/python/logilab/common/ureports/docbook_writer.py +139 -0
- data/vendor/python/logilab/common/ureports/html_writer.py +131 -0
- data/vendor/python/logilab/common/ureports/html_writer.pyc +0 -0
- data/vendor/python/logilab/common/ureports/nodes.py +201 -0
- data/vendor/python/logilab/common/ureports/nodes.pyc +0 -0
- data/vendor/python/logilab/common/ureports/text_writer.py +140 -0
- data/vendor/python/logilab/common/ureports/text_writer.pyc +0 -0
- data/vendor/python/logilab/common/urllib2ext.py +87 -0
- data/vendor/python/logilab/common/vcgutils.py +216 -0
- data/vendor/python/logilab/common/visitor.py +107 -0
- data/vendor/python/logilab/common/visitor.pyc +0 -0
- data/vendor/python/logilab/common/xmlrpcutils.py +131 -0
- data/vendor/python/logilab/common/xmlutils.py +61 -0
- data/vendor/python/pylint/CONTRIBUTORS.txt +38 -0
- data/vendor/python/pylint/COPYING +340 -0
- data/vendor/python/pylint/ChangeLog +1437 -0
- data/vendor/python/pylint/DEPENDS +3 -0
- data/vendor/python/pylint/MANIFEST.in +14 -0
- data/vendor/python/pylint/README +50 -0
- data/vendor/python/pylint/README.Python3 +37 -0
- data/vendor/python/pylint/__init__.py +44 -0
- data/vendor/python/pylint/__init__.pyc +0 -0
- data/vendor/python/pylint/__main__.py +3 -0
- data/vendor/python/pylint/__pkginfo__.py +74 -0
- data/vendor/python/pylint/__pkginfo__.pyc +0 -0
- data/vendor/python/pylint/bin/epylint +3 -0
- data/vendor/python/pylint/bin/epylint.bat +5 -0
- data/vendor/python/pylint/bin/pylint +3 -0
- data/vendor/python/pylint/bin/pylint-gui +3 -0
- data/vendor/python/pylint/bin/pylint-gui.bat +5 -0
- data/vendor/python/pylint/bin/pylint.bat +5 -0
- data/vendor/python/pylint/bin/pyreverse +3 -0
- data/vendor/python/pylint/bin/pyreverse.bat +5 -0
- data/vendor/python/pylint/bin/symilar +3 -0
- data/vendor/python/pylint/bin/symilar.bat +5 -0
- data/vendor/python/pylint/checkers/__init__.py +145 -0
- data/vendor/python/pylint/checkers/__init__.pyc +0 -0
- data/vendor/python/pylint/checkers/base.py +1141 -0
- data/vendor/python/pylint/checkers/base.pyc +0 -0
- data/vendor/python/pylint/checkers/classes.py +792 -0
- data/vendor/python/pylint/checkers/classes.pyc +0 -0
- data/vendor/python/pylint/checkers/design_analysis.py +367 -0
- data/vendor/python/pylint/checkers/design_analysis.pyc +0 -0
- data/vendor/python/pylint/checkers/exceptions.py +306 -0
- data/vendor/python/pylint/checkers/exceptions.pyc +0 -0
- data/vendor/python/pylint/checkers/format.py +943 -0
- data/vendor/python/pylint/checkers/format.pyc +0 -0
- data/vendor/python/pylint/checkers/imports.py +394 -0
- data/vendor/python/pylint/checkers/imports.pyc +0 -0
- data/vendor/python/pylint/checkers/logging.py +213 -0
- data/vendor/python/pylint/checkers/logging.pyc +0 -0
- data/vendor/python/pylint/checkers/misc.py +90 -0
- data/vendor/python/pylint/checkers/misc.pyc +0 -0
- data/vendor/python/pylint/checkers/newstyle.py +151 -0
- data/vendor/python/pylint/checkers/newstyle.pyc +0 -0
- data/vendor/python/pylint/checkers/raw_metrics.py +129 -0
- data/vendor/python/pylint/checkers/raw_metrics.pyc +0 -0
- data/vendor/python/pylint/checkers/similar.py +365 -0
- data/vendor/python/pylint/checkers/similar.pyc +0 -0
- data/vendor/python/pylint/checkers/stdlib.py +69 -0
- data/vendor/python/pylint/checkers/stdlib.pyc +0 -0
- data/vendor/python/pylint/checkers/strings.py +304 -0
- data/vendor/python/pylint/checkers/strings.pyc +0 -0
- data/vendor/python/pylint/checkers/typecheck.py +451 -0
- data/vendor/python/pylint/checkers/typecheck.pyc +0 -0
- data/vendor/python/pylint/checkers/utils.py +416 -0
- data/vendor/python/pylint/checkers/utils.pyc +0 -0
- data/vendor/python/pylint/checkers/variables.py +741 -0
- data/vendor/python/pylint/checkers/variables.pyc +0 -0
- data/vendor/python/pylint/config.py +156 -0
- data/vendor/python/pylint/config.pyc +0 -0
- data/vendor/python/pylint/epylint.py +175 -0
- data/vendor/python/pylint/gui.py +508 -0
- data/vendor/python/pylint/interfaces.py +72 -0
- data/vendor/python/pylint/interfaces.pyc +0 -0
- data/vendor/python/pylint/lint.py +1106 -0
- data/vendor/python/pylint/lint.pyc +0 -0
- data/vendor/python/pylint/pyreverse/__init__.py +5 -0
- data/vendor/python/pylint/pyreverse/diadefslib.py +233 -0
- data/vendor/python/pylint/pyreverse/diagrams.py +247 -0
- data/vendor/python/pylint/pyreverse/main.py +124 -0
- data/vendor/python/pylint/pyreverse/utils.py +131 -0
- data/vendor/python/pylint/pyreverse/writer.py +199 -0
- data/vendor/python/pylint/reporters/__init__.py +138 -0
- data/vendor/python/pylint/reporters/__init__.pyc +0 -0
- data/vendor/python/pylint/reporters/guireporter.py +28 -0
- data/vendor/python/pylint/reporters/guireporter.pyc +0 -0
- data/vendor/python/pylint/reporters/html.py +70 -0
- data/vendor/python/pylint/reporters/html.pyc +0 -0
- data/vendor/python/pylint/reporters/text.py +143 -0
- data/vendor/python/pylint/reporters/text.pyc +0 -0
- data/vendor/python/pylint/setup.cfg +3 -0
- data/vendor/python/pylint/setup.py +203 -0
- data/vendor/python/pylint/tox.ini +10 -0
- data/vendor/python/pylint/utils.py +744 -0
- data/vendor/python/pylint/utils.pyc +0 -0
- data/vendor/python/pylint_runner.py +22 -0
- metadata +675 -0
Binary file
|
@@ -0,0 +1,618 @@
|
|
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 base classes and functions for the nodes and some
|
19
|
+
inference utils.
|
20
|
+
"""
|
21
|
+
|
22
|
+
__docformat__ = "restructuredtext en"
|
23
|
+
|
24
|
+
import sys
|
25
|
+
from contextlib import contextmanager
|
26
|
+
|
27
|
+
from astroid.exceptions import (InferenceError, AstroidError, NotFoundError,
|
28
|
+
UnresolvableName, UseInferenceDefault)
|
29
|
+
|
30
|
+
|
31
|
+
if sys.version_info >= (3, 0):
|
32
|
+
BUILTINS = 'builtins'
|
33
|
+
else:
|
34
|
+
BUILTINS = '__builtin__'
|
35
|
+
|
36
|
+
|
37
|
+
class Proxy(object):
|
38
|
+
"""a simple proxy object"""
|
39
|
+
|
40
|
+
_proxied = None # proxied object may be set by class or by instance
|
41
|
+
|
42
|
+
def __init__(self, proxied=None):
|
43
|
+
if proxied is not None:
|
44
|
+
self._proxied = proxied
|
45
|
+
|
46
|
+
def __getattr__(self, name):
|
47
|
+
if name == '_proxied':
|
48
|
+
return getattr(self.__class__, '_proxied')
|
49
|
+
if name in self.__dict__:
|
50
|
+
return self.__dict__[name]
|
51
|
+
return getattr(self._proxied, name)
|
52
|
+
|
53
|
+
def infer(self, context=None):
|
54
|
+
yield self
|
55
|
+
|
56
|
+
|
57
|
+
# Inference ##################################################################
|
58
|
+
|
59
|
+
class InferenceContext(object):
|
60
|
+
__slots__ = ('path', 'lookupname', 'callcontext', 'boundnode')
|
61
|
+
|
62
|
+
def __init__(self, path=None):
|
63
|
+
if path is None:
|
64
|
+
self.path = set()
|
65
|
+
else:
|
66
|
+
self.path = path
|
67
|
+
self.lookupname = None
|
68
|
+
self.callcontext = None
|
69
|
+
self.boundnode = None
|
70
|
+
|
71
|
+
def push(self, node):
|
72
|
+
name = self.lookupname
|
73
|
+
if (node, name) in self.path:
|
74
|
+
raise StopIteration()
|
75
|
+
self.path.add( (node, name) )
|
76
|
+
|
77
|
+
def clone(self):
|
78
|
+
# XXX copy lookupname/callcontext ?
|
79
|
+
clone = InferenceContext(self.path)
|
80
|
+
clone.callcontext = self.callcontext
|
81
|
+
clone.boundnode = self.boundnode
|
82
|
+
return clone
|
83
|
+
|
84
|
+
@contextmanager
|
85
|
+
def restore_path(self):
|
86
|
+
path = set(self.path)
|
87
|
+
yield
|
88
|
+
self.path = path
|
89
|
+
|
90
|
+
def copy_context(context):
|
91
|
+
if context is not None:
|
92
|
+
return context.clone()
|
93
|
+
else:
|
94
|
+
return InferenceContext()
|
95
|
+
|
96
|
+
|
97
|
+
def _infer_stmts(stmts, context, frame=None):
|
98
|
+
"""return an iterator on statements inferred by each statement in <stmts>
|
99
|
+
"""
|
100
|
+
stmt = None
|
101
|
+
infered = False
|
102
|
+
if context is not None:
|
103
|
+
name = context.lookupname
|
104
|
+
context = context.clone()
|
105
|
+
else:
|
106
|
+
name = None
|
107
|
+
context = InferenceContext()
|
108
|
+
for stmt in stmts:
|
109
|
+
if stmt is YES:
|
110
|
+
yield stmt
|
111
|
+
infered = True
|
112
|
+
continue
|
113
|
+
context.lookupname = stmt._infer_name(frame, name)
|
114
|
+
try:
|
115
|
+
for infered in stmt.infer(context):
|
116
|
+
yield infered
|
117
|
+
infered = True
|
118
|
+
except UnresolvableName:
|
119
|
+
continue
|
120
|
+
except InferenceError:
|
121
|
+
yield YES
|
122
|
+
infered = True
|
123
|
+
if not infered:
|
124
|
+
raise InferenceError(str(stmt))
|
125
|
+
|
126
|
+
|
127
|
+
# special inference objects (e.g. may be returned as nodes by .infer()) #######
|
128
|
+
|
129
|
+
class _Yes(object):
|
130
|
+
"""a yes object"""
|
131
|
+
def __repr__(self):
|
132
|
+
return 'YES'
|
133
|
+
def __getattribute__(self, name):
|
134
|
+
if name == 'next':
|
135
|
+
raise AttributeError('next method should not be called')
|
136
|
+
if name.startswith('__') and name.endswith('__'):
|
137
|
+
# to avoid inspection pb
|
138
|
+
return super(_Yes, self).__getattribute__(name)
|
139
|
+
return self
|
140
|
+
def __call__(self, *args, **kwargs):
|
141
|
+
return self
|
142
|
+
|
143
|
+
|
144
|
+
YES = _Yes()
|
145
|
+
|
146
|
+
|
147
|
+
class Instance(Proxy):
|
148
|
+
"""a special node representing a class instance"""
|
149
|
+
def getattr(self, name, context=None, lookupclass=True):
|
150
|
+
try:
|
151
|
+
values = self._proxied.instance_attr(name, context)
|
152
|
+
except NotFoundError:
|
153
|
+
if name == '__class__':
|
154
|
+
return [self._proxied]
|
155
|
+
if lookupclass:
|
156
|
+
# class attributes not available through the instance
|
157
|
+
# unless they are explicitly defined
|
158
|
+
if name in ('__name__', '__bases__', '__mro__', '__subclasses__'):
|
159
|
+
return self._proxied.local_attr(name)
|
160
|
+
return self._proxied.getattr(name, context)
|
161
|
+
raise NotFoundError(name)
|
162
|
+
# since we've no context information, return matching class members as
|
163
|
+
# well
|
164
|
+
if lookupclass:
|
165
|
+
try:
|
166
|
+
return values + self._proxied.getattr(name, context)
|
167
|
+
except NotFoundError:
|
168
|
+
pass
|
169
|
+
return values
|
170
|
+
|
171
|
+
def igetattr(self, name, context=None):
|
172
|
+
"""inferred getattr"""
|
173
|
+
try:
|
174
|
+
# avoid recursively inferring the same attr on the same class
|
175
|
+
if context:
|
176
|
+
context.push((self._proxied, name))
|
177
|
+
# XXX frame should be self._proxied, or not ?
|
178
|
+
get_attr = self.getattr(name, context, lookupclass=False)
|
179
|
+
return _infer_stmts(self._wrap_attr(get_attr, context), context,
|
180
|
+
frame=self)
|
181
|
+
except NotFoundError:
|
182
|
+
try:
|
183
|
+
# fallback to class'igetattr since it has some logic to handle
|
184
|
+
# descriptors
|
185
|
+
return self._wrap_attr(self._proxied.igetattr(name, context),
|
186
|
+
context)
|
187
|
+
except NotFoundError:
|
188
|
+
raise InferenceError(name)
|
189
|
+
|
190
|
+
def _wrap_attr(self, attrs, context=None):
|
191
|
+
"""wrap bound methods of attrs in a InstanceMethod proxies"""
|
192
|
+
for attr in attrs:
|
193
|
+
if isinstance(attr, UnboundMethod):
|
194
|
+
if BUILTINS + '.property' in attr.decoratornames():
|
195
|
+
for infered in attr.infer_call_result(self, context):
|
196
|
+
yield infered
|
197
|
+
else:
|
198
|
+
yield BoundMethod(attr, self)
|
199
|
+
else:
|
200
|
+
yield attr
|
201
|
+
|
202
|
+
def infer_call_result(self, caller, context=None):
|
203
|
+
"""infer what a class instance is returning when called"""
|
204
|
+
infered = False
|
205
|
+
for node in self._proxied.igetattr('__call__', context):
|
206
|
+
if node is YES:
|
207
|
+
continue
|
208
|
+
for res in node.infer_call_result(caller, context):
|
209
|
+
infered = True
|
210
|
+
yield res
|
211
|
+
if not infered:
|
212
|
+
raise InferenceError()
|
213
|
+
|
214
|
+
def __repr__(self):
|
215
|
+
return '<Instance of %s.%s at 0x%s>' % (self._proxied.root().name,
|
216
|
+
self._proxied.name,
|
217
|
+
id(self))
|
218
|
+
def __str__(self):
|
219
|
+
return 'Instance of %s.%s' % (self._proxied.root().name,
|
220
|
+
self._proxied.name)
|
221
|
+
|
222
|
+
def callable(self):
|
223
|
+
try:
|
224
|
+
self._proxied.getattr('__call__')
|
225
|
+
return True
|
226
|
+
except NotFoundError:
|
227
|
+
return False
|
228
|
+
|
229
|
+
def pytype(self):
|
230
|
+
return self._proxied.qname()
|
231
|
+
|
232
|
+
def display_type(self):
|
233
|
+
return 'Instance of'
|
234
|
+
|
235
|
+
|
236
|
+
class UnboundMethod(Proxy):
|
237
|
+
"""a special node representing a method not bound to an instance"""
|
238
|
+
def __repr__(self):
|
239
|
+
frame = self._proxied.parent.frame()
|
240
|
+
return '<%s %s of %s at 0x%s' % (self.__class__.__name__,
|
241
|
+
self._proxied.name,
|
242
|
+
frame.qname(), id(self))
|
243
|
+
|
244
|
+
def is_bound(self):
|
245
|
+
return False
|
246
|
+
|
247
|
+
def getattr(self, name, context=None):
|
248
|
+
if name == 'im_func':
|
249
|
+
return [self._proxied]
|
250
|
+
return super(UnboundMethod, self).getattr(name, context)
|
251
|
+
|
252
|
+
def igetattr(self, name, context=None):
|
253
|
+
if name == 'im_func':
|
254
|
+
return iter((self._proxied,))
|
255
|
+
return super(UnboundMethod, self).igetattr(name, context)
|
256
|
+
|
257
|
+
def infer_call_result(self, caller, context):
|
258
|
+
# If we're unbound method __new__ of builtin object, the result is an
|
259
|
+
# instance of the class given as first argument.
|
260
|
+
if (self._proxied.name == '__new__' and
|
261
|
+
self._proxied.parent.frame().qname() == '%s.object' % BUILTINS):
|
262
|
+
return ((x is YES and x or Instance(x))
|
263
|
+
for x in caller.args[0].infer())
|
264
|
+
return self._proxied.infer_call_result(caller, context)
|
265
|
+
|
266
|
+
|
267
|
+
class BoundMethod(UnboundMethod):
|
268
|
+
"""a special node representing a method bound to an instance"""
|
269
|
+
def __init__(self, proxy, bound):
|
270
|
+
UnboundMethod.__init__(self, proxy)
|
271
|
+
self.bound = bound
|
272
|
+
|
273
|
+
def is_bound(self):
|
274
|
+
return True
|
275
|
+
|
276
|
+
def infer_call_result(self, caller, context):
|
277
|
+
context = context.clone()
|
278
|
+
context.boundnode = self.bound
|
279
|
+
return self._proxied.infer_call_result(caller, context)
|
280
|
+
|
281
|
+
|
282
|
+
class Generator(Instance):
|
283
|
+
"""a special node representing a generator.
|
284
|
+
|
285
|
+
Proxied class is set once for all in raw_building.
|
286
|
+
"""
|
287
|
+
def callable(self):
|
288
|
+
return False
|
289
|
+
|
290
|
+
def pytype(self):
|
291
|
+
return '%s.generator' % BUILTINS
|
292
|
+
|
293
|
+
def display_type(self):
|
294
|
+
return 'Generator'
|
295
|
+
|
296
|
+
def __repr__(self):
|
297
|
+
return '<Generator(%s) l.%s at 0x%s>' % (self._proxied.name, self.lineno, id(self))
|
298
|
+
|
299
|
+
def __str__(self):
|
300
|
+
return 'Generator(%s)' % (self._proxied.name)
|
301
|
+
|
302
|
+
|
303
|
+
# decorators ##################################################################
|
304
|
+
|
305
|
+
def path_wrapper(func):
|
306
|
+
"""return the given infer function wrapped to handle the path"""
|
307
|
+
def wrapped(node, context=None, _func=func, **kwargs):
|
308
|
+
"""wrapper function handling context"""
|
309
|
+
if context is None:
|
310
|
+
context = InferenceContext()
|
311
|
+
context.push(node)
|
312
|
+
yielded = set()
|
313
|
+
for res in _func(node, context, **kwargs):
|
314
|
+
# unproxy only true instance, not const, tuple, dict...
|
315
|
+
if res.__class__ is Instance:
|
316
|
+
ares = res._proxied
|
317
|
+
else:
|
318
|
+
ares = res
|
319
|
+
if not ares in yielded:
|
320
|
+
yield res
|
321
|
+
yielded.add(ares)
|
322
|
+
return wrapped
|
323
|
+
|
324
|
+
def yes_if_nothing_infered(func):
|
325
|
+
def wrapper(*args, **kwargs):
|
326
|
+
infered = False
|
327
|
+
for node in func(*args, **kwargs):
|
328
|
+
infered = True
|
329
|
+
yield node
|
330
|
+
if not infered:
|
331
|
+
yield YES
|
332
|
+
return wrapper
|
333
|
+
|
334
|
+
def raise_if_nothing_infered(func):
|
335
|
+
def wrapper(*args, **kwargs):
|
336
|
+
infered = False
|
337
|
+
for node in func(*args, **kwargs):
|
338
|
+
infered = True
|
339
|
+
yield node
|
340
|
+
if not infered:
|
341
|
+
raise InferenceError()
|
342
|
+
return wrapper
|
343
|
+
|
344
|
+
|
345
|
+
# Node ######################################################################
|
346
|
+
|
347
|
+
class NodeNG(object):
|
348
|
+
"""Base Class for all Astroid node classes.
|
349
|
+
|
350
|
+
It represents a node of the new abstract syntax tree.
|
351
|
+
"""
|
352
|
+
is_statement = False
|
353
|
+
optional_assign = False # True for For (and for Comprehension if py <3.0)
|
354
|
+
is_function = False # True for Function nodes
|
355
|
+
# attributes below are set by the builder module or by raw factories
|
356
|
+
lineno = None
|
357
|
+
fromlineno = None
|
358
|
+
tolineno = None
|
359
|
+
col_offset = None
|
360
|
+
# parent node in the tree
|
361
|
+
parent = None
|
362
|
+
# attributes containing child node(s) redefined in most concrete classes:
|
363
|
+
_astroid_fields = ()
|
364
|
+
# instance specific inference function infer(node, context)
|
365
|
+
_explicit_inference = None
|
366
|
+
|
367
|
+
def infer(self, context=None, **kwargs):
|
368
|
+
"""main interface to the interface system, return a generator on infered
|
369
|
+
values.
|
370
|
+
|
371
|
+
If the instance has some explicit inference function set, it will be
|
372
|
+
called instead of the default interface.
|
373
|
+
"""
|
374
|
+
if self._explicit_inference is not None:
|
375
|
+
# explicit_inference is not bound, give it self explicitly
|
376
|
+
try:
|
377
|
+
return self._explicit_inference(self, context, **kwargs)
|
378
|
+
except UseInferenceDefault:
|
379
|
+
pass
|
380
|
+
return self._infer(context, **kwargs)
|
381
|
+
|
382
|
+
def _repr_name(self):
|
383
|
+
"""return self.name or self.attrname or '' for nice representation"""
|
384
|
+
return getattr(self, 'name', getattr(self, 'attrname', ''))
|
385
|
+
|
386
|
+
def __str__(self):
|
387
|
+
return '%s(%s)' % (self.__class__.__name__, self._repr_name())
|
388
|
+
|
389
|
+
def __repr__(self):
|
390
|
+
return '<%s(%s) l.%s [%s] at Ox%x>' % (self.__class__.__name__,
|
391
|
+
self._repr_name(),
|
392
|
+
self.fromlineno,
|
393
|
+
self.root().name,
|
394
|
+
id(self))
|
395
|
+
|
396
|
+
|
397
|
+
def accept(self, visitor):
|
398
|
+
klass = self.__class__.__name__
|
399
|
+
func = getattr(visitor, "visit_" + self.__class__.__name__.lower())
|
400
|
+
return func(self)
|
401
|
+
|
402
|
+
def get_children(self):
|
403
|
+
for field in self._astroid_fields:
|
404
|
+
attr = getattr(self, field)
|
405
|
+
if attr is None:
|
406
|
+
continue
|
407
|
+
if isinstance(attr, (list, tuple)):
|
408
|
+
for elt in attr:
|
409
|
+
yield elt
|
410
|
+
else:
|
411
|
+
yield attr
|
412
|
+
|
413
|
+
def last_child(self):
|
414
|
+
"""an optimized version of list(get_children())[-1]"""
|
415
|
+
for field in self._astroid_fields[::-1]:
|
416
|
+
attr = getattr(self, field)
|
417
|
+
if not attr: # None or empty listy / tuple
|
418
|
+
continue
|
419
|
+
if isinstance(attr, (list, tuple)):
|
420
|
+
return attr[-1]
|
421
|
+
else:
|
422
|
+
return attr
|
423
|
+
return None
|
424
|
+
|
425
|
+
def parent_of(self, node):
|
426
|
+
"""return true if i'm a parent of the given node"""
|
427
|
+
parent = node.parent
|
428
|
+
while parent is not None:
|
429
|
+
if self is parent:
|
430
|
+
return True
|
431
|
+
parent = parent.parent
|
432
|
+
return False
|
433
|
+
|
434
|
+
def statement(self):
|
435
|
+
"""return the first parent node marked as statement node"""
|
436
|
+
if self.is_statement:
|
437
|
+
return self
|
438
|
+
return self.parent.statement()
|
439
|
+
|
440
|
+
def frame(self):
|
441
|
+
"""return the first parent frame node (i.e. Module, Function or Class)
|
442
|
+
"""
|
443
|
+
return self.parent.frame()
|
444
|
+
|
445
|
+
def scope(self):
|
446
|
+
"""return the first node defining a new scope (i.e. Module, Function,
|
447
|
+
Class, Lambda but also GenExpr)
|
448
|
+
"""
|
449
|
+
return self.parent.scope()
|
450
|
+
|
451
|
+
def root(self):
|
452
|
+
"""return the root node of the tree, (i.e. a Module)"""
|
453
|
+
if self.parent:
|
454
|
+
return self.parent.root()
|
455
|
+
return self
|
456
|
+
|
457
|
+
def child_sequence(self, child):
|
458
|
+
"""search for the right sequence where the child lies in"""
|
459
|
+
for field in self._astroid_fields:
|
460
|
+
node_or_sequence = getattr(self, field)
|
461
|
+
if node_or_sequence is child:
|
462
|
+
return [node_or_sequence]
|
463
|
+
# /!\ compiler.ast Nodes have an __iter__ walking over child nodes
|
464
|
+
if isinstance(node_or_sequence, (tuple, list)) and child in node_or_sequence:
|
465
|
+
return node_or_sequence
|
466
|
+
else:
|
467
|
+
msg = 'Could not find %s in %s\'s children'
|
468
|
+
raise AstroidError(msg % (repr(child), repr(self)))
|
469
|
+
|
470
|
+
def locate_child(self, child):
|
471
|
+
"""return a 2-uple (child attribute name, sequence or node)"""
|
472
|
+
for field in self._astroid_fields:
|
473
|
+
node_or_sequence = getattr(self, field)
|
474
|
+
# /!\ compiler.ast Nodes have an __iter__ walking over child nodes
|
475
|
+
if child is node_or_sequence:
|
476
|
+
return field, child
|
477
|
+
if isinstance(node_or_sequence, (tuple, list)) and child in node_or_sequence:
|
478
|
+
return field, node_or_sequence
|
479
|
+
msg = 'Could not find %s in %s\'s children'
|
480
|
+
raise AstroidError(msg % (repr(child), repr(self)))
|
481
|
+
# FIXME : should we merge child_sequence and locate_child ? locate_child
|
482
|
+
# is only used in are_exclusive, child_sequence one time in pylint.
|
483
|
+
|
484
|
+
def next_sibling(self):
|
485
|
+
"""return the next sibling statement"""
|
486
|
+
return self.parent.next_sibling()
|
487
|
+
|
488
|
+
def previous_sibling(self):
|
489
|
+
"""return the previous sibling statement"""
|
490
|
+
return self.parent.previous_sibling()
|
491
|
+
|
492
|
+
def nearest(self, nodes):
|
493
|
+
"""return the node which is the nearest before this one in the
|
494
|
+
given list of nodes
|
495
|
+
"""
|
496
|
+
myroot = self.root()
|
497
|
+
mylineno = self.fromlineno
|
498
|
+
nearest = None, 0
|
499
|
+
for node in nodes:
|
500
|
+
assert node.root() is myroot, \
|
501
|
+
'nodes %s and %s are not from the same module' % (self, node)
|
502
|
+
lineno = node.fromlineno
|
503
|
+
if node.fromlineno > mylineno:
|
504
|
+
break
|
505
|
+
if lineno > nearest[1]:
|
506
|
+
nearest = node, lineno
|
507
|
+
# FIXME: raise an exception if nearest is None ?
|
508
|
+
return nearest[0]
|
509
|
+
|
510
|
+
def set_line_info(self, lastchild):
|
511
|
+
if self.lineno is None:
|
512
|
+
self.fromlineno = self._fixed_source_line()
|
513
|
+
else:
|
514
|
+
self.fromlineno = self.lineno
|
515
|
+
if lastchild is None:
|
516
|
+
self.tolineno = self.fromlineno
|
517
|
+
else:
|
518
|
+
self.tolineno = lastchild.tolineno
|
519
|
+
return
|
520
|
+
# TODO / FIXME:
|
521
|
+
assert self.fromlineno is not None, self
|
522
|
+
assert self.tolineno is not None, self
|
523
|
+
|
524
|
+
def _fixed_source_line(self):
|
525
|
+
"""return the line number where the given node appears
|
526
|
+
|
527
|
+
we need this method since not all nodes have the lineno attribute
|
528
|
+
correctly set...
|
529
|
+
"""
|
530
|
+
line = self.lineno
|
531
|
+
_node = self
|
532
|
+
try:
|
533
|
+
while line is None:
|
534
|
+
_node = _node.get_children().next()
|
535
|
+
line = _node.lineno
|
536
|
+
except StopIteration:
|
537
|
+
_node = self.parent
|
538
|
+
while _node and line is None:
|
539
|
+
line = _node.lineno
|
540
|
+
_node = _node.parent
|
541
|
+
return line
|
542
|
+
|
543
|
+
def block_range(self, lineno):
|
544
|
+
"""handle block line numbers range for non block opening statements
|
545
|
+
"""
|
546
|
+
return lineno, self.tolineno
|
547
|
+
|
548
|
+
def set_local(self, name, stmt):
|
549
|
+
"""delegate to a scoped parent handling a locals dictionary"""
|
550
|
+
self.parent.set_local(name, stmt)
|
551
|
+
|
552
|
+
def nodes_of_class(self, klass, skip_klass=None):
|
553
|
+
"""return an iterator on nodes which are instance of the given class(es)
|
554
|
+
|
555
|
+
klass may be a class object or a tuple of class objects
|
556
|
+
"""
|
557
|
+
if isinstance(self, klass):
|
558
|
+
yield self
|
559
|
+
for child_node in self.get_children():
|
560
|
+
if skip_klass is not None and isinstance(child_node, skip_klass):
|
561
|
+
continue
|
562
|
+
for matching in child_node.nodes_of_class(klass, skip_klass):
|
563
|
+
yield matching
|
564
|
+
|
565
|
+
def _infer_name(self, frame, name):
|
566
|
+
# overridden for From, Import, Global, TryExcept and Arguments
|
567
|
+
return None
|
568
|
+
|
569
|
+
def _infer(self, context=None):
|
570
|
+
"""we don't know how to resolve a statement by default"""
|
571
|
+
# this method is overridden by most concrete classes
|
572
|
+
raise InferenceError(self.__class__.__name__)
|
573
|
+
|
574
|
+
def infered(self):
|
575
|
+
'''return list of infered values for a more simple inference usage'''
|
576
|
+
return list(self.infer())
|
577
|
+
|
578
|
+
def instanciate_class(self):
|
579
|
+
"""instanciate a node if it is a Class node, else return self"""
|
580
|
+
return self
|
581
|
+
|
582
|
+
def has_base(self, node):
|
583
|
+
return False
|
584
|
+
|
585
|
+
def callable(self):
|
586
|
+
return False
|
587
|
+
|
588
|
+
def eq(self, value):
|
589
|
+
return False
|
590
|
+
|
591
|
+
def as_string(self):
|
592
|
+
from astroid.as_string import to_code
|
593
|
+
return to_code(self)
|
594
|
+
|
595
|
+
def repr_tree(self, ids=False):
|
596
|
+
from astroid.as_string import dump
|
597
|
+
return dump(self)
|
598
|
+
|
599
|
+
|
600
|
+
class Statement(NodeNG):
|
601
|
+
"""Statement node adding a few attributes"""
|
602
|
+
is_statement = True
|
603
|
+
|
604
|
+
def next_sibling(self):
|
605
|
+
"""return the next sibling statement"""
|
606
|
+
stmts = self.parent.child_sequence(self)
|
607
|
+
index = stmts.index(self)
|
608
|
+
try:
|
609
|
+
return stmts[index +1]
|
610
|
+
except IndexError:
|
611
|
+
pass
|
612
|
+
|
613
|
+
def previous_sibling(self):
|
614
|
+
"""return the previous sibling statement"""
|
615
|
+
stmts = self.parent.child_sequence(self)
|
616
|
+
index = stmts.index(self)
|
617
|
+
if index >= 1:
|
618
|
+
return stmts[index -1]
|