Skip to content

Commit

Permalink
Rename our fork of StyleBlockDelimiters
Browse files Browse the repository at this point in the history
This should avoid migration warning code in the rubocop CLI

Fixes #271
  • Loading branch information
searls committed Mar 6, 2021
1 parent bae9394 commit d7e3586
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Copyright (c) 2019 Test Double, LLC

Portions of these files Copyright (c) 2012-18 Bozhidar Batsov:
- config/base.yml
- lib/standard/cop/block_delimiters.rb
- lib/standard/cop/block_single_line_braces.rb
- test/cop_invoker.rb

Permission is hereby granted, free of charge, to any person obtaining
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ rules to ignore for a particular glob:
```yaml
ignore:
- 'test/**/*':
- Style/BlockDelimiters
- Layout/EndAlignment
```

## How do I disable a warning within my source code?
Expand Down
2 changes: 1 addition & 1 deletion config/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ Security/YAMLLoad:
Enabled: true
SafeAutoCorrect: false

Standard/BlockDelimiters:
Standard/BlockSingleLineBraces:
Enabled: true

Style/Alias:
Expand Down
2 changes: 1 addition & 1 deletion lib/standard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
require "standard/railtie" if defined?(Rails) && defined?(Rails::Railtie)

require "standard/formatter"
require "standard/cop/block_delimiters"
require "standard/cop/block_single_line_braces"

module Standard
end
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Standard
# # good - single line block
# items.each { |item| item / 5 }
#
class BlockDelimiters < RuboCop::Cop::Base
class BlockSingleLineBraces < RuboCop::Cop::Base
extend RuboCop::Cop::AutoCorrector

def on_send(node)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
require "test_helper"
require "cop_invoker"

class RuboCop::Cop::Standard::BlockDelimitersTest < UnitTest
class RuboCop::Cop::Standard::BlockSingleLineBracesTest < UnitTest
include CopInvoker

def setup
config = RuboCop::Config.new("Standard/BlockDelimiters" => {
config = RuboCop::Config.new("Standard/BlockSingleLineBraces" => {
"Enabled" => true
})
@cop = RuboCop::Cop::Standard::BlockDelimiters.new(config)
@cop = RuboCop::Cop::Standard::BlockSingleLineBraces.new(config)
end

def test_single_line_with_braces
Expand Down
2 changes: 1 addition & 1 deletion test/standard_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class StandardTest < UnitTest
def test_loads_stuff
refute_nil RuboCop
refute_nil Standard::Cli
refute_nil RuboCop::Cop::Standard::BlockDelimiters
refute_nil RuboCop::Cop::Standard::BlockSingleLineBraces
assert_instance_of Gem::Version, ::Standard::VERSION
end
end

0 comments on commit d7e3586

Please sign in to comment.