ruby-lint 0.0.2 → 0.0.3
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.
- data.tar.gz.asc +17 -0
- data/.gitignore +1 -0
- data/.travis.yml +25 -0
- data/.yardopts +4 -0
- data/Gemfile +1 -1
- data/LICENSE +1 -1
- data/MANIFEST +238 -49
- data/README.md +84 -131
- data/Rakefile +6 -0
- data/bin/ruby-lint +2 -2
- data/checksum/.gitkeep +0 -0
- data/doc/DCO.md +26 -0
- data/doc/architecture.md +63 -0
- data/doc/code_analysis.md +90 -0
- data/doc/configuration.md +86 -0
- data/doc/contributing.md +16 -0
- data/doc/graphviz/flow.dot +7 -0
- data/doc/images/.gitkeep +0 -0
- data/doc/images/flow.png +0 -0
- data/lib/ruby-lint.rb +35 -35
- data/lib/ruby-lint/analyze/argument_amount.rb +73 -0
- data/lib/ruby-lint/analyze/shadowing_variables.rb +19 -24
- data/lib/ruby-lint/analyze/undefined_methods.rb +68 -0
- data/lib/ruby-lint/analyze/undefined_variables.rb +42 -69
- data/lib/ruby-lint/analyze/unused_variables.rb +23 -78
- data/lib/ruby-lint/base.rb +85 -0
- data/lib/ruby-lint/cli.rb +23 -167
- data/lib/ruby-lint/cli/analyze.rb +99 -0
- data/lib/ruby-lint/cli/ast.rb +35 -0
- data/lib/ruby-lint/cli/base.rb +120 -0
- data/lib/ruby-lint/configuration.rb +112 -0
- data/lib/ruby-lint/constant_loader.rb +92 -0
- data/lib/ruby-lint/definition/ruby_method.rb +248 -0
- data/lib/ruby-lint/definition/ruby_object.rb +757 -0
- data/lib/ruby-lint/definition_generator.rb +155 -0
- data/lib/ruby-lint/definitions/core.rb +5 -0
- data/lib/ruby-lint/definitions/core/arg0.rb +7 -0
- data/lib/ruby-lint/definitions/core/argf.rb +7 -0
- data/lib/ruby-lint/definitions/core/argument_error.rb +12 -0
- data/lib/ruby-lint/definitions/core/argv.rb +7 -0
- data/lib/ruby-lint/definitions/core/array.rb +414 -0
- data/lib/ruby-lint/definitions/core/autoload.rb +39 -0
- data/lib/ruby-lint/definitions/core/basic_object.rb +46 -0
- data/lib/ruby-lint/definitions/core/bignum.rb +128 -0
- data/lib/ruby-lint/definitions/core/binding.rb +52 -0
- data/lib/ruby-lint/definitions/core/class.rb +23 -0
- data/lib/ruby-lint/definitions/core/comparable.rb +38 -0
- data/lib/ruby-lint/definitions/core/complex.rb +195 -0
- data/lib/ruby-lint/definitions/core/condition_variable.rb +19 -0
- data/lib/ruby-lint/definitions/core/continuation.rb +8 -0
- data/lib/ruby-lint/definitions/core/data.rb +8 -0
- data/lib/ruby-lint/definitions/core/date.rb +706 -0
- data/lib/ruby-lint/definitions/core/date_time.rb +381 -0
- data/lib/ruby-lint/definitions/core/default_record_separator.rb +7 -0
- data/lib/ruby-lint/definitions/core/digest.rb +166 -0
- data/lib/ruby-lint/definitions/core/dir.rb +496 -0
- data/lib/ruby-lint/definitions/core/encoding.rb +2030 -0
- data/lib/ruby-lint/definitions/core/encoding_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/enumerable.rb +352 -0
- data/lib/ruby-lint/definitions/core/enumerator.rb +37 -0
- data/lib/ruby-lint/definitions/core/env.rb +7 -0
- data/lib/ruby-lint/definitions/core/eoferror.rb +8 -0
- data/lib/ruby-lint/definitions/core/erb.rb +304 -0
- data/lib/ruby-lint/definitions/core/errno.rb +3331 -0
- data/lib/ruby-lint/definitions/core/etc.rb +138 -0
- data/lib/ruby-lint/definitions/core/exception.rb +72 -0
- data/lib/ruby-lint/definitions/core/false.rb +7 -0
- data/lib/ruby-lint/definitions/core/false_class.rb +30 -0
- data/lib/ruby-lint/definitions/core/fatal_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/fiber.rb +35 -0
- data/lib/ruby-lint/definitions/core/fiber_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/file.rb +1277 -0
- data/lib/ruby-lint/definitions/core/file_list.rb +727 -0
- data/lib/ruby-lint/definitions/core/file_test.rb +106 -0
- data/lib/ruby-lint/definitions/core/file_utils.rb +1027 -0
- data/lib/ruby-lint/definitions/core/fixnum.rb +156 -0
- data/lib/ruby-lint/definitions/core/float.rb +307 -0
- data/lib/ruby-lint/definitions/core/float_domain_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/gc.rb +57 -0
- data/lib/ruby-lint/definitions/core/gem.rb +3161 -0
- data/lib/ruby-lint/definitions/core/hash.rb +512 -0
- data/lib/ruby-lint/definitions/core/immediate_value.rb +19 -0
- data/lib/ruby-lint/definitions/core/index_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/integer.rb +100 -0
- data/lib/ruby-lint/definitions/core/interrupt.rb +14 -0
- data/lib/ruby-lint/definitions/core/io.rb +928 -0
- data/lib/ruby-lint/definitions/core/ioerror.rb +8 -0
- data/lib/ruby-lint/definitions/core/kernel.rb +504 -0
- data/lib/ruby-lint/definitions/core/key_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/load_error.rb +28 -0
- data/lib/ruby-lint/definitions/core/local_jump_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/main.rb +25 -0
- data/lib/ruby-lint/definitions/core/marshal.rb +466 -0
- data/lib/ruby-lint/definitions/core/match_data.rb +73 -0
- data/lib/ruby-lint/definitions/core/math.rb +205 -0
- data/lib/ruby-lint/definitions/core/memory_segmention_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/method.rb +61 -0
- data/lib/ruby-lint/definitions/core/module.rb +262 -0
- data/lib/ruby-lint/definitions/core/monitor.rb +39 -0
- data/lib/ruby-lint/definitions/core/monitor_mixin.rb +59 -0
- data/lib/ruby-lint/definitions/core/mutex.rb +32 -0
- data/lib/ruby-lint/definitions/core/name_error.rb +16 -0
- data/lib/ruby-lint/definitions/core/nil.rb +7 -0
- data/lib/ruby-lint/definitions/core/nil_class.rb +46 -0
- data/lib/ruby-lint/definitions/core/no_memory_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/no_method_error.rb +18 -0
- data/lib/ruby-lint/definitions/core/not_implemented_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/numeric.rb +123 -0
- data/lib/ruby-lint/definitions/core/object.rb +31 -0
- data/lib/ruby-lint/definitions/core/object_space.rb +41 -0
- data/lib/ruby-lint/definitions/core/open_struct.rb +49 -0
- data/lib/ruby-lint/definitions/core/option_parser.rb +1355 -0
- data/lib/ruby-lint/definitions/core/precision.rb +21 -0
- data/lib/ruby-lint/definitions/core/primitive_failure.rb +8 -0
- data/lib/ruby-lint/definitions/core/proc.rb +109 -0
- data/lib/ruby-lint/definitions/core/process.rb +602 -0
- data/lib/ruby-lint/definitions/core/psych.rb +2231 -0
- data/lib/ruby-lint/definitions/core/queue.rb +44 -0
- data/lib/ruby-lint/definitions/core/rake.rb +4784 -0
- data/lib/ruby-lint/definitions/core/rake_file_utils.rb +203 -0
- data/lib/ruby-lint/definitions/core/rakeversion.rb +7 -0
- data/lib/ruby-lint/definitions/core/random.rb +38 -0
- data/lib/ruby-lint/definitions/core/range.rb +104 -0
- data/lib/ruby-lint/definitions/core/range_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/rational.rb +96 -0
- data/lib/ruby-lint/definitions/core/rb_config.rb +36 -0
- data/lib/ruby-lint/definitions/core/regexp.rb +396 -0
- data/lib/ruby-lint/definitions/core/regexp_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/rubinius.rb +16637 -0
- data/lib/ruby-lint/definitions/core/ruby_copyright.rb +7 -0
- data/lib/ruby-lint/definitions/core/ruby_description.rb +7 -0
- data/lib/ruby-lint/definitions/core/ruby_engine.rb +7 -0
- data/lib/ruby-lint/definitions/core/ruby_lint.rb +93 -0
- data/lib/ruby-lint/definitions/core/ruby_patchlevel.rb +7 -0
- data/lib/ruby-lint/definitions/core/ruby_platform.rb +7 -0
- data/lib/ruby-lint/definitions/core/ruby_release_date.rb +7 -0
- data/lib/ruby-lint/definitions/core/ruby_version.rb +7 -0
- data/lib/ruby-lint/definitions/core/runtime_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/scan_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/script_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/security_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/shellwords.rb +37 -0
- data/lib/ruby-lint/definitions/core/signal.rb +37 -0
- data/lib/ruby-lint/definitions/core/signal_exception.rb +19 -0
- data/lib/ruby-lint/definitions/core/singleton.rb +37 -0
- data/lib/ruby-lint/definitions/core/sized_queue.rb +42 -0
- data/lib/ruby-lint/definitions/core/standard_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/stderr.rb +7 -0
- data/lib/ruby-lint/definitions/core/stdin.rb +7 -0
- data/lib/ruby-lint/definitions/core/stdout.rb +7 -0
- data/lib/ruby-lint/definitions/core/stop_iteration.rb +8 -0
- data/lib/ruby-lint/definitions/core/string.rb +713 -0
- data/lib/ruby-lint/definitions/core/string_io.rb +287 -0
- data/lib/ruby-lint/definitions/core/string_scanner.rb +158 -0
- data/lib/ruby-lint/definitions/core/struct.rb +357 -0
- data/lib/ruby-lint/definitions/core/syck.rb +30 -0
- data/lib/ruby-lint/definitions/core/symbol.rb +90 -0
- data/lib/ruby-lint/definitions/core/syntax_error.rb +44 -0
- data/lib/ruby-lint/definitions/core/system_call_error.rb +31 -0
- data/lib/ruby-lint/definitions/core/system_exit.rb +19 -0
- data/lib/ruby-lint/definitions/core/system_stack_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/thread.rb +209 -0
- data/lib/ruby-lint/definitions/core/thread_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/thread_group.rb +22 -0
- data/lib/ruby-lint/definitions/core/time.rb +233 -0
- data/lib/ruby-lint/definitions/core/toplevel_binding.rb +7 -0
- data/lib/ruby-lint/definitions/core/true.rb +7 -0
- data/lib/ruby-lint/definitions/core/true_class.rb +30 -0
- data/lib/ruby-lint/definitions/core/type_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/unbound_method.rb +51 -0
- data/lib/ruby-lint/definitions/core/unmarshalable.rb +13 -0
- data/lib/ruby-lint/definitions/core/unsupported_library_error.rb +8 -0
- data/lib/ruby-lint/definitions/core/weak_ref.rb +42 -0
- data/lib/ruby-lint/definitions/core/zero_division_error.rb +8 -0
- data/lib/ruby-lint/definitions_builder.rb +692 -0
- data/lib/ruby-lint/extensions/string.rb +15 -0
- data/lib/ruby-lint/helper/constant_paths.rb +41 -0
- data/lib/ruby-lint/helper/conversion.rb +33 -0
- data/lib/ruby-lint/helper/current_scope.rb +98 -0
- data/lib/ruby-lint/helper/methods.rb +91 -0
- data/lib/ruby-lint/inspector.rb +191 -0
- data/lib/ruby-lint/iterator.rb +187 -127
- data/lib/ruby-lint/node.rb +107 -0
- data/lib/ruby-lint/parser.rb +510 -1137
- data/lib/ruby-lint/parser_error.rb +15 -27
- data/lib/ruby-lint/presenter/json.rb +19 -0
- data/lib/ruby-lint/presenter/text.rb +37 -0
- data/lib/ruby-lint/report.rb +95 -53
- data/lib/ruby-lint/report/entry.rb +71 -0
- data/lib/ruby-lint/template/definition.erb +24 -0
- data/lib/ruby-lint/template/scope.rb +25 -0
- data/lib/ruby-lint/variable_predicates.rb +109 -0
- data/lib/ruby-lint/version.rb +1 -1
- data/ruby-lint.gemspec +19 -8
- data/spec/helper.rb +10 -2
- data/spec/ruby-lint/analyze/argument_amount.rb +91 -0
- data/spec/ruby-lint/analyze/shadowing_variables.rb +69 -14
- data/spec/ruby-lint/analyze/undefined_methods.rb +174 -0
- data/spec/ruby-lint/analyze/undefined_variables.rb +70 -179
- data/spec/ruby-lint/analyze/unused_variables.rb +63 -183
- data/spec/ruby-lint/configuration.rb +15 -0
- data/spec/ruby-lint/constant_loader.rb +32 -0
- data/spec/ruby-lint/definition/dsl.rb +142 -0
- data/spec/ruby-lint/definition/method_calls.rb +26 -0
- data/spec/ruby-lint/definition/ruby_method.rb +175 -0
- data/spec/ruby-lint/definition/ruby_object.rb +228 -0
- data/spec/ruby-lint/definitions_builder/assignments/arrays.rb +71 -0
- data/spec/ruby-lint/definitions_builder/assignments/hashes.rb +65 -0
- data/spec/ruby-lint/definitions_builder/assignments/objects.rb +23 -0
- data/spec/ruby-lint/definitions_builder/assignments/optional.rb +22 -0
- data/spec/ruby-lint/definitions_builder/assignments/return_values.rb +78 -0
- data/spec/ruby-lint/definitions_builder/assignments/variables.rb +71 -0
- data/spec/ruby-lint/definitions_builder/associate_nodes.rb +17 -0
- data/spec/ruby-lint/definitions_builder/blocks.rb +40 -0
- data/spec/ruby-lint/definitions_builder/classes.rb +230 -0
- data/spec/ruby-lint/definitions_builder/for.rb +16 -0
- data/spec/ruby-lint/definitions_builder/methods.rb +147 -0
- data/spec/ruby-lint/definitions_builder/modules.rb +175 -0
- data/spec/ruby-lint/definitions_builder/reference_amount.rb +31 -0
- data/spec/ruby-lint/definitions_builder/unused.rb +15 -0
- data/spec/ruby-lint/extensions/string.rb +7 -0
- data/spec/ruby-lint/iterator.rb +42 -417
- data/spec/ruby-lint/node.rb +38 -0
- data/spec/ruby-lint/parser/assignments.rb +225 -0
- data/spec/ruby-lint/parser/classes.rb +80 -122
- data/spec/ruby-lint/parser/errors.rb +7 -14
- data/spec/ruby-lint/parser/metadata.rb +17 -0
- data/spec/ruby-lint/parser/method_definitions.rb +111 -0
- data/spec/ruby-lint/parser/methods.rb +184 -216
- data/spec/ruby-lint/parser/modules.rb +54 -33
- data/spec/ruby-lint/parser/operators.rb +30 -65
- data/spec/ruby-lint/parser/statements/begin.rb +55 -0
- data/spec/ruby-lint/parser/statements/case.rb +34 -0
- data/spec/ruby-lint/parser/statements/defined.rb +11 -0
- data/spec/ruby-lint/parser/statements/for.rb +34 -0
- data/spec/ruby-lint/parser/statements/if.rb +46 -0
- data/spec/ruby-lint/parser/statements/return.rb +14 -0
- data/spec/ruby-lint/parser/statements/super.rb +49 -0
- data/spec/ruby-lint/parser/statements/unless.rb +42 -0
- data/spec/ruby-lint/parser/statements/until.rb +25 -0
- data/spec/ruby-lint/parser/statements/while.rb +25 -0
- data/spec/ruby-lint/parser/statements/yield.rb +18 -0
- data/spec/ruby-lint/parser/types/arrays.rb +47 -0
- data/spec/ruby-lint/parser/types/booleans.rb +11 -0
- data/spec/ruby-lint/parser/types/constants.rb +32 -0
- data/spec/ruby-lint/parser/types/hashes.rb +55 -0
- data/spec/ruby-lint/parser/types/nil.rb +7 -0
- data/spec/ruby-lint/parser/types/numbers.rb +11 -0
- data/spec/ruby-lint/parser/types/procs.rb +11 -0
- data/spec/ruby-lint/parser/types/ranges.rb +11 -0
- data/spec/ruby-lint/parser/types/regexp.rb +27 -0
- data/spec/ruby-lint/parser/types/strings.rb +44 -0
- data/spec/ruby-lint/parser/types/symbols.rb +15 -0
- data/spec/ruby-lint/presenter/json.rb +31 -0
- data/spec/ruby-lint/presenter/text.rb +22 -0
- data/spec/ruby-lint/report.rb +45 -15
- data/spec/ruby-lint/report/entry.rb +24 -0
- data/spec/support/bacon.rb +33 -0
- data/spec/support/building.rb +43 -0
- data/spec/support/definitions.rb +23 -0
- data/spec/support/parsing.rb +23 -0
- data/spec/support/simplecov.rb +16 -0
- data/task/build.rake +9 -0
- data/task/checksum.rake +13 -0
- data/task/coverage.rake +6 -0
- data/task/doc.rake +5 -0
- data/task/generate.rake +34 -0
- data/task/graphviz.rake +12 -0
- data/task/stdlib.rake +2 -9
- data/task/tag.rake +6 -0
- metadata +337 -68
- metadata.gz.asc +17 -0
- data/.rbenv-version +0 -1
- data/lib/ruby-lint/analyze/coding_style.rb +0 -407
- data/lib/ruby-lint/analyze/definitions.rb +0 -244
- data/lib/ruby-lint/analyze/method_validation.rb +0 -104
- data/lib/ruby-lint/callback.rb +0 -67
- data/lib/ruby-lint/constant_importer.rb +0 -112
- data/lib/ruby-lint/definition.rb +0 -230
- data/lib/ruby-lint/formatter/text.rb +0 -54
- data/lib/ruby-lint/helper/definition_resolver.rb +0 -143
- data/lib/ruby-lint/helper/scoping.rb +0 -138
- data/lib/ruby-lint/options.rb +0 -58
- data/lib/ruby-lint/token/assignment_token.rb +0 -35
- data/lib/ruby-lint/token/begin_rescue_token.rb +0 -57
- data/lib/ruby-lint/token/block_token.rb +0 -26
- data/lib/ruby-lint/token/case_token.rb +0 -44
- data/lib/ruby-lint/token/class_token.rb +0 -24
- data/lib/ruby-lint/token/keyword_token.rb +0 -43
- data/lib/ruby-lint/token/method_definition_token.rb +0 -64
- data/lib/ruby-lint/token/method_token.rb +0 -56
- data/lib/ruby-lint/token/parameters_token.rb +0 -99
- data/lib/ruby-lint/token/regexp_token.rb +0 -15
- data/lib/ruby-lint/token/statement_token.rb +0 -69
- data/lib/ruby-lint/token/token.rb +0 -176
- data/lib/ruby-lint/token/variable_token.rb +0 -18
- data/spec/benchmarks/memory.rb +0 -52
- data/spec/benchmarks/parse_parser.rb +0 -16
- data/spec/fixtures/stdlib/un.rb +0 -348
- data/spec/ruby-lint/analyze/coding_style.rb +0 -224
- data/spec/ruby-lint/analyze/complex/un.rb +0 -29
- data/spec/ruby-lint/analyze/definitions/classes.rb +0 -114
- data/spec/ruby-lint/analyze/definitions/methods.rb +0 -91
- data/spec/ruby-lint/analyze/definitions/modules.rb +0 -207
- data/spec/ruby-lint/analyze/definitions/variables.rb +0 -103
- data/spec/ruby-lint/analyze/method_validation.rb +0 -177
- data/spec/ruby-lint/callback.rb +0 -28
- data/spec/ruby-lint/constant_importer.rb +0 -27
- data/spec/ruby-lint/definition.rb +0 -96
- data/spec/ruby-lint/formatter/text.rb +0 -21
- data/spec/ruby-lint/parser/arrays.rb +0 -147
- data/spec/ruby-lint/parser/expander_assignments.rb +0 -183
- data/spec/ruby-lint/parser/hashes.rb +0 -136
- data/spec/ruby-lint/parser/keywords.rb +0 -89
- data/spec/ruby-lint/parser/objects.rb +0 -39
- data/spec/ruby-lint/parser/procs.rb +0 -113
- data/spec/ruby-lint/parser/ranges.rb +0 -49
- data/spec/ruby-lint/parser/regexp.rb +0 -31
- data/spec/ruby-lint/parser/scalars.rb +0 -93
- data/spec/ruby-lint/parser/statements.rb +0 -591
- data/spec/ruby-lint/parser/variables.rb +0 -230
data.tar.gz.asc
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
-----BEGIN PGP SIGNATURE-----
|
|
2
|
+
Version: GnuPG v2.0.19 (GNU/Linux)
|
|
3
|
+
|
|
4
|
+
iQIcBAABAgAGBQJRdZvaAAoJEPMbESk2SfREdKYQAJQ2anToVom5wnIc/3ujvS4j
|
|
5
|
+
EH4gzq+geMPJ4ZtqmVH+AVmNotQZ6tCYzWyMfQPb4QWCu1uTvVqmg0WNbMCwCGyJ
|
|
6
|
+
aNmUiZTzN7Nit2vytiyFOUK+Y2KyDrLtqeKXkiCpOmb6MbMfQVSQg74QpOuf6O2H
|
|
7
|
+
ND2mZvgBHfsMM1rBxHNnHrvkTMF0yjq7v83j6N1K2NmzOIDm5zpQUlA41G5oTQxp
|
|
8
|
+
TWN163GuSVzzaOEuyLOIg10j9M34slFaumbTzQsF1cfrf/VXx8dldQ1ljeFggGLP
|
|
9
|
+
nY1OrrCIKnc5cNv+NpBTtxMEDT49k2gO1T3bTVIqhuiMY30tGLlpNTev59OCM7iX
|
|
10
|
+
m974eVth4XS2jCO9MoQRs7q4twz9NmtUOhQG/q5GqqLPD8BBmOw87I0cJsrONzD+
|
|
11
|
+
dKIubK7RqZ4z1MLdgE9t0PZ18WturcCKxzxMuyC37x/a2Cx3ciE76EKVfQyo6kT1
|
|
12
|
+
aHXtHogGIVNNUAtjY+EbetZmMkYE5YmuHr+3dDbrGYgN+tf+P7puB96smcGO54NE
|
|
13
|
+
/x/cHtpYqWbpU0BUCT5SIQU19hnNaoodUoVycnkXlhb5OYg1k36Z+1xK92X9jKQf
|
|
14
|
+
2jZlez4OAbF7AyUjR3AwM1M/d9nG9VpBStvaNARzksuCRuEGjvTqLnXEkjgZG+X2
|
|
15
|
+
8hG6fF3zrf9uAT9GevoM
|
|
16
|
+
=TlVu
|
|
17
|
+
-----END PGP SIGNATURE-----
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
script: rake
|
|
3
|
+
|
|
4
|
+
rvm:
|
|
5
|
+
- 1.9.3
|
|
6
|
+
- 2.0.0
|
|
7
|
+
- jruby-head
|
|
8
|
+
|
|
9
|
+
matrix:
|
|
10
|
+
allow_failures:
|
|
11
|
+
- rvm: 2.0.0
|
|
12
|
+
- rvm: jruby-head
|
|
13
|
+
|
|
14
|
+
notifications:
|
|
15
|
+
email:
|
|
16
|
+
recipients:
|
|
17
|
+
- yorickpeterse@gmail.com
|
|
18
|
+
email:
|
|
19
|
+
on_success: change
|
|
20
|
+
on_failure: always
|
|
21
|
+
|
|
22
|
+
branches:
|
|
23
|
+
only:
|
|
24
|
+
- master
|
|
25
|
+
- develop
|
data/.yardopts
CHANGED
data/Gemfile
CHANGED
data/LICENSE
CHANGED
data/MANIFEST
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.gitignore
|
|
2
|
-
.
|
|
2
|
+
.travis.yml
|
|
3
3
|
.yardopts
|
|
4
4
|
Gemfile
|
|
5
5
|
LICENSE
|
|
@@ -7,80 +7,269 @@ MANIFEST
|
|
|
7
7
|
README.md
|
|
8
8
|
Rakefile
|
|
9
9
|
bin/ruby-lint
|
|
10
|
+
checksum/.gitkeep
|
|
10
11
|
doc/.gitkeep
|
|
12
|
+
doc/DCO.md
|
|
13
|
+
doc/architecture.md
|
|
11
14
|
doc/build/.gitkeep
|
|
15
|
+
doc/code_analysis.md
|
|
16
|
+
doc/configuration.md
|
|
17
|
+
doc/contributing.md
|
|
12
18
|
doc/css/.gitkeep
|
|
13
19
|
doc/css/common.css
|
|
20
|
+
doc/graphviz/flow.dot
|
|
21
|
+
doc/images/.gitkeep
|
|
22
|
+
doc/images/flow.png
|
|
14
23
|
lib/ruby-lint.rb
|
|
15
|
-
lib/ruby-lint/analyze/
|
|
16
|
-
lib/ruby-lint/analyze/definitions.rb
|
|
17
|
-
lib/ruby-lint/analyze/method_validation.rb
|
|
24
|
+
lib/ruby-lint/analyze/argument_amount.rb
|
|
18
25
|
lib/ruby-lint/analyze/shadowing_variables.rb
|
|
26
|
+
lib/ruby-lint/analyze/undefined_methods.rb
|
|
19
27
|
lib/ruby-lint/analyze/undefined_variables.rb
|
|
20
28
|
lib/ruby-lint/analyze/unused_variables.rb
|
|
21
|
-
lib/ruby-lint/
|
|
29
|
+
lib/ruby-lint/base.rb
|
|
22
30
|
lib/ruby-lint/cli.rb
|
|
23
|
-
lib/ruby-lint/
|
|
24
|
-
lib/ruby-lint/
|
|
25
|
-
lib/ruby-lint/
|
|
26
|
-
lib/ruby-lint/
|
|
27
|
-
lib/ruby-lint/
|
|
31
|
+
lib/ruby-lint/cli/analyze.rb
|
|
32
|
+
lib/ruby-lint/cli/ast.rb
|
|
33
|
+
lib/ruby-lint/cli/base.rb
|
|
34
|
+
lib/ruby-lint/configuration.rb
|
|
35
|
+
lib/ruby-lint/constant_loader.rb
|
|
36
|
+
lib/ruby-lint/definition/ruby_method.rb
|
|
37
|
+
lib/ruby-lint/definition/ruby_object.rb
|
|
38
|
+
lib/ruby-lint/definition_generator.rb
|
|
39
|
+
lib/ruby-lint/definitions/core.rb
|
|
40
|
+
lib/ruby-lint/definitions/core/arg0.rb
|
|
41
|
+
lib/ruby-lint/definitions/core/argf.rb
|
|
42
|
+
lib/ruby-lint/definitions/core/argument_error.rb
|
|
43
|
+
lib/ruby-lint/definitions/core/argv.rb
|
|
44
|
+
lib/ruby-lint/definitions/core/array.rb
|
|
45
|
+
lib/ruby-lint/definitions/core/autoload.rb
|
|
46
|
+
lib/ruby-lint/definitions/core/basic_object.rb
|
|
47
|
+
lib/ruby-lint/definitions/core/bignum.rb
|
|
48
|
+
lib/ruby-lint/definitions/core/binding.rb
|
|
49
|
+
lib/ruby-lint/definitions/core/class.rb
|
|
50
|
+
lib/ruby-lint/definitions/core/comparable.rb
|
|
51
|
+
lib/ruby-lint/definitions/core/complex.rb
|
|
52
|
+
lib/ruby-lint/definitions/core/condition_variable.rb
|
|
53
|
+
lib/ruby-lint/definitions/core/continuation.rb
|
|
54
|
+
lib/ruby-lint/definitions/core/data.rb
|
|
55
|
+
lib/ruby-lint/definitions/core/date.rb
|
|
56
|
+
lib/ruby-lint/definitions/core/date_time.rb
|
|
57
|
+
lib/ruby-lint/definitions/core/default_record_separator.rb
|
|
58
|
+
lib/ruby-lint/definitions/core/digest.rb
|
|
59
|
+
lib/ruby-lint/definitions/core/dir.rb
|
|
60
|
+
lib/ruby-lint/definitions/core/encoding.rb
|
|
61
|
+
lib/ruby-lint/definitions/core/encoding_error.rb
|
|
62
|
+
lib/ruby-lint/definitions/core/enumerable.rb
|
|
63
|
+
lib/ruby-lint/definitions/core/enumerator.rb
|
|
64
|
+
lib/ruby-lint/definitions/core/env.rb
|
|
65
|
+
lib/ruby-lint/definitions/core/eoferror.rb
|
|
66
|
+
lib/ruby-lint/definitions/core/erb.rb
|
|
67
|
+
lib/ruby-lint/definitions/core/errno.rb
|
|
68
|
+
lib/ruby-lint/definitions/core/etc.rb
|
|
69
|
+
lib/ruby-lint/definitions/core/exception.rb
|
|
70
|
+
lib/ruby-lint/definitions/core/false.rb
|
|
71
|
+
lib/ruby-lint/definitions/core/false_class.rb
|
|
72
|
+
lib/ruby-lint/definitions/core/fatal_error.rb
|
|
73
|
+
lib/ruby-lint/definitions/core/fiber.rb
|
|
74
|
+
lib/ruby-lint/definitions/core/fiber_error.rb
|
|
75
|
+
lib/ruby-lint/definitions/core/file.rb
|
|
76
|
+
lib/ruby-lint/definitions/core/file_list.rb
|
|
77
|
+
lib/ruby-lint/definitions/core/file_test.rb
|
|
78
|
+
lib/ruby-lint/definitions/core/file_utils.rb
|
|
79
|
+
lib/ruby-lint/definitions/core/fixnum.rb
|
|
80
|
+
lib/ruby-lint/definitions/core/float.rb
|
|
81
|
+
lib/ruby-lint/definitions/core/float_domain_error.rb
|
|
82
|
+
lib/ruby-lint/definitions/core/gc.rb
|
|
83
|
+
lib/ruby-lint/definitions/core/gem.rb
|
|
84
|
+
lib/ruby-lint/definitions/core/hash.rb
|
|
85
|
+
lib/ruby-lint/definitions/core/immediate_value.rb
|
|
86
|
+
lib/ruby-lint/definitions/core/index_error.rb
|
|
87
|
+
lib/ruby-lint/definitions/core/integer.rb
|
|
88
|
+
lib/ruby-lint/definitions/core/interrupt.rb
|
|
89
|
+
lib/ruby-lint/definitions/core/io.rb
|
|
90
|
+
lib/ruby-lint/definitions/core/ioerror.rb
|
|
91
|
+
lib/ruby-lint/definitions/core/kernel.rb
|
|
92
|
+
lib/ruby-lint/definitions/core/key_error.rb
|
|
93
|
+
lib/ruby-lint/definitions/core/load_error.rb
|
|
94
|
+
lib/ruby-lint/definitions/core/local_jump_error.rb
|
|
95
|
+
lib/ruby-lint/definitions/core/main.rb
|
|
96
|
+
lib/ruby-lint/definitions/core/marshal.rb
|
|
97
|
+
lib/ruby-lint/definitions/core/match_data.rb
|
|
98
|
+
lib/ruby-lint/definitions/core/math.rb
|
|
99
|
+
lib/ruby-lint/definitions/core/memory_segmention_error.rb
|
|
100
|
+
lib/ruby-lint/definitions/core/method.rb
|
|
101
|
+
lib/ruby-lint/definitions/core/module.rb
|
|
102
|
+
lib/ruby-lint/definitions/core/monitor.rb
|
|
103
|
+
lib/ruby-lint/definitions/core/monitor_mixin.rb
|
|
104
|
+
lib/ruby-lint/definitions/core/mutex.rb
|
|
105
|
+
lib/ruby-lint/definitions/core/name_error.rb
|
|
106
|
+
lib/ruby-lint/definitions/core/nil.rb
|
|
107
|
+
lib/ruby-lint/definitions/core/nil_class.rb
|
|
108
|
+
lib/ruby-lint/definitions/core/no_memory_error.rb
|
|
109
|
+
lib/ruby-lint/definitions/core/no_method_error.rb
|
|
110
|
+
lib/ruby-lint/definitions/core/not_implemented_error.rb
|
|
111
|
+
lib/ruby-lint/definitions/core/numeric.rb
|
|
112
|
+
lib/ruby-lint/definitions/core/object.rb
|
|
113
|
+
lib/ruby-lint/definitions/core/object_space.rb
|
|
114
|
+
lib/ruby-lint/definitions/core/open_struct.rb
|
|
115
|
+
lib/ruby-lint/definitions/core/option_parser.rb
|
|
116
|
+
lib/ruby-lint/definitions/core/precision.rb
|
|
117
|
+
lib/ruby-lint/definitions/core/primitive_failure.rb
|
|
118
|
+
lib/ruby-lint/definitions/core/proc.rb
|
|
119
|
+
lib/ruby-lint/definitions/core/process.rb
|
|
120
|
+
lib/ruby-lint/definitions/core/psych.rb
|
|
121
|
+
lib/ruby-lint/definitions/core/queue.rb
|
|
122
|
+
lib/ruby-lint/definitions/core/rake.rb
|
|
123
|
+
lib/ruby-lint/definitions/core/rake_file_utils.rb
|
|
124
|
+
lib/ruby-lint/definitions/core/rakeversion.rb
|
|
125
|
+
lib/ruby-lint/definitions/core/random.rb
|
|
126
|
+
lib/ruby-lint/definitions/core/range.rb
|
|
127
|
+
lib/ruby-lint/definitions/core/range_error.rb
|
|
128
|
+
lib/ruby-lint/definitions/core/rational.rb
|
|
129
|
+
lib/ruby-lint/definitions/core/rb_config.rb
|
|
130
|
+
lib/ruby-lint/definitions/core/regexp.rb
|
|
131
|
+
lib/ruby-lint/definitions/core/regexp_error.rb
|
|
132
|
+
lib/ruby-lint/definitions/core/rubinius.rb
|
|
133
|
+
lib/ruby-lint/definitions/core/ruby_copyright.rb
|
|
134
|
+
lib/ruby-lint/definitions/core/ruby_description.rb
|
|
135
|
+
lib/ruby-lint/definitions/core/ruby_engine.rb
|
|
136
|
+
lib/ruby-lint/definitions/core/ruby_lint.rb
|
|
137
|
+
lib/ruby-lint/definitions/core/ruby_patchlevel.rb
|
|
138
|
+
lib/ruby-lint/definitions/core/ruby_platform.rb
|
|
139
|
+
lib/ruby-lint/definitions/core/ruby_release_date.rb
|
|
140
|
+
lib/ruby-lint/definitions/core/ruby_version.rb
|
|
141
|
+
lib/ruby-lint/definitions/core/runtime_error.rb
|
|
142
|
+
lib/ruby-lint/definitions/core/scan_error.rb
|
|
143
|
+
lib/ruby-lint/definitions/core/script_error.rb
|
|
144
|
+
lib/ruby-lint/definitions/core/security_error.rb
|
|
145
|
+
lib/ruby-lint/definitions/core/shellwords.rb
|
|
146
|
+
lib/ruby-lint/definitions/core/signal.rb
|
|
147
|
+
lib/ruby-lint/definitions/core/signal_exception.rb
|
|
148
|
+
lib/ruby-lint/definitions/core/singleton.rb
|
|
149
|
+
lib/ruby-lint/definitions/core/sized_queue.rb
|
|
150
|
+
lib/ruby-lint/definitions/core/standard_error.rb
|
|
151
|
+
lib/ruby-lint/definitions/core/stderr.rb
|
|
152
|
+
lib/ruby-lint/definitions/core/stdin.rb
|
|
153
|
+
lib/ruby-lint/definitions/core/stdout.rb
|
|
154
|
+
lib/ruby-lint/definitions/core/stop_iteration.rb
|
|
155
|
+
lib/ruby-lint/definitions/core/string.rb
|
|
156
|
+
lib/ruby-lint/definitions/core/string_io.rb
|
|
157
|
+
lib/ruby-lint/definitions/core/string_scanner.rb
|
|
158
|
+
lib/ruby-lint/definitions/core/struct.rb
|
|
159
|
+
lib/ruby-lint/definitions/core/syck.rb
|
|
160
|
+
lib/ruby-lint/definitions/core/symbol.rb
|
|
161
|
+
lib/ruby-lint/definitions/core/syntax_error.rb
|
|
162
|
+
lib/ruby-lint/definitions/core/system_call_error.rb
|
|
163
|
+
lib/ruby-lint/definitions/core/system_exit.rb
|
|
164
|
+
lib/ruby-lint/definitions/core/system_stack_error.rb
|
|
165
|
+
lib/ruby-lint/definitions/core/thread.rb
|
|
166
|
+
lib/ruby-lint/definitions/core/thread_error.rb
|
|
167
|
+
lib/ruby-lint/definitions/core/thread_group.rb
|
|
168
|
+
lib/ruby-lint/definitions/core/time.rb
|
|
169
|
+
lib/ruby-lint/definitions/core/toplevel_binding.rb
|
|
170
|
+
lib/ruby-lint/definitions/core/true.rb
|
|
171
|
+
lib/ruby-lint/definitions/core/true_class.rb
|
|
172
|
+
lib/ruby-lint/definitions/core/type_error.rb
|
|
173
|
+
lib/ruby-lint/definitions/core/unbound_method.rb
|
|
174
|
+
lib/ruby-lint/definitions/core/unmarshalable.rb
|
|
175
|
+
lib/ruby-lint/definitions/core/unsupported_library_error.rb
|
|
176
|
+
lib/ruby-lint/definitions/core/weak_ref.rb
|
|
177
|
+
lib/ruby-lint/definitions/core/zero_division_error.rb
|
|
178
|
+
lib/ruby-lint/definitions_builder.rb
|
|
179
|
+
lib/ruby-lint/extensions/string.rb
|
|
180
|
+
lib/ruby-lint/helper/constant_paths.rb
|
|
181
|
+
lib/ruby-lint/helper/conversion.rb
|
|
182
|
+
lib/ruby-lint/helper/current_scope.rb
|
|
183
|
+
lib/ruby-lint/helper/methods.rb
|
|
184
|
+
lib/ruby-lint/inspector.rb
|
|
28
185
|
lib/ruby-lint/iterator.rb
|
|
29
|
-
lib/ruby-lint/
|
|
186
|
+
lib/ruby-lint/node.rb
|
|
30
187
|
lib/ruby-lint/parser.rb
|
|
31
188
|
lib/ruby-lint/parser_error.rb
|
|
189
|
+
lib/ruby-lint/presenter/json.rb
|
|
190
|
+
lib/ruby-lint/presenter/text.rb
|
|
32
191
|
lib/ruby-lint/report.rb
|
|
33
|
-
lib/ruby-lint/
|
|
34
|
-
lib/ruby-lint/
|
|
35
|
-
lib/ruby-lint/
|
|
36
|
-
lib/ruby-lint/
|
|
37
|
-
lib/ruby-lint/token/class_token.rb
|
|
38
|
-
lib/ruby-lint/token/keyword_token.rb
|
|
39
|
-
lib/ruby-lint/token/method_definition_token.rb
|
|
40
|
-
lib/ruby-lint/token/method_token.rb
|
|
41
|
-
lib/ruby-lint/token/parameters_token.rb
|
|
42
|
-
lib/ruby-lint/token/regexp_token.rb
|
|
43
|
-
lib/ruby-lint/token/statement_token.rb
|
|
44
|
-
lib/ruby-lint/token/token.rb
|
|
45
|
-
lib/ruby-lint/token/variable_token.rb
|
|
192
|
+
lib/ruby-lint/report/entry.rb
|
|
193
|
+
lib/ruby-lint/template/definition.erb
|
|
194
|
+
lib/ruby-lint/template/scope.rb
|
|
195
|
+
lib/ruby-lint/variable_predicates.rb
|
|
46
196
|
lib/ruby-lint/version.rb
|
|
47
197
|
ruby-lint.gemspec
|
|
48
|
-
spec/benchmarks/memory.rb
|
|
49
|
-
spec/benchmarks/parse_parser.rb
|
|
50
|
-
spec/fixtures/stdlib/un.rb
|
|
51
198
|
spec/helper.rb
|
|
52
|
-
spec/ruby-lint/analyze/
|
|
53
|
-
spec/ruby-lint/analyze/complex/un.rb
|
|
54
|
-
spec/ruby-lint/analyze/definitions/classes.rb
|
|
55
|
-
spec/ruby-lint/analyze/definitions/methods.rb
|
|
56
|
-
spec/ruby-lint/analyze/definitions/modules.rb
|
|
57
|
-
spec/ruby-lint/analyze/definitions/variables.rb
|
|
58
|
-
spec/ruby-lint/analyze/method_validation.rb
|
|
199
|
+
spec/ruby-lint/analyze/argument_amount.rb
|
|
59
200
|
spec/ruby-lint/analyze/shadowing_variables.rb
|
|
201
|
+
spec/ruby-lint/analyze/undefined_methods.rb
|
|
60
202
|
spec/ruby-lint/analyze/undefined_variables.rb
|
|
61
203
|
spec/ruby-lint/analyze/unused_variables.rb
|
|
62
|
-
spec/ruby-lint/
|
|
63
|
-
spec/ruby-lint/
|
|
64
|
-
spec/ruby-lint/definition.rb
|
|
65
|
-
spec/ruby-lint/
|
|
204
|
+
spec/ruby-lint/configuration.rb
|
|
205
|
+
spec/ruby-lint/constant_loader.rb
|
|
206
|
+
spec/ruby-lint/definition/dsl.rb
|
|
207
|
+
spec/ruby-lint/definition/method_calls.rb
|
|
208
|
+
spec/ruby-lint/definition/ruby_method.rb
|
|
209
|
+
spec/ruby-lint/definition/ruby_object.rb
|
|
210
|
+
spec/ruby-lint/definitions_builder/assignments/arrays.rb
|
|
211
|
+
spec/ruby-lint/definitions_builder/assignments/hashes.rb
|
|
212
|
+
spec/ruby-lint/definitions_builder/assignments/objects.rb
|
|
213
|
+
spec/ruby-lint/definitions_builder/assignments/optional.rb
|
|
214
|
+
spec/ruby-lint/definitions_builder/assignments/return_values.rb
|
|
215
|
+
spec/ruby-lint/definitions_builder/assignments/variables.rb
|
|
216
|
+
spec/ruby-lint/definitions_builder/associate_nodes.rb
|
|
217
|
+
spec/ruby-lint/definitions_builder/blocks.rb
|
|
218
|
+
spec/ruby-lint/definitions_builder/classes.rb
|
|
219
|
+
spec/ruby-lint/definitions_builder/for.rb
|
|
220
|
+
spec/ruby-lint/definitions_builder/methods.rb
|
|
221
|
+
spec/ruby-lint/definitions_builder/modules.rb
|
|
222
|
+
spec/ruby-lint/definitions_builder/reference_amount.rb
|
|
223
|
+
spec/ruby-lint/definitions_builder/unused.rb
|
|
224
|
+
spec/ruby-lint/extensions/string.rb
|
|
66
225
|
spec/ruby-lint/iterator.rb
|
|
67
|
-
spec/ruby-lint/
|
|
226
|
+
spec/ruby-lint/node.rb
|
|
227
|
+
spec/ruby-lint/parser/assignments.rb
|
|
68
228
|
spec/ruby-lint/parser/classes.rb
|
|
69
229
|
spec/ruby-lint/parser/errors.rb
|
|
70
|
-
spec/ruby-lint/parser/
|
|
71
|
-
spec/ruby-lint/parser/
|
|
72
|
-
spec/ruby-lint/parser/keywords.rb
|
|
230
|
+
spec/ruby-lint/parser/metadata.rb
|
|
231
|
+
spec/ruby-lint/parser/method_definitions.rb
|
|
73
232
|
spec/ruby-lint/parser/methods.rb
|
|
74
233
|
spec/ruby-lint/parser/modules.rb
|
|
75
|
-
spec/ruby-lint/parser/objects.rb
|
|
76
234
|
spec/ruby-lint/parser/operators.rb
|
|
77
|
-
spec/ruby-lint/parser/
|
|
78
|
-
spec/ruby-lint/parser/
|
|
79
|
-
spec/ruby-lint/parser/
|
|
80
|
-
spec/ruby-lint/parser/
|
|
81
|
-
spec/ruby-lint/parser/statements.rb
|
|
82
|
-
spec/ruby-lint/parser/
|
|
235
|
+
spec/ruby-lint/parser/statements/begin.rb
|
|
236
|
+
spec/ruby-lint/parser/statements/case.rb
|
|
237
|
+
spec/ruby-lint/parser/statements/defined.rb
|
|
238
|
+
spec/ruby-lint/parser/statements/for.rb
|
|
239
|
+
spec/ruby-lint/parser/statements/if.rb
|
|
240
|
+
spec/ruby-lint/parser/statements/return.rb
|
|
241
|
+
spec/ruby-lint/parser/statements/super.rb
|
|
242
|
+
spec/ruby-lint/parser/statements/unless.rb
|
|
243
|
+
spec/ruby-lint/parser/statements/until.rb
|
|
244
|
+
spec/ruby-lint/parser/statements/while.rb
|
|
245
|
+
spec/ruby-lint/parser/statements/yield.rb
|
|
246
|
+
spec/ruby-lint/parser/types/arrays.rb
|
|
247
|
+
spec/ruby-lint/parser/types/booleans.rb
|
|
248
|
+
spec/ruby-lint/parser/types/constants.rb
|
|
249
|
+
spec/ruby-lint/parser/types/hashes.rb
|
|
250
|
+
spec/ruby-lint/parser/types/nil.rb
|
|
251
|
+
spec/ruby-lint/parser/types/numbers.rb
|
|
252
|
+
spec/ruby-lint/parser/types/procs.rb
|
|
253
|
+
spec/ruby-lint/parser/types/ranges.rb
|
|
254
|
+
spec/ruby-lint/parser/types/regexp.rb
|
|
255
|
+
spec/ruby-lint/parser/types/strings.rb
|
|
256
|
+
spec/ruby-lint/parser/types/symbols.rb
|
|
257
|
+
spec/ruby-lint/presenter/json.rb
|
|
258
|
+
spec/ruby-lint/presenter/text.rb
|
|
83
259
|
spec/ruby-lint/report.rb
|
|
260
|
+
spec/ruby-lint/report/entry.rb
|
|
261
|
+
spec/support/bacon.rb
|
|
262
|
+
spec/support/building.rb
|
|
263
|
+
spec/support/definitions.rb
|
|
264
|
+
spec/support/parsing.rb
|
|
265
|
+
spec/support/simplecov.rb
|
|
266
|
+
task/build.rake
|
|
267
|
+
task/checksum.rake
|
|
268
|
+
task/coverage.rake
|
|
269
|
+
task/doc.rake
|
|
270
|
+
task/generate.rake
|
|
271
|
+
task/graphviz.rake
|
|
84
272
|
task/manifest.rake
|
|
85
273
|
task/stdlib.rake
|
|
274
|
+
task/tag.rake
|
|
86
275
|
task/test.rake
|
data/README.md
CHANGED
|
@@ -1,150 +1,103 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ruby-lint
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
similar tools such as JSHint. It makes it possible for developers to detect
|
|
8
|
-
errors such as undefined (or unused) variables and the use of non existing
|
|
9
|
-
methods.
|
|
3
|
+
ruby-lint is a linter and static code analysis tool for Ruby. It is inspired by
|
|
4
|
+
similar tools such as jshint, flake8 and similar tools. ruby-lint primarily
|
|
5
|
+
focuses on logic related errors such as the use of non existing variables
|
|
6
|
+
instead of focusing on semantics (e.g. the amount of characters per line).
|
|
10
7
|
|
|
11
8
|
## Requirements
|
|
12
9
|
|
|
13
|
-
* Ruby 1.9 or newer
|
|
14
|
-
*
|
|
10
|
+
* Ruby (MRI) 1.9.3 or newer
|
|
11
|
+
* a Unix based Operating System
|
|
15
12
|
|
|
16
13
|
## Installation
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
The easiest way to install ruby-lint is to install it from RubyGems:
|
|
16
|
+
|
|
17
|
+
$ gem install ruby-lint
|
|
18
|
+
|
|
19
|
+
Alternatively you can install it from a RubyGems mirror that I run (updated
|
|
20
|
+
daily and only mirrors a very small subset of RubyGems):
|
|
21
|
+
|
|
22
|
+
$ gem install --source=http://rubygems.yorickpeterse.com/
|
|
23
|
+
|
|
24
|
+
If you prefer to install (and build) ruby-lint from the source code you can do
|
|
25
|
+
so as following:
|
|
26
|
+
|
|
27
|
+
$ git clone git://github.com/YorickPeterse/ruby-lint.git
|
|
28
|
+
$ cd ruby-lint
|
|
29
|
+
$ bundle install # you can also install the dependencies manually
|
|
30
|
+
$ rake gem
|
|
19
31
|
|
|
20
|
-
|
|
32
|
+
This builds a new version of the Gem and saves it in the pkg/ directory.
|
|
21
33
|
|
|
22
|
-
|
|
23
|
-
required.
|
|
34
|
+
## Security
|
|
24
35
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
36
|
+
To ensure that people can't tamper with the ruby-lint Gem once it's being
|
|
37
|
+
distributed as a `.gem` file the Gem is signed using GNUPG (using the
|
|
38
|
+
[rubygems-openpgp][rubygems-openpgp] Gem). If you have this Gem installed it's
|
|
39
|
+
recommended that you install ruby-lint as following:
|
|
40
|
+
|
|
41
|
+
$ gem install ruby-lint --verify --trust
|
|
42
|
+
|
|
43
|
+
Unless you have my GPG public key and have marked it as trusted this process
|
|
44
|
+
will fail. For signing Gems I use the public key **3649F444** registered to
|
|
45
|
+
"Yorick Peterse" using Email address <yorickpeterse@gmail.com>.
|
|
46
|
+
|
|
47
|
+
You can add this key by running the following command:
|
|
48
|
+
|
|
49
|
+
$ gpg --recv-keys 3649F444
|
|
50
|
+
|
|
51
|
+
In case you don't use GPG but still want some form of verification you can use
|
|
52
|
+
the checksums that are located in the "checksum" directory. These checksums are
|
|
53
|
+
SHA512 checksums of entire Gem files and can be verified using the `sha512sum`
|
|
54
|
+
command.
|
|
28
55
|
|
|
29
56
|
## Usage
|
|
30
57
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
RubyLint
|
|
68
|
-
|
|
69
|
-
* A parser that turns a block of Ruby code into an AST.
|
|
70
|
-
* A class that iterates over this AST and executes callback methods (aptly
|
|
71
|
-
named `RubyLint::Iterator`).
|
|
72
|
-
* A set of callback classes that are used by an iterator. These callback
|
|
73
|
-
classes perform the actual data analysis.
|
|
74
|
-
* A report for storing error messages, warnings and informal messages.
|
|
75
|
-
* A formatter that turns a report into something useful such as plain text or
|
|
76
|
-
JSON.
|
|
77
|
-
|
|
78
|
-
The process of analyzing code basically looks like the following:
|
|
79
|
-
|
|
80
|
-
+------+
|
|
81
|
-
| Code |
|
|
82
|
-
+------+
|
|
83
|
-
|
|
|
84
|
-
v
|
|
85
|
-
+------------------+
|
|
86
|
-
| RubyLint::Parser |
|
|
87
|
-
+------------------+
|
|
88
|
-
|
|
|
89
|
-
v
|
|
90
|
-
+--------------------+
|
|
91
|
-
| RubyLint::Iterator |
|
|
92
|
-
+--------------------+
|
|
93
|
-
|
|
|
94
|
-
v
|
|
95
|
-
+------------------------------+
|
|
96
|
-
| RubyLint::Callback instances |
|
|
97
|
-
+------------------------------+
|
|
98
|
-
|
|
|
99
|
-
v
|
|
100
|
-
+------------------+
|
|
101
|
-
| RubyLint::Report |
|
|
102
|
-
+------------------+
|
|
103
|
-
|
|
|
104
|
-
v
|
|
105
|
-
+-------------------------------+
|
|
106
|
-
| RubyLint::Formatter instances |
|
|
107
|
-
+-------------------------------+
|
|
108
|
-
|
|
|
109
|
-
v
|
|
110
|
-
+------------------+
|
|
111
|
-
| Something useful |
|
|
112
|
-
+------------------+
|
|
113
|
-
|
|
114
|
-
The advantage of this setup is that different tasks are decoupled (where
|
|
115
|
-
possible) and that it's fairly trivial to write custom formatters that spit out
|
|
116
|
-
JSON, HTML, XML or something else. It also makes things easier to maintain as
|
|
117
|
-
there's no single giant lump of code that does everything.
|
|
118
|
-
|
|
119
|
-
## Compatibility Issues
|
|
120
|
-
|
|
121
|
-
Currently RubyLint can only be executed using MRI 1.9.3, it does not run on MRI
|
|
122
|
-
1.8.x due to the lack of Ripper. It also does not yet run without errors on
|
|
123
|
-
MRI 2.0 as the addition of named variables changes the Ripper output, something
|
|
124
|
-
RubyLint doesn't properly handle at the moment.
|
|
125
|
-
|
|
126
|
-
For the time being RubyLint will stick to using Ripper which means it's also
|
|
127
|
-
limited to MRI 1.9.x/2.0.x. I've been looking around for alternatives so that
|
|
128
|
-
RubyLint can be run on Jruby/Rubinius in the future but so far I haven't really
|
|
129
|
-
found a worthy alternative. For now I'd rather focus on making RubyLint work on
|
|
130
|
-
one implementation instead of a number of different ones.
|
|
131
|
-
|
|
132
|
-
Also keep in mind that while in theory RubyLint should run on MRI 1.8.x I couldn't
|
|
133
|
-
get the "ripper" gem to install properly, thus I'm unable to confirm this. Feel
|
|
134
|
-
free to try it out but I won't bother with MRI 1.8.x myself if it requires more
|
|
135
|
-
than a few minutes worth of work.
|
|
136
|
-
|
|
137
|
-
## TODO
|
|
138
|
-
|
|
139
|
-
* Allow options to be set and libraries to be loaded using a configuration
|
|
140
|
-
file (`./.rlint.rb` and `~/.rlint.rb`).
|
|
141
|
-
* Handle named parameters in Ruby 2.0 (and other potential differences).
|
|
142
|
-
* Validate the parameters passed to method calls where possible.
|
|
143
|
-
* Better/more up to date documentation.
|
|
144
|
-
* Testing, testing and more testing.
|
|
58
|
+
Using ruby-lint from the CLI is very easy. To analyze a set of files
|
|
59
|
+
you run the following:
|
|
60
|
+
|
|
61
|
+
$ ruby-lint file1.rb file2.rb
|
|
62
|
+
|
|
63
|
+
For more information specify either the `-h` or `--help` option.
|
|
64
|
+
|
|
65
|
+
## Compatibility
|
|
66
|
+
|
|
67
|
+
For the time being ruby-lint only runs on MRI 1.9 due to its dependency on
|
|
68
|
+
Ripper, a library that is not available on Rubinius, Jruby and other Ruby
|
|
69
|
+
implementations.
|
|
70
|
+
|
|
71
|
+
In the future I intend to move away from Ripper but when this happens depends
|
|
72
|
+
on when I can find something that suits my needs. Most existing solutions, such
|
|
73
|
+
as `ruby_parser` lack features that I require (such as storing column numbers
|
|
74
|
+
of AST nodes), are either unmaintained or severely limited in what they can do.
|
|
75
|
+
|
|
76
|
+
## Documentation
|
|
77
|
+
|
|
78
|
+
* {file:contributing Contributing}
|
|
79
|
+
* {file:architecture Architecture}
|
|
80
|
+
* {file:code\_analysis Code Analysis}
|
|
81
|
+
* {file:configuration Configuration}
|
|
82
|
+
|
|
83
|
+
Noteworthy constants:
|
|
84
|
+
|
|
85
|
+
* {RubyLint::Node}
|
|
86
|
+
* {RubyLint::Iterator}
|
|
87
|
+
* {RubyLint::Report}
|
|
88
|
+
* {RubyLint::Presenter::Text}
|
|
89
|
+
|
|
90
|
+
Helper modules:
|
|
91
|
+
|
|
92
|
+
* {RubyLint::Helper::ConstantPaths}
|
|
93
|
+
* {RubyLint::Helper::Conversion}
|
|
94
|
+
* {RubyLint::Helper::CurrentScope}
|
|
95
|
+
* {RubyLint::Helper::Methods}
|
|
145
96
|
|
|
146
97
|
## License
|
|
147
98
|
|
|
148
99
|
All source code in this repository is licensed under the MIT license unless
|
|
149
100
|
specified otherwise. A copy of this license can be found in the file "LICENSE"
|
|
150
101
|
in the root directory of this repository.
|
|
102
|
+
|
|
103
|
+
[rubygems-openpgp]: https://github.com/grant-olson/rubygems-openpgp
|