rubocop-rails_deprecation 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ff5c12830fa2efec748d3d13d6eaefe473fe1297626b63f1bc112a087de5464
4
- data.tar.gz: 6940ecd0c3afbf1de9c8d3e85af86f816ef0a2cb484a8eae24274d7575ef47bb
3
+ metadata.gz: da01f0263fa7e9a3194e60ab4d57c81c4b393f75428aca97ec06996d336ee9a7
4
+ data.tar.gz: 3b90560d249ea93480f1b18a849f06b4b424b2eaa26c7698b52a9bbd0ea36cf9
5
5
  SHA512:
6
- metadata.gz: fab9d41ad7bbd440435a274b032c015e2c6bb6f2fb216d11731c572a10803ff63ffab4e7d80431fe31cc08866c701d1766cfe6c8205d2fb6742b91322bfc58d7
7
- data.tar.gz: a6ebef02c3bb65654e219ece8df7aaff11069e9750b09fcd8f974c6a50cdc164190a16062ac002ae53ee18817b065dafa1edeb0e8fe84e5d184cb1e16281fec1
6
+ metadata.gz: d306908941b38c43bbc6891a29d22902b2673fba6d51278d97a6d650df1ec9ba5a5f536923b502c25352dd47041f8b9f189b802415dcc18c08965058415c722c
7
+ data.tar.gz: 6d314536880558be1dcfa822fd0d7fbd537946ea37d34ae782c2c3daa6a768279d7d1cb73478678966b570253392245cbf0bd2bb85ced777561969ab52228fe0
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.2.0
6
+
7
+ ### Changed
8
+
9
+ - Make #to_fs the default replacement for #to_s(:format).
10
+
5
11
  ## 0.1.0
6
12
 
7
13
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubocop-rails_deprecation (0.1.0)
4
+ rubocop-rails_deprecation (0.2.0)
5
5
  rubocop
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # rubocop-rails_deprecation
2
2
 
3
+ [![test](https://github.com/r7kamura/rubocop-rails_deprecation/actions/workflows/test.yml/badge.svg)](https://github.com/r7kamura/rubocop-rails_deprecation/actions/workflows/test.yml)
4
+ [![Gem Version](https://badge.fury.io/rb/rubocop-rails_deprecation.svg)](https://rubygems.org/gems/rubocop-rails_deprecation)
5
+
3
6
  RuboCop extension for Rails deprecation.
4
7
 
5
8
  ## Installation
@@ -21,3 +24,11 @@ Or install it yourself as:
21
24
  ```
22
25
  gem install rubocop-rails_deprecation
23
26
  ```
27
+
28
+ ## Usage
29
+
30
+ ```yaml
31
+ # .rubocop.yml
32
+ require:
33
+ - rubocop-rails_deprecation
34
+ ```
@@ -6,7 +6,7 @@ module RuboCop
6
6
  # This cop identifies passing a format to `#to_s`.
7
7
  #
8
8
  # @safety
9
- # This cop's auto-correction is unsafe because a custom or unrelated `to_s` method call would be change to `to_formatted_s`.
9
+ # This cop's auto-correction is unsafe because a custom or unrelated `to_s` method call would be change to `to_fs`.
10
10
  #
11
11
  # @example
12
12
  #
@@ -14,6 +14,9 @@ module RuboCop
14
14
  # to_s(:delimited)
15
15
  #
16
16
  # # good
17
+ # to_fs(:delimited)
18
+ #
19
+ # # good
17
20
  # to_formatted_s(:delimited)
18
21
  #
19
22
  # # good
@@ -24,7 +27,7 @@ module RuboCop
24
27
 
25
28
  self.minimum_target_rails_version = 7.0
26
29
 
27
- MSG = 'Use `to_formatted_s(...)` instead of `to_s(...)`.'
30
+ MSG = 'Use `to_fs(...)` instead of `to_s(...)`.'
28
31
 
29
32
  def_node_matcher :to_s_with_any_argument?, <<~PATTERN
30
33
  (send _ :to_s _ ...)
@@ -36,7 +39,7 @@ module RuboCop
36
39
  add_offense(node) do |rewriter|
37
40
  rewriter.replace(
38
41
  node.loc.selector,
39
- 'to_formatted_s'
42
+ 'to_fs'
40
43
  )
41
44
  end
42
45
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module RailsDeprecation
5
- VERSION = '0.1.0'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-rails_deprecation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-23 00:00:00.000000000 Z
11
+ date: 2022-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -49,7 +49,6 @@ files:
49
49
  - lib/rubocop/rails_deprecation/inject.rb
50
50
  - lib/rubocop/rails_deprecation/version.rb
51
51
  - rubocop-rails_deprecation.gemspec
52
- - sig/rubocop/rails_deprecation.rbs
53
52
  homepage: https://github.com/r7kamura/rubocop-rails_deprecation
54
53
  licenses:
55
54
  - MIT
@@ -1,6 +0,0 @@
1
- module Rubocop
2
- module RailsDeprecation
3
- VERSION: String
4
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
5
- end
6
- end