Skip to content

Commit

Permalink
[Fix #206] Fix a false positive for Rails/RakeEnvironment when usin…
Browse files Browse the repository at this point in the history
…g Capistrano

It excludes the directory where Capistrano tasks are located.
Because these tasks don't need to invoke the `:environment` task,
and the directory structure is the official way.
ref: https://github.com/capistrano/capistrano/tree/v3.12.0#capify-your-project

Fixes #206
  • Loading branch information
sinsoku committed Feb 28, 2020
1 parent 7506a31 commit 4cb5cd5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* [#180](https://github.com/rubocop-hq/rubocop-rails/issues/180): Fix a false positive for `HttpPositionalArguments` when using `get` method with `:to` option. ([@koic][])
* [#193](https://github.com/rubocop-hq/rubocop-rails/issues/193): Make `Rails/EnvironmentComparison` aware of `Rails.env` is used in RHS or when `!=` is used for comparison. ([@koic][])
* [#205](https://github.com/rubocop-hq/rubocop-rails/pull/205): Make `Rails/ReversibleMigration` aware of `:to_table` option of `remove_foreign_key`. ([@joshpencheon][])
* [#207](https://github.com/rubocop-hq/rubocop-rails/pull/207): Fix a false positive for `Rails/RakeEnvironment` when using Capistrano. ([@sinsoku][])

## 2.4.2 (2020-01-26)

Expand Down
2 changes: 2 additions & 0 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ Rails/RakeEnvironment:
Include:
- '**/Rakefile'
- '**/*.rake'
Exclude:
- 'lib/capistrano/tasks/**/*.rake'

Rails/ReadWriteAttribute:
Description: >-
Expand Down
1 change: 1 addition & 0 deletions manual/cops_rails.md
Original file line number Diff line number Diff line change
Expand Up @@ -1696,6 +1696,7 @@ end
Name | Default value | Configurable values
--- | --- | ---
Include | `**/Rakefile`, `**/*.rake` | Array
Exclude | `lib/capistrano/tasks/**/*.rake` | Array

## Rails/ReadWriteAttribute

Expand Down

0 comments on commit 4cb5cd5

Please sign in to comment.