rubocop-safe_todo_searcher 0.1.1 → 0.1.2
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 +4 -4
- data/.rubocop.yml +12 -1
- data/CHANGELOG.md +15 -0
- data/README.md +1 -1
- data/exe/safe-search +1 -1
- data/lib/rubocop/safe_todo_searcher/version.rb +1 -1
- data/lib/rubocop/safe_todo_searcher.rb +16 -6
- metadata +73 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b7a18ffdd32249f8ae28b6bc0390626068b80740aab32f5853d5a315fa57675
|
4
|
+
data.tar.gz: 2459d8c1d8cd5ac0e3c296f0e887fce08f9a25aef10a8fda794349fafef895f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 416cc45b863ea5290f275abfd9d755ffc105812e35cb78cd26b26659c77f3f3ed7f679264e4a101491877806c8913ae113213e58a43bd9f5510026bfdd2dde83
|
7
|
+
data.tar.gz: a1ea62866061ff6009f5962533c8046c32851ef134b87e91ebb5c47b52f06485f8fc8d77c93177d6742db96a486b2cd38d0aa74e29f24263cd4bdf283ca6f1f9
|
data/.rubocop.yml
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
AllCops:
|
2
2
|
TargetRubyVersion: 2.6
|
3
|
+
NewCops: enable
|
4
|
+
SuggestExtensions: false
|
3
5
|
|
4
6
|
Style/StringLiterals:
|
5
7
|
Enabled: true
|
@@ -10,4 +12,13 @@ Style/StringLiteralsInInterpolation:
|
|
10
12
|
EnforcedStyle: double_quotes
|
11
13
|
|
12
14
|
Layout/LineLength:
|
13
|
-
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
Documentation:
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
Style/FrozenStringLiteralComment:
|
21
|
+
Enabled: false
|
22
|
+
|
23
|
+
Metrics:
|
24
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.1.2] - 2022-01-07
|
4
|
+
|
5
|
+
### New features:
|
6
|
+
- [#14](https://github.com/ydah/rubocop-safe_todo_searcher/pull/14/commits/80e2b415fb7af12463c71d162c4d956261b13a7b) : Add support official extensions.
|
7
|
+
|
8
|
+
### Bug fixes
|
9
|
+
- [#9](https://github.com/ydah/rubocop-safe_todo_searcher/pull/9/commits/7005c9c9165aefccd67f7d2c912593f87ee6b229) : Fixes to not search rubocop_todo.yml if it doesn't exist.
|
10
|
+
- [#9](https://github.com/ydah/rubocop-safe_todo_searcher/pull/9/commits/28ccb1eadaca3fb983a72e990636650d6d16ca88) : Fixes rubocop_todo.yml to output an error message if it doesn't exist.
|
11
|
+
- [#15](https://github.com/ydah/rubocop-safe_todo_searcher/pull/16/commits/4d01c6593b6927dc1d27c8b1e18d194a97144b1f) : Fixes to detect Unsafe cops.
|
12
|
+
|
13
|
+
## [0.1.1] - 2021-12-28
|
14
|
+
|
15
|
+
### New features:
|
16
|
+
- [#2](https://github.com/ydah/rubocop-safe_todo_searcher/pull/2) : Support rubocop-rails extention.
|
17
|
+
|
3
18
|
## [0.1.0] - 2021-12-27
|
4
19
|
|
5
20
|
- Initial release
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Rubocop SafeTodoSearcher [](https://badge.fury.io/rb/rubocop-safe_todo_searcher) [](https://codeclimate.com/github/ydah/rubocop-safe_todo_searcher/maintainability)
|
1
|
+
# Rubocop SafeTodoSearcher [](https://github.com/ydah/rubocop-safe_todo_searcher/actions/workflows/ci.yml) [](https://badge.fury.io/rb/rubocop-safe_todo_searcher) [](https://codeclimate.com/github/ydah/rubocop-safe_todo_searcher/maintainability)
|
2
2
|
|
3
3
|
Search `rubocop_todo.yml` to see if there are any cop that can be resolved with auto correct.
|
4
4
|
If you want to know if the pending remarks in your `rubocop_todo.yml `can be deleted automatically, please use it.
|
data/exe/safe-search
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "rubocop"
|
2
4
|
require "rubocop-rails"
|
3
5
|
require "yaml"
|
@@ -8,14 +10,22 @@ module Rubocop
|
|
8
10
|
class Error < StandardError; end
|
9
11
|
|
10
12
|
def self.search
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
File.exist?(".rubocop_todo.yml") ? parse : "rubocop_todo.yml does not exist"
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.parse
|
17
|
+
res = +""
|
18
|
+
File.open(".rubocop_todo.yml", "r") { |f| YAML.safe_load(f) }.each_key do |key|
|
19
|
+
res << "#{key}\n" if support_autocorrect?(key)
|
17
20
|
end
|
18
21
|
res
|
19
22
|
end
|
23
|
+
|
24
|
+
def self.support_autocorrect?(key)
|
25
|
+
cop = Object.const_get "RuboCop::Cop::#{key.gsub(%r{/}, "::")}"
|
26
|
+
cop.support_autocorrect? && cop.new(RuboCop::ConfigLoader.default_configuration).safe_autocorrect?
|
27
|
+
rescue NameError
|
28
|
+
false
|
29
|
+
end
|
20
30
|
end
|
21
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-safe_todo_searcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "ydah\n\n"
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -24,6 +24,34 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.21'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rubocop-minitest
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop-performance
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
27
55
|
- !ruby/object:Gem::Dependency
|
28
56
|
name: rubocop-rails
|
29
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,6 +66,48 @@ dependencies:
|
|
38
66
|
- - ">="
|
39
67
|
- !ruby/object:Gem::Version
|
40
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop-rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop-rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop-sequel
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
41
111
|
- !ruby/object:Gem::Dependency
|
42
112
|
name: rake
|
43
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,9 +163,7 @@ homepage: https://github.com/ydah/rubocop-safe_todo_searcher
|
|
93
163
|
licenses:
|
94
164
|
- MIT
|
95
165
|
metadata:
|
96
|
-
|
97
|
-
source_code_uri: https://github.com/ydah/rubocop-safe_todo_searcher
|
98
|
-
changelog_uri: https://github.com/ydah/rubocop-safe_todo_searcher/blob/main/CHANGELOG.md
|
166
|
+
rubygems_mfa_required: 'true'
|
99
167
|
post_install_message:
|
100
168
|
rdoc_options: []
|
101
169
|
require_paths:
|