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,69 @@
|
|
|
1
|
+
# Copyright 2012 Google Inc.
|
|
2
|
+
#
|
|
3
|
+
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
|
|
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
|
+
"""Checkers for various standard library functions."""
|
|
17
|
+
|
|
18
|
+
import re
|
|
19
|
+
import sys
|
|
20
|
+
|
|
21
|
+
import astroid
|
|
22
|
+
|
|
23
|
+
from pylint.interfaces import IAstroidChecker
|
|
24
|
+
from pylint.checkers import BaseChecker
|
|
25
|
+
from pylint.checkers import utils
|
|
26
|
+
|
|
27
|
+
_VALID_OPEN_MODE_REGEX = r'^(r?U|[rwa]\+?b?)$'
|
|
28
|
+
|
|
29
|
+
if sys.version_info >= (3, 0):
|
|
30
|
+
OPEN_MODULE = '_io'
|
|
31
|
+
else:
|
|
32
|
+
OPEN_MODULE = '__builtin__'
|
|
33
|
+
|
|
34
|
+
class OpenModeChecker(BaseChecker):
|
|
35
|
+
__implements__ = (IAstroidChecker,)
|
|
36
|
+
name = 'open_mode'
|
|
37
|
+
|
|
38
|
+
msgs = {
|
|
39
|
+
'W1501': ('"%s" is not a valid mode for open.',
|
|
40
|
+
'bad-open-mode',
|
|
41
|
+
'Python supports: r, w, a modes with b, +, and U options. '
|
|
42
|
+
'See http://docs.python.org/2/library/functions.html#open'),
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@utils.check_messages('bad-open-mode')
|
|
46
|
+
def visit_callfunc(self, node):
|
|
47
|
+
"""Visit a CallFunc node."""
|
|
48
|
+
if hasattr(node, 'func'):
|
|
49
|
+
infer = utils.safe_infer(node.func)
|
|
50
|
+
if infer and infer.root().name == OPEN_MODULE:
|
|
51
|
+
if getattr(node.func, 'name', None) in ('open', 'file'):
|
|
52
|
+
self._check_open_mode(node)
|
|
53
|
+
|
|
54
|
+
def _check_open_mode(self, node):
|
|
55
|
+
"""Check that the mode argument of an open or file call is valid."""
|
|
56
|
+
try:
|
|
57
|
+
mode_arg = utils.get_argument_from_call(node, position=1, keyword='mode')
|
|
58
|
+
if mode_arg:
|
|
59
|
+
mode_arg = utils.safe_infer(mode_arg)
|
|
60
|
+
if (isinstance(mode_arg, astroid.Const)
|
|
61
|
+
and not re.match(_VALID_OPEN_MODE_REGEX, mode_arg.value)):
|
|
62
|
+
self.add_message('bad-open-mode', node=node, args=(mode_arg.value))
|
|
63
|
+
except (utils.NoSuchArgumentError, TypeError):
|
|
64
|
+
pass
|
|
65
|
+
|
|
66
|
+
def register(linter):
|
|
67
|
+
"""required method to auto register this checker """
|
|
68
|
+
linter.register_checker(OpenModeChecker(linter))
|
|
69
|
+
|
|
Binary file
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
# Copyright (c) 2009-2010 Arista Networks, Inc. - James Lingard
|
|
2
|
+
# Copyright (c) 2004-2013 LOGILAB S.A. (Paris, FRANCE).
|
|
3
|
+
# Copyright 2012 Google Inc.
|
|
4
|
+
#
|
|
5
|
+
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
|
|
6
|
+
# This program is free software; you can redistribute it and/or modify it under
|
|
7
|
+
# the terms of the GNU General Public License as published by the Free Software
|
|
8
|
+
# Foundation; either version 2 of the License, or (at your option) any later
|
|
9
|
+
# version.
|
|
10
|
+
#
|
|
11
|
+
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
12
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
13
|
+
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details
|
|
14
|
+
#
|
|
15
|
+
# You should have received a copy of the GNU General Public License along with
|
|
16
|
+
# this program; if not, write to the Free Software Foundation, Inc.,
|
|
17
|
+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
18
|
+
"""Checker for string formatting operations.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
import sys
|
|
22
|
+
import tokenize
|
|
23
|
+
|
|
24
|
+
import astroid
|
|
25
|
+
|
|
26
|
+
from pylint.interfaces import ITokenChecker, IAstroidChecker, IRawChecker
|
|
27
|
+
from pylint.checkers import BaseChecker, BaseTokenChecker
|
|
28
|
+
from pylint.checkers import utils
|
|
29
|
+
from pylint.checkers.utils import check_messages
|
|
30
|
+
|
|
31
|
+
_PY3K = sys.version_info >= (3, 0)
|
|
32
|
+
|
|
33
|
+
MSGS = {
|
|
34
|
+
'E1300': ("Unsupported format character %r (%#02x) at index %d",
|
|
35
|
+
"bad-format-character",
|
|
36
|
+
"Used when a unsupported format character is used in a format\
|
|
37
|
+
string."),
|
|
38
|
+
'E1301': ("Format string ends in middle of conversion specifier",
|
|
39
|
+
"truncated-format-string",
|
|
40
|
+
"Used when a format string terminates before the end of a \
|
|
41
|
+
conversion specifier."),
|
|
42
|
+
'E1302': ("Mixing named and unnamed conversion specifiers in format string",
|
|
43
|
+
"mixed-format-string",
|
|
44
|
+
"Used when a format string contains both named (e.g. '%(foo)d') \
|
|
45
|
+
and unnamed (e.g. '%d') conversion specifiers. This is also \
|
|
46
|
+
used when a named conversion specifier contains * for the \
|
|
47
|
+
minimum field width and/or precision."),
|
|
48
|
+
'E1303': ("Expected mapping for format string, not %s",
|
|
49
|
+
"format-needs-mapping",
|
|
50
|
+
"Used when a format string that uses named conversion specifiers \
|
|
51
|
+
is used with an argument that is not a mapping."),
|
|
52
|
+
'W1300': ("Format string dictionary key should be a string, not %s",
|
|
53
|
+
"bad-format-string-key",
|
|
54
|
+
"Used when a format string that uses named conversion specifiers \
|
|
55
|
+
is used with a dictionary whose keys are not all strings."),
|
|
56
|
+
'W1301': ("Unused key %r in format string dictionary",
|
|
57
|
+
"unused-format-string-key",
|
|
58
|
+
"Used when a format string that uses named conversion specifiers \
|
|
59
|
+
is used with a dictionary that conWtains keys not required by the \
|
|
60
|
+
format string."),
|
|
61
|
+
'E1304': ("Missing key %r in format string dictionary",
|
|
62
|
+
"missing-format-string-key",
|
|
63
|
+
"Used when a format string that uses named conversion specifiers \
|
|
64
|
+
is used with a dictionary that doesn't contain all the keys \
|
|
65
|
+
required by the format string."),
|
|
66
|
+
'E1305': ("Too many arguments for format string",
|
|
67
|
+
"too-many-format-args",
|
|
68
|
+
"Used when a format string that uses unnamed conversion \
|
|
69
|
+
specifiers is given too many arguments."),
|
|
70
|
+
'E1306': ("Not enough arguments for format string",
|
|
71
|
+
"too-few-format-args",
|
|
72
|
+
"Used when a format string that uses unnamed conversion \
|
|
73
|
+
specifiers is given too few arguments"),
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
OTHER_NODES = (astroid.Const, astroid.List, astroid.Backquote,
|
|
77
|
+
astroid.Lambda, astroid.Function,
|
|
78
|
+
astroid.ListComp, astroid.SetComp, astroid.GenExpr)
|
|
79
|
+
|
|
80
|
+
class StringFormatChecker(BaseChecker):
|
|
81
|
+
"""Checks string formatting operations to ensure that the format string
|
|
82
|
+
is valid and the arguments match the format string.
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
__implements__ = (IAstroidChecker,)
|
|
86
|
+
name = 'string'
|
|
87
|
+
msgs = MSGS
|
|
88
|
+
|
|
89
|
+
@check_messages(*(MSGS.keys()))
|
|
90
|
+
def visit_binop(self, node):
|
|
91
|
+
if node.op != '%':
|
|
92
|
+
return
|
|
93
|
+
left = node.left
|
|
94
|
+
args = node.right
|
|
95
|
+
|
|
96
|
+
if not (isinstance(left, astroid.Const)
|
|
97
|
+
and isinstance(left.value, basestring)):
|
|
98
|
+
return
|
|
99
|
+
format_string = left.value
|
|
100
|
+
try:
|
|
101
|
+
required_keys, required_num_args = \
|
|
102
|
+
utils.parse_format_string(format_string)
|
|
103
|
+
except utils.UnsupportedFormatCharacter, e:
|
|
104
|
+
c = format_string[e.index]
|
|
105
|
+
self.add_message('bad-format-character', node=node, args=(c, ord(c), e.index))
|
|
106
|
+
return
|
|
107
|
+
except utils.IncompleteFormatString:
|
|
108
|
+
self.add_message('truncated-format-string', node=node)
|
|
109
|
+
return
|
|
110
|
+
if required_keys and required_num_args:
|
|
111
|
+
# The format string uses both named and unnamed format
|
|
112
|
+
# specifiers.
|
|
113
|
+
self.add_message('mixed-format-string', node=node)
|
|
114
|
+
elif required_keys:
|
|
115
|
+
# The format string uses only named format specifiers.
|
|
116
|
+
# Check that the RHS of the % operator is a mapping object
|
|
117
|
+
# that contains precisely the set of keys required by the
|
|
118
|
+
# format string.
|
|
119
|
+
if isinstance(args, astroid.Dict):
|
|
120
|
+
keys = set()
|
|
121
|
+
unknown_keys = False
|
|
122
|
+
for k, _ in args.items:
|
|
123
|
+
if isinstance(k, astroid.Const):
|
|
124
|
+
key = k.value
|
|
125
|
+
if isinstance(key, basestring):
|
|
126
|
+
keys.add(key)
|
|
127
|
+
else:
|
|
128
|
+
self.add_message('bad-format-string-key', node=node, args=key)
|
|
129
|
+
else:
|
|
130
|
+
# One of the keys was something other than a
|
|
131
|
+
# constant. Since we can't tell what it is,
|
|
132
|
+
# supress checks for missing keys in the
|
|
133
|
+
# dictionary.
|
|
134
|
+
unknown_keys = True
|
|
135
|
+
if not unknown_keys:
|
|
136
|
+
for key in required_keys:
|
|
137
|
+
if key not in keys:
|
|
138
|
+
self.add_message('missing-format-string-key', node=node, args=key)
|
|
139
|
+
for key in keys:
|
|
140
|
+
if key not in required_keys:
|
|
141
|
+
self.add_message('unused-format-string-key', node=node, args=key)
|
|
142
|
+
elif isinstance(args, OTHER_NODES + (astroid.Tuple,)):
|
|
143
|
+
type_name = type(args).__name__
|
|
144
|
+
self.add_message('format-needs-mapping', node=node, args=type_name)
|
|
145
|
+
# else:
|
|
146
|
+
# The RHS of the format specifier is a name or
|
|
147
|
+
# expression. It may be a mapping object, so
|
|
148
|
+
# there's nothing we can check.
|
|
149
|
+
else:
|
|
150
|
+
# The format string uses only unnamed format specifiers.
|
|
151
|
+
# Check that the number of arguments passed to the RHS of
|
|
152
|
+
# the % operator matches the number required by the format
|
|
153
|
+
# string.
|
|
154
|
+
if isinstance(args, astroid.Tuple):
|
|
155
|
+
num_args = len(args.elts)
|
|
156
|
+
elif isinstance(args, OTHER_NODES + (astroid.Dict, astroid.DictComp)):
|
|
157
|
+
num_args = 1
|
|
158
|
+
else:
|
|
159
|
+
# The RHS of the format specifier is a name or
|
|
160
|
+
# expression. It could be a tuple of unknown size, so
|
|
161
|
+
# there's nothing we can check.
|
|
162
|
+
num_args = None
|
|
163
|
+
if num_args is not None:
|
|
164
|
+
if num_args > required_num_args:
|
|
165
|
+
self.add_message('too-many-format-args', node=node)
|
|
166
|
+
elif num_args < required_num_args:
|
|
167
|
+
self.add_message('too-few-format-args', node=node)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
class StringMethodsChecker(BaseChecker):
|
|
171
|
+
__implements__ = (IAstroidChecker,)
|
|
172
|
+
name = 'string'
|
|
173
|
+
msgs = {
|
|
174
|
+
'E1310': ("Suspicious argument in %s.%s call",
|
|
175
|
+
"bad-str-strip-call",
|
|
176
|
+
"The argument to a str.{l,r,}strip call contains a"
|
|
177
|
+
" duplicate character, "),
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
@check_messages(*(MSGS.keys()))
|
|
181
|
+
def visit_callfunc(self, node):
|
|
182
|
+
func = utils.safe_infer(node.func)
|
|
183
|
+
if (isinstance(func, astroid.BoundMethod)
|
|
184
|
+
and isinstance(func.bound, astroid.Instance)
|
|
185
|
+
and func.bound.name in ('str', 'unicode', 'bytes')
|
|
186
|
+
and func.name in ('strip', 'lstrip', 'rstrip')
|
|
187
|
+
and node.args):
|
|
188
|
+
arg = utils.safe_infer(node.args[0])
|
|
189
|
+
if not isinstance(arg, astroid.Const):
|
|
190
|
+
return
|
|
191
|
+
if len(arg.value) != len(set(arg.value)):
|
|
192
|
+
self.add_message('bad-str-strip-call', node=node,
|
|
193
|
+
args=(func.bound.name, func.name))
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
class StringConstantChecker(BaseTokenChecker):
|
|
197
|
+
"""Check string literals"""
|
|
198
|
+
__implements__ = (ITokenChecker, IRawChecker)
|
|
199
|
+
name = 'string_constant'
|
|
200
|
+
msgs = {
|
|
201
|
+
'W1401': ('Anomalous backslash in string: \'%s\'. '
|
|
202
|
+
'String constant might be missing an r prefix.',
|
|
203
|
+
'anomalous-backslash-in-string',
|
|
204
|
+
'Used when a backslash is in a literal string but not as an '
|
|
205
|
+
'escape.'),
|
|
206
|
+
'W1402': ('Anomalous Unicode escape in byte string: \'%s\'. '
|
|
207
|
+
'String constant might be missing an r or u prefix.',
|
|
208
|
+
'anomalous-unicode-escape-in-string',
|
|
209
|
+
'Used when an escape like \\u is encountered in a byte '
|
|
210
|
+
'string where it has no effect.'),
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
# Characters that have a special meaning after a backslash in either
|
|
214
|
+
# Unicode or byte strings.
|
|
215
|
+
ESCAPE_CHARACTERS = 'abfnrtvx\n\r\t\\\'\"01234567'
|
|
216
|
+
|
|
217
|
+
# TODO(mbp): Octal characters are quite an edge case today; people may
|
|
218
|
+
# prefer a separate warning where they occur. \0 should be allowed.
|
|
219
|
+
|
|
220
|
+
# Characters that have a special meaning after a backslash but only in
|
|
221
|
+
# Unicode strings.
|
|
222
|
+
UNICODE_ESCAPE_CHARACTERS = 'uUN'
|
|
223
|
+
|
|
224
|
+
def process_module(self, module):
|
|
225
|
+
self._unicode_literals = 'unicode_literals' in module.future_imports
|
|
226
|
+
|
|
227
|
+
def process_tokens(self, tokens):
|
|
228
|
+
for (tok_type, token, (start_row, start_col), _, _) in tokens:
|
|
229
|
+
if tok_type == tokenize.STRING:
|
|
230
|
+
# 'token' is the whole un-parsed token; we can look at the start
|
|
231
|
+
# of it to see whether it's a raw or unicode string etc.
|
|
232
|
+
self.process_string_token(token, start_row, start_col)
|
|
233
|
+
|
|
234
|
+
def process_string_token(self, token, start_row, start_col):
|
|
235
|
+
for i, c in enumerate(token):
|
|
236
|
+
if c in '\'\"':
|
|
237
|
+
quote_char = c
|
|
238
|
+
break
|
|
239
|
+
prefix = token[:i].lower() # markers like u, b, r.
|
|
240
|
+
after_prefix = token[i:]
|
|
241
|
+
if after_prefix[:3] == after_prefix[-3:] == 3 * quote_char:
|
|
242
|
+
string_body = after_prefix[3:-3]
|
|
243
|
+
else:
|
|
244
|
+
string_body = after_prefix[1:-1] # Chop off quotes
|
|
245
|
+
# No special checks on raw strings at the moment.
|
|
246
|
+
if 'r' not in prefix:
|
|
247
|
+
self.process_non_raw_string_token(prefix, string_body,
|
|
248
|
+
start_row, start_col)
|
|
249
|
+
|
|
250
|
+
def process_non_raw_string_token(self, prefix, string_body, start_row,
|
|
251
|
+
start_col):
|
|
252
|
+
"""check for bad escapes in a non-raw string.
|
|
253
|
+
|
|
254
|
+
prefix: lowercase string of eg 'ur' string prefix markers.
|
|
255
|
+
string_body: the un-parsed body of the string, not including the quote
|
|
256
|
+
marks.
|
|
257
|
+
start_row: integer line number in the source.
|
|
258
|
+
start_col: integer column number in the source.
|
|
259
|
+
"""
|
|
260
|
+
# Walk through the string; if we see a backslash then escape the next
|
|
261
|
+
# character, and skip over it. If we see a non-escaped character,
|
|
262
|
+
# alert, and continue.
|
|
263
|
+
#
|
|
264
|
+
# Accept a backslash when it escapes a backslash, or a quote, or
|
|
265
|
+
# end-of-line, or one of the letters that introduce a special escape
|
|
266
|
+
# sequence <http://docs.python.org/reference/lexical_analysis.html>
|
|
267
|
+
#
|
|
268
|
+
# TODO(mbp): Maybe give a separate warning about the rarely-used
|
|
269
|
+
# \a \b \v \f?
|
|
270
|
+
#
|
|
271
|
+
# TODO(mbp): We could give the column of the problem character, but
|
|
272
|
+
# add_message doesn't seem to have a way to pass it through at present.
|
|
273
|
+
i = 0
|
|
274
|
+
while True:
|
|
275
|
+
i = string_body.find('\\', i)
|
|
276
|
+
if i == -1:
|
|
277
|
+
break
|
|
278
|
+
# There must be a next character; having a backslash at the end
|
|
279
|
+
# of the string would be a SyntaxError.
|
|
280
|
+
next_char = string_body[i+1]
|
|
281
|
+
match = string_body[i:i+2]
|
|
282
|
+
if next_char in self.UNICODE_ESCAPE_CHARACTERS:
|
|
283
|
+
if 'u' in prefix:
|
|
284
|
+
pass
|
|
285
|
+
elif (_PY3K or self._unicode_literals) and 'b' not in prefix:
|
|
286
|
+
pass # unicode by default
|
|
287
|
+
else:
|
|
288
|
+
self.add_message('anomalous-unicode-escape-in-string',
|
|
289
|
+
line=start_row, args=(match, ))
|
|
290
|
+
elif next_char not in self.ESCAPE_CHARACTERS:
|
|
291
|
+
self.add_message('anomalous-backslash-in-string',
|
|
292
|
+
line=start_row, args=(match, ))
|
|
293
|
+
# Whether it was a valid escape or not, backslash followed by
|
|
294
|
+
# another character can always be consumed whole: the second
|
|
295
|
+
# character can never be the start of a new backslash escape.
|
|
296
|
+
i += 2
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
def register(linter):
|
|
301
|
+
"""required method to auto register this checker """
|
|
302
|
+
linter.register_checker(StringFormatChecker(linter))
|
|
303
|
+
linter.register_checker(StringMethodsChecker(linter))
|
|
304
|
+
linter.register_checker(StringConstantChecker(linter))
|
|
Binary file
|
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
# Copyright (c) 2006-2013 LOGILAB S.A. (Paris, FRANCE).
|
|
2
|
+
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
|
|
3
|
+
#
|
|
4
|
+
# This program is free software; you can redistribute it and/or modify it under
|
|
5
|
+
# the terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
# Foundation; either version 2 of the License, or (at your option) any later
|
|
7
|
+
# version.
|
|
8
|
+
#
|
|
9
|
+
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
10
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
+
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
12
|
+
#
|
|
13
|
+
# You should have received a copy of the GNU General Public License along with
|
|
14
|
+
# this program; if not, write to the Free Software Foundation, Inc.,
|
|
15
|
+
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
16
|
+
"""try to find more bugs in the code using astroid inference capabilities
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
import re
|
|
20
|
+
import shlex
|
|
21
|
+
|
|
22
|
+
import astroid
|
|
23
|
+
from astroid import InferenceError, NotFoundError, YES, Instance
|
|
24
|
+
|
|
25
|
+
from pylint.interfaces import IAstroidChecker
|
|
26
|
+
from pylint.checkers import BaseChecker
|
|
27
|
+
from pylint.checkers.utils import safe_infer, is_super, check_messages
|
|
28
|
+
|
|
29
|
+
MSGS = {
|
|
30
|
+
'E1101': ('%s %r has no %r member',
|
|
31
|
+
'no-member',
|
|
32
|
+
'Used when a variable is accessed for an unexistent member.'),
|
|
33
|
+
'E1102': ('%s is not callable',
|
|
34
|
+
'not-callable',
|
|
35
|
+
'Used when an object being called has been inferred to a non \
|
|
36
|
+
callable object'),
|
|
37
|
+
'E1103': ('%s %r has no %r member (but some types could not be inferred)',
|
|
38
|
+
'maybe-no-member',
|
|
39
|
+
'Used when a variable is accessed for an unexistent member, but \
|
|
40
|
+
astroid was not able to interpret all possible types of this \
|
|
41
|
+
variable.'),
|
|
42
|
+
'E1111': ('Assigning to function call which doesn\'t return',
|
|
43
|
+
'assignment-from-no-return',
|
|
44
|
+
'Used when an assignment is done on a function call but the \
|
|
45
|
+
inferred function doesn\'t return anything.'),
|
|
46
|
+
'W1111': ('Assigning to function call which only returns None',
|
|
47
|
+
'assignment-from-none',
|
|
48
|
+
'Used when an assignment is done on a function call but the \
|
|
49
|
+
inferred function returns nothing but None.'),
|
|
50
|
+
|
|
51
|
+
'E1120': ('No value for argument %s in %s call',
|
|
52
|
+
'no-value-for-parameter',
|
|
53
|
+
'Used when a function call passes too few arguments.'),
|
|
54
|
+
'E1121': ('Too many positional arguments for %s call',
|
|
55
|
+
'too-many-function-args',
|
|
56
|
+
'Used when a function call passes too many positional \
|
|
57
|
+
arguments.'),
|
|
58
|
+
'E1122': ('Duplicate keyword argument %r in %s call',
|
|
59
|
+
'duplicate-keyword-arg',
|
|
60
|
+
'Used when a function call passes the same keyword argument \
|
|
61
|
+
multiple times.',
|
|
62
|
+
{'maxversion': (2, 6)}),
|
|
63
|
+
'E1123': ('Unexpected keyword argument %r in %s call',
|
|
64
|
+
'unexpected-keyword-arg',
|
|
65
|
+
'Used when a function call passes a keyword argument that \
|
|
66
|
+
doesn\'t correspond to one of the function\'s parameter names.'),
|
|
67
|
+
'E1124': ('Argument %r passed by position and keyword in %s call',
|
|
68
|
+
'redundant-keyword-arg',
|
|
69
|
+
'Used when a function call would result in assigning multiple \
|
|
70
|
+
values to a function parameter, one value from a positional \
|
|
71
|
+
argument and one from a keyword argument.'),
|
|
72
|
+
'E1125': ('Missing mandatory keyword argument %r in %s call',
|
|
73
|
+
'missing-kwoa',
|
|
74
|
+
('Used when a function call does not pass a mandatory'
|
|
75
|
+
' keyword-only argument.'),
|
|
76
|
+
{'minversion': (3, 0)}),
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
def _determine_callable(callable_obj):
|
|
80
|
+
# Ordering is important, since BoundMethod is a subclass of UnboundMethod,
|
|
81
|
+
# and Function inherits Lambda.
|
|
82
|
+
if isinstance(callable_obj, astroid.BoundMethod):
|
|
83
|
+
# Bound methods have an extra implicit 'self' argument.
|
|
84
|
+
return callable_obj, 1, callable_obj.type
|
|
85
|
+
elif isinstance(callable_obj, astroid.UnboundMethod):
|
|
86
|
+
return callable_obj, 0, 'unbound method'
|
|
87
|
+
elif isinstance(callable_obj, astroid.Function):
|
|
88
|
+
return callable_obj, 0, callable_obj.type
|
|
89
|
+
elif isinstance(callable_obj, astroid.Lambda):
|
|
90
|
+
return callable_obj, 0, 'lambda'
|
|
91
|
+
elif isinstance(callable_obj, astroid.Class):
|
|
92
|
+
# Class instantiation, lookup __new__ instead.
|
|
93
|
+
# If we only find object.__new__, we can safely check __init__
|
|
94
|
+
# instead.
|
|
95
|
+
try:
|
|
96
|
+
# Use the last definition of __new__.
|
|
97
|
+
new = callable_obj.local_attr('__new__')[-1]
|
|
98
|
+
except astroid.NotFoundError:
|
|
99
|
+
new = None
|
|
100
|
+
|
|
101
|
+
if not new or new.parent.scope().name == 'object':
|
|
102
|
+
try:
|
|
103
|
+
# Use the last definition of __init__.
|
|
104
|
+
callable_obj = callable_obj.local_attr('__init__')[-1]
|
|
105
|
+
except astroid.NotFoundError:
|
|
106
|
+
# do nothing, covered by no-init.
|
|
107
|
+
raise ValueError
|
|
108
|
+
else:
|
|
109
|
+
callable_obj = new
|
|
110
|
+
|
|
111
|
+
if not isinstance(callable_obj, astroid.Function):
|
|
112
|
+
raise ValueError
|
|
113
|
+
# both have an extra implicit 'cls'/'self' argument.
|
|
114
|
+
return callable_obj, 1, 'constructor'
|
|
115
|
+
else:
|
|
116
|
+
raise ValueError
|
|
117
|
+
|
|
118
|
+
class TypeChecker(BaseChecker):
|
|
119
|
+
"""try to find bugs in the code using type inference
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
__implements__ = (IAstroidChecker,)
|
|
123
|
+
|
|
124
|
+
# configuration section name
|
|
125
|
+
name = 'typecheck'
|
|
126
|
+
# messages
|
|
127
|
+
msgs = MSGS
|
|
128
|
+
priority = -1
|
|
129
|
+
# configuration options
|
|
130
|
+
options = (('ignore-mixin-members',
|
|
131
|
+
{'default' : True, 'type' : 'yn', 'metavar': '<y_or_n>',
|
|
132
|
+
'help' : 'Tells whether missing members accessed in mixin \
|
|
133
|
+
class should be ignored. A mixin class is detected if its name ends with \
|
|
134
|
+
"mixin" (case insensitive).'}
|
|
135
|
+
),
|
|
136
|
+
('ignored-modules',
|
|
137
|
+
{'default': (),
|
|
138
|
+
'type': 'csv',
|
|
139
|
+
'metavar': '<module names>',
|
|
140
|
+
'help': 'List of module names for which member attributes \
|
|
141
|
+
should not be checked (useful for modules/projects where namespaces are \
|
|
142
|
+
manipulated during runtime and thus existing member attributes cannot be \
|
|
143
|
+
deduced by static analysis'},
|
|
144
|
+
),
|
|
145
|
+
('ignored-classes',
|
|
146
|
+
{'default' : ('SQLObject',),
|
|
147
|
+
'type' : 'csv',
|
|
148
|
+
'metavar' : '<members names>',
|
|
149
|
+
'help' : 'List of classes names for which member attributes \
|
|
150
|
+
should not be checked (useful for classes with attributes dynamically set).'}
|
|
151
|
+
),
|
|
152
|
+
|
|
153
|
+
('zope',
|
|
154
|
+
{'default' : False, 'type' : 'yn', 'metavar': '<y_or_n>',
|
|
155
|
+
'help' : 'When zope mode is activated, add a predefined set \
|
|
156
|
+
of Zope acquired attributes to generated-members.'}
|
|
157
|
+
),
|
|
158
|
+
('generated-members',
|
|
159
|
+
{'default' : (
|
|
160
|
+
'REQUEST', 'acl_users', 'aq_parent'),
|
|
161
|
+
'type' : 'string',
|
|
162
|
+
'metavar' : '<members names>',
|
|
163
|
+
'help' : 'List of members which are set dynamically and \
|
|
164
|
+
missed by pylint inference system, and so shouldn\'t trigger E0201 when \
|
|
165
|
+
accessed. Python regular expressions are accepted.'}
|
|
166
|
+
),
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
def open(self):
|
|
170
|
+
# do this in open since config not fully initialized in __init__
|
|
171
|
+
self.generated_members = list(self.config.generated_members)
|
|
172
|
+
if self.config.zope:
|
|
173
|
+
self.generated_members.extend(('REQUEST', 'acl_users', 'aq_parent'))
|
|
174
|
+
|
|
175
|
+
def visit_assattr(self, node):
|
|
176
|
+
if isinstance(node.ass_type(), astroid.AugAssign):
|
|
177
|
+
self.visit_getattr(node)
|
|
178
|
+
|
|
179
|
+
def visit_delattr(self, node):
|
|
180
|
+
self.visit_getattr(node)
|
|
181
|
+
|
|
182
|
+
@check_messages('no-member', 'maybe-no-member')
|
|
183
|
+
def visit_getattr(self, node):
|
|
184
|
+
"""check that the accessed attribute exists
|
|
185
|
+
|
|
186
|
+
to avoid to much false positives for now, we'll consider the code as
|
|
187
|
+
correct if a single of the inferred nodes has the accessed attribute.
|
|
188
|
+
|
|
189
|
+
function/method, super call and metaclasses are ignored
|
|
190
|
+
"""
|
|
191
|
+
# generated_members may containt regular expressions
|
|
192
|
+
# (surrounded by quote `"` and followed by a comma `,`)
|
|
193
|
+
# REQUEST,aq_parent,"[a-zA-Z]+_set{1,2}"' =>
|
|
194
|
+
# ('REQUEST', 'aq_parent', '[a-zA-Z]+_set{1,2}')
|
|
195
|
+
if isinstance(self.config.generated_members, str):
|
|
196
|
+
gen = shlex.shlex(self.config.generated_members)
|
|
197
|
+
gen.whitespace += ','
|
|
198
|
+
gen.wordchars += '[]-+'
|
|
199
|
+
self.config.generated_members = tuple(tok.strip('"') for tok in gen)
|
|
200
|
+
for pattern in self.config.generated_members:
|
|
201
|
+
# attribute is marked as generated, stop here
|
|
202
|
+
if re.match(pattern, node.attrname):
|
|
203
|
+
return
|
|
204
|
+
try:
|
|
205
|
+
infered = list(node.expr.infer())
|
|
206
|
+
except InferenceError:
|
|
207
|
+
return
|
|
208
|
+
# list of (node, nodename) which are missing the attribute
|
|
209
|
+
missingattr = set()
|
|
210
|
+
ignoremim = self.config.ignore_mixin_members
|
|
211
|
+
inference_failure = False
|
|
212
|
+
for owner in infered:
|
|
213
|
+
# skip yes object
|
|
214
|
+
if owner is YES:
|
|
215
|
+
inference_failure = True
|
|
216
|
+
continue
|
|
217
|
+
# skip None anyway
|
|
218
|
+
if isinstance(owner, astroid.Const) and owner.value is None:
|
|
219
|
+
continue
|
|
220
|
+
# XXX "super" / metaclass call
|
|
221
|
+
if is_super(owner) or getattr(owner, 'type', None) == 'metaclass':
|
|
222
|
+
continue
|
|
223
|
+
name = getattr(owner, 'name', 'None')
|
|
224
|
+
if name in self.config.ignored_classes:
|
|
225
|
+
continue
|
|
226
|
+
if ignoremim and name[-5:].lower() == 'mixin':
|
|
227
|
+
continue
|
|
228
|
+
try:
|
|
229
|
+
if not [n for n in owner.getattr(node.attrname)
|
|
230
|
+
if not isinstance(n.statement(), astroid.AugAssign)]:
|
|
231
|
+
missingattr.add((owner, name))
|
|
232
|
+
continue
|
|
233
|
+
except AttributeError:
|
|
234
|
+
# XXX method / function
|
|
235
|
+
continue
|
|
236
|
+
except NotFoundError:
|
|
237
|
+
if isinstance(owner, astroid.Function) and owner.decorators:
|
|
238
|
+
continue
|
|
239
|
+
if isinstance(owner, Instance) and owner.has_dynamic_getattr():
|
|
240
|
+
continue
|
|
241
|
+
# explicit skipping of module member access
|
|
242
|
+
if owner.root().name in self.config.ignored_modules:
|
|
243
|
+
continue
|
|
244
|
+
missingattr.add((owner, name))
|
|
245
|
+
continue
|
|
246
|
+
# stop on the first found
|
|
247
|
+
break
|
|
248
|
+
else:
|
|
249
|
+
# we have not found any node with the attributes, display the
|
|
250
|
+
# message for infered nodes
|
|
251
|
+
done = set()
|
|
252
|
+
for owner, name in missingattr:
|
|
253
|
+
if isinstance(owner, Instance):
|
|
254
|
+
actual = owner._proxied
|
|
255
|
+
else:
|
|
256
|
+
actual = owner
|
|
257
|
+
if actual in done:
|
|
258
|
+
continue
|
|
259
|
+
done.add(actual)
|
|
260
|
+
if inference_failure:
|
|
261
|
+
msgid = 'maybe-no-member'
|
|
262
|
+
else:
|
|
263
|
+
msgid = 'no-member'
|
|
264
|
+
self.add_message(msgid, node=node,
|
|
265
|
+
args=(owner.display_type(), name,
|
|
266
|
+
node.attrname))
|
|
267
|
+
|
|
268
|
+
@check_messages('assignment-from-no-return', 'assignment-from-none')
|
|
269
|
+
def visit_assign(self, node):
|
|
270
|
+
"""check that if assigning to a function call, the function is
|
|
271
|
+
possibly returning something valuable
|
|
272
|
+
"""
|
|
273
|
+
if not isinstance(node.value, astroid.CallFunc):
|
|
274
|
+
return
|
|
275
|
+
function_node = safe_infer(node.value.func)
|
|
276
|
+
# skip class, generator and incomplete function definition
|
|
277
|
+
if not (isinstance(function_node, astroid.Function) and
|
|
278
|
+
function_node.root().fully_defined()):
|
|
279
|
+
return
|
|
280
|
+
if function_node.is_generator() \
|
|
281
|
+
or function_node.is_abstract(pass_is_abstract=False):
|
|
282
|
+
return
|
|
283
|
+
returns = list(function_node.nodes_of_class(astroid.Return,
|
|
284
|
+
skip_klass=astroid.Function))
|
|
285
|
+
if len(returns) == 0:
|
|
286
|
+
self.add_message('assignment-from-no-return', node=node)
|
|
287
|
+
else:
|
|
288
|
+
for rnode in returns:
|
|
289
|
+
if not (isinstance(rnode.value, astroid.Const)
|
|
290
|
+
and rnode.value.value is None
|
|
291
|
+
or rnode.value is None):
|
|
292
|
+
break
|
|
293
|
+
else:
|
|
294
|
+
self.add_message('assignment-from-none', node=node)
|
|
295
|
+
|
|
296
|
+
@check_messages(*(MSGS.keys()))
|
|
297
|
+
def visit_callfunc(self, node):
|
|
298
|
+
"""check that called functions/methods are inferred to callable objects,
|
|
299
|
+
and that the arguments passed to the function match the parameters in
|
|
300
|
+
the inferred function's definition
|
|
301
|
+
"""
|
|
302
|
+
# Build the set of keyword arguments, checking for duplicate keywords,
|
|
303
|
+
# and count the positional arguments.
|
|
304
|
+
keyword_args = set()
|
|
305
|
+
num_positional_args = 0
|
|
306
|
+
for arg in node.args:
|
|
307
|
+
if isinstance(arg, astroid.Keyword):
|
|
308
|
+
keyword = arg.arg
|
|
309
|
+
if keyword in keyword_args:
|
|
310
|
+
self.add_message('duplicate-keyword-arg', node=node, args=keyword)
|
|
311
|
+
keyword_args.add(keyword)
|
|
312
|
+
else:
|
|
313
|
+
num_positional_args += 1
|
|
314
|
+
|
|
315
|
+
called = safe_infer(node.func)
|
|
316
|
+
# only function, generator and object defining __call__ are allowed
|
|
317
|
+
if called is not None and not called.callable():
|
|
318
|
+
self.add_message('not-callable', node=node, args=node.func.as_string())
|
|
319
|
+
|
|
320
|
+
try:
|
|
321
|
+
called, implicit_args, callable_name = _determine_callable(called)
|
|
322
|
+
except ValueError:
|
|
323
|
+
# Any error occurred during determining the function type, most of
|
|
324
|
+
# those errors are handled by different warnings.
|
|
325
|
+
return
|
|
326
|
+
num_positional_args += implicit_args
|
|
327
|
+
if called.args.args is None:
|
|
328
|
+
# Built-in functions have no argument information.
|
|
329
|
+
return
|
|
330
|
+
|
|
331
|
+
if len(called.argnames()) != len(set(called.argnames())):
|
|
332
|
+
# Duplicate parameter name (see E9801). We can't really make sense
|
|
333
|
+
# of the function call in this case, so just return.
|
|
334
|
+
return
|
|
335
|
+
|
|
336
|
+
# Analyze the list of formal parameters.
|
|
337
|
+
num_mandatory_parameters = len(called.args.args) - len(called.args.defaults)
|
|
338
|
+
parameters = []
|
|
339
|
+
parameter_name_to_index = {}
|
|
340
|
+
for i, arg in enumerate(called.args.args):
|
|
341
|
+
if isinstance(arg, astroid.Tuple):
|
|
342
|
+
name = None
|
|
343
|
+
# Don't store any parameter names within the tuple, since those
|
|
344
|
+
# are not assignable from keyword arguments.
|
|
345
|
+
else:
|
|
346
|
+
if isinstance(arg, astroid.Keyword):
|
|
347
|
+
name = arg.arg
|
|
348
|
+
else:
|
|
349
|
+
assert isinstance(arg, astroid.AssName)
|
|
350
|
+
# This occurs with:
|
|
351
|
+
# def f( (a), (b) ): pass
|
|
352
|
+
name = arg.name
|
|
353
|
+
parameter_name_to_index[name] = i
|
|
354
|
+
if i >= num_mandatory_parameters:
|
|
355
|
+
defval = called.args.defaults[i - num_mandatory_parameters]
|
|
356
|
+
else:
|
|
357
|
+
defval = None
|
|
358
|
+
parameters.append([(name, defval), False])
|
|
359
|
+
|
|
360
|
+
kwparams = {}
|
|
361
|
+
for i, arg in enumerate(called.args.kwonlyargs):
|
|
362
|
+
if isinstance(arg, astroid.Keyword):
|
|
363
|
+
name = arg.arg
|
|
364
|
+
else:
|
|
365
|
+
assert isinstance(arg, astroid.AssName)
|
|
366
|
+
name = arg.name
|
|
367
|
+
kwparams[name] = [called.args.kw_defaults[i], False]
|
|
368
|
+
|
|
369
|
+
# Match the supplied arguments against the function parameters.
|
|
370
|
+
|
|
371
|
+
# 1. Match the positional arguments.
|
|
372
|
+
for i in range(num_positional_args):
|
|
373
|
+
if i < len(parameters):
|
|
374
|
+
parameters[i][1] = True
|
|
375
|
+
elif called.args.vararg is not None:
|
|
376
|
+
# The remaining positional arguments get assigned to the *args
|
|
377
|
+
# parameter.
|
|
378
|
+
break
|
|
379
|
+
else:
|
|
380
|
+
# Too many positional arguments.
|
|
381
|
+
self.add_message('too-many-function-args', node=node, args=(callable_name,))
|
|
382
|
+
break
|
|
383
|
+
|
|
384
|
+
# 2. Match the keyword arguments.
|
|
385
|
+
for keyword in keyword_args:
|
|
386
|
+
if keyword in parameter_name_to_index:
|
|
387
|
+
i = parameter_name_to_index[keyword]
|
|
388
|
+
if parameters[i][1]:
|
|
389
|
+
# Duplicate definition of function parameter.
|
|
390
|
+
self.add_message('redundant-keyword-arg', node=node, args=(keyword, callable_name))
|
|
391
|
+
else:
|
|
392
|
+
parameters[i][1] = True
|
|
393
|
+
elif keyword in kwparams:
|
|
394
|
+
if kwparams[keyword][1]: # XXX is that even possible?
|
|
395
|
+
# Duplicate definition of function parameter.
|
|
396
|
+
self.add_message('redundant-keyword-arg', node=node, args=(keyword, callable_name))
|
|
397
|
+
else:
|
|
398
|
+
kwparams[keyword][1] = True
|
|
399
|
+
elif called.args.kwarg is not None:
|
|
400
|
+
# The keyword argument gets assigned to the **kwargs parameter.
|
|
401
|
+
pass
|
|
402
|
+
else:
|
|
403
|
+
# Unexpected keyword argument.
|
|
404
|
+
self.add_message('unexpected-keyword-arg', node=node, args=(keyword, callable_name))
|
|
405
|
+
|
|
406
|
+
# 3. Match the *args, if any. Note that Python actually processes
|
|
407
|
+
# *args _before_ any keyword arguments, but we wait until after
|
|
408
|
+
# looking at the keyword arguments so as to make a more conservative
|
|
409
|
+
# guess at how many values are in the *args sequence.
|
|
410
|
+
if node.starargs is not None:
|
|
411
|
+
for i in range(num_positional_args, len(parameters)):
|
|
412
|
+
[(name, defval), assigned] = parameters[i]
|
|
413
|
+
# Assume that *args provides just enough values for all
|
|
414
|
+
# non-default parameters after the last parameter assigned by
|
|
415
|
+
# the positional arguments but before the first parameter
|
|
416
|
+
# assigned by the keyword arguments. This is the best we can
|
|
417
|
+
# get without generating any false positives.
|
|
418
|
+
if (defval is not None) or assigned:
|
|
419
|
+
break
|
|
420
|
+
parameters[i][1] = True
|
|
421
|
+
|
|
422
|
+
# 4. Match the **kwargs, if any.
|
|
423
|
+
if node.kwargs is not None:
|
|
424
|
+
for i, [(name, defval), assigned] in enumerate(parameters):
|
|
425
|
+
# Assume that *kwargs provides values for all remaining
|
|
426
|
+
# unassigned named parameters.
|
|
427
|
+
if name is not None:
|
|
428
|
+
parameters[i][1] = True
|
|
429
|
+
else:
|
|
430
|
+
# **kwargs can't assign to tuples.
|
|
431
|
+
pass
|
|
432
|
+
|
|
433
|
+
# Check that any parameters without a default have been assigned
|
|
434
|
+
# values.
|
|
435
|
+
for [(name, defval), assigned] in parameters:
|
|
436
|
+
if (defval is None) and not assigned:
|
|
437
|
+
if name is None:
|
|
438
|
+
display_name = '<tuple>'
|
|
439
|
+
else:
|
|
440
|
+
display_name = repr(name)
|
|
441
|
+
self.add_message('no-value-for-parameter', node=node, args=(display_name, callable_name))
|
|
442
|
+
|
|
443
|
+
for name in kwparams:
|
|
444
|
+
defval, assigned = kwparams[name]
|
|
445
|
+
if defval is None and not assigned:
|
|
446
|
+
self.add_message('missing-kwoa', node=node, args=(name, callable_name))
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
def register(linter):
|
|
450
|
+
"""required method to auto register this checker """
|
|
451
|
+
linter.register_checker(TypeChecker(linter))
|