Skip to content

Commit

Permalink
Default changed to disallow Layout/TrailingWhitespace in heredoc.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre authored and mergify[bot] committed Oct 16, 2020
1 parent 4138083 commit eeb00eb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -15,6 +15,7 @@
* [#8882](https://github.com/rubocop-hq/rubocop/pull/8882): **(Potentially breaking)** RuboCop assumes that Cop classes do not define new `on_<type>` methods at runtime (e.g. via `extend` in `initialize`). ([@marcandre][])
* [#7966](https://github.com/rubocop-hq/rubocop/issues/7966): **(Breaking)** Enable all pending cops for RuboCop 1.0. ([@koic][])
* [#8490](https://github.com/rubocop-hq/rubocop/pull/8490): **(Breaking)** Change logic for cop department name computation. Cops inside deep namespaces (5 or more levels deep) now belong to departments with names that are calculated by joining module names starting from the third one with slashes as separators. For example, cop `Rubocop::Cop::Foo::Bar::Baz` now belongs to `Foo/Bar` department (previously it was `Bar`). ([@dsavochkin][])
* [#8692](https://github.com/rubocop-hq/rubocop/pull/8692): Default changed to disallow `Layout/TrailingWhitespace` in heredoc. ([@marcandre][])

## 0.93.1 (2020-10-12)

Expand Down
2 changes: 1 addition & 1 deletion config/default.yml
Expand Up @@ -1335,7 +1335,7 @@ Layout/TrailingWhitespace:
Enabled: true
VersionAdded: '0.49'
VersionChanged: '0.83'
AllowInHeredoc: true
AllowInHeredoc: false

#################### Lint ##################################
### Warnings
Expand Down
6 changes: 3 additions & 3 deletions docs/modules/ROOT/pages/cops_layout.adoc
Expand Up @@ -6360,7 +6360,7 @@ x = 0
x = 0
----

==== AllowInHeredoc: false
==== AllowInHeredoc: false (default)

[source,ruby]
----
Expand All @@ -6382,7 +6382,7 @@ code = <<~RUBY
RUBY
----

==== AllowInHeredoc: true (default)
==== AllowInHeredoc: true

[source,ruby]
----
Expand All @@ -6399,7 +6399,7 @@ RUBY
| Name | Default value | Configurable values

| AllowInHeredoc
| `true`
| `false`
| Boolean
|===

Expand Down
4 changes: 2 additions & 2 deletions lib/rubocop/cop/layout/trailing_whitespace.rb
Expand Up @@ -14,7 +14,7 @@ module Layout
# # good
# x = 0
#
# @example AllowInHeredoc: false
# @example AllowInHeredoc: false (default)
# # The line in this example contains spaces after the 0.
# # bad
# code = <<~RUBY
Expand All @@ -32,7 +32,7 @@ module Layout
# x = 0#{trailing_whitespace}
# RUBY
#
# @example AllowInHeredoc: true (default)
# @example AllowInHeredoc: true
# # The line in this example contains spaces after the 0.
# # good
# code = <<~RUBY
Expand Down

0 comments on commit eeb00eb

Please sign in to comment.