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/spec/ruby-lint/report.rb
CHANGED
|
@@ -1,30 +1,60 @@
|
|
|
1
1
|
require File.expand_path('../../helper', __FILE__)
|
|
2
2
|
|
|
3
3
|
describe 'RubyLint::Report' do
|
|
4
|
-
|
|
4
|
+
should 'register a custom level' do
|
|
5
|
+
RubyLint::Report.add_level(:test)
|
|
6
|
+
|
|
7
|
+
RubyLint::Report.levels.include?(:test).should == true
|
|
8
|
+
|
|
9
|
+
RubyLint::Report.delete_level(:test)
|
|
10
|
+
|
|
11
|
+
RubyLint::Report.levels.include?(:test).should == false
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
should 'add a message using #add' do
|
|
15
|
+
report = RubyLint::Report.new
|
|
16
|
+
|
|
17
|
+
report.add(:info, 'info message', 1, 1, 'file.rb')
|
|
18
|
+
|
|
19
|
+
report.entries.length.should == 1
|
|
20
|
+
|
|
21
|
+
entry = report.entries[0]
|
|
22
|
+
|
|
23
|
+
entry.level.should == :info
|
|
24
|
+
entry.message.should == 'info message'
|
|
25
|
+
entry.line.should == 1
|
|
26
|
+
entry.column.should == 1
|
|
27
|
+
entry.file.should == 'file.rb'
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
should 'add a message using method_missing' do
|
|
5
31
|
report = RubyLint::Report.new
|
|
6
32
|
|
|
7
|
-
report.
|
|
33
|
+
report.info('info message', 1, 1, 'file.rb')
|
|
8
34
|
|
|
9
|
-
report.
|
|
10
|
-
report.messages.length.should == 1
|
|
35
|
+
report.entries.length.should == 1
|
|
11
36
|
|
|
12
|
-
report.
|
|
13
|
-
report.messages[:error].length.should == 1
|
|
37
|
+
entry = report.entries[0]
|
|
14
38
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
39
|
+
entry.level.should == :info
|
|
40
|
+
entry.message.should == 'info message'
|
|
41
|
+
entry.line.should == 1
|
|
42
|
+
entry.column.should == 1
|
|
43
|
+
entry.file.should == 'file.rb'
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
should 'raise for invalid method calls' do
|
|
47
|
+
report = RubyLint::Report.new
|
|
48
|
+
error = should.raise?(NoMethodError) { report.test }
|
|
18
49
|
|
|
19
|
-
|
|
50
|
+
error.message.should =~ /undefined method "test" for/
|
|
20
51
|
end
|
|
21
52
|
|
|
22
|
-
|
|
23
|
-
report = RubyLint::Report.new
|
|
53
|
+
should 'ignore invalid reporting levels' do
|
|
54
|
+
report = RubyLint::Report.new
|
|
24
55
|
|
|
25
|
-
report.add(:
|
|
56
|
+
report.add(:test, 'invalid message', 1, 1, 'file.rb')
|
|
26
57
|
|
|
27
|
-
report.
|
|
28
|
-
report.messages[:info].nil?.should == true
|
|
58
|
+
report.entries.empty?.should == true
|
|
29
59
|
end
|
|
30
60
|
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
require File.expand_path('../../../helper', __FILE__)
|
|
2
|
+
|
|
3
|
+
describe RubyLint::Report::Entry do
|
|
4
|
+
should 'sort a list of entries' do
|
|
5
|
+
entries = [
|
|
6
|
+
RubyLint::Report::Entry.new(:info, 'info', 1, 1, 'a.rb'),
|
|
7
|
+
RubyLint::Report::Entry.new(:error, 'error', 1, 1, 'a.rb'),
|
|
8
|
+
RubyLint::Report::Entry.new(:warning, 'warning', 1, 1, 'b.rb'),
|
|
9
|
+
RubyLint::Report::Entry.new(:error, 'error', 1, 1, 'c.rb'),
|
|
10
|
+
].sort
|
|
11
|
+
|
|
12
|
+
entries[0].file.should == 'a.rb'
|
|
13
|
+
entries[0].level.should == :error
|
|
14
|
+
|
|
15
|
+
entries[1].file.should == 'a.rb'
|
|
16
|
+
entries[1].level.should == :info
|
|
17
|
+
|
|
18
|
+
entries[2].file.should == 'b.rb'
|
|
19
|
+
entries[2].level.should == :warning
|
|
20
|
+
|
|
21
|
+
entries[3].file.should == 'c.rb'
|
|
22
|
+
entries[3].level.should == :error
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Bacon's output is a bit annoying for the sexp output of RubyLint::Node. This
|
|
2
|
+
# patch changes it to make it a lot easier to read.
|
|
3
|
+
class Should
|
|
4
|
+
def method_missing(name, *args, &block)
|
|
5
|
+
name = "#{name}?" if name.to_s =~ /\w[^?]\z/
|
|
6
|
+
negated = @negated ? " not " : " "
|
|
7
|
+
desc = ''
|
|
8
|
+
|
|
9
|
+
desc << "\n\nGot (using#{negated}#{name}):\n\n" << @object.inspect
|
|
10
|
+
desc << "\n\nExpected:\n\n" << args.map{|x|x.inspect}.join(", ") << "\n"
|
|
11
|
+
|
|
12
|
+
satisfy(desc) { |x| x.__send__(name, *args, &block) }
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Show performance related information after running the tests.
|
|
17
|
+
module Bacon
|
|
18
|
+
class << self
|
|
19
|
+
alias old_handle_summary handle_summary
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def self.handle_summary
|
|
23
|
+
old_handle_summary
|
|
24
|
+
|
|
25
|
+
memory = `ps -o rss= #{Process.pid}`.strip.to_f
|
|
26
|
+
memory_mb = (memory / 1024)
|
|
27
|
+
time_secs = (Time.now - @timer)
|
|
28
|
+
time_ms = time_secs * 1000
|
|
29
|
+
|
|
30
|
+
puts '%i KB (%.2f MB) used in %.2f miliseconds (%.2f seconds)' \
|
|
31
|
+
% [memory, memory_mb, time_ms, time_secs]
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
##
|
|
2
|
+
# Builds a list of definitions for the specified block of Ruby code.
|
|
3
|
+
#
|
|
4
|
+
# @param [String] code The code to analyze.
|
|
5
|
+
# @return [RubyLint::Definition::RubyObject]
|
|
6
|
+
#
|
|
7
|
+
def build_definitions(code)
|
|
8
|
+
loader = RubyLint::ConstantLoader.new
|
|
9
|
+
iterator = RubyLint::DefinitionsBuilder.new
|
|
10
|
+
ast = parse(code, false)
|
|
11
|
+
|
|
12
|
+
loader.iterate(ast)
|
|
13
|
+
iterator.iterate(ast)
|
|
14
|
+
|
|
15
|
+
return iterator.options[:definitions]
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
##
|
|
19
|
+
# Builds a report for the given code and iterator class.
|
|
20
|
+
#
|
|
21
|
+
# @param [String] code
|
|
22
|
+
# @param [Class] iterator
|
|
23
|
+
# @return [RubyLint::Report]
|
|
24
|
+
#
|
|
25
|
+
def build_report(code, iterator)
|
|
26
|
+
ast = parse(code, false)
|
|
27
|
+
defs_builder = RubyLint::DefinitionsBuilder.new
|
|
28
|
+
loader = RubyLint::ConstantLoader.new
|
|
29
|
+
|
|
30
|
+
loader.iterate(ast)
|
|
31
|
+
defs_builder.iterate(ast)
|
|
32
|
+
|
|
33
|
+
report = RubyLint::Report.new
|
|
34
|
+
iterator = iterator.new(
|
|
35
|
+
:report => report,
|
|
36
|
+
:definitions => defs_builder.options[:definitions],
|
|
37
|
+
:node_definitions => defs_builder.options[:node_definitions]
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
iterator.iterate(ast)
|
|
41
|
+
|
|
42
|
+
return report
|
|
43
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
##
|
|
2
|
+
# @return [Class]
|
|
3
|
+
#
|
|
4
|
+
def ruby_object
|
|
5
|
+
return RubyLint::Definition::RubyObject
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
##
|
|
9
|
+
# @return [Class]
|
|
10
|
+
#
|
|
11
|
+
def ruby_method
|
|
12
|
+
return RubyLint::Definition::RubyMethod
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
##
|
|
16
|
+
# @param [#to_s] type
|
|
17
|
+
# @return [RubyLint::Definition::RubyMethod]
|
|
18
|
+
#
|
|
19
|
+
def method_with_argument(object, type)
|
|
20
|
+
return object.define_method('example') do |example|
|
|
21
|
+
example.send("define_#{type}", 'number')
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
##
|
|
2
|
+
# Parses the specified Ruby code and returns the first instance of
|
|
3
|
+
# {RubyLint::Node} (excluding the root node).
|
|
4
|
+
#
|
|
5
|
+
# @param [String] code The code to parse.
|
|
6
|
+
# @param [TrueClass|FalseClass] first When set to `true` only the first node
|
|
7
|
+
# is returned.
|
|
8
|
+
# @return [RubyLint::Node]
|
|
9
|
+
#
|
|
10
|
+
def parse(code, first = true)
|
|
11
|
+
ast = RubyLint::Parser.new(code).parse
|
|
12
|
+
|
|
13
|
+
return first ? ast.children[0] : ast
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
##
|
|
17
|
+
# Shorthand for creating instances of {RubyLint::Node}.
|
|
18
|
+
#
|
|
19
|
+
# @see RubyLint::Node#initialize
|
|
20
|
+
#
|
|
21
|
+
def s(type, *children)
|
|
22
|
+
return RubyLint::Node.new(type, children)
|
|
23
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
require 'simplecov'
|
|
2
|
+
|
|
3
|
+
SimpleCov.configure do
|
|
4
|
+
root File.expand_path('../../../', __FILE__)
|
|
5
|
+
command_name 'bacon'
|
|
6
|
+
project_name 'ruby-lint'
|
|
7
|
+
|
|
8
|
+
add_group 'Analysis' , 'ruby-lint/analyze'
|
|
9
|
+
add_group 'Definitions', 'ruby-lint/definition'
|
|
10
|
+
add_group 'Formatters' , 'ruby-lint/formatter'
|
|
11
|
+
|
|
12
|
+
add_filter 'spec'
|
|
13
|
+
add_filter 'lib/ruby-lint/version'
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
SimpleCov.start
|
data/task/build.rake
ADDED
data/task/checksum.rake
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
desc 'Creates a SHA512 checksum of the current version'
|
|
2
|
+
task :checksum do
|
|
3
|
+
checksums = File.expand_path('../../checksum', __FILE__)
|
|
4
|
+
name = "#{GEMSPEC.name}-#{GEMSPEC.version}.gem"
|
|
5
|
+
path = File.join(File.expand_path('../../pkg', __FILE__), name)
|
|
6
|
+
|
|
7
|
+
checksum_name = File.basename(path) + '.sha512'
|
|
8
|
+
checksum = Digest::SHA512.new.hexdigest(File.read(path))
|
|
9
|
+
|
|
10
|
+
File.open(File.join(checksums, checksum_name), 'w') do |handle|
|
|
11
|
+
handle.write(checksum)
|
|
12
|
+
end
|
|
13
|
+
end
|
data/task/coverage.rake
ADDED
data/task/doc.rake
ADDED
data/task/generate.rake
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
namespace :generate do
|
|
2
|
+
desc 'Generates a set of definitions for a constant'
|
|
3
|
+
task :definitions, :constant, :directory do |task, args|
|
|
4
|
+
abort 'You have to specify a constant' unless args[:constant]
|
|
5
|
+
abort 'You have to specify a directory' unless args[:directory]
|
|
6
|
+
|
|
7
|
+
generator = RubyLint::DefinitionGenerator.new(
|
|
8
|
+
args[:constant],
|
|
9
|
+
args[:directory],
|
|
10
|
+
:overwrite => true
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
generator.generate
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
desc 'Generates definitions for all available constants'
|
|
17
|
+
task :everything, :overwrite do |task, args|
|
|
18
|
+
args.with_defaults(:overwrite => false)
|
|
19
|
+
|
|
20
|
+
directory = File.expand_path(
|
|
21
|
+
'../../lib/ruby-lint/definitions/core/',
|
|
22
|
+
__FILE__
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
generator = RubyLint::DefinitionGenerator.new(
|
|
26
|
+
Object,
|
|
27
|
+
directory,
|
|
28
|
+
:ignore => %w{BasicObject Class GEMSPEC Module},
|
|
29
|
+
:overwrite => !!args[:overwrite]
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
generator.generate
|
|
33
|
+
end
|
|
34
|
+
end
|
data/task/graphviz.rake
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
desc 'Generates all the Graphviz graphs'
|
|
2
|
+
task :graphviz do
|
|
3
|
+
pattern = File.expand_path('../../doc/graphviz/*.dot', __FILE__)
|
|
4
|
+
output = File.expand_path('../../doc/images/', __FILE__)
|
|
5
|
+
|
|
6
|
+
Dir.glob(pattern) do |file|
|
|
7
|
+
name = File.basename(file, '.dot') + '.png'
|
|
8
|
+
destination = File.join(output, name)
|
|
9
|
+
|
|
10
|
+
sh("dot -T png -o #{destination} #{file}")
|
|
11
|
+
end
|
|
12
|
+
end
|
data/task/stdlib.rake
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
desc 'Analyses the Ruby standard library
|
|
2
|
-
|
|
3
|
-
This task parses and analyses all the files in the Ruby standard library.
|
|
4
|
-
Errors that might occur during this process are catched using pry-rescue.'
|
|
5
|
-
|
|
1
|
+
desc 'Analyses the Ruby standard library'
|
|
6
2
|
task :stdlib do
|
|
7
3
|
require File.expand_path('../../lib/ruby-lint', __FILE__)
|
|
8
4
|
require 'pry/rescue'
|
|
@@ -21,10 +17,7 @@ task :stdlib do
|
|
|
21
17
|
puts "%-#{spacing}s %s" % [prefix, path]
|
|
22
18
|
|
|
23
19
|
Pry.rescue do
|
|
24
|
-
|
|
25
|
-
iterator = RubyLint::Iterator.new
|
|
26
|
-
|
|
27
|
-
RubyLint.options.analyzers.each { |const| iterator.bind(const) }
|
|
20
|
+
RubyLint::Parser.new(File.read(file), file).parse
|
|
28
21
|
end
|
|
29
22
|
end
|
|
30
23
|
end
|
data/task/tag.rake
ADDED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby-lint
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,32 +9,48 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2013-04-22 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
|
-
name:
|
|
15
|
+
name: ast
|
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
|
17
17
|
none: false
|
|
18
18
|
requirements:
|
|
19
19
|
- - ! '>='
|
|
20
20
|
- !ruby/object:Gem::Version
|
|
21
|
-
version: 0
|
|
22
|
-
type: :
|
|
21
|
+
version: '0'
|
|
22
|
+
type: :runtime
|
|
23
23
|
prerelease: false
|
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
25
|
none: false
|
|
26
26
|
requirements:
|
|
27
27
|
- - ! '>='
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: 0
|
|
29
|
+
version: '0'
|
|
30
30
|
- !ruby/object:Gem::Dependency
|
|
31
|
-
name:
|
|
31
|
+
name: slop
|
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
|
33
33
|
none: false
|
|
34
34
|
requirements:
|
|
35
35
|
- - ! '>='
|
|
36
36
|
- !ruby/object:Gem::Version
|
|
37
|
-
version:
|
|
37
|
+
version: '0'
|
|
38
|
+
type: :runtime
|
|
39
|
+
prerelease: false
|
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
+
none: false
|
|
42
|
+
requirements:
|
|
43
|
+
- - ! '>='
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: '0'
|
|
46
|
+
- !ruby/object:Gem::Dependency
|
|
47
|
+
name: rake
|
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
|
49
|
+
none: false
|
|
50
|
+
requirements:
|
|
51
|
+
- - ! '>='
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '0'
|
|
38
54
|
type: :development
|
|
39
55
|
prerelease: false
|
|
40
56
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -42,7 +58,7 @@ dependencies:
|
|
|
42
58
|
requirements:
|
|
43
59
|
- - ! '>='
|
|
44
60
|
- !ruby/object:Gem::Version
|
|
45
|
-
version:
|
|
61
|
+
version: '0'
|
|
46
62
|
- !ruby/object:Gem::Dependency
|
|
47
63
|
name: bacon
|
|
48
64
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -50,7 +66,7 @@ dependencies:
|
|
|
50
66
|
requirements:
|
|
51
67
|
- - ! '>='
|
|
52
68
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: 1.
|
|
69
|
+
version: 1.2.0
|
|
54
70
|
type: :development
|
|
55
71
|
prerelease: false
|
|
56
72
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -58,7 +74,7 @@ dependencies:
|
|
|
58
74
|
requirements:
|
|
59
75
|
- - ! '>='
|
|
60
76
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: 1.
|
|
77
|
+
version: 1.2.0
|
|
62
78
|
- !ruby/object:Gem::Dependency
|
|
63
79
|
name: yard
|
|
64
80
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -66,7 +82,7 @@ dependencies:
|
|
|
66
82
|
requirements:
|
|
67
83
|
- - ! '>='
|
|
68
84
|
- !ruby/object:Gem::Version
|
|
69
|
-
version: 0
|
|
85
|
+
version: '0'
|
|
70
86
|
type: :development
|
|
71
87
|
prerelease: false
|
|
72
88
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -74,7 +90,7 @@ dependencies:
|
|
|
74
90
|
requirements:
|
|
75
91
|
- - ! '>='
|
|
76
92
|
- !ruby/object:Gem::Version
|
|
77
|
-
version: 0
|
|
93
|
+
version: '0'
|
|
78
94
|
- !ruby/object:Gem::Dependency
|
|
79
95
|
name: pry-rescue
|
|
80
96
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -82,7 +98,7 @@ dependencies:
|
|
|
82
98
|
requirements:
|
|
83
99
|
- - ! '>='
|
|
84
100
|
- !ruby/object:Gem::Version
|
|
85
|
-
version: '0
|
|
101
|
+
version: '0'
|
|
86
102
|
type: :development
|
|
87
103
|
prerelease: false
|
|
88
104
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -90,8 +106,72 @@ dependencies:
|
|
|
90
106
|
requirements:
|
|
91
107
|
- - ! '>='
|
|
92
108
|
- !ruby/object:Gem::Version
|
|
93
|
-
version: '0
|
|
94
|
-
|
|
109
|
+
version: '0'
|
|
110
|
+
- !ruby/object:Gem::Dependency
|
|
111
|
+
name: bacon-colored_output
|
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
|
113
|
+
none: false
|
|
114
|
+
requirements:
|
|
115
|
+
- - ! '>='
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: '0'
|
|
118
|
+
type: :development
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
none: false
|
|
122
|
+
requirements:
|
|
123
|
+
- - ! '>='
|
|
124
|
+
- !ruby/object:Gem::Version
|
|
125
|
+
version: '0'
|
|
126
|
+
- !ruby/object:Gem::Dependency
|
|
127
|
+
name: simplecov
|
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
|
129
|
+
none: false
|
|
130
|
+
requirements:
|
|
131
|
+
- - ! '>='
|
|
132
|
+
- !ruby/object:Gem::Version
|
|
133
|
+
version: '0'
|
|
134
|
+
type: :development
|
|
135
|
+
prerelease: false
|
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
137
|
+
none: false
|
|
138
|
+
requirements:
|
|
139
|
+
- - ! '>='
|
|
140
|
+
- !ruby/object:Gem::Version
|
|
141
|
+
version: '0'
|
|
142
|
+
- !ruby/object:Gem::Dependency
|
|
143
|
+
name: rubygems-openpgp
|
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
|
145
|
+
none: false
|
|
146
|
+
requirements:
|
|
147
|
+
- - ! '>='
|
|
148
|
+
- !ruby/object:Gem::Version
|
|
149
|
+
version: '0'
|
|
150
|
+
type: :development
|
|
151
|
+
prerelease: false
|
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
153
|
+
none: false
|
|
154
|
+
requirements:
|
|
155
|
+
- - ! '>='
|
|
156
|
+
- !ruby/object:Gem::Version
|
|
157
|
+
version: '0'
|
|
158
|
+
- !ruby/object:Gem::Dependency
|
|
159
|
+
name: redcarpet
|
|
160
|
+
requirement: !ruby/object:Gem::Requirement
|
|
161
|
+
none: false
|
|
162
|
+
requirements:
|
|
163
|
+
- - ! '>='
|
|
164
|
+
- !ruby/object:Gem::Version
|
|
165
|
+
version: 2.1.1
|
|
166
|
+
type: :development
|
|
167
|
+
prerelease: false
|
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
169
|
+
none: false
|
|
170
|
+
requirements:
|
|
171
|
+
- - ! '>='
|
|
172
|
+
- !ruby/object:Gem::Version
|
|
173
|
+
version: 2.1.1
|
|
174
|
+
description: A linter and static code analysis tool for Ruby.
|
|
95
175
|
email: yorickpeterse@gmail.com
|
|
96
176
|
executables:
|
|
97
177
|
- ruby-lint
|
|
@@ -99,7 +179,7 @@ extensions: []
|
|
|
99
179
|
extra_rdoc_files: []
|
|
100
180
|
files:
|
|
101
181
|
- .gitignore
|
|
102
|
-
- .
|
|
182
|
+
- .travis.yml
|
|
103
183
|
- .yardopts
|
|
104
184
|
- Gemfile
|
|
105
185
|
- LICENSE
|
|
@@ -107,82 +187,271 @@ files:
|
|
|
107
187
|
- README.md
|
|
108
188
|
- Rakefile
|
|
109
189
|
- bin/ruby-lint
|
|
190
|
+
- checksum/.gitkeep
|
|
110
191
|
- doc/.gitkeep
|
|
192
|
+
- doc/DCO.md
|
|
193
|
+
- doc/architecture.md
|
|
111
194
|
- doc/build/.gitkeep
|
|
195
|
+
- doc/code_analysis.md
|
|
196
|
+
- doc/configuration.md
|
|
197
|
+
- doc/contributing.md
|
|
112
198
|
- doc/css/.gitkeep
|
|
113
199
|
- doc/css/common.css
|
|
200
|
+
- doc/graphviz/flow.dot
|
|
201
|
+
- doc/images/.gitkeep
|
|
202
|
+
- doc/images/flow.png
|
|
114
203
|
- lib/ruby-lint.rb
|
|
115
|
-
- lib/ruby-lint/analyze/
|
|
116
|
-
- lib/ruby-lint/analyze/definitions.rb
|
|
117
|
-
- lib/ruby-lint/analyze/method_validation.rb
|
|
204
|
+
- lib/ruby-lint/analyze/argument_amount.rb
|
|
118
205
|
- lib/ruby-lint/analyze/shadowing_variables.rb
|
|
206
|
+
- lib/ruby-lint/analyze/undefined_methods.rb
|
|
119
207
|
- lib/ruby-lint/analyze/undefined_variables.rb
|
|
120
208
|
- lib/ruby-lint/analyze/unused_variables.rb
|
|
121
|
-
- lib/ruby-lint/
|
|
209
|
+
- lib/ruby-lint/base.rb
|
|
122
210
|
- lib/ruby-lint/cli.rb
|
|
123
|
-
- lib/ruby-lint/
|
|
124
|
-
- lib/ruby-lint/
|
|
125
|
-
- lib/ruby-lint/
|
|
126
|
-
- lib/ruby-lint/
|
|
127
|
-
- lib/ruby-lint/
|
|
211
|
+
- lib/ruby-lint/cli/analyze.rb
|
|
212
|
+
- lib/ruby-lint/cli/ast.rb
|
|
213
|
+
- lib/ruby-lint/cli/base.rb
|
|
214
|
+
- lib/ruby-lint/configuration.rb
|
|
215
|
+
- lib/ruby-lint/constant_loader.rb
|
|
216
|
+
- lib/ruby-lint/definition/ruby_method.rb
|
|
217
|
+
- lib/ruby-lint/definition/ruby_object.rb
|
|
218
|
+
- lib/ruby-lint/definition_generator.rb
|
|
219
|
+
- lib/ruby-lint/definitions/core.rb
|
|
220
|
+
- lib/ruby-lint/definitions/core/arg0.rb
|
|
221
|
+
- lib/ruby-lint/definitions/core/argf.rb
|
|
222
|
+
- lib/ruby-lint/definitions/core/argument_error.rb
|
|
223
|
+
- lib/ruby-lint/definitions/core/argv.rb
|
|
224
|
+
- lib/ruby-lint/definitions/core/array.rb
|
|
225
|
+
- lib/ruby-lint/definitions/core/autoload.rb
|
|
226
|
+
- lib/ruby-lint/definitions/core/basic_object.rb
|
|
227
|
+
- lib/ruby-lint/definitions/core/bignum.rb
|
|
228
|
+
- lib/ruby-lint/definitions/core/binding.rb
|
|
229
|
+
- lib/ruby-lint/definitions/core/class.rb
|
|
230
|
+
- lib/ruby-lint/definitions/core/comparable.rb
|
|
231
|
+
- lib/ruby-lint/definitions/core/complex.rb
|
|
232
|
+
- lib/ruby-lint/definitions/core/condition_variable.rb
|
|
233
|
+
- lib/ruby-lint/definitions/core/continuation.rb
|
|
234
|
+
- lib/ruby-lint/definitions/core/data.rb
|
|
235
|
+
- lib/ruby-lint/definitions/core/date.rb
|
|
236
|
+
- lib/ruby-lint/definitions/core/date_time.rb
|
|
237
|
+
- lib/ruby-lint/definitions/core/default_record_separator.rb
|
|
238
|
+
- lib/ruby-lint/definitions/core/digest.rb
|
|
239
|
+
- lib/ruby-lint/definitions/core/dir.rb
|
|
240
|
+
- lib/ruby-lint/definitions/core/encoding.rb
|
|
241
|
+
- lib/ruby-lint/definitions/core/encoding_error.rb
|
|
242
|
+
- lib/ruby-lint/definitions/core/enumerable.rb
|
|
243
|
+
- lib/ruby-lint/definitions/core/enumerator.rb
|
|
244
|
+
- lib/ruby-lint/definitions/core/env.rb
|
|
245
|
+
- lib/ruby-lint/definitions/core/eoferror.rb
|
|
246
|
+
- lib/ruby-lint/definitions/core/erb.rb
|
|
247
|
+
- lib/ruby-lint/definitions/core/errno.rb
|
|
248
|
+
- lib/ruby-lint/definitions/core/etc.rb
|
|
249
|
+
- lib/ruby-lint/definitions/core/exception.rb
|
|
250
|
+
- lib/ruby-lint/definitions/core/false.rb
|
|
251
|
+
- lib/ruby-lint/definitions/core/false_class.rb
|
|
252
|
+
- lib/ruby-lint/definitions/core/fatal_error.rb
|
|
253
|
+
- lib/ruby-lint/definitions/core/fiber.rb
|
|
254
|
+
- lib/ruby-lint/definitions/core/fiber_error.rb
|
|
255
|
+
- lib/ruby-lint/definitions/core/file.rb
|
|
256
|
+
- lib/ruby-lint/definitions/core/file_list.rb
|
|
257
|
+
- lib/ruby-lint/definitions/core/file_test.rb
|
|
258
|
+
- lib/ruby-lint/definitions/core/file_utils.rb
|
|
259
|
+
- lib/ruby-lint/definitions/core/fixnum.rb
|
|
260
|
+
- lib/ruby-lint/definitions/core/float.rb
|
|
261
|
+
- lib/ruby-lint/definitions/core/float_domain_error.rb
|
|
262
|
+
- lib/ruby-lint/definitions/core/gc.rb
|
|
263
|
+
- lib/ruby-lint/definitions/core/gem.rb
|
|
264
|
+
- lib/ruby-lint/definitions/core/hash.rb
|
|
265
|
+
- lib/ruby-lint/definitions/core/immediate_value.rb
|
|
266
|
+
- lib/ruby-lint/definitions/core/index_error.rb
|
|
267
|
+
- lib/ruby-lint/definitions/core/integer.rb
|
|
268
|
+
- lib/ruby-lint/definitions/core/interrupt.rb
|
|
269
|
+
- lib/ruby-lint/definitions/core/io.rb
|
|
270
|
+
- lib/ruby-lint/definitions/core/ioerror.rb
|
|
271
|
+
- lib/ruby-lint/definitions/core/kernel.rb
|
|
272
|
+
- lib/ruby-lint/definitions/core/key_error.rb
|
|
273
|
+
- lib/ruby-lint/definitions/core/load_error.rb
|
|
274
|
+
- lib/ruby-lint/definitions/core/local_jump_error.rb
|
|
275
|
+
- lib/ruby-lint/definitions/core/main.rb
|
|
276
|
+
- lib/ruby-lint/definitions/core/marshal.rb
|
|
277
|
+
- lib/ruby-lint/definitions/core/match_data.rb
|
|
278
|
+
- lib/ruby-lint/definitions/core/math.rb
|
|
279
|
+
- lib/ruby-lint/definitions/core/memory_segmention_error.rb
|
|
280
|
+
- lib/ruby-lint/definitions/core/method.rb
|
|
281
|
+
- lib/ruby-lint/definitions/core/module.rb
|
|
282
|
+
- lib/ruby-lint/definitions/core/monitor.rb
|
|
283
|
+
- lib/ruby-lint/definitions/core/monitor_mixin.rb
|
|
284
|
+
- lib/ruby-lint/definitions/core/mutex.rb
|
|
285
|
+
- lib/ruby-lint/definitions/core/name_error.rb
|
|
286
|
+
- lib/ruby-lint/definitions/core/nil.rb
|
|
287
|
+
- lib/ruby-lint/definitions/core/nil_class.rb
|
|
288
|
+
- lib/ruby-lint/definitions/core/no_memory_error.rb
|
|
289
|
+
- lib/ruby-lint/definitions/core/no_method_error.rb
|
|
290
|
+
- lib/ruby-lint/definitions/core/not_implemented_error.rb
|
|
291
|
+
- lib/ruby-lint/definitions/core/numeric.rb
|
|
292
|
+
- lib/ruby-lint/definitions/core/object.rb
|
|
293
|
+
- lib/ruby-lint/definitions/core/object_space.rb
|
|
294
|
+
- lib/ruby-lint/definitions/core/open_struct.rb
|
|
295
|
+
- lib/ruby-lint/definitions/core/option_parser.rb
|
|
296
|
+
- lib/ruby-lint/definitions/core/precision.rb
|
|
297
|
+
- lib/ruby-lint/definitions/core/primitive_failure.rb
|
|
298
|
+
- lib/ruby-lint/definitions/core/proc.rb
|
|
299
|
+
- lib/ruby-lint/definitions/core/process.rb
|
|
300
|
+
- lib/ruby-lint/definitions/core/psych.rb
|
|
301
|
+
- lib/ruby-lint/definitions/core/queue.rb
|
|
302
|
+
- lib/ruby-lint/definitions/core/rake.rb
|
|
303
|
+
- lib/ruby-lint/definitions/core/rake_file_utils.rb
|
|
304
|
+
- lib/ruby-lint/definitions/core/rakeversion.rb
|
|
305
|
+
- lib/ruby-lint/definitions/core/random.rb
|
|
306
|
+
- lib/ruby-lint/definitions/core/range.rb
|
|
307
|
+
- lib/ruby-lint/definitions/core/range_error.rb
|
|
308
|
+
- lib/ruby-lint/definitions/core/rational.rb
|
|
309
|
+
- lib/ruby-lint/definitions/core/rb_config.rb
|
|
310
|
+
- lib/ruby-lint/definitions/core/regexp.rb
|
|
311
|
+
- lib/ruby-lint/definitions/core/regexp_error.rb
|
|
312
|
+
- lib/ruby-lint/definitions/core/rubinius.rb
|
|
313
|
+
- lib/ruby-lint/definitions/core/ruby_copyright.rb
|
|
314
|
+
- lib/ruby-lint/definitions/core/ruby_description.rb
|
|
315
|
+
- lib/ruby-lint/definitions/core/ruby_engine.rb
|
|
316
|
+
- lib/ruby-lint/definitions/core/ruby_lint.rb
|
|
317
|
+
- lib/ruby-lint/definitions/core/ruby_patchlevel.rb
|
|
318
|
+
- lib/ruby-lint/definitions/core/ruby_platform.rb
|
|
319
|
+
- lib/ruby-lint/definitions/core/ruby_release_date.rb
|
|
320
|
+
- lib/ruby-lint/definitions/core/ruby_version.rb
|
|
321
|
+
- lib/ruby-lint/definitions/core/runtime_error.rb
|
|
322
|
+
- lib/ruby-lint/definitions/core/scan_error.rb
|
|
323
|
+
- lib/ruby-lint/definitions/core/script_error.rb
|
|
324
|
+
- lib/ruby-lint/definitions/core/security_error.rb
|
|
325
|
+
- lib/ruby-lint/definitions/core/shellwords.rb
|
|
326
|
+
- lib/ruby-lint/definitions/core/signal.rb
|
|
327
|
+
- lib/ruby-lint/definitions/core/signal_exception.rb
|
|
328
|
+
- lib/ruby-lint/definitions/core/singleton.rb
|
|
329
|
+
- lib/ruby-lint/definitions/core/sized_queue.rb
|
|
330
|
+
- lib/ruby-lint/definitions/core/standard_error.rb
|
|
331
|
+
- lib/ruby-lint/definitions/core/stderr.rb
|
|
332
|
+
- lib/ruby-lint/definitions/core/stdin.rb
|
|
333
|
+
- lib/ruby-lint/definitions/core/stdout.rb
|
|
334
|
+
- lib/ruby-lint/definitions/core/stop_iteration.rb
|
|
335
|
+
- lib/ruby-lint/definitions/core/string.rb
|
|
336
|
+
- lib/ruby-lint/definitions/core/string_io.rb
|
|
337
|
+
- lib/ruby-lint/definitions/core/string_scanner.rb
|
|
338
|
+
- lib/ruby-lint/definitions/core/struct.rb
|
|
339
|
+
- lib/ruby-lint/definitions/core/syck.rb
|
|
340
|
+
- lib/ruby-lint/definitions/core/symbol.rb
|
|
341
|
+
- lib/ruby-lint/definitions/core/syntax_error.rb
|
|
342
|
+
- lib/ruby-lint/definitions/core/system_call_error.rb
|
|
343
|
+
- lib/ruby-lint/definitions/core/system_exit.rb
|
|
344
|
+
- lib/ruby-lint/definitions/core/system_stack_error.rb
|
|
345
|
+
- lib/ruby-lint/definitions/core/thread.rb
|
|
346
|
+
- lib/ruby-lint/definitions/core/thread_error.rb
|
|
347
|
+
- lib/ruby-lint/definitions/core/thread_group.rb
|
|
348
|
+
- lib/ruby-lint/definitions/core/time.rb
|
|
349
|
+
- lib/ruby-lint/definitions/core/toplevel_binding.rb
|
|
350
|
+
- lib/ruby-lint/definitions/core/true.rb
|
|
351
|
+
- lib/ruby-lint/definitions/core/true_class.rb
|
|
352
|
+
- lib/ruby-lint/definitions/core/type_error.rb
|
|
353
|
+
- lib/ruby-lint/definitions/core/unbound_method.rb
|
|
354
|
+
- lib/ruby-lint/definitions/core/unmarshalable.rb
|
|
355
|
+
- lib/ruby-lint/definitions/core/unsupported_library_error.rb
|
|
356
|
+
- lib/ruby-lint/definitions/core/weak_ref.rb
|
|
357
|
+
- lib/ruby-lint/definitions/core/zero_division_error.rb
|
|
358
|
+
- lib/ruby-lint/definitions_builder.rb
|
|
359
|
+
- lib/ruby-lint/extensions/string.rb
|
|
360
|
+
- lib/ruby-lint/helper/constant_paths.rb
|
|
361
|
+
- lib/ruby-lint/helper/conversion.rb
|
|
362
|
+
- lib/ruby-lint/helper/current_scope.rb
|
|
363
|
+
- lib/ruby-lint/helper/methods.rb
|
|
364
|
+
- lib/ruby-lint/inspector.rb
|
|
128
365
|
- lib/ruby-lint/iterator.rb
|
|
129
|
-
- lib/ruby-lint/
|
|
366
|
+
- lib/ruby-lint/node.rb
|
|
130
367
|
- lib/ruby-lint/parser.rb
|
|
131
368
|
- lib/ruby-lint/parser_error.rb
|
|
369
|
+
- lib/ruby-lint/presenter/json.rb
|
|
370
|
+
- lib/ruby-lint/presenter/text.rb
|
|
132
371
|
- lib/ruby-lint/report.rb
|
|
133
|
-
- lib/ruby-lint/
|
|
134
|
-
- lib/ruby-lint/
|
|
135
|
-
- lib/ruby-lint/
|
|
136
|
-
- lib/ruby-lint/
|
|
137
|
-
- lib/ruby-lint/token/class_token.rb
|
|
138
|
-
- lib/ruby-lint/token/keyword_token.rb
|
|
139
|
-
- lib/ruby-lint/token/method_definition_token.rb
|
|
140
|
-
- lib/ruby-lint/token/method_token.rb
|
|
141
|
-
- lib/ruby-lint/token/parameters_token.rb
|
|
142
|
-
- lib/ruby-lint/token/regexp_token.rb
|
|
143
|
-
- lib/ruby-lint/token/statement_token.rb
|
|
144
|
-
- lib/ruby-lint/token/token.rb
|
|
145
|
-
- lib/ruby-lint/token/variable_token.rb
|
|
372
|
+
- lib/ruby-lint/report/entry.rb
|
|
373
|
+
- lib/ruby-lint/template/definition.erb
|
|
374
|
+
- lib/ruby-lint/template/scope.rb
|
|
375
|
+
- lib/ruby-lint/variable_predicates.rb
|
|
146
376
|
- lib/ruby-lint/version.rb
|
|
147
377
|
- ruby-lint.gemspec
|
|
148
|
-
- spec/benchmarks/memory.rb
|
|
149
|
-
- spec/benchmarks/parse_parser.rb
|
|
150
|
-
- spec/fixtures/stdlib/un.rb
|
|
151
378
|
- spec/helper.rb
|
|
152
|
-
- spec/ruby-lint/analyze/
|
|
153
|
-
- spec/ruby-lint/analyze/complex/un.rb
|
|
154
|
-
- spec/ruby-lint/analyze/definitions/classes.rb
|
|
155
|
-
- spec/ruby-lint/analyze/definitions/methods.rb
|
|
156
|
-
- spec/ruby-lint/analyze/definitions/modules.rb
|
|
157
|
-
- spec/ruby-lint/analyze/definitions/variables.rb
|
|
158
|
-
- spec/ruby-lint/analyze/method_validation.rb
|
|
379
|
+
- spec/ruby-lint/analyze/argument_amount.rb
|
|
159
380
|
- spec/ruby-lint/analyze/shadowing_variables.rb
|
|
381
|
+
- spec/ruby-lint/analyze/undefined_methods.rb
|
|
160
382
|
- spec/ruby-lint/analyze/undefined_variables.rb
|
|
161
383
|
- spec/ruby-lint/analyze/unused_variables.rb
|
|
162
|
-
- spec/ruby-lint/
|
|
163
|
-
- spec/ruby-lint/
|
|
164
|
-
- spec/ruby-lint/definition.rb
|
|
165
|
-
- spec/ruby-lint/
|
|
384
|
+
- spec/ruby-lint/configuration.rb
|
|
385
|
+
- spec/ruby-lint/constant_loader.rb
|
|
386
|
+
- spec/ruby-lint/definition/dsl.rb
|
|
387
|
+
- spec/ruby-lint/definition/method_calls.rb
|
|
388
|
+
- spec/ruby-lint/definition/ruby_method.rb
|
|
389
|
+
- spec/ruby-lint/definition/ruby_object.rb
|
|
390
|
+
- spec/ruby-lint/definitions_builder/assignments/arrays.rb
|
|
391
|
+
- spec/ruby-lint/definitions_builder/assignments/hashes.rb
|
|
392
|
+
- spec/ruby-lint/definitions_builder/assignments/objects.rb
|
|
393
|
+
- spec/ruby-lint/definitions_builder/assignments/optional.rb
|
|
394
|
+
- spec/ruby-lint/definitions_builder/assignments/return_values.rb
|
|
395
|
+
- spec/ruby-lint/definitions_builder/assignments/variables.rb
|
|
396
|
+
- spec/ruby-lint/definitions_builder/associate_nodes.rb
|
|
397
|
+
- spec/ruby-lint/definitions_builder/blocks.rb
|
|
398
|
+
- spec/ruby-lint/definitions_builder/classes.rb
|
|
399
|
+
- spec/ruby-lint/definitions_builder/for.rb
|
|
400
|
+
- spec/ruby-lint/definitions_builder/methods.rb
|
|
401
|
+
- spec/ruby-lint/definitions_builder/modules.rb
|
|
402
|
+
- spec/ruby-lint/definitions_builder/reference_amount.rb
|
|
403
|
+
- spec/ruby-lint/definitions_builder/unused.rb
|
|
404
|
+
- spec/ruby-lint/extensions/string.rb
|
|
166
405
|
- spec/ruby-lint/iterator.rb
|
|
167
|
-
- spec/ruby-lint/
|
|
406
|
+
- spec/ruby-lint/node.rb
|
|
407
|
+
- spec/ruby-lint/parser/assignments.rb
|
|
168
408
|
- spec/ruby-lint/parser/classes.rb
|
|
169
409
|
- spec/ruby-lint/parser/errors.rb
|
|
170
|
-
- spec/ruby-lint/parser/
|
|
171
|
-
- spec/ruby-lint/parser/
|
|
172
|
-
- spec/ruby-lint/parser/keywords.rb
|
|
410
|
+
- spec/ruby-lint/parser/metadata.rb
|
|
411
|
+
- spec/ruby-lint/parser/method_definitions.rb
|
|
173
412
|
- spec/ruby-lint/parser/methods.rb
|
|
174
413
|
- spec/ruby-lint/parser/modules.rb
|
|
175
|
-
- spec/ruby-lint/parser/objects.rb
|
|
176
414
|
- spec/ruby-lint/parser/operators.rb
|
|
177
|
-
- spec/ruby-lint/parser/
|
|
178
|
-
- spec/ruby-lint/parser/
|
|
179
|
-
- spec/ruby-lint/parser/
|
|
180
|
-
- spec/ruby-lint/parser/
|
|
181
|
-
- spec/ruby-lint/parser/statements.rb
|
|
182
|
-
- spec/ruby-lint/parser/
|
|
415
|
+
- spec/ruby-lint/parser/statements/begin.rb
|
|
416
|
+
- spec/ruby-lint/parser/statements/case.rb
|
|
417
|
+
- spec/ruby-lint/parser/statements/defined.rb
|
|
418
|
+
- spec/ruby-lint/parser/statements/for.rb
|
|
419
|
+
- spec/ruby-lint/parser/statements/if.rb
|
|
420
|
+
- spec/ruby-lint/parser/statements/return.rb
|
|
421
|
+
- spec/ruby-lint/parser/statements/super.rb
|
|
422
|
+
- spec/ruby-lint/parser/statements/unless.rb
|
|
423
|
+
- spec/ruby-lint/parser/statements/until.rb
|
|
424
|
+
- spec/ruby-lint/parser/statements/while.rb
|
|
425
|
+
- spec/ruby-lint/parser/statements/yield.rb
|
|
426
|
+
- spec/ruby-lint/parser/types/arrays.rb
|
|
427
|
+
- spec/ruby-lint/parser/types/booleans.rb
|
|
428
|
+
- spec/ruby-lint/parser/types/constants.rb
|
|
429
|
+
- spec/ruby-lint/parser/types/hashes.rb
|
|
430
|
+
- spec/ruby-lint/parser/types/nil.rb
|
|
431
|
+
- spec/ruby-lint/parser/types/numbers.rb
|
|
432
|
+
- spec/ruby-lint/parser/types/procs.rb
|
|
433
|
+
- spec/ruby-lint/parser/types/ranges.rb
|
|
434
|
+
- spec/ruby-lint/parser/types/regexp.rb
|
|
435
|
+
- spec/ruby-lint/parser/types/strings.rb
|
|
436
|
+
- spec/ruby-lint/parser/types/symbols.rb
|
|
437
|
+
- spec/ruby-lint/presenter/json.rb
|
|
438
|
+
- spec/ruby-lint/presenter/text.rb
|
|
183
439
|
- spec/ruby-lint/report.rb
|
|
440
|
+
- spec/ruby-lint/report/entry.rb
|
|
441
|
+
- spec/support/bacon.rb
|
|
442
|
+
- spec/support/building.rb
|
|
443
|
+
- spec/support/definitions.rb
|
|
444
|
+
- spec/support/parsing.rb
|
|
445
|
+
- spec/support/simplecov.rb
|
|
446
|
+
- task/build.rake
|
|
447
|
+
- task/checksum.rake
|
|
448
|
+
- task/coverage.rake
|
|
449
|
+
- task/doc.rake
|
|
450
|
+
- task/generate.rake
|
|
451
|
+
- task/graphviz.rake
|
|
184
452
|
- task/manifest.rake
|
|
185
453
|
- task/stdlib.rake
|
|
454
|
+
- task/tag.rake
|
|
186
455
|
- task/test.rake
|
|
187
456
|
homepage: https://github.com/yorickpeterse/ruby-lint/
|
|
188
457
|
licenses: []
|
|
@@ -195,7 +464,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
195
464
|
requirements:
|
|
196
465
|
- - ! '>='
|
|
197
466
|
- !ruby/object:Gem::Version
|
|
198
|
-
version: 1.9.
|
|
467
|
+
version: 1.9.3
|
|
199
468
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
469
|
none: false
|
|
201
470
|
requirements:
|
|
@@ -204,8 +473,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
204
473
|
version: '0'
|
|
205
474
|
requirements: []
|
|
206
475
|
rubyforge_project:
|
|
207
|
-
rubygems_version: 1.8.
|
|
476
|
+
rubygems_version: 1.8.23
|
|
208
477
|
signing_key:
|
|
209
478
|
specification_version: 3
|
|
210
|
-
summary:
|
|
479
|
+
summary: A linter and static code analysis tool for Ruby.
|
|
211
480
|
test_files: []
|