ridecharge-rubocop 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/.rspec +1 -0
- data/.travis.yml +14 -0
- data/CHANGELOG.md +0 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +35 -0
- data/Rakefile +22 -0
- data/bin/ridecharge-rubocop +49 -0
- data/config/0default.yml +8 -0
- data/config/fleet-magic-todo.yml +380 -0
- data/config/rc-todo.yml +190 -0
- data/config/ridecharge-rubocop_todo.yml +73 -0
- data/config/rubocop/default.yml +308 -0
- data/config/rubocop/disabled.yml +9 -0
- data/config/rubocop/enabled.yml +648 -0
- data/config/standard-todo.yml +24 -0
- data/config/tabs.yml +15 -0
- data/config/vehicle-todo.yml +195 -0
- data/lib/ridecharge/rubocop.rb +2 -0
- data/lib/ridecharge/rubocop/version.rb +5 -0
- data/lib/rubocop/config_loader_monkeypatch.rb +117 -0
- data/lib/rubocop/ridecharge.rb +1 -0
- data/ridecharge-rubocop.gemspec +25 -0
- data/spec/isolated_environment_spec.rb +24 -0
- data/spec/project_spec.rb +118 -0
- data/spec/rubocop/cli_spec.rb +1385 -0
- data/spec/rubocop/config_loader_spec.rb +328 -0
- data/spec/rubocop/config_spec.rb +179 -0
- data/spec/rubocop/config_store_spec.rb +53 -0
- data/spec/rubocop/cop/commissioner_spec.rb +83 -0
- data/spec/rubocop/cop/cop_spec.rb +114 -0
- data/spec/rubocop/cop/corrector_spec.rb +59 -0
- data/spec/rubocop/cop/lint/ambiguous_operator_spec.rb +113 -0
- data/spec/rubocop/cop/lint/ambiguous_regexp_literal_spec.rb +35 -0
- data/spec/rubocop/cop/lint/assignment_in_condition_spec.rb +107 -0
- data/spec/rubocop/cop/lint/block_alignment_spec.rb +411 -0
- data/spec/rubocop/cop/lint/condition_position_spec.rb +49 -0
- data/spec/rubocop/cop/lint/debugger_spec.rb +39 -0
- data/spec/rubocop/cop/lint/else_layout_spec.rb +65 -0
- data/spec/rubocop/cop/lint/empty_ensure_spec.rb +27 -0
- data/spec/rubocop/cop/lint/end_alignment_spec.rb +136 -0
- data/spec/rubocop/cop/lint/end_in_method_spec.rb +29 -0
- data/spec/rubocop/cop/lint/ensure_return_spec.rb +39 -0
- data/spec/rubocop/cop/lint/eval_spec.rb +35 -0
- data/spec/rubocop/cop/lint/handle_exceptions_spec.rb +30 -0
- data/spec/rubocop/cop/lint/invalid_character_literal_spec.rb +33 -0
- data/spec/rubocop/cop/lint/literal_in_condition_spec.rb +63 -0
- data/spec/rubocop/cop/lint/loop_spec.rb +27 -0
- data/spec/rubocop/cop/lint/parentheses_as_grouped_expression_spec.rb +57 -0
- data/spec/rubocop/cop/lint/require_parentheses_spec.rb +82 -0
- data/spec/rubocop/cop/lint/rescue_exception_spec.rb +131 -0
- data/spec/rubocop/cop/lint/shadowing_outer_local_variable_spec.rb +237 -0
- data/spec/rubocop/cop/lint/syntax_spec.rb +34 -0
- data/spec/rubocop/cop/lint/unreachable_code_spec.rb +63 -0
- data/spec/rubocop/cop/lint/useless_assignment_spec.rb +1570 -0
- data/spec/rubocop/cop/lint/useless_comparison_spec.rb +30 -0
- data/spec/rubocop/cop/lint/useless_else_without_rescue_spec.rb +48 -0
- data/spec/rubocop/cop/lint/useless_setter_call_spec.rb +149 -0
- data/spec/rubocop/cop/lint/void_spec.rb +57 -0
- data/spec/rubocop/cop/offence_spec.rb +133 -0
- data/spec/rubocop/cop/rails/default_scope_spec.rb +37 -0
- data/spec/rubocop/cop/rails/has_and_belongs_to_many_spec.rb +13 -0
- data/spec/rubocop/cop/rails/output_spec.rb +41 -0
- data/spec/rubocop/cop/rails/read_attribute_spec.rb +13 -0
- data/spec/rubocop/cop/rails/validation_spec.rb +21 -0
- data/spec/rubocop/cop/style/access_modifier_indentation_spec.rb +361 -0
- data/spec/rubocop/cop/style/accessor_method_name_spec.rb +81 -0
- data/spec/rubocop/cop/style/alias_spec.rb +59 -0
- data/spec/rubocop/cop/style/align_array_spec.rb +75 -0
- data/spec/rubocop/cop/style/align_hash_spec.rb +310 -0
- data/spec/rubocop/cop/style/align_parameters_spec.rb +222 -0
- data/spec/rubocop/cop/style/and_or_spec.rb +57 -0
- data/spec/rubocop/cop/style/ascii_comments_spec.rb +22 -0
- data/spec/rubocop/cop/style/ascii_identifiers_spec.rb +36 -0
- data/spec/rubocop/cop/style/attr_spec.rb +19 -0
- data/spec/rubocop/cop/style/begin_block_spec.rb +13 -0
- data/spec/rubocop/cop/style/block_comments_spec.rb +21 -0
- data/spec/rubocop/cop/style/block_nesting_spec.rb +156 -0
- data/spec/rubocop/cop/style/blocks_spec.rb +99 -0
- data/spec/rubocop/cop/style/braces_around_hash_parameters_spec.rb +284 -0
- data/spec/rubocop/cop/style/case_equality_spec.rb +12 -0
- data/spec/rubocop/cop/style/case_indentation_spec.rb +289 -0
- data/spec/rubocop/cop/style/character_literal_spec.rb +37 -0
- data/spec/rubocop/cop/style/class_and_module_camel_case_spec.rb +40 -0
- data/spec/rubocop/cop/style/class_length_spec.rb +131 -0
- data/spec/rubocop/cop/style/class_methods_spec.rb +45 -0
- data/spec/rubocop/cop/style/class_vars_spec.rb +19 -0
- data/spec/rubocop/cop/style/collection_methods_spec.rb +48 -0
- data/spec/rubocop/cop/style/colon_method_call_spec.rb +60 -0
- data/spec/rubocop/cop/style/comment_annotation_spec.rb +86 -0
- data/spec/rubocop/cop/style/constant_name_spec.rb +65 -0
- data/spec/rubocop/cop/style/cyclomatic_complexity_spec.rb +204 -0
- data/spec/rubocop/cop/style/def_with_parentheses_spec.rb +39 -0
- data/spec/rubocop/cop/style/documentation_spec.rb +123 -0
- data/spec/rubocop/cop/style/dot_position_spec.rb +94 -0
- data/spec/rubocop/cop/style/empty_line_between_defs_spec.rb +127 -0
- data/spec/rubocop/cop/style/empty_lines_around_access_modifier_spec.rb +56 -0
- data/spec/rubocop/cop/style/empty_lines_around_body_spec.rb +131 -0
- data/spec/rubocop/cop/style/empty_lines_spec.rb +40 -0
- data/spec/rubocop/cop/style/empty_literal_spec.rb +100 -0
- data/spec/rubocop/cop/style/encoding_spec.rb +56 -0
- data/spec/rubocop/cop/style/end_block_spec.rb +13 -0
- data/spec/rubocop/cop/style/end_of_line_spec.rb +47 -0
- data/spec/rubocop/cop/style/even_odd_spec.rb +75 -0
- data/spec/rubocop/cop/style/favor_join_spec.rb +31 -0
- data/spec/rubocop/cop/style/favor_sprintf_spec.rb +47 -0
- data/spec/rubocop/cop/style/favor_unless_over_negated_if_spec.rb +76 -0
- data/spec/rubocop/cop/style/favor_until_over_negated_while_spec.rb +41 -0
- data/spec/rubocop/cop/style/final_newline_spec.rb +30 -0
- data/spec/rubocop/cop/style/flip_flop_spec.rb +23 -0
- data/spec/rubocop/cop/style/for_spec.rb +105 -0
- data/spec/rubocop/cop/style/global_vars_spec.rb +34 -0
- data/spec/rubocop/cop/style/hash_methods_spec.rb +45 -0
- data/spec/rubocop/cop/style/hash_syntax_spec.rb +131 -0
- data/spec/rubocop/cop/style/if_unless_modifier_spec.rb +128 -0
- data/spec/rubocop/cop/style/if_with_semicolon_spec.rb +19 -0
- data/spec/rubocop/cop/style/indentation_consistency_spec.rb +490 -0
- data/spec/rubocop/cop/style/indentation_width_spec.rb +470 -0
- data/spec/rubocop/cop/style/lambda_call_spec.rb +65 -0
- data/spec/rubocop/cop/style/lambda_spec.rb +41 -0
- data/spec/rubocop/cop/style/leading_comment_space_spec.rb +64 -0
- data/spec/rubocop/cop/style/line_end_concatenation_spec.rb +34 -0
- data/spec/rubocop/cop/style/line_length_spec.rb +20 -0
- data/spec/rubocop/cop/style/method_call_parentheses_spec.rb +59 -0
- data/spec/rubocop/cop/style/method_called_on_do_end_block_spec.rb +60 -0
- data/spec/rubocop/cop/style/method_def_parentheses_spec.rb +106 -0
- data/spec/rubocop/cop/style/method_length_spec.rb +147 -0
- data/spec/rubocop/cop/style/method_name_spec.rb +125 -0
- data/spec/rubocop/cop/style/module_function_spec.rb +24 -0
- data/spec/rubocop/cop/style/multiline_block_chain_spec.rb +78 -0
- data/spec/rubocop/cop/style/multiline_if_then_spec.rb +107 -0
- data/spec/rubocop/cop/style/multiline_ternary_operator_spec.rb +18 -0
- data/spec/rubocop/cop/style/nested_ternary_operator_spec.rb +21 -0
- data/spec/rubocop/cop/style/nil_comparison_spec.rb +30 -0
- data/spec/rubocop/cop/style/not_spec.rb +22 -0
- data/spec/rubocop/cop/style/numeric_literals_spec.rb +64 -0
- data/spec/rubocop/cop/style/one_line_conditional_spec.rb +13 -0
- data/spec/rubocop/cop/style/op_method_spec.rb +74 -0
- data/spec/rubocop/cop/style/parameter_lists_spec.rb +44 -0
- data/spec/rubocop/cop/style/parentheses_around_condition_spec.rb +122 -0
- data/spec/rubocop/cop/style/perl_backrefs_spec.rb +17 -0
- data/spec/rubocop/cop/style/predicate_name_spec.rb +25 -0
- data/spec/rubocop/cop/style/proc_spec.rb +27 -0
- data/spec/rubocop/cop/style/raise_args_spec.rb +82 -0
- data/spec/rubocop/cop/style/redundant_begin_spec.rb +57 -0
- data/spec/rubocop/cop/style/redundant_exception_spec.rb +27 -0
- data/spec/rubocop/cop/style/redundant_return_spec.rb +171 -0
- data/spec/rubocop/cop/style/redundant_self_spec.rb +142 -0
- data/spec/rubocop/cop/style/regexp_literal_spec.rb +83 -0
- data/spec/rubocop/cop/style/rescue_modifier_spec.rb +116 -0
- data/spec/rubocop/cop/style/semicolon_spec.rb +100 -0
- data/spec/rubocop/cop/style/signal_exception_spec.rb +266 -0
- data/spec/rubocop/cop/style/single_line_block_params_spec.rb +68 -0
- data/spec/rubocop/cop/style/single_line_methods_spec.rb +52 -0
- data/spec/rubocop/cop/style/space_after_colon_spec.rb +38 -0
- data/spec/rubocop/cop/style/space_after_comma_spec.rb +30 -0
- data/spec/rubocop/cop/style/space_after_control_keyword_spec.rb +84 -0
- data/spec/rubocop/cop/style/space_after_method_name_spec.rb +70 -0
- data/spec/rubocop/cop/style/space_after_not_spec.rb +22 -0
- data/spec/rubocop/cop/style/space_after_semicolon_spec.rb +23 -0
- data/spec/rubocop/cop/style/space_around_block_braces_spec.rb +283 -0
- data/spec/rubocop/cop/style/space_around_equals_in_parameter_default_spec.rb +33 -0
- data/spec/rubocop/cop/style/space_around_operators_spec.rb +325 -0
- data/spec/rubocop/cop/style/space_before_modifier_keyword_spec.rb +70 -0
- data/spec/rubocop/cop/style/space_inside_brackets_spec.rb +52 -0
- data/spec/rubocop/cop/style/space_inside_hash_literal_braces_spec.rb +138 -0
- data/spec/rubocop/cop/style/space_inside_parens_spec.rb +34 -0
- data/spec/rubocop/cop/style/special_global_vars_spec.rb +56 -0
- data/spec/rubocop/cop/style/string_literals_spec.rb +212 -0
- data/spec/rubocop/cop/style/symbol_array_spec.rb +37 -0
- data/spec/rubocop/cop/style/tab_spec.rb +17 -0
- data/spec/rubocop/cop/style/trailing_blank_lines_spec.rb +43 -0
- data/spec/rubocop/cop/style/trailing_comma_spec.rb +230 -0
- data/spec/rubocop/cop/style/trailing_whitespace_spec.rb +30 -0
- data/spec/rubocop/cop/style/trivial_accessors_spec.rb +415 -0
- data/spec/rubocop/cop/style/unless_else_spec.rb +25 -0
- data/spec/rubocop/cop/style/variable_interpolation_spec.rb +47 -0
- data/spec/rubocop/cop/style/variable_name_spec.rb +107 -0
- data/spec/rubocop/cop/style/when_then_spec.rb +41 -0
- data/spec/rubocop/cop/style/while_until_do_spec.rb +53 -0
- data/spec/rubocop/cop/style/while_until_modifier_spec.rb +75 -0
- data/spec/rubocop/cop/style/word_array_spec.rb +97 -0
- data/spec/rubocop/cop/team_spec.rb +156 -0
- data/spec/rubocop/cop/util_spec.rb +49 -0
- data/spec/rubocop/cop/variable_inspector/assignment_spec.rb +213 -0
- data/spec/rubocop/cop/variable_inspector/locatable_spec.rb +734 -0
- data/spec/rubocop/cop/variable_inspector/scope_spec.rb +184 -0
- data/spec/rubocop/cop/variable_inspector/variable_spec.rb +73 -0
- data/spec/rubocop/cop/variable_inspector/variable_table_spec.rb +269 -0
- data/spec/rubocop/cop/variable_inspector_spec.rb +29 -0
- data/spec/rubocop/file_inspector_spec.rb +78 -0
- data/spec/rubocop/formatter/base_formatter_spec.rb +191 -0
- data/spec/rubocop/formatter/clang_style_formatter_spec.rb +114 -0
- data/spec/rubocop/formatter/colorizable_spec.rb +107 -0
- data/spec/rubocop/formatter/disabled_config_formatter_spec.rb +50 -0
- data/spec/rubocop/formatter/emacs_style_formatter_spec.rb +62 -0
- data/spec/rubocop/formatter/file_list_formatter_spec.rb +33 -0
- data/spec/rubocop/formatter/formatter_set_spec.rb +132 -0
- data/spec/rubocop/formatter/json_formatter_spec.rb +148 -0
- data/spec/rubocop/formatter/offence_count_formatter_spec.rb +52 -0
- data/spec/rubocop/formatter/progress_formatter_spec.rb +182 -0
- data/spec/rubocop/formatter/simple_text_formatter_spec.rb +123 -0
- data/spec/rubocop/options_spec.rb +145 -0
- data/spec/rubocop/path_util_spec.rb +42 -0
- data/spec/rubocop/processed_source_spec.rb +114 -0
- data/spec/rubocop/source_parser_spec.rb +139 -0
- data/spec/rubocop/target_finder_spec.rb +180 -0
- data/spec/rubocop/token_spec.rb +25 -0
- data/spec/spec_helper.rb +136 -0
- data/spec/support/ast_helper.rb +15 -0
- data/spec/support/file_helper.rb +21 -0
- data/spec/support/isolated_environment.rb +34 -0
- data/spec/support/mri_syntax_checker.rb +73 -0
- data/spec/support/shared_context.rb +22 -0
- data/spec/support/shared_examples.rb +33 -0
- data/spec/support/statement_modifier_helper.rb +41 -0
- metadata +511 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 2e31b784423b36917ed2dcc04c9555484ba27ffc
|
|
4
|
+
data.tar.gz: 41d86c6a5748d1aea82277b47c077ba1c924deea
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 3fa11e93ce6310941aea1c08194ead7aa8ddb1eeae18d53c371cb20b954c94b99f246b1cba0eaed52e810db66657a9687d75829ce9203c648a0bcef0245a4fc8
|
|
7
|
+
data.tar.gz: 6233975f3b892512d5f7a79032338fa68c2b75d669afb6d5951ae6a952bc5ab2b8a4bfa2f325f821e7b8f3e586fe596ba1aa3108fabf85483046d88cbb7dc984
|
data/.gitignore
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
*.gem
|
|
2
|
+
*.rbc
|
|
3
|
+
.bundle
|
|
4
|
+
.config
|
|
5
|
+
.yardoc
|
|
6
|
+
Gemfile.lock
|
|
7
|
+
InstalledFiles
|
|
8
|
+
_yardoc
|
|
9
|
+
coverage
|
|
10
|
+
doc/
|
|
11
|
+
lib/bundler/man
|
|
12
|
+
pkg
|
|
13
|
+
rdoc
|
|
14
|
+
spec/reports
|
|
15
|
+
test/tmp
|
|
16
|
+
test/version_tmp
|
|
17
|
+
tmp
|
|
18
|
+
*.bundle
|
|
19
|
+
*.so
|
|
20
|
+
*.o
|
|
21
|
+
*.a
|
|
22
|
+
mkmf.log
|
data/.rspec
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
--color
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
|
File without changes
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2014 Tim Snowhite
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Ridecharge::Rubocop
|
|
2
|
+
|
|
3
|
+
Our company's syntax guide, in tool form.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
8
|
+
|
|
9
|
+
gem 'ridecharge-rubocop', '0.0.1'
|
|
10
|
+
|
|
11
|
+
And then execute:
|
|
12
|
+
|
|
13
|
+
$ bundle
|
|
14
|
+
|
|
15
|
+
Or install it yourself as:
|
|
16
|
+
|
|
17
|
+
$ gem install ridecharge-rubocop
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
Run `ridecharge-rubocop -R` in .travis.yml to check your application against our current syntax guide.
|
|
22
|
+
|
|
23
|
+
`config/0default.yml` is the entrypoint.
|
|
24
|
+
|
|
25
|
+
`config/tabs.yml` shows an example setting.
|
|
26
|
+
|
|
27
|
+
## Contributing
|
|
28
|
+
|
|
29
|
+
1. Make a new branch, with your requested change.
|
|
30
|
+
2. Make a pull request with some reasoning. Get at least 3 :+1:'s.
|
|
31
|
+
3. Bump the version before merging your pull request.
|
|
32
|
+
4. Run `rake release` in a local checkout of this repository to push the updated gem version to rubygems.
|
|
33
|
+
5. Make an Issue with a todo for each name of all the applications which are not yet updated.
|
|
34
|
+
6. Make pull requests in each app to update the ridecharge-rubocop version. Change any offenses.
|
|
35
|
+
7. Merge and deploy the pull requests in each of the organization's apps.
|
data/Rakefile
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
require "bundler/gem_tasks"
|
|
2
|
+
|
|
3
|
+
require 'rspec/core'
|
|
4
|
+
require 'rspec/core/rake_task'
|
|
5
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
|
6
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
|
7
|
+
end
|
|
8
|
+
task :default => :spec
|
|
9
|
+
|
|
10
|
+
require 'rubocop'
|
|
11
|
+
require 'rubocop/ridecharge'
|
|
12
|
+
require 'rubocop/rake_task'
|
|
13
|
+
Rubocop::RakeTask.new
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
task :console do
|
|
18
|
+
require 'irb'
|
|
19
|
+
require 'irb/completion'
|
|
20
|
+
ARGV.clear
|
|
21
|
+
IRB.start
|
|
22
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# encoding: utf-8
|
|
3
|
+
|
|
4
|
+
# https://github.com/bbatsov/rubocop/blob/ff167d8f202baf7a68955db0aaf0dc29afb7e7ee/bin/rubocop
|
|
5
|
+
=begin
|
|
6
|
+
#!/usr/bin/env ruby
|
|
7
|
+
# encoding: utf-8
|
|
8
|
+
|
|
9
|
+
if RUBY_VERSION >= '1.9.2'
|
|
10
|
+
$LOAD_PATH.unshift(File.dirname(File.realpath(__FILE__)) + '/../lib')
|
|
11
|
+
|
|
12
|
+
require 'rubocop'
|
|
13
|
+
require 'benchmark'
|
|
14
|
+
|
|
15
|
+
cli = Rubocop::CLI.new
|
|
16
|
+
result = 0
|
|
17
|
+
|
|
18
|
+
time = Benchmark.realtime do
|
|
19
|
+
result = cli.run
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
puts "Finished in #{time} seconds" if cli.options[:debug]
|
|
23
|
+
exit result
|
|
24
|
+
else
|
|
25
|
+
puts 'RuboCop supports only Ruby 1.9.2+'
|
|
26
|
+
exit(-1)
|
|
27
|
+
end
|
|
28
|
+
=end
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
if RUBY_VERSION >= '1.9.2'
|
|
32
|
+
$LOAD_PATH.unshift(File.dirname(File.realpath(__FILE__)) + '/../lib')
|
|
33
|
+
|
|
34
|
+
require 'rubocop/ridecharge'
|
|
35
|
+
require 'benchmark'
|
|
36
|
+
|
|
37
|
+
cli = Rubocop::CLI.new
|
|
38
|
+
result = 0
|
|
39
|
+
|
|
40
|
+
time = Benchmark.realtime do
|
|
41
|
+
result = cli.run
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
puts "Finished in #{time} seconds" if cli.options[:debug]
|
|
45
|
+
exit result
|
|
46
|
+
else
|
|
47
|
+
puts 'RuboCop supports only Ruby 1.9.2+'
|
|
48
|
+
exit(-1)
|
|
49
|
+
end
|
data/config/0default.yml
ADDED
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
# This configuration was generated by `rubocop --auto-gen-config`
|
|
2
|
+
# on 2014-07-18 10:58:16 -0400 using RuboCop version 0.18.1.
|
|
3
|
+
# The point is for the user to remove these configuration records
|
|
4
|
+
# one by one as the offences are removed from the code base.
|
|
5
|
+
# Note that changes in the inspected code, or installation of new
|
|
6
|
+
# versions of RuboCop, may require this file to be generated again.
|
|
7
|
+
|
|
8
|
+
# Offence count: 12
|
|
9
|
+
AccessorMethodName:
|
|
10
|
+
Enabled: false
|
|
11
|
+
|
|
12
|
+
# Offence count: 2
|
|
13
|
+
# Cop supports --auto-correct.
|
|
14
|
+
Alias:
|
|
15
|
+
Enabled: false
|
|
16
|
+
|
|
17
|
+
# Offence count: 16
|
|
18
|
+
# Cop supports --auto-correct.
|
|
19
|
+
# Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle.
|
|
20
|
+
AlignHash:
|
|
21
|
+
Enabled: false
|
|
22
|
+
|
|
23
|
+
# Offence count: 3
|
|
24
|
+
AmbiguousOperator:
|
|
25
|
+
Enabled: false
|
|
26
|
+
|
|
27
|
+
# Offence count: 22
|
|
28
|
+
# Cop supports --auto-correct.
|
|
29
|
+
AndOr:
|
|
30
|
+
Enabled: false
|
|
31
|
+
|
|
32
|
+
# Offence count: 1
|
|
33
|
+
AsciiComments:
|
|
34
|
+
Enabled: false
|
|
35
|
+
|
|
36
|
+
# Offence count: 8
|
|
37
|
+
# Configuration parameters: AllowSafeAssignment.
|
|
38
|
+
AssignmentInCondition:
|
|
39
|
+
Enabled: false
|
|
40
|
+
|
|
41
|
+
# Offence count: 3
|
|
42
|
+
BlockAlignment:
|
|
43
|
+
Enabled: false
|
|
44
|
+
|
|
45
|
+
# Offence count: 4
|
|
46
|
+
BlockNesting:
|
|
47
|
+
Max: 4
|
|
48
|
+
|
|
49
|
+
# Offence count: 6
|
|
50
|
+
# Cop supports --auto-correct.
|
|
51
|
+
Blocks:
|
|
52
|
+
Enabled: false
|
|
53
|
+
|
|
54
|
+
# Offence count: 86
|
|
55
|
+
# Cop supports --auto-correct.
|
|
56
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
57
|
+
BracesAroundHashParameters:
|
|
58
|
+
Enabled: false
|
|
59
|
+
|
|
60
|
+
# Offence count: 39
|
|
61
|
+
# Configuration parameters: IndentWhenRelativeTo, SupportedStyles, IndentOneStep.
|
|
62
|
+
CaseIndentation:
|
|
63
|
+
Enabled: false
|
|
64
|
+
|
|
65
|
+
# Offence count: 12
|
|
66
|
+
# Configuration parameters: CountComments.
|
|
67
|
+
ClassLength:
|
|
68
|
+
Max: 301
|
|
69
|
+
|
|
70
|
+
# Offence count: 3
|
|
71
|
+
# Cop supports --auto-correct.
|
|
72
|
+
# Configuration parameters: PreferredMethods.
|
|
73
|
+
CollectionMethods:
|
|
74
|
+
Enabled: false
|
|
75
|
+
|
|
76
|
+
# Offence count: 2
|
|
77
|
+
# Cop supports --auto-correct.
|
|
78
|
+
ColonMethodCall:
|
|
79
|
+
Enabled: false
|
|
80
|
+
|
|
81
|
+
# Offence count: 5
|
|
82
|
+
# Configuration parameters: Keywords.
|
|
83
|
+
CommentAnnotation:
|
|
84
|
+
Enabled: false
|
|
85
|
+
|
|
86
|
+
# Offence count: 12
|
|
87
|
+
ConstantName:
|
|
88
|
+
Enabled: false
|
|
89
|
+
|
|
90
|
+
# Offence count: 30
|
|
91
|
+
CyclomaticComplexity:
|
|
92
|
+
Max: 31
|
|
93
|
+
|
|
94
|
+
# Offence count: 1
|
|
95
|
+
# Cop supports --auto-correct.
|
|
96
|
+
DefWithParentheses:
|
|
97
|
+
Enabled: false
|
|
98
|
+
|
|
99
|
+
# Offence count: 12
|
|
100
|
+
EmptyLinesAroundAccessModifier:
|
|
101
|
+
Enabled: false
|
|
102
|
+
|
|
103
|
+
# Offence count: 293
|
|
104
|
+
# Cop supports --auto-correct.
|
|
105
|
+
EmptyLinesAroundBody:
|
|
106
|
+
Enabled: false
|
|
107
|
+
|
|
108
|
+
# Offence count: 1
|
|
109
|
+
# Cop supports --auto-correct.
|
|
110
|
+
EmptyLiteral:
|
|
111
|
+
Enabled: false
|
|
112
|
+
|
|
113
|
+
# Offence count: 7
|
|
114
|
+
# Configuration parameters: AlignWith, SupportedStyles.
|
|
115
|
+
EndAlignment:
|
|
116
|
+
Enabled: false
|
|
117
|
+
|
|
118
|
+
# Offence count: 6
|
|
119
|
+
Eval:
|
|
120
|
+
Enabled: false
|
|
121
|
+
|
|
122
|
+
# Offence count: 1
|
|
123
|
+
FavorSprintf:
|
|
124
|
+
Enabled: false
|
|
125
|
+
|
|
126
|
+
# Offence count: 8
|
|
127
|
+
FavorUnlessOverNegatedIf:
|
|
128
|
+
Enabled: false
|
|
129
|
+
|
|
130
|
+
# Offence count: 58
|
|
131
|
+
# Cop supports --auto-correct.
|
|
132
|
+
FinalNewline:
|
|
133
|
+
Enabled: false
|
|
134
|
+
|
|
135
|
+
# Offence count: 1
|
|
136
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
137
|
+
For:
|
|
138
|
+
Enabled: false
|
|
139
|
+
|
|
140
|
+
# Offence count: 25
|
|
141
|
+
# Configuration parameters: AllowedVariables.
|
|
142
|
+
GlobalVars:
|
|
143
|
+
Enabled: false
|
|
144
|
+
|
|
145
|
+
# Offence count: 1
|
|
146
|
+
HandleExceptions:
|
|
147
|
+
Enabled: false
|
|
148
|
+
|
|
149
|
+
# Offence count: 2
|
|
150
|
+
# Configuration parameters: IncludePaths.
|
|
151
|
+
HasAndBelongsToMany:
|
|
152
|
+
Enabled: false
|
|
153
|
+
|
|
154
|
+
# Offence count: 22
|
|
155
|
+
# Cop supports --auto-correct.
|
|
156
|
+
HashMethods:
|
|
157
|
+
Enabled: false
|
|
158
|
+
|
|
159
|
+
# Offence count: 1647
|
|
160
|
+
# Cop supports --auto-correct.
|
|
161
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
162
|
+
HashSyntax:
|
|
163
|
+
Enabled: false
|
|
164
|
+
|
|
165
|
+
# Offence count: 1
|
|
166
|
+
IfWithSemicolon:
|
|
167
|
+
Enabled: false
|
|
168
|
+
|
|
169
|
+
# Offence count: 20
|
|
170
|
+
IndentationConsistency:
|
|
171
|
+
Enabled: false
|
|
172
|
+
|
|
173
|
+
# Offence count: 32
|
|
174
|
+
IndentationWidth:
|
|
175
|
+
Enabled: false
|
|
176
|
+
|
|
177
|
+
# Offence count: 11
|
|
178
|
+
Lambda:
|
|
179
|
+
Enabled: false
|
|
180
|
+
|
|
181
|
+
# Offence count: 372
|
|
182
|
+
LineLength:
|
|
183
|
+
Max: 830
|
|
184
|
+
|
|
185
|
+
# Offence count: 2
|
|
186
|
+
# Cop supports --auto-correct.
|
|
187
|
+
MethodCallParentheses:
|
|
188
|
+
Enabled: false
|
|
189
|
+
|
|
190
|
+
# Offence count: 54
|
|
191
|
+
# Configuration parameters: CountComments.
|
|
192
|
+
MethodLength:
|
|
193
|
+
Max: 203
|
|
194
|
+
|
|
195
|
+
# Offence count: 2
|
|
196
|
+
MultilineIfThen:
|
|
197
|
+
Enabled: false
|
|
198
|
+
|
|
199
|
+
# Offence count: 1
|
|
200
|
+
MultilineTernaryOperator:
|
|
201
|
+
Enabled: false
|
|
202
|
+
|
|
203
|
+
# Offence count: 26
|
|
204
|
+
NilComparison:
|
|
205
|
+
Enabled: false
|
|
206
|
+
|
|
207
|
+
# Offence count: 2
|
|
208
|
+
Not:
|
|
209
|
+
Enabled: false
|
|
210
|
+
|
|
211
|
+
# Offence count: 3
|
|
212
|
+
# Cop supports --auto-correct.
|
|
213
|
+
NumericLiterals:
|
|
214
|
+
MinDigits: 14
|
|
215
|
+
|
|
216
|
+
# Offence count: 1
|
|
217
|
+
OneLineConditional:
|
|
218
|
+
Enabled: false
|
|
219
|
+
|
|
220
|
+
# Offence count: 45
|
|
221
|
+
# Configuration parameters: Ignore.
|
|
222
|
+
Output:
|
|
223
|
+
Enabled: false
|
|
224
|
+
|
|
225
|
+
# Offence count: 1
|
|
226
|
+
# Configuration parameters: CountKeywordArgs.
|
|
227
|
+
ParameterLists:
|
|
228
|
+
Max: 6
|
|
229
|
+
|
|
230
|
+
# Offence count: 3
|
|
231
|
+
# Cop supports --auto-correct.
|
|
232
|
+
# Configuration parameters: AllowSafeAssignment.
|
|
233
|
+
ParenthesesAroundCondition:
|
|
234
|
+
Enabled: false
|
|
235
|
+
|
|
236
|
+
# Offence count: 3
|
|
237
|
+
ParenthesesAsGroupedExpression:
|
|
238
|
+
Enabled: false
|
|
239
|
+
|
|
240
|
+
# Offence count: 1
|
|
241
|
+
# Cop supports --auto-correct.
|
|
242
|
+
PerlBackrefs:
|
|
243
|
+
Enabled: false
|
|
244
|
+
|
|
245
|
+
# Offence count: 9
|
|
246
|
+
# Configuration parameters: NamePrefixBlacklist.
|
|
247
|
+
PredicateName:
|
|
248
|
+
Enabled: false
|
|
249
|
+
|
|
250
|
+
# Offence count: 6
|
|
251
|
+
# Cop supports --auto-correct.
|
|
252
|
+
Proc:
|
|
253
|
+
Enabled: false
|
|
254
|
+
|
|
255
|
+
# Offence count: 2
|
|
256
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
257
|
+
RaiseArgs:
|
|
258
|
+
Enabled: false
|
|
259
|
+
|
|
260
|
+
# Offence count: 11
|
|
261
|
+
RedundantBegin:
|
|
262
|
+
Enabled: false
|
|
263
|
+
|
|
264
|
+
# Offence count: 3
|
|
265
|
+
RedundantException:
|
|
266
|
+
Enabled: false
|
|
267
|
+
|
|
268
|
+
# Offence count: 5
|
|
269
|
+
# Cop supports --auto-correct.
|
|
270
|
+
# Configuration parameters: AllowMultipleReturnValues.
|
|
271
|
+
RedundantReturn:
|
|
272
|
+
Enabled: false
|
|
273
|
+
|
|
274
|
+
# Offence count: 60
|
|
275
|
+
# Cop supports --auto-correct.
|
|
276
|
+
RedundantSelf:
|
|
277
|
+
Enabled: false
|
|
278
|
+
|
|
279
|
+
# Offence count: 5
|
|
280
|
+
RegexpLiteral:
|
|
281
|
+
MaxSlashes: 4
|
|
282
|
+
|
|
283
|
+
# Offence count: 3
|
|
284
|
+
RescueException:
|
|
285
|
+
Enabled: false
|
|
286
|
+
|
|
287
|
+
# Offence count: 19
|
|
288
|
+
# Cop supports --auto-correct.
|
|
289
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
|
290
|
+
SignalException:
|
|
291
|
+
Enabled: false
|
|
292
|
+
|
|
293
|
+
# Offence count: 15
|
|
294
|
+
# Configuration parameters: AllowIfMethodIsEmpty.
|
|
295
|
+
SingleLineMethods:
|
|
296
|
+
Enabled: false
|
|
297
|
+
|
|
298
|
+
# Offence count: 39
|
|
299
|
+
# Cop supports --auto-correct.
|
|
300
|
+
SpaceAfterColon:
|
|
301
|
+
Enabled: false
|
|
302
|
+
|
|
303
|
+
# Offence count: 326
|
|
304
|
+
# Cop supports --auto-correct.
|
|
305
|
+
SpaceAfterComma:
|
|
306
|
+
Enabled: false
|
|
307
|
+
|
|
308
|
+
# Offence count: 1
|
|
309
|
+
# Cop supports --auto-correct.
|
|
310
|
+
SpaceAfterControlKeyword:
|
|
311
|
+
Enabled: false
|
|
312
|
+
|
|
313
|
+
# Offence count: 242
|
|
314
|
+
# Cop supports --auto-correct.
|
|
315
|
+
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
|
|
316
|
+
SpaceAroundBlockBraces:
|
|
317
|
+
Enabled: false
|
|
318
|
+
|
|
319
|
+
# Offence count: 39
|
|
320
|
+
# Cop supports --auto-correct.
|
|
321
|
+
SpaceAroundEqualsInParameterDefault:
|
|
322
|
+
Enabled: false
|
|
323
|
+
|
|
324
|
+
# Offence count: 1
|
|
325
|
+
# Cop supports --auto-correct.
|
|
326
|
+
SpaceInsideBrackets:
|
|
327
|
+
Enabled: false
|
|
328
|
+
|
|
329
|
+
# Offence count: 369
|
|
330
|
+
# Cop supports --auto-correct.
|
|
331
|
+
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles.
|
|
332
|
+
SpaceInsideHashLiteralBraces:
|
|
333
|
+
Enabled: false
|
|
334
|
+
|
|
335
|
+
# Offence count: 9
|
|
336
|
+
# Cop supports --auto-correct.
|
|
337
|
+
SpaceInsideParens:
|
|
338
|
+
Enabled: false
|
|
339
|
+
|
|
340
|
+
# Offence count: 10
|
|
341
|
+
# Cop supports --auto-correct.
|
|
342
|
+
SpecialGlobalVars:
|
|
343
|
+
Enabled: false
|
|
344
|
+
|
|
345
|
+
# Offence count: 20
|
|
346
|
+
# Cop supports --auto-correct.
|
|
347
|
+
TrailingBlankLines:
|
|
348
|
+
Enabled: false
|
|
349
|
+
|
|
350
|
+
# Offence count: 8
|
|
351
|
+
# Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
|
|
352
|
+
TrailingComma:
|
|
353
|
+
Enabled: false
|
|
354
|
+
|
|
355
|
+
# Offence count: 2
|
|
356
|
+
# Configuration parameters: ExactNameMatch, AllowPredicates, Whitelist.
|
|
357
|
+
TrivialAccessors:
|
|
358
|
+
Enabled: false
|
|
359
|
+
|
|
360
|
+
# Offence count: 6
|
|
361
|
+
UnlessElse:
|
|
362
|
+
Enabled: false
|
|
363
|
+
|
|
364
|
+
# Offence count: 45
|
|
365
|
+
UselessAssignment:
|
|
366
|
+
Enabled: false
|
|
367
|
+
|
|
368
|
+
# Offence count: 20
|
|
369
|
+
# Configuration parameters: IncludePaths.
|
|
370
|
+
Validation:
|
|
371
|
+
Enabled: false
|
|
372
|
+
|
|
373
|
+
# Offence count: 545
|
|
374
|
+
Void:
|
|
375
|
+
Enabled: false
|
|
376
|
+
|
|
377
|
+
# Offence count: 22
|
|
378
|
+
# Cop supports --auto-correct.
|
|
379
|
+
WordArray:
|
|
380
|
+
MinSize: 24
|