diff --git a/.rubocop.yml b/.rubocop.yml index 3aac8401848019e8189eab9383bec3099d7b2b19..17802fbb30701606fd579de43ebff2b7b1889382 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,6 +2,8 @@ require: - rubocop-rspec - ./rubocop/rubocop +inherit_from: .rubocop_todo.yml + AllCops: TargetRubyVersion: 2.1 # Cop names are not displayed in offense messages by default. Change behavior @@ -159,10 +161,6 @@ Style/ConstantName: Style/DefWithParentheses: Enabled: true -# Checks for use of deprecated Hash methods. -Style/DeprecatedHashMethods: - Enabled: false - # Document classes and non-namespace modules. Style/Documentation: Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000000000000000000000000000000000000..9a791d74c1570d90e28c82fa79f48e857c1cab83 --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,65 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2016-06-29 18:24:55 +0200 using RuboCop version 0.41.1. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 1 +Lint/ShadowedException: + Exclude: + - 'app/models/u2f_registration.rb' + +# Offense count: 12 +# Cop supports --auto-correct. +Performance/PushSplat: + Exclude: + - 'app/controllers/projects/refs_controller.rb' + - 'app/helpers/page_layout_helper.rb' + - 'app/models/ability.rb' + - 'app/models/network/graph.rb' + - 'app/models/project_team.rb' + - 'app/models/user.rb' + - 'config/application.rb' + +# Offense count: 59 +Rails/OutputSafety: + Enabled: false + +# Offense count: 6 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedOctalStyle, SupportedOctalStyles. +# SupportedOctalStyles: zero_with_o, zero_only +Style/NumericLiteralPrefix: + Exclude: + - 'config/initializers/1_settings.rb' + - 'config/initializers/secret_token.rb' + - 'lib/gitlab/backend/shell.rb' + - 'spec/support/test_env.rb' + - 'spec/tasks/gitlab/backup_rake_spec.rb' + +# Offense count: 28 +# Cop supports --auto-correct. +Style/PreferredHashMethods: + Exclude: + - 'app/helpers/dropdowns_helper.rb' + - 'app/models/application_setting.rb' + - 'app/models/members/project_member.rb' + - 'app/services/git_push_service.rb' + - 'lib/api/helpers.rb' + - 'lib/ci/api/builds.rb' + - 'lib/ci/gitlab_ci_yaml_processor.rb' + - 'lib/gitlab/ci/config/node/configurable.rb' + - 'lib/gitlab/ci/config/node/factory.rb' + - 'lib/gitlab/google_code_import/client.rb' + - 'lib/gitlab/google_code_import/importer.rb' + - 'lib/gitlab/visibility_level.rb' + - 'spec/requests/api/projects_spec.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +Style/SpaceInsidePercentLiteralDelimiters: + Exclude: + - 'lib/event_filter.rb' + - 'lib/gitlab/git_access.rb' diff --git a/Gemfile b/Gemfile index 5c43015e52c6457e7fd281b6a2acf71fb6a9fc68..0769214a07123d06f344a22777c2b9a39fdff87e 100644 --- a/Gemfile +++ b/Gemfile @@ -299,7 +299,7 @@ group :development, :test do gem 'spring-commands-spinach', '~> 1.1.0' gem 'spring-commands-teaspoon', '~> 0.0.2' - gem 'rubocop', '~> 0.40.0', require: false + gem 'rubocop', '~> 0.41.1', require: false gem 'rubocop-rspec', '~> 1.5.0', require: false gem 'scss_lint', '~> 0.47.0', require: false gem 'simplecov', '~> 0.11.0', require: false diff --git a/Gemfile.lock b/Gemfile.lock index f8018e58a5e794d6106e0efc3ed0fe6d3bb429a2..6f93a5343592d9f83929011444a647cb04010135 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -58,7 +58,7 @@ GEM faraday_middleware-multi_json (~> 0.0) oauth2 (~> 1.0) asciidoctor (1.5.3) - ast (2.2.0) + ast (2.3.0) attr_encrypted (3.0.1) encryptor (~> 3.0.0) attr_required (1.0.0) @@ -473,7 +473,7 @@ GEM orm_adapter (0.5.0) paranoia (2.1.4) activerecord (~> 4.0) - parser (2.3.1.0) + parser (2.3.1.2) ast (~> 2.2) pg (0.18.4) pkg-config (1.1.7) @@ -606,8 +606,8 @@ GEM rspec-retry (0.4.5) rspec-core rspec-support (3.5.0) - rubocop (0.40.0) - parser (>= 2.3.1.0, < 3.0) + rubocop (0.41.2) + parser (>= 2.3.1.1, < 3.0) powerpack (~> 0.1) rainbow (>= 1.99.1, < 3.0) ruby-progressbar (~> 1.7) @@ -758,7 +758,7 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.7.2) - unicode-display_width (1.0.5) + unicode-display_width (1.1.0) unicorn (4.9.0) kgio (~> 2.6) rack @@ -937,7 +937,7 @@ DEPENDENCIES rqrcode-rails3 (~> 0.1.7) rspec-rails (~> 3.5.0) rspec-retry (~> 0.4.5) - rubocop (~> 0.40.0) + rubocop (~> 0.41.1) rubocop-rspec (~> 1.5.0) ruby-fogbugz (~> 0.2.1) sanitize (~> 2.0)