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,275 @@
|
|
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
|
+
"""visitor doing some postprocessing on the astroid tree.
|
19
|
+
Try to resolve definitions (namespace) dictionary, relationship...
|
20
|
+
|
21
|
+
This module has been imported from pyreverse
|
22
|
+
"""
|
23
|
+
|
24
|
+
__docformat__ = "restructuredtext en"
|
25
|
+
|
26
|
+
from os.path import dirname
|
27
|
+
|
28
|
+
from logilab.common.modutils import get_module_part, is_relative, \
|
29
|
+
is_standard_module
|
30
|
+
|
31
|
+
import astroid
|
32
|
+
from astroid.exceptions import InferenceError
|
33
|
+
from astroid.utils import LocalsVisitor
|
34
|
+
|
35
|
+
class IdGeneratorMixIn:
|
36
|
+
"""
|
37
|
+
Mixin adding the ability to generate integer uid
|
38
|
+
"""
|
39
|
+
def __init__(self, start_value=0):
|
40
|
+
self.id_count = start_value
|
41
|
+
|
42
|
+
def init_counter(self, start_value=0):
|
43
|
+
"""init the id counter
|
44
|
+
"""
|
45
|
+
self.id_count = start_value
|
46
|
+
|
47
|
+
def generate_id(self):
|
48
|
+
"""generate a new identifier
|
49
|
+
"""
|
50
|
+
self.id_count += 1
|
51
|
+
return self.id_count
|
52
|
+
|
53
|
+
|
54
|
+
class Linker(IdGeneratorMixIn, LocalsVisitor):
|
55
|
+
"""
|
56
|
+
walk on the project tree and resolve relationships.
|
57
|
+
|
58
|
+
According to options the following attributes may be added to visited nodes:
|
59
|
+
|
60
|
+
* uid,
|
61
|
+
a unique identifier for the node (on astroid.Project, astroid.Module,
|
62
|
+
astroid.Class and astroid.locals_type). Only if the linker has been instantiated
|
63
|
+
with tag=True parameter (False by default).
|
64
|
+
|
65
|
+
* Function
|
66
|
+
a mapping from locals names to their bounded value, which may be a
|
67
|
+
constant like a string or an integer, or an astroid node (on astroid.Module,
|
68
|
+
astroid.Class and astroid.Function).
|
69
|
+
|
70
|
+
* instance_attrs_type
|
71
|
+
as locals_type but for klass member attributes (only on astroid.Class)
|
72
|
+
|
73
|
+
* implements,
|
74
|
+
list of implemented interface _objects_ (only on astroid.Class nodes)
|
75
|
+
"""
|
76
|
+
|
77
|
+
def __init__(self, project, inherited_interfaces=0, tag=False):
|
78
|
+
IdGeneratorMixIn.__init__(self)
|
79
|
+
LocalsVisitor.__init__(self)
|
80
|
+
# take inherited interface in consideration or not
|
81
|
+
self.inherited_interfaces = inherited_interfaces
|
82
|
+
# tag nodes or not
|
83
|
+
self.tag = tag
|
84
|
+
# visited project
|
85
|
+
self.project = project
|
86
|
+
|
87
|
+
|
88
|
+
def visit_project(self, node):
|
89
|
+
"""visit an astroid.Project node
|
90
|
+
|
91
|
+
* optionally tag the node with a unique id
|
92
|
+
"""
|
93
|
+
if self.tag:
|
94
|
+
node.uid = self.generate_id()
|
95
|
+
for module in node.modules:
|
96
|
+
self.visit(module)
|
97
|
+
|
98
|
+
def visit_package(self, node):
|
99
|
+
"""visit an astroid.Package node
|
100
|
+
|
101
|
+
* optionally tag the node with a unique id
|
102
|
+
"""
|
103
|
+
if self.tag:
|
104
|
+
node.uid = self.generate_id()
|
105
|
+
for subelmt in node.values():
|
106
|
+
self.visit(subelmt)
|
107
|
+
|
108
|
+
def visit_module(self, node):
|
109
|
+
"""visit an astroid.Module node
|
110
|
+
|
111
|
+
* set the locals_type mapping
|
112
|
+
* set the depends mapping
|
113
|
+
* optionally tag the node with a unique id
|
114
|
+
"""
|
115
|
+
if hasattr(node, 'locals_type'):
|
116
|
+
return
|
117
|
+
node.locals_type = {}
|
118
|
+
node.depends = []
|
119
|
+
if self.tag:
|
120
|
+
node.uid = self.generate_id()
|
121
|
+
|
122
|
+
def visit_class(self, node):
|
123
|
+
"""visit an astroid.Class node
|
124
|
+
|
125
|
+
* set the locals_type and instance_attrs_type mappings
|
126
|
+
* set the implements list and build it
|
127
|
+
* optionally tag the node with a unique id
|
128
|
+
"""
|
129
|
+
if hasattr(node, 'locals_type'):
|
130
|
+
return
|
131
|
+
node.locals_type = {}
|
132
|
+
if self.tag:
|
133
|
+
node.uid = self.generate_id()
|
134
|
+
# resolve ancestors
|
135
|
+
for baseobj in node.ancestors(recurs=False):
|
136
|
+
specializations = getattr(baseobj, 'specializations', [])
|
137
|
+
specializations.append(node)
|
138
|
+
baseobj.specializations = specializations
|
139
|
+
# resolve instance attributes
|
140
|
+
node.instance_attrs_type = {}
|
141
|
+
for assattrs in node.instance_attrs.values():
|
142
|
+
for assattr in assattrs:
|
143
|
+
self.handle_assattr_type(assattr, node)
|
144
|
+
# resolve implemented interface
|
145
|
+
try:
|
146
|
+
node.implements = list(node.interfaces(self.inherited_interfaces))
|
147
|
+
except InferenceError:
|
148
|
+
node.implements = ()
|
149
|
+
|
150
|
+
def visit_function(self, node):
|
151
|
+
"""visit an astroid.Function node
|
152
|
+
|
153
|
+
* set the locals_type mapping
|
154
|
+
* optionally tag the node with a unique id
|
155
|
+
"""
|
156
|
+
if hasattr(node, 'locals_type'):
|
157
|
+
return
|
158
|
+
node.locals_type = {}
|
159
|
+
if self.tag:
|
160
|
+
node.uid = self.generate_id()
|
161
|
+
|
162
|
+
link_project = visit_project
|
163
|
+
link_module = visit_module
|
164
|
+
link_class = visit_class
|
165
|
+
link_function = visit_function
|
166
|
+
|
167
|
+
def visit_assname(self, node):
|
168
|
+
"""visit an astroid.AssName node
|
169
|
+
|
170
|
+
handle locals_type
|
171
|
+
"""
|
172
|
+
# avoid double parsing done by different Linkers.visit
|
173
|
+
# running over the same project:
|
174
|
+
if hasattr(node, '_handled'):
|
175
|
+
return
|
176
|
+
node._handled = True
|
177
|
+
if node.name in node.frame():
|
178
|
+
frame = node.frame()
|
179
|
+
else:
|
180
|
+
# the name has been defined as 'global' in the frame and belongs
|
181
|
+
# there. Btw the frame is not yet visited as the name is in the
|
182
|
+
# root locals; the frame hence has no locals_type attribute
|
183
|
+
frame = node.root()
|
184
|
+
try:
|
185
|
+
values = node.infered()
|
186
|
+
try:
|
187
|
+
already_infered = frame.locals_type[node.name]
|
188
|
+
for valnode in values:
|
189
|
+
if not valnode in already_infered:
|
190
|
+
already_infered.append(valnode)
|
191
|
+
except KeyError:
|
192
|
+
frame.locals_type[node.name] = values
|
193
|
+
except astroid.InferenceError:
|
194
|
+
pass
|
195
|
+
|
196
|
+
def handle_assattr_type(self, node, parent):
|
197
|
+
"""handle an astroid.AssAttr node
|
198
|
+
|
199
|
+
handle instance_attrs_type
|
200
|
+
"""
|
201
|
+
try:
|
202
|
+
values = list(node.infer())
|
203
|
+
try:
|
204
|
+
already_infered = parent.instance_attrs_type[node.attrname]
|
205
|
+
for valnode in values:
|
206
|
+
if not valnode in already_infered:
|
207
|
+
already_infered.append(valnode)
|
208
|
+
except KeyError:
|
209
|
+
parent.instance_attrs_type[node.attrname] = values
|
210
|
+
except astroid.InferenceError:
|
211
|
+
pass
|
212
|
+
|
213
|
+
def visit_import(self, node):
|
214
|
+
"""visit an astroid.Import node
|
215
|
+
|
216
|
+
resolve module dependencies
|
217
|
+
"""
|
218
|
+
context_file = node.root().file
|
219
|
+
for name in node.names:
|
220
|
+
relative = is_relative(name[0], context_file)
|
221
|
+
self._imported_module(node, name[0], relative)
|
222
|
+
|
223
|
+
|
224
|
+
def visit_from(self, node):
|
225
|
+
"""visit an astroid.From node
|
226
|
+
|
227
|
+
resolve module dependencies
|
228
|
+
"""
|
229
|
+
basename = node.modname
|
230
|
+
context_file = node.root().file
|
231
|
+
if context_file is not None:
|
232
|
+
relative = is_relative(basename, context_file)
|
233
|
+
else:
|
234
|
+
relative = False
|
235
|
+
for name in node.names:
|
236
|
+
if name[0] == '*':
|
237
|
+
continue
|
238
|
+
# analyze dependencies
|
239
|
+
fullname = '%s.%s' % (basename, name[0])
|
240
|
+
if fullname.find('.') > -1:
|
241
|
+
try:
|
242
|
+
# XXX: don't use get_module_part, missing package precedence
|
243
|
+
fullname = get_module_part(fullname, context_file)
|
244
|
+
except ImportError:
|
245
|
+
continue
|
246
|
+
if fullname != basename:
|
247
|
+
self._imported_module(node, fullname, relative)
|
248
|
+
|
249
|
+
|
250
|
+
def compute_module(self, context_name, mod_path):
|
251
|
+
"""return true if the module should be added to dependencies"""
|
252
|
+
package_dir = dirname(self.project.path)
|
253
|
+
if context_name == mod_path:
|
254
|
+
return 0
|
255
|
+
elif is_standard_module(mod_path, (package_dir,)):
|
256
|
+
return 1
|
257
|
+
return 0
|
258
|
+
|
259
|
+
# protected methods ########################################################
|
260
|
+
|
261
|
+
def _imported_module(self, node, mod_path, relative):
|
262
|
+
"""notify an imported module, used to analyze dependencies
|
263
|
+
"""
|
264
|
+
module = node.root()
|
265
|
+
context_name = module.name
|
266
|
+
if relative:
|
267
|
+
mod_path = '%s.%s' % ('.'.join(context_name.split('.')[:-1]),
|
268
|
+
mod_path)
|
269
|
+
if self.compute_module(context_name, mod_path):
|
270
|
+
# handle dependencies
|
271
|
+
if not hasattr(module, 'depends'):
|
272
|
+
module.depends = []
|
273
|
+
mod_paths = module.depends
|
274
|
+
if not mod_path in mod_paths:
|
275
|
+
mod_paths.append(mod_path)
|
@@ -0,0 +1,336 @@
|
|
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
|
+
"""astroid manager: avoid multiple astroid build of a same module when
|
19
|
+
possible by providing a class responsible to get astroid representation
|
20
|
+
from various source and using a cache of built modules)
|
21
|
+
"""
|
22
|
+
|
23
|
+
__docformat__ = "restructuredtext en"
|
24
|
+
|
25
|
+
import os
|
26
|
+
from os.path import dirname, join, isdir, exists
|
27
|
+
|
28
|
+
from logilab.common.modutils import NoSourceFile, is_python_source, \
|
29
|
+
file_from_modpath, load_module_from_name, modpath_from_file, \
|
30
|
+
get_module_files, get_source_file, zipimport
|
31
|
+
from logilab.common.configuration import OptionsProviderMixIn
|
32
|
+
|
33
|
+
from astroid.exceptions import AstroidBuildingException
|
34
|
+
|
35
|
+
def astroid_wrapper(func, modname):
|
36
|
+
"""wrapper to give to AstroidManager.project_from_files"""
|
37
|
+
print 'parsing %s...' % modname
|
38
|
+
try:
|
39
|
+
return func(modname)
|
40
|
+
except AstroidBuildingException, exc:
|
41
|
+
print exc
|
42
|
+
except Exception, exc:
|
43
|
+
import traceback
|
44
|
+
traceback.print_exc()
|
45
|
+
|
46
|
+
def _silent_no_wrap(func, modname):
|
47
|
+
"""silent wrapper that doesn't do anything; can be used for tests"""
|
48
|
+
return func(modname)
|
49
|
+
|
50
|
+
def safe_repr(obj):
|
51
|
+
try:
|
52
|
+
return repr(obj)
|
53
|
+
except:
|
54
|
+
return '???'
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
class AstroidManager(OptionsProviderMixIn):
|
59
|
+
"""the astroid manager, responsible to build astroid from files
|
60
|
+
or modules.
|
61
|
+
|
62
|
+
Use the Borg pattern.
|
63
|
+
"""
|
64
|
+
|
65
|
+
name = 'astroid loader'
|
66
|
+
options = (("ignore",
|
67
|
+
{'type' : "csv", 'metavar' : "<file>",
|
68
|
+
'dest' : "black_list", "default" : ('CVS',),
|
69
|
+
'help' : "add <file> (may be a directory) to the black list\
|
70
|
+
. It should be a base name, not a path. You may set this option multiple times\
|
71
|
+
."}),
|
72
|
+
("project",
|
73
|
+
{'default': "No Name", 'type' : 'string', 'short': 'p',
|
74
|
+
'metavar' : '<project name>',
|
75
|
+
'help' : 'set the project name.'}),
|
76
|
+
)
|
77
|
+
brain = {}
|
78
|
+
def __init__(self):
|
79
|
+
self.__dict__ = AstroidManager.brain
|
80
|
+
if not self.__dict__:
|
81
|
+
OptionsProviderMixIn.__init__(self)
|
82
|
+
self.load_defaults()
|
83
|
+
# NOTE: cache entries are added by the [re]builder
|
84
|
+
self.astroid_cache = {}
|
85
|
+
self._mod_file_cache = {}
|
86
|
+
self.transforms = {}
|
87
|
+
|
88
|
+
def ast_from_file(self, filepath, modname=None, fallback=True, source=False):
|
89
|
+
"""given a module name, return the astroid object"""
|
90
|
+
try:
|
91
|
+
filepath = get_source_file(filepath, include_no_ext=True)
|
92
|
+
source = True
|
93
|
+
except NoSourceFile:
|
94
|
+
pass
|
95
|
+
if modname is None:
|
96
|
+
try:
|
97
|
+
modname = '.'.join(modpath_from_file(filepath))
|
98
|
+
except ImportError:
|
99
|
+
modname = filepath
|
100
|
+
if modname in self.astroid_cache and self.astroid_cache[modname].file == filepath:
|
101
|
+
return self.astroid_cache[modname]
|
102
|
+
if source:
|
103
|
+
from astroid.builder import AstroidBuilder
|
104
|
+
return AstroidBuilder(self).file_build(filepath, modname)
|
105
|
+
elif fallback and modname:
|
106
|
+
return self.ast_from_module_name(modname)
|
107
|
+
raise AstroidBuildingException('unable to get astroid for file %s' %
|
108
|
+
filepath)
|
109
|
+
|
110
|
+
def ast_from_module_name(self, modname, context_file=None):
|
111
|
+
"""given a module name, return the astroid object"""
|
112
|
+
if modname in self.astroid_cache:
|
113
|
+
return self.astroid_cache[modname]
|
114
|
+
if modname == '__main__':
|
115
|
+
from astroid.builder import AstroidBuilder
|
116
|
+
return AstroidBuilder(self).string_build('', modname)
|
117
|
+
old_cwd = os.getcwd()
|
118
|
+
if context_file:
|
119
|
+
os.chdir(dirname(context_file))
|
120
|
+
try:
|
121
|
+
filepath = self.file_from_module_name(modname, context_file)
|
122
|
+
if filepath is not None and not is_python_source(filepath):
|
123
|
+
module = self.zip_import_data(filepath)
|
124
|
+
if module is not None:
|
125
|
+
return module
|
126
|
+
if filepath is None or not is_python_source(filepath):
|
127
|
+
try:
|
128
|
+
module = load_module_from_name(modname)
|
129
|
+
except Exception, ex:
|
130
|
+
msg = 'Unable to load module %s (%s)' % (modname, ex)
|
131
|
+
raise AstroidBuildingException(msg)
|
132
|
+
return self.ast_from_module(module, modname)
|
133
|
+
return self.ast_from_file(filepath, modname, fallback=False)
|
134
|
+
finally:
|
135
|
+
os.chdir(old_cwd)
|
136
|
+
|
137
|
+
def zip_import_data(self, filepath):
|
138
|
+
if zipimport is None:
|
139
|
+
return None
|
140
|
+
from astroid.builder import AstroidBuilder
|
141
|
+
builder = AstroidBuilder(self)
|
142
|
+
for ext in ('.zip', '.egg'):
|
143
|
+
try:
|
144
|
+
eggpath, resource = filepath.rsplit(ext + '/', 1)
|
145
|
+
except ValueError:
|
146
|
+
continue
|
147
|
+
try:
|
148
|
+
importer = zipimport.zipimporter(eggpath + ext)
|
149
|
+
zmodname = resource.replace('/', '.')
|
150
|
+
if importer.is_package(resource):
|
151
|
+
zmodname = zmodname + '.__init__'
|
152
|
+
module = builder.string_build(importer.get_source(resource),
|
153
|
+
zmodname, filepath)
|
154
|
+
return module
|
155
|
+
except:
|
156
|
+
continue
|
157
|
+
return None
|
158
|
+
|
159
|
+
def file_from_module_name(self, modname, contextfile):
|
160
|
+
try:
|
161
|
+
value = self._mod_file_cache[(modname, contextfile)]
|
162
|
+
except KeyError:
|
163
|
+
try:
|
164
|
+
value = file_from_modpath(modname.split('.'),
|
165
|
+
context_file=contextfile)
|
166
|
+
except ImportError, ex:
|
167
|
+
msg = 'Unable to load module %s (%s)' % (modname, ex)
|
168
|
+
value = AstroidBuildingException(msg)
|
169
|
+
self._mod_file_cache[(modname, contextfile)] = value
|
170
|
+
if isinstance(value, AstroidBuildingException):
|
171
|
+
raise value
|
172
|
+
return value
|
173
|
+
|
174
|
+
def ast_from_module(self, module, modname=None):
|
175
|
+
"""given an imported module, return the astroid object"""
|
176
|
+
modname = modname or module.__name__
|
177
|
+
if modname in self.astroid_cache:
|
178
|
+
return self.astroid_cache[modname]
|
179
|
+
try:
|
180
|
+
# some builtin modules don't have __file__ attribute
|
181
|
+
filepath = module.__file__
|
182
|
+
if is_python_source(filepath):
|
183
|
+
return self.ast_from_file(filepath, modname)
|
184
|
+
except AttributeError:
|
185
|
+
pass
|
186
|
+
from astroid.builder import AstroidBuilder
|
187
|
+
return AstroidBuilder(self).module_build(module, modname)
|
188
|
+
|
189
|
+
def ast_from_class(self, klass, modname=None):
|
190
|
+
"""get astroid for the given class"""
|
191
|
+
if modname is None:
|
192
|
+
try:
|
193
|
+
modname = klass.__module__
|
194
|
+
except AttributeError:
|
195
|
+
raise AstroidBuildingException(
|
196
|
+
'Unable to get module for class %s' % safe_repr(klass))
|
197
|
+
modastroid = self.ast_from_module_name(modname)
|
198
|
+
return modastroid.getattr(klass.__name__)[0] # XXX
|
199
|
+
|
200
|
+
|
201
|
+
def infer_ast_from_something(self, obj, context=None):
|
202
|
+
"""infer astroid for the given class"""
|
203
|
+
if hasattr(obj, '__class__') and not isinstance(obj, type):
|
204
|
+
klass = obj.__class__
|
205
|
+
else:
|
206
|
+
klass = obj
|
207
|
+
try:
|
208
|
+
modname = klass.__module__
|
209
|
+
except AttributeError:
|
210
|
+
raise AstroidBuildingException(
|
211
|
+
'Unable to get module for %s' % safe_repr(klass))
|
212
|
+
except Exception, ex:
|
213
|
+
raise AstroidBuildingException(
|
214
|
+
'Unexpected error while retrieving module for %s: %s'
|
215
|
+
% (safe_repr(klass), ex))
|
216
|
+
try:
|
217
|
+
name = klass.__name__
|
218
|
+
except AttributeError:
|
219
|
+
raise AstroidBuildingException(
|
220
|
+
'Unable to get name for %s' % safe_repr(klass))
|
221
|
+
except Exception, ex:
|
222
|
+
raise AstroidBuildingException(
|
223
|
+
'Unexpected error while retrieving name for %s: %s'
|
224
|
+
% (safe_repr(klass), ex))
|
225
|
+
# take care, on living object __module__ is regularly wrong :(
|
226
|
+
modastroid = self.ast_from_module_name(modname)
|
227
|
+
if klass is obj:
|
228
|
+
for infered in modastroid.igetattr(name, context):
|
229
|
+
yield infered
|
230
|
+
else:
|
231
|
+
for infered in modastroid.igetattr(name, context):
|
232
|
+
yield infered.instanciate_class()
|
233
|
+
|
234
|
+
def project_from_files(self, files, func_wrapper=astroid_wrapper,
|
235
|
+
project_name=None, black_list=None):
|
236
|
+
"""return a Project from a list of files or modules"""
|
237
|
+
# build the project representation
|
238
|
+
project_name = project_name or self.config.project
|
239
|
+
black_list = black_list or self.config.black_list
|
240
|
+
project = Project(project_name)
|
241
|
+
for something in files:
|
242
|
+
if not exists(something):
|
243
|
+
fpath = file_from_modpath(something.split('.'))
|
244
|
+
elif isdir(something):
|
245
|
+
fpath = join(something, '__init__.py')
|
246
|
+
else:
|
247
|
+
fpath = something
|
248
|
+
astroid = func_wrapper(self.ast_from_file, fpath)
|
249
|
+
if astroid is None:
|
250
|
+
continue
|
251
|
+
# XXX why is first file defining the project.path ?
|
252
|
+
project.path = project.path or astroid.file
|
253
|
+
project.add_module(astroid)
|
254
|
+
base_name = astroid.name
|
255
|
+
# recurse in package except if __init__ was explicitly given
|
256
|
+
if astroid.package and something.find('__init__') == -1:
|
257
|
+
# recurse on others packages / modules if this is a package
|
258
|
+
for fpath in get_module_files(dirname(astroid.file),
|
259
|
+
black_list):
|
260
|
+
astroid = func_wrapper(self.ast_from_file, fpath)
|
261
|
+
if astroid is None or astroid.name == base_name:
|
262
|
+
continue
|
263
|
+
project.add_module(astroid)
|
264
|
+
return project
|
265
|
+
|
266
|
+
def register_transform(self, node_class, transform, predicate=None):
|
267
|
+
"""Register `transform(node)` function to be applied on the given
|
268
|
+
Astroid's `node_class` if `predicate` is None or return a true value
|
269
|
+
when called with the node as argument.
|
270
|
+
|
271
|
+
The transform function may return a value which is then used to
|
272
|
+
substitute the original node in the tree.
|
273
|
+
"""
|
274
|
+
self.transforms.setdefault(node_class, []).append( (transform, predicate) )
|
275
|
+
|
276
|
+
def unregister_transform(self, node_class, transform, predicate=None):
|
277
|
+
"""Unregister the given transform."""
|
278
|
+
self.transforms[node_class].remove( (transform, predicate) )
|
279
|
+
|
280
|
+
def transform(self, node):
|
281
|
+
"""Call matching transforms for the given node if any and return the
|
282
|
+
transformed node.
|
283
|
+
"""
|
284
|
+
cls = node.__class__
|
285
|
+
if cls not in self.transforms:
|
286
|
+
# no transform registered for this class of node
|
287
|
+
return node
|
288
|
+
|
289
|
+
transforms = self.transforms[cls]
|
290
|
+
orig_node = node # copy the reference
|
291
|
+
for transform_func, predicate in transforms:
|
292
|
+
if predicate is None or predicate(node):
|
293
|
+
ret = transform_func(node)
|
294
|
+
# if the transformation function returns something, it's
|
295
|
+
# expected to be a replacement for the node
|
296
|
+
if ret is not None:
|
297
|
+
if node is not orig_node:
|
298
|
+
# node has already be modified by some previous
|
299
|
+
# transformation, warn about it
|
300
|
+
warn('node %s substitued multiple times' % node)
|
301
|
+
node = ret
|
302
|
+
return node
|
303
|
+
|
304
|
+
def cache_module(self, module):
|
305
|
+
"""Cache a module if no module with the same name is known yet."""
|
306
|
+
self.astroid_cache.setdefault(module.name, module)
|
307
|
+
|
308
|
+
|
309
|
+
class Project(object):
|
310
|
+
"""a project handle a set of modules / packages"""
|
311
|
+
def __init__(self, name=''):
|
312
|
+
self.name = name
|
313
|
+
self.path = None
|
314
|
+
self.modules = []
|
315
|
+
self.locals = {}
|
316
|
+
self.__getitem__ = self.locals.__getitem__
|
317
|
+
self.__iter__ = self.locals.__iter__
|
318
|
+
self.values = self.locals.values
|
319
|
+
self.keys = self.locals.keys
|
320
|
+
self.items = self.locals.items
|
321
|
+
|
322
|
+
def add_module(self, node):
|
323
|
+
self.locals[node.name] = node
|
324
|
+
self.modules.append(node)
|
325
|
+
|
326
|
+
def get_module(self, name):
|
327
|
+
return self.locals[name]
|
328
|
+
|
329
|
+
def get_children(self):
|
330
|
+
return self.modules
|
331
|
+
|
332
|
+
def __repr__(self):
|
333
|
+
return '<Project %r at %s (%s modules)>' % (self.name, id(self),
|
334
|
+
len(self.modules))
|
335
|
+
|
336
|
+
|