Skip to content

Commit

Permalink
Remove redundant parentheses in pending cops message
Browse files Browse the repository at this point in the history
Follow up to #8414.

Perhaps the parentheses used in the old plain-text format message remain.
In the current YAML format comment it would look redundant.

## Past

```console
- Gemspec/DateAssignment (1.10)
```

## Present

```console
Gemspec/DateAssignment: # (new in 1.10)
  Enabled: true
```

## Future

```console
Gemspec/DateAssignment: # new in 1.10
  Enabled: true
```
  • Loading branch information
koic authored and bbatsov committed Aug 23, 2021
1 parent 8b8635a commit d41eeb1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/rubocop/config_loader.rb
Expand Up @@ -161,7 +161,7 @@ def warn_on_pending_cops(pending_cops)
def warn_pending_cop(cop)
version = cop.metadata['VersionAdded'] || 'N/A'

warn Rainbow("#{cop.name}: # (new in #{version})").yellow
warn Rainbow("#{cop.name}: # new in #{version}").yellow
warn Rainbow(' Enabled: true').yellow
end

Expand Down
4 changes: 2 additions & 2 deletions spec/rubocop/cli/options_spec.rb
Expand Up @@ -415,7 +415,7 @@ class SomeCop < Cop
remaining_range = pending_cop_warning.length..-(inspected_output.length + 1)
pending_cops = output[remaining_range]

expect(pending_cops).to include("Style/SomeCop: # (new in 0.80)\n Enabled: true")
expect(pending_cops).to include("Style/SomeCop: # new in 0.80\n Enabled: true")

manual_url = output[remaining_range].split("\n").last

Expand All @@ -433,7 +433,7 @@ class SomeCop < Cop
remaining_range = pending_cop_warning.length..-(inspected_output.length + 1)
pending_cops = output[remaining_range]

expect(pending_cops).to include("Style/SomeCop: # (new in N/A)\n Enabled: true")
expect(pending_cops).to include("Style/SomeCop: # new in N/A\n Enabled: true")

manual_url = output[remaining_range].split("\n").last

Expand Down

0 comments on commit d41eeb1

Please sign in to comment.