rubocop-rails_deprecation 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/README.md +11 -0
- data/lib/rubocop/cop/rails_deprecation/to_formatted_s.rb +6 -3
- data/lib/rubocop/rails_deprecation/version.rb +1 -1
- metadata +2 -3
- data/sig/rubocop/rails_deprecation.rbs +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da01f0263fa7e9a3194e60ab4d57c81c4b393f75428aca97ec06996d336ee9a7
|
4
|
+
data.tar.gz: 3b90560d249ea93480f1b18a849f06b4b424b2eaa26c7698b52a9bbd0ea36cf9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d306908941b38c43bbc6891a29d22902b2673fba6d51278d97a6d650df1ec9ba5a5f536923b502c25352dd47041f8b9f189b802415dcc18c08965058415c722c
|
7
|
+
data.tar.gz: 6d314536880558be1dcfa822fd0d7fbd537946ea37d34ae782c2c3daa6a768279d7d1cb73478678966b570253392245cbf0bd2bb85ced777561969ab52228fe0
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
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 `
|
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 `
|
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
|
-
'
|
42
|
+
'to_fs'
|
40
43
|
)
|
41
44
|
end
|
42
45
|
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.
|
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-
|
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
|