1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

17 commits

Author SHA1 Message Date
Abhay Nikam
00b3b68602 Bump rubocop to 0.71 2019-06-06 15:34:50 +05:30
Koichi ITO
c6379fd27f Bump RuboCop to 0.67.2
Performance cops will be extracted from RuboCop to RuboCop Performance
when next RuboCop 0.68 will be released.
https://github.com/rubocop-hq/rubocop/issues/5977

RuboCop 0.67 is its transition period.

Since rails/rails repository uses Performance cops, This PR added
rubocop-performance gem to Gemfile.

And this PR fixes some offenses using the following auto-correct.

```console
% bundle exec rubocop -a

Offenses:

activerecord/test/cases/connection_adapters/connection_handlers_multi_db_test.rb:212:26:
C: [Corrected] Layout/SpaceAroundOperators: Operator =
> should be surrounded by a single space.
              "primary"  => { adapter: "sqlite3", database: "db/primary.sqlite3" }
                         ^^
activerecord/test/cases/connection_adapters/connection_handlers_multi_db_test.rb:239:26:
C: [Corrected] Layout/SpaceAroundOperators: Operator => should be
surrounded by a single space.
              "primary"  => { adapter: "sqlite3", database: "db/primary.sqlite3" }
                         ^^
actionview/test/template/resolver_shared_tests.rb:1:1: C: [Corrected]
Style/FrozenStringLiteralComment: Missing magic comment #
frozen_string_literal: true.
module ResolverSharedTests
^
actionview/test/template/resolver_shared_tests.rb:10:33: C: [Corrected]
Layout/SpaceAroundEqualsInParameterDefault: Surrounding space missing in
default value assignment.
  def with_file(filename, source="File at #{filename}")
                                ^
actionview/test/template/resolver_shared_tests.rb:106:5: C: [Corrected]
Rails/RefuteMethods: Prefer assert_not_same over refute_same.
    refute_same a, b
    ^^^^^^^^^^^

2760 files inspected, 5 offenses detected, 5 offenses corrected
```
2019-04-16 17:58:24 +09:00
yuuji.yaginuma
0c813cbf86 Migrate Code Climate config file to new configuration
I don't know whether have to move to a new configuration, but I think
there is no need to keep using the old configuration.

Ref: https://docs.codeclimate.com/docs/advanced-configuration#section-analysis-configuration-versions
2019-04-16 09:06:32 +09:00
yuuji.yaginuma
3b9a857e4d Fix Code Climate exclude patterns config
I removed `exclude_paths` by a737143. But I had mistaken that exclude paths
would not be used if removed `exclude_paths` config.

However, in the absence of `exclude_paths`, the default setting used and
it contains `test`.
https://docs.codeclimate.com/docs/advanced-configuration#section-exclude-patterns
https://docs.codeclimate.com/docs/excluding-files-and-folders#section-auto-generated-file-and-folder-exclusions

As we need to target the tests, specify an empty array to prevent the
default from being used.
2019-04-13 12:51:31 +09:00
yuuji.yaginuma
a7371430c5 Do not exclude paths in the global level of Code Climate
We use only RuboCop in Code Climate and exclude paths are specified in
RuboCop's setting.

The global level excludes paths should not be specified to match the
behavior of local and CodeClimate.
2019-04-05 12:59:19 +09:00
Koichi ITO
1e1adadb41 Bump RuboCop to 0.66.0
### Summary

RuboCop 0.66.0 has been released.
https://github.com/rubocop-hq/rubocop/releases/tag/v0.66.0

And rubocop-0-66 channel is available in Code Climate.
https://github.com/codeclimate/codeclimate/releases/tag/v0.84.0

RuboCop 0.66.0 fixed the false negative to indentation for
modifier. And this PR applied the auto-correction fixed by it.
https://github.com/rubocop-hq/rubocop/pull/6792

In addtion, this PR is also updating the following 4 gems that
RuboCop depends on.

- Update Psych gem ... https://github.com/rubocop-hq/rubocop/pull/6766
- Update Parser gem to 2.6.2.0 that supports Ruby 2.5.5 and 2.6.2 ...
 https://github.com/whitequark/parser/blob/v2.6.2.0/CHANGELOG.md#changelog
- Remove powerpack gem ... https://github.com/rubocop-hq/rubocop/pull/6806
- Update unicode-display_width gem ... https://github.com/rubocop-hq/rubocop/pull/6813
2019-03-27 07:57:43 +09:00
Koichi ITO
43a9f4f7ca Bump RuboCop to 0.63.0
### Summary

RuboCop 0.63.0 has been released.
https://github.com/rubocop-hq/rubocop/releases/tag/v0.63.0

And rubocop-0-63 channel is available in Code Climate.
https://github.com/codeclimate/codeclimate/releases/tag/v0.83.0

Currently, RuboCop version specified for Gemfile.lock (0.61) and
Code Climate (0.60) are different.

