exercism-analysis 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,792 @@
|
|
|
1
|
+
# Copyright (c) 2003-2014 LOGILAB S.A. (Paris, FRANCE).
|
|
2
|
+
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
|
|
3
|
+
#
|
|
4
|
+
# This program is free software; you can redistribute it and/or modify it under
|
|
5
|
+
# the terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
# Foundation; either version 2 of the License, or (at your option) any later
|
|
7
|
+
# version.
|
|
8
|
+
#
|
|
9
|
+
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
10
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
+
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
12
|
+
#
|
|
13
|
+
# You should have received a copy of the GNU General Public License along with
|
|
14
|
+
# this program; if not, write to the Free Software Foundation, Inc.,
|
|
15
|
+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
16
|
+
"""classes checker for Python code
|
|
17
|
+
"""
|
|
18
|
+
from __future__ import generators
|
|
19
|
+
|
|
20
|
+
import sys
|
|
21
|
+
|
|
22
|
+
import astroid
|
|
23
|
+
from astroid import YES, Instance, are_exclusive, AssAttr
|
|
24
|
+
from astroid.bases import Generator
|
|
25
|
+
|
|
26
|
+
from pylint.interfaces import IAstroidChecker
|
|
27
|
+
from pylint.checkers import BaseChecker
|
|
28
|
+
from pylint.checkers.utils import (PYMETHODS, overrides_a_method,
|
|
29
|
+
check_messages, is_attr_private, is_attr_protected, node_frame_class)
|
|
30
|
+
|
|
31
|
+
if sys.version_info >= (3, 0):
|
|
32
|
+
NEXT_METHOD = '__next__'
|
|
33
|
+
else:
|
|
34
|
+
NEXT_METHOD = 'next'
|
|
35
|
+
ITER_METHODS = ('__iter__', '__getitem__')
|
|
36
|
+
|
|
37
|
+
def class_is_abstract(node):
|
|
38
|
+
"""return true if the given class node should be considered as an abstract
|
|
39
|
+
class
|
|
40
|
+
"""
|
|
41
|
+
for method in node.methods():
|
|
42
|
+
if method.parent.frame() is node:
|
|
43
|
+
if method.is_abstract(pass_is_abstract=False):
|
|
44
|
+
return True
|
|
45
|
+
return False
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
MSGS = {
|
|
49
|
+
'F0202': ('Unable to check methods signature (%s / %s)',
|
|
50
|
+
'method-check-failed',
|
|
51
|
+
'Used when PyLint has been unable to check methods signature \
|
|
52
|
+
compatibility for an unexpected reason. Please report this kind \
|
|
53
|
+
if you don\'t make sense of it.'),
|
|
54
|
+
|
|
55
|
+
'E0202': ('An attribute defined in %s line %s hides this method',
|
|
56
|
+
'method-hidden',
|
|
57
|
+
'Used when a class defines a method which is hidden by an '
|
|
58
|
+
'instance attribute from an ancestor class or set by some '
|
|
59
|
+
'client code.'),
|
|
60
|
+
'E0203': ('Access to member %r before its definition line %s',
|
|
61
|
+
'access-member-before-definition',
|
|
62
|
+
'Used when an instance member is accessed before it\'s actually\
|
|
63
|
+
assigned.'),
|
|
64
|
+
'W0201': ('Attribute %r defined outside __init__',
|
|
65
|
+
'attribute-defined-outside-init',
|
|
66
|
+
'Used when an instance attribute is defined outside the __init__\
|
|
67
|
+
method.'),
|
|
68
|
+
|
|
69
|
+
'W0212': ('Access to a protected member %s of a client class', # E0214
|
|
70
|
+
'protected-access',
|
|
71
|
+
'Used when a protected member (i.e. class member with a name \
|
|
72
|
+
beginning with an underscore) is access outside the class or a \
|
|
73
|
+
descendant of the class where it\'s defined.'),
|
|
74
|
+
|
|
75
|
+
'E0211': ('Method has no argument',
|
|
76
|
+
'no-method-argument',
|
|
77
|
+
'Used when a method which should have the bound instance as \
|
|
78
|
+
first argument has no argument defined.'),
|
|
79
|
+
'E0213': ('Method should have "self" as first argument',
|
|
80
|
+
'no-self-argument',
|
|
81
|
+
'Used when a method has an attribute different the "self" as\
|
|
82
|
+
first argument. This is considered as an error since this is\
|
|
83
|
+
a so common convention that you shouldn\'t break it!'),
|
|
84
|
+
'C0202': ('Class method %s should have %s as first argument', # E0212
|
|
85
|
+
'bad-classmethod-argument',
|
|
86
|
+
'Used when a class method has a first argument named differently '
|
|
87
|
+
'than the value specified in valid-classmethod-first-arg option '
|
|
88
|
+
'(default to "cls"), recommended to easily differentiate them '
|
|
89
|
+
'from regular instance methods.'),
|
|
90
|
+
'C0203': ('Metaclass method %s should have %s as first argument', # E0214
|
|
91
|
+
'bad-mcs-method-argument',
|
|
92
|
+
'Used when a metaclass method has a first agument named '
|
|
93
|
+
'differently than the value specified in valid-classmethod-first'
|
|
94
|
+
'-arg option (default to "cls"), recommended to easily '
|
|
95
|
+
'differentiate them from regular instance methods.'),
|
|
96
|
+
'C0204': ('Metaclass class method %s should have %s as first argument',
|
|
97
|
+
'bad-mcs-classmethod-argument',
|
|
98
|
+
'Used when a metaclass class method has a first argument named '
|
|
99
|
+
'differently than the value specified in valid-metaclass-'
|
|
100
|
+
'classmethod-first-arg option (default to "mcs"), recommended to '
|
|
101
|
+
'easily differentiate them from regular instance methods.'),
|
|
102
|
+
|
|
103
|
+
'W0211': ('Static method with %r as first argument',
|
|
104
|
+
'bad-staticmethod-argument',
|
|
105
|
+
'Used when a static method has "self" or a value specified in '
|
|
106
|
+
'valid-classmethod-first-arg option or '
|
|
107
|
+
'valid-metaclass-classmethod-first-arg option as first argument.'
|
|
108
|
+
),
|
|
109
|
+
'R0201': ('Method could be a function',
|
|
110
|
+
'no-self-use',
|
|
111
|
+
'Used when a method doesn\'t use its bound instance, and so could\
|
|
112
|
+
be written as a function.'
|
|
113
|
+
),
|
|
114
|
+
|
|
115
|
+
'E0221': ('Interface resolved to %s is not a class',
|
|
116
|
+
'interface-is-not-class',
|
|
117
|
+
'Used when a class claims to implement an interface which is not \
|
|
118
|
+
a class.'),
|
|
119
|
+
'E0222': ('Missing method %r from %s interface',
|
|
120
|
+
'missing-interface-method',
|
|
121
|
+
'Used when a method declared in an interface is missing from a \
|
|
122
|
+
class implementing this interface'),
|
|
123
|
+
'W0221': ('Arguments number differs from %s method',
|
|
124
|
+
'arguments-differ',
|
|
125
|
+
'Used when a method has a different number of arguments than in \
|
|
126
|
+
the implemented interface or in an overridden method.'),
|
|
127
|
+
'W0222': ('Signature differs from %s method',
|
|
128
|
+
'signature-differs',
|
|
129
|
+
'Used when a method signature is different than in the \
|
|
130
|
+
implemented interface or in an overridden method.'),
|
|
131
|
+
'W0223': ('Method %r is abstract in class %r but is not overridden',
|
|
132
|
+
'abstract-method',
|
|
133
|
+
'Used when an abstract method (i.e. raise NotImplementedError) is \
|
|
134
|
+
not overridden in concrete class.'
|
|
135
|
+
),
|
|
136
|
+
'F0220': ('failed to resolve interfaces implemented by %s (%s)', # W0224
|
|
137
|
+
'unresolved-interface',
|
|
138
|
+
'Used when a PyLint as failed to find interfaces implemented by \
|
|
139
|
+
a class'),
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
'W0231': ('__init__ method from base class %r is not called',
|
|
143
|
+
'super-init-not-called',
|
|
144
|
+
'Used when an ancestor class method has an __init__ method \
|
|
145
|
+
which is not called by a derived class.'),
|
|
146
|
+
'W0232': ('Class has no __init__ method',
|
|
147
|
+
'no-init',
|
|
148
|
+
'Used when a class has no __init__ method, neither its parent \
|
|
149
|
+
classes.'),
|
|
150
|
+
'W0233': ('__init__ method from a non direct base class %r is called',
|
|
151
|
+
'non-parent-init-called',
|
|
152
|
+
'Used when an __init__ method is called on a class which is not \
|
|
153
|
+
in the direct ancestors for the analysed class.'),
|
|
154
|
+
'W0234': ('__iter__ returns non-iterator',
|
|
155
|
+
'non-iterator-returned',
|
|
156
|
+
'Used when an __iter__ method returns something which is not an \
|
|
157
|
+
iterable (i.e. has no `%s` method)' % NEXT_METHOD),
|
|
158
|
+
'E0235': ('__exit__ must accept 3 arguments: type, value, traceback',
|
|
159
|
+
'bad-context-manager',
|
|
160
|
+
'Used when the __exit__ special method, belonging to a \
|
|
161
|
+
context manager, does not accept 3 arguments \
|
|
162
|
+
(type, value, traceback).'),
|
|
163
|
+
'E0236': ('Invalid object %r in __slots__, must contain '
|
|
164
|
+
'only non empty strings',
|
|
165
|
+
'invalid-slots-object',
|
|
166
|
+
'Used when an invalid (non-string) object occurs in __slots__.'),
|
|
167
|
+
'E0238': ('Invalid __slots__ object',
|
|
168
|
+
'invalid-slots',
|
|
169
|
+
'Used when an invalid __slots__ is found in class. '
|
|
170
|
+
'Only a string, an iterable or a sequence is permitted.')
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
class ClassChecker(BaseChecker):
|
|
177
|
+
"""checks for :
|
|
178
|
+
* methods without self as first argument
|
|
179
|
+
* overridden methods signature
|
|
180
|
+
* access only to existent members via self
|
|
181
|
+
* attributes not defined in the __init__ method
|
|
182
|
+
* supported interfaces implementation
|
|
183
|
+
* unreachable code
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
__implements__ = (IAstroidChecker,)
|
|
187
|
+
|
|
188
|
+
# configuration section name
|
|
189
|
+
name = 'classes'
|
|
190
|
+
# messages
|
|
191
|
+
msgs = MSGS
|
|
192
|
+
priority = -2
|
|
193
|
+
# configuration options
|
|
194
|
+
options = (('ignore-iface-methods',
|
|
195
|
+
{'default' : (#zope interface
|
|
196
|
+
'isImplementedBy', 'deferred', 'extends', 'names',
|
|
197
|
+
'namesAndDescriptions', 'queryDescriptionFor', 'getBases',
|
|
198
|
+
'getDescriptionFor', 'getDoc', 'getName', 'getTaggedValue',
|
|
199
|
+
'getTaggedValueTags', 'isEqualOrExtendedBy', 'setTaggedValue',
|
|
200
|
+
'isImplementedByInstancesOf',
|
|
201
|
+
# twisted
|
|
202
|
+
'adaptWith',
|
|
203
|
+
# logilab.common interface
|
|
204
|
+
'is_implemented_by'),
|
|
205
|
+
'type' : 'csv',
|
|
206
|
+
'metavar' : '<method names>',
|
|
207
|
+
'help' : 'List of interface methods to ignore, \
|
|
208
|
+
separated by a comma. This is used for instance to not check methods defines \
|
|
209
|
+
in Zope\'s Interface base class.'}
|
|
210
|
+
),
|
|
211
|
+
|
|
212
|
+
('defining-attr-methods',
|
|
213
|
+
{'default' : ('__init__', '__new__', 'setUp'),
|
|
214
|
+
'type' : 'csv',
|
|
215
|
+
'metavar' : '<method names>',
|
|
216
|
+
'help' : 'List of method names used to declare (i.e. assign) \
|
|
217
|
+
instance attributes.'}
|
|
218
|
+
),
|
|
219
|
+
('valid-classmethod-first-arg',
|
|
220
|
+
{'default' : ('cls',),
|
|
221
|
+
'type' : 'csv',
|
|
222
|
+
'metavar' : '<argument names>',
|
|
223
|
+
'help' : 'List of valid names for the first argument in \
|
|
224
|
+
a class method.'}
|
|
225
|
+
),
|
|
226
|
+
('valid-metaclass-classmethod-first-arg',
|
|
227
|
+
{'default' : ('mcs',),
|
|
228
|
+
'type' : 'csv',
|
|
229
|
+
'metavar' : '<argument names>',
|
|
230
|
+
'help' : 'List of valid names for the first argument in \
|
|
231
|
+
a metaclass class method.'}
|
|
232
|
+
),
|
|
233
|
+
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
def __init__(self, linter=None):
|
|
237
|
+
BaseChecker.__init__(self, linter)
|
|
238
|
+
self._accessed = []
|
|
239
|
+
self._first_attrs = []
|
|
240
|
+
self._meth_could_be_func = None
|
|
241
|
+
|
|
242
|
+
def visit_class(self, node):
|
|
243
|
+
"""init visit variable _accessed and check interfaces
|
|
244
|
+
"""
|
|
245
|
+
self._accessed.append({})
|
|
246
|
+
self._check_bases_classes(node)
|
|
247
|
+
self._check_interfaces(node)
|
|
248
|
+
# if not an interface, exception, metaclass
|
|
249
|
+
if node.type == 'class':
|
|
250
|
+
try:
|
|
251
|
+
node.local_attr('__init__')
|
|
252
|
+
except astroid.NotFoundError:
|
|
253
|
+
self.add_message('no-init', args=node, node=node)
|
|
254
|
+
self._check_slots(node)
|
|
255
|
+
|
|
256
|
+
@check_messages('access-member-before-definition', 'attribute-defined-outside-init')
|
|
257
|
+
def leave_class(self, cnode):
|
|
258
|
+
"""close a class node:
|
|
259
|
+
check that instance attributes are defined in __init__ and check
|
|
260
|
+
access to existent members
|
|
261
|
+
"""
|
|
262
|
+
# check access to existent members on non metaclass classes
|
|
263
|
+
accessed = self._accessed.pop()
|
|
264
|
+
if cnode.type != 'metaclass':
|
|
265
|
+
self._check_accessed_members(cnode, accessed)
|
|
266
|
+
# checks attributes are defined in an allowed method such as __init__
|
|
267
|
+
if not self.linter.is_message_enabled('attribute-defined-outside-init'):
|
|
268
|
+
return
|
|
269
|
+
defining_methods = self.config.defining_attr_methods
|
|
270
|
+
for attr, nodes in cnode.instance_attrs.iteritems():
|
|
271
|
+
nodes = [n for n in nodes if not
|
|
272
|
+
isinstance(n.statement(), (astroid.Delete, astroid.AugAssign))]
|
|
273
|
+
if not nodes:
|
|
274
|
+
continue # error detected by typechecking
|
|
275
|
+
attr_defined = False
|
|
276
|
+
# check if any method attr is defined in is a defining method
|
|
277
|
+
for node in nodes:
|
|
278
|
+
if node.frame().name in defining_methods:
|
|
279
|
+
attr_defined = True
|
|
280
|
+
if not attr_defined:
|
|
281
|
+
# check attribute is defined in a parent's __init__
|
|
282
|
+
for parent in cnode.instance_attr_ancestors(attr):
|
|
283
|
+
attr_defined = False
|
|
284
|
+
# check if any parent method attr is defined in is a defining method
|
|
285
|
+
for node in parent.instance_attrs[attr]:
|
|
286
|
+
if node.frame().name in defining_methods:
|
|
287
|
+
attr_defined = True
|
|
288
|
+
if attr_defined:
|
|
289
|
+
# we're done :)
|
|
290
|
+
break
|
|
291
|
+
else:
|
|
292
|
+
# check attribute is defined as a class attribute
|
|
293
|
+
try:
|
|
294
|
+
cnode.local_attr(attr)
|
|
295
|
+
except astroid.NotFoundError:
|
|
296
|
+
self.add_message('attribute-defined-outside-init', args=attr, node=node)
|
|
297
|
+
|
|
298
|
+
def visit_function(self, node):
|
|
299
|
+
"""check method arguments, overriding"""
|
|
300
|
+
# ignore actual functions
|
|
301
|
+
if not node.is_method():
|
|
302
|
+
return
|
|
303
|
+
klass = node.parent.frame()
|
|
304
|
+
self._meth_could_be_func = True
|
|
305
|
+
# check first argument is self if this is actually a method
|
|
306
|
+
self._check_first_arg_for_type(node, klass.type == 'metaclass')
|
|
307
|
+
if node.name == '__init__':
|
|
308
|
+
self._check_init(node)
|
|
309
|
+
return
|
|
310
|
+
# check signature if the method overloads inherited method
|
|
311
|
+
for overridden in klass.local_attr_ancestors(node.name):
|
|
312
|
+
# get astroid for the searched method
|
|
313
|
+
try:
|
|
314
|
+
meth_node = overridden[node.name]
|
|
315
|
+
except KeyError:
|
|
316
|
+
# we have found the method but it's not in the local
|
|
317
|
+
# dictionary.
|
|
318
|
+
# This may happen with astroid build from living objects
|
|
319
|
+
continue
|
|
320
|
+
if not isinstance(meth_node, astroid.Function):
|
|
321
|
+
continue
|
|
322
|
+
self._check_signature(node, meth_node, 'overridden')
|
|
323
|
+
break
|
|
324
|
+
if node.decorators:
|
|
325
|
+
for decorator in node.decorators.nodes:
|
|
326
|
+
if isinstance(decorator, astroid.Getattr) and \
|
|
327
|
+
decorator.attrname in ('getter', 'setter', 'deleter'):
|
|
328
|
+
# attribute affectation will call this method, not hiding it
|
|
329
|
+
return
|
|
330
|
+
if isinstance(decorator, astroid.Name) and decorator.name == 'property':
|
|
331
|
+
# attribute affectation will either call a setter or raise
|
|
332
|
+
# an attribute error, anyway not hiding the function
|
|
333
|
+
return
|
|
334
|
+
# check if the method is hidden by an attribute
|
|
335
|
+
try:
|
|
336
|
+
overridden = klass.instance_attr(node.name)[0] # XXX
|
|
337
|
+
args = (overridden.root().name, overridden.fromlineno)
|
|
338
|
+
self.add_message('method-hidden', args=args, node=node)
|
|
339
|
+
except astroid.NotFoundError:
|
|
340
|
+
pass
|
|
341
|
+
|
|
342
|
+
# check non-iterators in __iter__
|
|
343
|
+
if node.name == '__iter__':
|
|
344
|
+
self._check_iter(node)
|
|
345
|
+
elif node.name == '__exit__':
|
|
346
|
+
self._check_exit(node)
|
|
347
|
+
|
|
348
|
+
def _check_slots(self, node):
|
|
349
|
+
if '__slots__' not in node.locals:
|
|
350
|
+
return
|
|
351
|
+
for slots in node.igetattr('__slots__'):
|
|
352
|
+
# check if __slots__ is a valid type
|
|
353
|
+
for meth in ITER_METHODS:
|
|
354
|
+
try:
|
|
355
|
+
slots.getattr(meth)
|
|
356
|
+
break
|
|
357
|
+
except astroid.NotFoundError:
|
|
358
|
+
continue
|
|
359
|
+
else:
|
|
360
|
+
self.add_message('invalid-slots', node=node)
|
|
361
|
+
continue
|
|
362
|
+
|
|
363
|
+
if isinstance(slots, astroid.Const):
|
|
364
|
+
# a string, ignore the following checks
|
|
365
|
+
continue
|
|
366
|
+
if not hasattr(slots, 'itered'):
|
|
367
|
+
# we can't obtain the values, maybe a .deque?
|
|
368
|
+
continue
|
|
369
|
+
|
|
370
|
+
if isinstance(slots, astroid.Dict):
|
|
371
|
+
values = [item[0] for item in slots.items]
|
|
372
|
+
else:
|
|
373
|
+
values = slots.itered()
|
|
374
|
+
if values is YES:
|
|
375
|
+
return
|
|
376
|
+
|
|
377
|
+
for elt in values:
|
|
378
|
+
try:
|
|
379
|
+
self._check_slots_elt(elt)
|
|
380
|
+
except astroid.InferenceError:
|
|
381
|
+
continue
|
|
382
|
+
|
|
383
|
+
def _check_slots_elt(self, elt):
|
|
384
|
+
for infered in elt.infer():
|
|
385
|
+
if infered is YES:
|
|
386
|
+
continue
|
|
387
|
+
if (not isinstance(infered, astroid.Const) or
|
|
388
|
+
not isinstance(infered.value, str)):
|
|
389
|
+
self.add_message('invalid-slots-object',
|
|
390
|
+
args=infered.as_string(),
|
|
391
|
+
node=elt)
|
|
392
|
+
continue
|
|
393
|
+
if not infered.value:
|
|
394
|
+
self.add_message('invalid-slots-object',
|
|
395
|
+
args=infered.as_string(),
|
|
396
|
+
node=elt)
|
|
397
|
+
|
|
398
|
+
def _check_iter(self, node):
|
|
399
|
+
try:
|
|
400
|
+
infered = node.infer_call_result(node)
|
|
401
|
+
except astroid.InferenceError:
|
|
402
|
+
return
|
|
403
|
+
|
|
404
|
+
for infered_node in infered:
|
|
405
|
+
if (infered_node is YES
|
|
406
|
+
or isinstance(infered_node, Generator)):
|
|
407
|
+
continue
|
|
408
|
+
if isinstance(infered_node, astroid.Instance):
|
|
409
|
+
try:
|
|
410
|
+
infered_node.local_attr(NEXT_METHOD)
|
|
411
|
+
except astroid.NotFoundError:
|
|
412
|
+
self.add_message('non-iterator-returned',
|
|
413
|
+
node=node)
|
|
414
|
+
break
|
|
415
|
+
|
|
416
|
+
def _check_exit(self, node):
|
|
417
|
+
positional = sum(1 for arg in node.args.args if arg.name != 'self')
|
|
418
|
+
if positional < 3 and not node.args.vararg:
|
|
419
|
+
self.add_message('bad-context-manager',
|
|
420
|
+
node=node)
|
|
421
|
+
elif positional > 3:
|
|
422
|
+
self.add_message('bad-context-manager',
|
|
423
|
+
node=node)
|
|
424
|
+
|
|
425
|
+
def leave_function(self, node):
|
|
426
|
+
"""on method node, check if this method couldn't be a function
|
|
427
|
+
|
|
428
|
+
ignore class, static and abstract methods, initializer,
|
|
429
|
+
methods overridden from a parent class and any
|
|
430
|
+
kind of method defined in an interface for this warning
|
|
431
|
+
"""
|
|
432
|
+
if node.is_method():
|
|
433
|
+
if node.args.args is not None:
|
|
434
|
+
self._first_attrs.pop()
|
|
435
|
+
if not self.linter.is_message_enabled('no-self-use'):
|
|
436
|
+
return
|
|
437
|
+
class_node = node.parent.frame()
|
|
438
|
+
if (self._meth_could_be_func and node.type == 'method'
|
|
439
|
+
and not node.name in PYMETHODS
|
|
440
|
+
and not (node.is_abstract() or
|
|
441
|
+
overrides_a_method(class_node, node.name))
|
|
442
|
+
and class_node.type != 'interface'):
|
|
443
|
+
self.add_message('no-self-use', node=node)
|
|
444
|
+
|
|
445
|
+
def visit_getattr(self, node):
|
|
446
|
+
"""check if the getattr is an access to a class member
|
|
447
|
+
if so, register it. Also check for access to protected
|
|
448
|
+
class member from outside its class (but ignore __special__
|
|
449
|
+
methods)
|
|
450
|
+
"""
|
|
451
|
+
attrname = node.attrname
|
|
452
|
+
# Check self
|
|
453
|
+
if self.is_first_attr(node):
|
|
454
|
+
self._accessed[-1].setdefault(attrname, []).append(node)
|
|
455
|
+
return
|
|
456
|
+
if not self.linter.is_message_enabled('protected-access'):
|
|
457
|
+
return
|
|
458
|
+
|
|
459
|
+
self._check_protected_attribute_access(node)
|
|
460
|
+
|
|
461
|
+
def visit_assattr(self, node):
|
|
462
|
+
if isinstance(node.ass_type(), astroid.AugAssign) and self.is_first_attr(node):
|
|
463
|
+
self._accessed[-1].setdefault(node.attrname, []).append(node)
|
|
464
|
+
|
|
465
|
+
@check_messages('protected-access')
|
|
466
|
+
def visit_assign(self, assign_node):
|
|
467
|
+
node = assign_node.targets[0]
|
|
468
|
+
if not isinstance(node, AssAttr):
|
|
469
|
+
return
|
|
470
|
+
|
|
471
|
+
if self.is_first_attr(node):
|
|
472
|
+
return
|
|
473
|
+
|
|
474
|
+
self._check_protected_attribute_access(node)
|
|
475
|
+
|
|
476
|
+
def _check_protected_attribute_access(self, node):
|
|
477
|
+
'''Given an attribute access node (set or get), check if attribute
|
|
478
|
+
access is legitimate. Call _check_first_attr with node before calling
|
|
479
|
+
this method. Valid cases are:
|
|
480
|
+
* self._attr in a method or cls._attr in a classmethod. Checked by
|
|
481
|
+
_check_first_attr.
|
|
482
|
+
* Klass._attr inside "Klass" class.
|
|
483
|
+
* Klass2._attr inside "Klass" class when Klass2 is a base class of
|
|
484
|
+
Klass.
|
|
485
|
+
'''
|
|
486
|
+
attrname = node.attrname
|
|
487
|
+
|
|
488
|
+
if is_attr_protected(attrname):
|
|
489
|
+
|
|
490
|
+
klass = node_frame_class(node)
|
|
491
|
+
|
|
492
|
+
# XXX infer to be more safe and less dirty ??
|
|
493
|
+
# in classes, check we are not getting a parent method
|
|
494
|
+
# through the class object or through super
|
|
495
|
+
callee = node.expr.as_string()
|
|
496
|
+
|
|
497
|
+
# We are not in a class, no remaining valid case
|
|
498
|
+
if klass is None:
|
|
499
|
+
self.add_message('protected-access', node=node, args=attrname)
|
|
500
|
+
return
|
|
501
|
+
|
|
502
|
+
# If the expression begins with a call to super, that's ok.
|
|
503
|
+
if isinstance(node.expr, astroid.CallFunc) and \
|
|
504
|
+
isinstance(node.expr.func, astroid.Name) and \
|
|
505
|
+
node.expr.func.name == 'super':
|
|
506
|
+
return
|
|
507
|
+
|
|
508
|
+
# We are in a class, one remaining valid cases, Klass._attr inside
|
|
509
|
+
# Klass
|
|
510
|
+
if not (callee == klass.name or callee in klass.basenames):
|
|
511
|
+
self.add_message('protected-access', node=node, args=attrname)
|
|
512
|
+
|
|
513
|
+
def visit_name(self, node):
|
|
514
|
+
"""check if the name handle an access to a class member
|
|
515
|
+
if so, register it
|
|
516
|
+
"""
|
|
517
|
+
if self._first_attrs and (node.name == self._first_attrs[-1] or
|
|
518
|
+
not self._first_attrs[-1]):
|
|
519
|
+
self._meth_could_be_func = False
|
|
520
|
+
|
|
521
|
+
def _check_accessed_members(self, node, accessed):
|
|
522
|
+
"""check that accessed members are defined"""
|
|
523
|
+
# XXX refactor, probably much simpler now that E0201 is in type checker
|
|
524
|
+
for attr, nodes in accessed.iteritems():
|
|
525
|
+
# deactivate "except doesn't do anything", that's expected
|
|
526
|
+
# pylint: disable=W0704
|
|
527
|
+
try:
|
|
528
|
+
# is it a class attribute ?
|
|
529
|
+
node.local_attr(attr)
|
|
530
|
+
# yes, stop here
|
|
531
|
+
continue
|
|
532
|
+
except astroid.NotFoundError:
|
|
533
|
+
pass
|
|
534
|
+
# is it an instance attribute of a parent class ?
|
|
535
|
+
try:
|
|
536
|
+
node.instance_attr_ancestors(attr).next()
|
|
537
|
+
# yes, stop here
|
|
538
|
+
continue
|
|
539
|
+
except StopIteration:
|
|
540
|
+
pass
|
|
541
|
+
# is it an instance attribute ?
|
|
542
|
+
try:
|
|
543
|
+
defstmts = node.instance_attr(attr)
|
|
544
|
+
except astroid.NotFoundError:
|
|
545
|
+
pass
|
|
546
|
+
else:
|
|
547
|
+
# filter out augment assignment nodes
|
|
548
|
+
defstmts = [stmt for stmt in defstmts if stmt not in nodes]
|
|
549
|
+
if not defstmts:
|
|
550
|
+
# only augment assignment for this node, no-member should be
|
|
551
|
+
# triggered by the typecheck checker
|
|
552
|
+
continue
|
|
553
|
+
# filter defstmts to only pick the first one when there are
|
|
554
|
+
# several assignments in the same scope
|
|
555
|
+
scope = defstmts[0].scope()
|
|
556
|
+
defstmts = [stmt for i, stmt in enumerate(defstmts)
|
|
557
|
+
if i == 0 or stmt.scope() is not scope]
|
|
558
|
+
# if there are still more than one, don't attempt to be smarter
|
|
559
|
+
# than we can be
|
|
560
|
+
if len(defstmts) == 1:
|
|
561
|
+
defstmt = defstmts[0]
|
|
562
|
+
# check that if the node is accessed in the same method as
|
|
563
|
+
# it's defined, it's accessed after the initial assignment
|
|
564
|
+
frame = defstmt.frame()
|
|
565
|
+
lno = defstmt.fromlineno
|
|
566
|
+
for _node in nodes:
|
|
567
|
+
if _node.frame() is frame and _node.fromlineno < lno \
|
|
568
|
+
and not are_exclusive(_node.statement(), defstmt, ('AttributeError', 'Exception', 'BaseException')):
|
|
569
|
+
self.add_message('access-member-before-definition',
|
|
570
|
+
node=_node, args=(attr, lno))
|
|
571
|
+
|
|
572
|
+
def _check_first_arg_for_type(self, node, metaclass=0):
|
|
573
|
+
"""check the name of first argument, expect:
|
|
574
|
+
|
|
575
|
+
* 'self' for a regular method
|
|
576
|
+
* 'cls' for a class method or a metaclass regular method (actually
|
|
577
|
+
valid-classmethod-first-arg value)
|
|
578
|
+
* 'mcs' for a metaclass class method (actually
|
|
579
|
+
valid-metaclass-classmethod-first-arg)
|
|
580
|
+
* not one of the above for a static method
|
|
581
|
+
"""
|
|
582
|
+
# don't care about functions with unknown argument (builtins)
|
|
583
|
+
if node.args.args is None:
|
|
584
|
+
return
|
|
585
|
+
first_arg = node.args.args and node.argnames()[0]
|
|
586
|
+
self._first_attrs.append(first_arg)
|
|
587
|
+
first = self._first_attrs[-1]
|
|
588
|
+
# static method
|
|
589
|
+
if node.type == 'staticmethod':
|
|
590
|
+
if (first_arg == 'self' or
|
|
591
|
+
first_arg in self.config.valid_classmethod_first_arg or
|
|
592
|
+
first_arg in self.config.valid_metaclass_classmethod_first_arg):
|
|
593
|
+
self.add_message('bad-staticmethod-argument', args=first, node=node)
|
|
594
|
+
return
|
|
595
|
+
self._first_attrs[-1] = None
|
|
596
|
+
# class / regular method with no args
|
|
597
|
+
elif not node.args.args:
|
|
598
|
+
self.add_message('no-method-argument', node=node)
|
|
599
|
+
# metaclass
|
|
600
|
+
elif metaclass:
|
|
601
|
+
# metaclass __new__ or classmethod
|
|
602
|
+
if node.type == 'classmethod':
|
|
603
|
+
self._check_first_arg_config(first,
|
|
604
|
+
self.config.valid_metaclass_classmethod_first_arg, node,
|
|
605
|
+
'bad-mcs-classmethod-argument', node.name)
|
|
606
|
+
# metaclass regular method
|
|
607
|
+
else:
|
|
608
|
+
self._check_first_arg_config(first,
|
|
609
|
+
self.config.valid_classmethod_first_arg, node, 'bad-mcs-method-argument',
|
|
610
|
+
node.name)
|
|
611
|
+
# regular class
|
|
612
|
+
else:
|
|
613
|
+
# class method
|
|
614
|
+
if node.type == 'classmethod':
|
|
615
|
+
self._check_first_arg_config(first,
|
|
616
|
+
self.config.valid_classmethod_first_arg, node, 'bad-classmethod-argument',
|
|
617
|
+
node.name)
|
|
618
|
+
# regular method without self as argument
|
|
619
|
+
elif first != 'self':
|
|
620
|
+
self.add_message('no-self-argument', node=node)
|
|
621
|
+
|
|
622
|
+
def _check_first_arg_config(self, first, config, node, message,
|
|
623
|
+
method_name):
|
|
624
|
+
if first not in config:
|
|
625
|
+
if len(config) == 1:
|
|
626
|
+
valid = repr(config[0])
|
|
627
|
+
else:
|
|
628
|
+
valid = ', '.join(
|
|
629
|
+
repr(v)
|
|
630
|
+
for v in config[:-1])
|
|
631
|
+
valid = '%s or %r' % (
|
|
632
|
+
valid, config[-1])
|
|
633
|
+
self.add_message(message, args=(method_name, valid), node=node)
|
|
634
|
+
|
|
635
|
+
def _check_bases_classes(self, node):
|
|
636
|
+
"""check that the given class node implements abstract methods from
|
|
637
|
+
base classes
|
|
638
|
+
"""
|
|
639
|
+
# check if this class abstract
|
|
640
|
+
if class_is_abstract(node):
|
|
641
|
+
return
|
|
642
|
+
for method in node.methods():
|
|
643
|
+
owner = method.parent.frame()
|
|
644
|
+
if owner is node:
|
|
645
|
+
continue
|
|
646
|
+
# owner is not this class, it must be a parent class
|
|
647
|
+
# check that the ancestor's method is not abstract
|
|
648
|
+
if method.name in node.locals:
|
|
649
|
+
# it is redefined as an attribute or with a descriptor
|
|
650
|
+
continue
|
|
651
|
+
if method.is_abstract(pass_is_abstract=False):
|
|
652
|
+
self.add_message('abstract-method', node=node,
|
|
653
|
+
args=(method.name, owner.name))
|
|
654
|
+
|
|
655
|
+
def _check_interfaces(self, node):
|
|
656
|
+
"""check that the given class node really implements declared
|
|
657
|
+
interfaces
|
|
658
|
+
"""
|
|
659
|
+
e0221_hack = [False]
|
|
660
|
+
def iface_handler(obj):
|
|
661
|
+
"""filter interface objects, it should be classes"""
|
|
662
|
+
if not isinstance(obj, astroid.Class):
|
|
663
|
+
e0221_hack[0] = True
|
|
664
|
+
self.add_message('interface-is-not-class', node=node,
|
|
665
|
+
args=(obj.as_string(),))
|
|
666
|
+
return False
|
|
667
|
+
return True
|
|
668
|
+
ignore_iface_methods = self.config.ignore_iface_methods
|
|
669
|
+
try:
|
|
670
|
+
for iface in node.interfaces(handler_func=iface_handler):
|
|
671
|
+
for imethod in iface.methods():
|
|
672
|
+
name = imethod.name
|
|
673
|
+
if name.startswith('_') or name in ignore_iface_methods:
|
|
674
|
+
# don't check method beginning with an underscore,
|
|
675
|
+
# usually belonging to the interface implementation
|
|
676
|
+
continue
|
|
677
|
+
# get class method astroid
|
|
678
|
+
try:
|
|
679
|
+
method = node_method(node, name)
|
|
680
|
+
except astroid.NotFoundError:
|
|
681
|
+
self.add_message('missing-interface-method', args=(name, iface.name),
|
|
682
|
+
node=node)
|
|
683
|
+
continue
|
|
684
|
+
# ignore inherited methods
|
|
685
|
+
if method.parent.frame() is not node:
|
|
686
|
+
continue
|
|
687
|
+
# check signature
|
|
688
|
+
self._check_signature(method, imethod,
|
|
689
|
+
'%s interface' % iface.name)
|
|
690
|
+
except astroid.InferenceError:
|
|
691
|
+
if e0221_hack[0]:
|
|
692
|
+
return
|
|
693
|
+
implements = Instance(node).getattr('__implements__')[0]
|
|
694
|
+
assignment = implements.parent
|
|
695
|
+
assert isinstance(assignment, astroid.Assign)
|
|
696
|
+
# assignment.expr can be a Name or a Tuple or whatever.
|
|
697
|
+
# Use as_string() for the message
|
|
698
|
+
# FIXME: in case of multiple interfaces, find which one could not
|
|
699
|
+
# be resolved
|
|
700
|
+
self.add_message('unresolved-interface', node=implements,
|
|
701
|
+
args=(node.name, assignment.value.as_string()))
|
|
702
|
+
|
|
703
|
+
def _check_init(self, node):
|
|
704
|
+
"""check that the __init__ method call super or ancestors'__init__
|
|
705
|
+
method
|
|
706
|
+
"""
|
|
707
|
+
if (not self.linter.is_message_enabled('super-init-not-called') and
|
|
708
|
+
not self.linter.is_message_enabled('non-parent-init-called')):
|
|
709
|
+
return
|
|
710
|
+
klass_node = node.parent.frame()
|
|
711
|
+
to_call = _ancestors_to_call(klass_node)
|
|
712
|
+
not_called_yet = dict(to_call)
|
|
713
|
+
for stmt in node.nodes_of_class(astroid.CallFunc):
|
|
714
|
+
expr = stmt.func
|
|
715
|
+
if not isinstance(expr, astroid.Getattr) \
|
|
716
|
+
or expr.attrname != '__init__':
|
|
717
|
+
continue
|
|
718
|
+
# skip the test if using super
|
|
719
|
+
if isinstance(expr.expr, astroid.CallFunc) and \
|
|
720
|
+
isinstance(expr.expr.func, astroid.Name) and \
|
|
721
|
+
expr.expr.func.name == 'super':
|
|
722
|
+
return
|
|
723
|
+
try:
|
|
724
|
+
klass = expr.expr.infer().next()
|
|
725
|
+
if klass is YES:
|
|
726
|
+
continue
|
|
727
|
+
try:
|
|
728
|
+
del not_called_yet[klass]
|
|
729
|
+
except KeyError:
|
|
730
|
+
if klass not in to_call:
|
|
731
|
+
self.add_message('non-parent-init-called', node=expr, args=klass.name)
|
|
732
|
+
except astroid.InferenceError:
|
|
733
|
+
continue
|
|
734
|
+
for klass, method in not_called_yet.iteritems():
|
|
735
|
+
if klass.name == 'object' or method.parent.name == 'object':
|
|
736
|
+
continue
|
|
737
|
+
self.add_message('super-init-not-called', args=klass.name, node=node)
|
|
738
|
+
|
|
739
|
+
def _check_signature(self, method1, refmethod, class_type):
|
|
740
|
+
"""check that the signature of the two given methods match
|
|
741
|
+
|
|
742
|
+
class_type is in 'class', 'interface'
|
|
743
|
+
"""
|
|
744
|
+
if not (isinstance(method1, astroid.Function)
|
|
745
|
+
and isinstance(refmethod, astroid.Function)):
|
|
746
|
+
self.add_message('method-check-failed', args=(method1, refmethod), node=method1)
|
|
747
|
+
return
|
|
748
|
+
# don't care about functions with unknown argument (builtins)
|
|
749
|
+
if method1.args.args is None or refmethod.args.args is None:
|
|
750
|
+
return
|
|
751
|
+
# if we use *args, **kwargs, skip the below checks
|
|
752
|
+
if method1.args.vararg or method1.args.kwarg:
|
|
753
|
+
return
|
|
754
|
+
if is_attr_private(method1.name):
|
|
755
|
+
return
|
|
756
|
+
if len(method1.args.args) != len(refmethod.args.args):
|
|
757
|
+
self.add_message('arguments-differ', args=class_type, node=method1)
|
|
758
|
+
elif len(method1.args.defaults) < len(refmethod.args.defaults):
|
|
759
|
+
self.add_message('signature-differs', args=class_type, node=method1)
|
|
760
|
+
|
|
761
|
+
def is_first_attr(self, node):
|
|
762
|
+
"""Check that attribute lookup name use first attribute variable name
|
|
763
|
+
(self for method, cls for classmethod and mcs for metaclass).
|
|
764
|
+
"""
|
|
765
|
+
return self._first_attrs and isinstance(node.expr, astroid.Name) and \
|
|
766
|
+
node.expr.name == self._first_attrs[-1]
|
|
767
|
+
|
|
768
|
+
def _ancestors_to_call(klass_node, method='__init__'):
|
|
769
|
+
"""return a dictionary where keys are the list of base classes providing
|
|
770
|
+
the queried method, and so that should/may be called from the method node
|
|
771
|
+
"""
|
|
772
|
+
to_call = {}
|
|
773
|
+
for base_node in klass_node.ancestors(recurs=False):
|
|
774
|
+
try:
|
|
775
|
+
to_call[base_node] = base_node.igetattr(method).next()
|
|
776
|
+
except astroid.InferenceError:
|
|
777
|
+
continue
|
|
778
|
+
return to_call
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
def node_method(node, method_name):
|
|
782
|
+
"""get astroid for <method_name> on the given class node, ensuring it
|
|
783
|
+
is a Function node
|
|
784
|
+
"""
|
|
785
|
+
for n in node.local_attr(method_name):
|
|
786
|
+
if isinstance(n, astroid.Function):
|
|
787
|
+
return n
|
|
788
|
+
raise astroid.NotFoundError(method_name)
|
|
789
|
+
|
|
790
|
+
def register(linter):
|
|
791
|
+
"""required method to auto register this checker """
|
|
792
|
+
linter.register_checker(ClassChecker(linter))
|