- https://github.com/rails/rails/blob/v6.0.0.beta1/Gemfile.lock#L407
- https://github.com/rails/rails/blob/v6.0.0.beta1/.codeclimate.yml#L26

This PR matches these versions to 0.63.
2019-01-19 18:52:09 +09:00
Yasuo Honda
4e9703158f Use RuboCop 0.60.0 and remove exclude files for Style/RedundantFreeze
Since https://github.com/rubocop-hq/rubocop/pull/6333 has been
included into RuboCop 0.60.0.
2018-11-08 13:06:12 +00:00
Koichi ITO
211b10aea6 Bump RuboCop to 0.58.2
## Summary

RuboCop 0.58.2 was released.
https://github.com/rubocop-hq/rubocop/releases/tag/v0.58.2

And rubocop-0-58 channel is available in Code Climate.
https://github.com/codeclimate/codeclimate/releases/tag/v0.76.0
https://github.com/codeclimate/codeclimate/commit/38f21f0

In addition, the following changes are made in this PR.

- Replace Custom cops with Rails cops
- Add jaro_winkler gem to Gemfile.lock

### Replace Custom cops with Rails cops

These are compatible replacements.

- Replace `CustomCops/AssertNot` cop with `Rails/AssertNot` cop.
- Replace `CustomCops/RefuteNot` cop with `Rails/RefuteMethods` cop.

With this replacement, it was decided to use cop of RuboCop itself.
It removes the code related to CustomCops accordingly.

### Add jaro_winkler gem to Gemfile.lock

Since RuboCop 0.57.0 depends on jaro_winkler gem,
it has been added to Gemfile.lock.
2018-07-26 17:48:07 +09:00
Bart de Water
e236454a1a Rubocop 0.54
Fix `.rubocop.yml: Lint/EndAlignment has the wrong namespace - should be Layout` warning
2018-04-21 13:18:50 -04:00
Yasuo Honda
d0537238ae Use rubocop-0-52 channel
Since https://github.com/rails/rails/pull/32091 expects RuboCop 0.52.1
2018-02-23 00:30:10 +00:00
Noah Davis
5b2e826e6d
Keep current Code Climate behavior before upgrade
If you merge these changes now (*before Monday, December 4th*), Code Climate will run the same analysis on Rails as it always has on your pull requests.

*If you do not merge these changes*, when Code Climate migrates Rails to our new analysis, Code Climate will continue to run Rubocop, but it will ALSO run Code Climate's new maintainability checks (https://codeclimate.com/blog/10-point-technical-debt-assessment). 

You may want this ... you may not. 

Just want to make sure you knew the quick option to disable them if it's a problem!
2017-11-29 23:16:04 -05:00
Koichi ITO
8c5115f95d Bump RuboCop to 0.51.0
## Summary

RuboCop 0.51.0 was released.
https://github.com/bbatsov/rubocop/releases/tag/v0.51.0

And rubocop-0-51 channel is available in Code Climate.
https://github.com/codeclimate/codeclimate-rubocop/issues/109

This PR will bump RuboCop to 0.51.0 and fixes the following new
offenses.

```console
% bundle exec rubocop
Inspecting 2358 files

(snip)

Offenses:

actionpack/lib/action_controller/metal/http_authentication.rb:251:59: C:
Prefer double-quoted strings unless you need single quotes to avoid
extra backslashes for escaping.
          [key.strip, value.to_s.gsub(/^"|"$/, "").delete('\'')]
                                                          ^^^^
activesupport/test/core_ext/load_error_test.rb:8:39: C: Prefer
double-quoted strings unless you need single quotes to avoid extra
backslashes for escaping.
    assert_raise(LoadError) { require 'no_this_file_don\'t_exist' }
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^

2358 files inspected, 2 offenses detected
```
2017-11-10 10:52:04 +09:00
Koichi ITO
2e0de2dd41 Bump RuboCop 0.50.0
RuboCop 0.50.0 was released.
https://github.com/bbatsov/rubocop/releases/tag/v0.50.0

And `rubocop-0-50` channel is available in Code Climate.
https://github.com/codeclimate/codeclimate-rubocop/issues/107#issuecomment-336234260

This commit will bump RuboCop to 0.50.0.
There are no new offences in this change.

```console
% bundle exec rubocop --version
0.50.0
% bundle exec rubocop
Inspecting 2350 files

(snip)

2350 files inspected, no offenses detected
```
2017-10-13 12:01:03 +09:00
Wassim Metallaoui
d95bbad994
Run latest Rubocop in CodeClimate 2017-08-26 09:30:23 -05:00
Rafael Mendonça França
4f8a594f18
Generators and tests are under the same style rules 2016-07-27 20:26:39 -03:00
Jon Moss
80e819586b
Move code style configuration files to root directory
I think these are meant to be in the root directory, not in
`/activerecord`? 😬

r? @sgrif

[ci skip]
2016-06-16 22:17:46 -04:00
Renamed from activerecord/.codeclimate.yml (Browse further)