rubocop-eightyfourcodes 0.0.4 → 0.0.6
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/README.md +41 -1
- data/config/eightyfourcodes.yml +143 -0
- data/lib/rubocop/cop/eighty_four_codes/ensure_redirect.rb +2 -2
- data/lib/rubocop/cop/eighty_four_codes/ruby_version_file.rb +3 -3
- data/lib/rubocop/cop/eightyfourcodes_cops.rb +9 -9
- data/lib/rubocop/eightyfourcodes/inject.rb +1 -1
- data/lib/rubocop/eightyfourcodes/version.rb +1 -1
- data/lib/rubocop/eightyfourcodes.rb +2 -2
- data/lib/rubocop-eightyfourcodes.rb +5 -5
- metadata +70 -15
- data/.rspec +0 -3
- data/.rubocop.yml +0 -16
- data/CHANGELOG.md +0 -15
- data/Gemfile +0 -15
- data/Gemfile.lock +0 -75
- data/Rakefile +0 -32
- data/rubocop-eightyfourcodes.gemspec +0 -34
- data/sig/rubocop/eightyfourcodes.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: aa3ad3b979562574a7c92e3b9b3ac4f6eb4cfb64f620839dce5d93db95bb659f
|
|
4
|
+
data.tar.gz: eee72657e11b56238aef21b80d695e76189d426d78f8938757e4c87917a99f48
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5bba1819cb2375c2e16f70c04d8ccc2e3ac9d63259fc83b7e0cae0e945830f7bc733e9bee610659f1cf98cb4ed5a390623e53e76b5818f728b075f87450b2865
|
|
7
|
+
data.tar.gz: db89032a12f8a23765ccce1bb8bae4ed05f131a9c3f1b6ec47e451832465e8bc7b61bf3472e60a2d7549593d31999cd37f764dbb8648c25cc4e78be2b1ea883a
|
data/README.md
CHANGED
|
@@ -28,6 +28,13 @@ require: rubocop-eightyfourcodes
|
|
|
28
28
|
Now you can run `rubocop` and it will automatically load the RuboCop eightyfourcodes
|
|
29
29
|
cops together with the standard cops.
|
|
30
30
|
|
|
31
|
+
To use the `eightyfourcodes` RuboCop config:
|
|
32
|
+
|
|
33
|
+
```yaml
|
|
34
|
+
inherit_gem:
|
|
35
|
+
rubocop-eightyfourcodes: config/eightyfourcodes.yml
|
|
36
|
+
```
|
|
37
|
+
|
|
31
38
|
## Development
|
|
32
39
|
|
|
33
40
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
@@ -36,7 +43,40 @@ Use `bundle exec rake 'new_cop[EightyFourCodes/CommandLiteralInjection]'` to gen
|
|
|
36
43
|
|
|
37
44
|
The [NodePattern Debugger](https://nodepattern.herokuapp.com/) is a very helpful resource when creating new AST matchers.
|
|
38
45
|
|
|
39
|
-
|
|
46
|
+
|
|
47
|
+
If you need to try out this gem in a project using it, before releasing a new version, you can do the following in the project:
|
|
48
|
+
|
|
49
|
+
```ruby
|
|
50
|
+
gem "rubocop-eightyfourcodes", **(ENV["LOCAL_RUBOCOP84"] ? { path: ENV["LOCAL_RUBOCOP84"] } : {})
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Then try it like this:
|
|
54
|
+
|
|
55
|
+
```shell
|
|
56
|
+
LOCAL_RUBOCOP84=~/repos/rubocop-eightyfourcodes bundle install
|
|
57
|
+
LOCAL_RUBOCOP84=~/repos/rubocop-eightyfourcodes bundle exec rubocop
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Releasing
|
|
61
|
+
|
|
62
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
|
63
|
+
|
|
64
|
+
To release a new version, update the version number in `version.rb`, in a commit or pull request.
|
|
65
|
+
|
|
66
|
+
Create and push a new signed git tag, the `git:tag` rake task will use the version from `version.rb`.
|
|
67
|
+
|
|
68
|
+
```shell
|
|
69
|
+
rake git:tag
|
|
70
|
+
git push --tags
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
This will trigger GitHub Actions to build and push the gem to [RubyGems.org](https://rubygems.org/gems/rubocop-eightyfourcodes).
|
|
74
|
+
|
|
75
|
+
If the release workflow fails, you can re-run it by deleting the tag and pushing it again.
|
|
76
|
+
|
|
77
|
+
```shell
|
|
78
|
+
git push --delete origin v<VERSION>
|
|
79
|
+
```
|
|
40
80
|
|
|
41
81
|
## Contributing
|
|
42
82
|
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
plugins:
|
|
2
|
+
- rubocop-minitest
|
|
3
|
+
- rubocop-performance
|
|
4
|
+
- rubocop-rake
|
|
5
|
+
- rubocop-sequel
|
|
6
|
+
|
|
7
|
+
require:
|
|
8
|
+
- rubocop-eightyfourcodes
|
|
9
|
+
|
|
10
|
+
AllCops:
|
|
11
|
+
TargetRubyVersion: 3.4
|
|
12
|
+
NewCops: enable
|
|
13
|
+
|
|
14
|
+
### Metrics
|
|
15
|
+
|
|
16
|
+
Metrics/ClassLength:
|
|
17
|
+
Max: 300
|
|
18
|
+
CountAsOne: ["array", "hash", "heredoc", "method_call"]
|
|
19
|
+
|
|
20
|
+
Metrics/ModuleLength:
|
|
21
|
+
Max: 300
|
|
22
|
+
CountAsOne: ["array", "hash", "heredoc", "method_call"]
|
|
23
|
+
|
|
24
|
+
Metrics/MethodLength:
|
|
25
|
+
Max: 50
|
|
26
|
+
CountAsOne: ["array", "hash", "heredoc", "method_call"]
|
|
27
|
+
|
|
28
|
+
Metrics/AbcSize:
|
|
29
|
+
Max: 40
|
|
30
|
+
|
|
31
|
+
Metrics/CyclomaticComplexity:
|
|
32
|
+
Max: 12
|
|
33
|
+
|
|
34
|
+
Metrics/BlockLength:
|
|
35
|
+
Max: 200
|
|
36
|
+
AllowedMethods:
|
|
37
|
+
- refine
|
|
38
|
+
- describe
|
|
39
|
+
|
|
40
|
+
Metrics/ParameterLists:
|
|
41
|
+
CountKeywordArgs: false
|
|
42
|
+
|
|
43
|
+
### Lint
|
|
44
|
+
|
|
45
|
+
Lint/DuplicateBranch:
|
|
46
|
+
IgnoreDuplicateElseBranch: true
|
|
47
|
+
IgnoreLiteralBranches: true
|
|
48
|
+
IgnoreConstantBranches: true
|
|
49
|
+
|
|
50
|
+
Lint/UselessConstantScoping:
|
|
51
|
+
# Increases indirection and reduces readability. We often don't care about constant scoping.
|
|
52
|
+
Enabled: false
|
|
53
|
+
|
|
54
|
+
### Style
|
|
55
|
+
|
|
56
|
+
Style/Documentation:
|
|
57
|
+
Enabled: false
|
|
58
|
+
|
|
59
|
+
Style/GuardClause:
|
|
60
|
+
AllowConsecutiveConditionals: true
|
|
61
|
+
|
|
62
|
+
Style/StringLiterals:
|
|
63
|
+
EnforcedStyle: double_quotes
|
|
64
|
+
|
|
65
|
+
Style/MethodCallWithArgsParentheses:
|
|
66
|
+
AllowParenthesesInMultilineCall: true
|
|
67
|
+
AllowParenthesesInChaining: true
|
|
68
|
+
AllowParenthesesInCamelCaseMethod: true
|
|
69
|
+
AllowParenthesesInStringInterpolation: true
|
|
70
|
+
AllowedMethods: ["puts", "print"]
|
|
71
|
+
AllowedPatterns: ["^assert"]
|
|
72
|
+
|
|
73
|
+
Style/ClassVars:
|
|
74
|
+
# We use them quite a lot, and the "good" alternative is not so nice.
|
|
75
|
+
# Need a targeted effort to refactor our codebase to get rid of them.
|
|
76
|
+
Enabled: false
|
|
77
|
+
|
|
78
|
+
Style/TrailingCommaInHashLiteral:
|
|
79
|
+
EnforcedStyleForMultiline: comma
|
|
80
|
+
|
|
81
|
+
Style/TrailingCommaInArrayLiteral:
|
|
82
|
+
EnforcedStyleForMultiline: comma
|
|
83
|
+
|
|
84
|
+
Style/HashSyntax:
|
|
85
|
+
EnforcedShorthandSyntax: always
|
|
86
|
+
|
|
87
|
+
### Layout
|
|
88
|
+
|
|
89
|
+
Layout/FirstHashElementIndentation:
|
|
90
|
+
EnforcedStyle: consistent
|
|
91
|
+
|
|
92
|
+
Layout/MultilineMethodCallIndentation:
|
|
93
|
+
EnforcedStyle: indented
|
|
94
|
+
|
|
95
|
+
Layout/LineLength:
|
|
96
|
+
URISchemes: ["http", "https", "amqp", "amqps"]
|
|
97
|
+
AllowedPatterns:
|
|
98
|
+
- '^\s*puts(\s|\()'
|
|
99
|
+
- '^\s*print(\s|\()'
|
|
100
|
+
- '^\s*@?log(ger)?[\s\(\.]'
|
|
101
|
+
- '^\s*LOG(GER)?[\s\(\.]'
|
|
102
|
+
- '^\s*debug[\s\(]'
|
|
103
|
+
- '^\s*\#'
|
|
104
|
+
|
|
105
|
+
### Performance
|
|
106
|
+
|
|
107
|
+
Performance/RedundantMerge:
|
|
108
|
+
MaxKeyValuePairs: 1
|
|
109
|
+
|
|
110
|
+
Performance/BigDecimalWithNumericArgument:
|
|
111
|
+
Enabled: false
|
|
112
|
+
|
|
113
|
+
Performance/ChainArrayAllocation:
|
|
114
|
+
Enabled: false
|
|
115
|
+
|
|
116
|
+
### Naming
|
|
117
|
+
|
|
118
|
+
Naming/MethodParameterName:
|
|
119
|
+
MinNameLength: 1
|
|
120
|
+
|
|
121
|
+
Naming/PredicateMethod:
|
|
122
|
+
AllowBangMethods: true
|
|
123
|
+
|
|
124
|
+
### Security
|
|
125
|
+
|
|
126
|
+
GitlabSecurity/JsonSerialization:
|
|
127
|
+
Enabled: false
|
|
128
|
+
|
|
129
|
+
### Minitest
|
|
130
|
+
|
|
131
|
+
Minitest/GlobalExpectations:
|
|
132
|
+
EnforcedStyle: _
|
|
133
|
+
|
|
134
|
+
Minitest/MultipleAssertions:
|
|
135
|
+
Enabled: true
|
|
136
|
+
|
|
137
|
+
# Sequel
|
|
138
|
+
|
|
139
|
+
Sequel/SaveChanges:
|
|
140
|
+
Enabled: false
|
|
141
|
+
|
|
142
|
+
Sequel/IrreversibleMigration:
|
|
143
|
+
Enabled: false
|
|
@@ -33,11 +33,11 @@ module RuboCop
|
|
|
33
33
|
# cleanup
|
|
34
34
|
# end
|
|
35
35
|
class EnsureRedirect < Base
|
|
36
|
-
MSG =
|
|
36
|
+
MSG = "Do not redirect from an `ensure` block."
|
|
37
37
|
|
|
38
38
|
def on_ensure(node)
|
|
39
39
|
# `:send` nodes represent method calls, so we look for send nodes and then check if they are `redirect`
|
|
40
|
-
node.
|
|
40
|
+
node.branch&.each_node(:send) do |send_node|
|
|
41
41
|
# Check if the method name being called is `redirect`
|
|
42
42
|
add_offense(send_node) if send_node.method?(:redirect)
|
|
43
43
|
end
|
|
@@ -28,12 +28,12 @@ module RuboCop
|
|
|
28
28
|
PATTERN
|
|
29
29
|
|
|
30
30
|
def on_send(node)
|
|
31
|
-
return unless File.basename(processed_source.file_path).eql?(
|
|
31
|
+
return unless File.basename(processed_source.file_path).eql?("Gemfile")
|
|
32
32
|
|
|
33
33
|
static_version_found?(node) do |source_node, source|
|
|
34
|
-
message = format(MSG, source:
|
|
34
|
+
message = format(MSG, source:)
|
|
35
35
|
|
|
36
|
-
add_offense(source_node, message:
|
|
36
|
+
add_offense(source_node, message:) do |corrector|
|
|
37
37
|
corrector.replace(source_node, "File.read('.ruby-version')")
|
|
38
38
|
end
|
|
39
39
|
end
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative
|
|
4
|
-
require_relative
|
|
5
|
-
require_relative
|
|
3
|
+
require_relative "eighty_four_codes/command_literal_injection"
|
|
4
|
+
require_relative "eighty_four_codes/ensure_redirect"
|
|
5
|
+
require_relative "eighty_four_codes/ruby_version_file"
|
|
6
6
|
|
|
7
|
-
require_relative
|
|
8
|
-
require_relative
|
|
9
|
-
require_relative
|
|
10
|
-
require_relative
|
|
11
|
-
require_relative
|
|
12
|
-
require_relative
|
|
7
|
+
require_relative "gitlab_security/json_serialization"
|
|
8
|
+
require_relative "gitlab_security/public_send"
|
|
9
|
+
require_relative "gitlab_security/redirect_to_params_update"
|
|
10
|
+
require_relative "gitlab_security/send_file_params"
|
|
11
|
+
require_relative "gitlab_security/sql_injection"
|
|
12
|
+
require_relative "gitlab_security/system_command_injection"
|
|
@@ -9,7 +9,7 @@ module RuboCop
|
|
|
9
9
|
module Inject
|
|
10
10
|
def self.defaults!
|
|
11
11
|
path = CONFIG_DEFAULT.to_s
|
|
12
|
-
hash = ConfigLoader.send(:load_yaml_configuration, path)
|
|
12
|
+
hash = ConfigLoader.send(:load_yaml_configuration, path) # rubocop:disable GitlabSecurity/PublicSend
|
|
13
13
|
config = Config.new(hash, path).tap(&:make_excludes_absolute)
|
|
14
14
|
puts "configuration from #{path}" if ConfigLoader.debug?
|
|
15
15
|
config = ConfigLoader.merge_with_default(config, path)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative
|
|
3
|
+
require_relative "eightyfourcodes/version"
|
|
4
4
|
|
|
5
5
|
module RuboCop
|
|
6
6
|
# Namespace for EightyFourCodes cops
|
|
7
7
|
module EightyFourCodes
|
|
8
8
|
class Error < StandardError; end
|
|
9
9
|
PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
|
|
10
|
-
CONFIG_DEFAULT = PROJECT_ROOT.join(
|
|
10
|
+
CONFIG_DEFAULT = PROJECT_ROOT.join("config", "default.yml").freeze
|
|
11
11
|
CONFIG = YAML.safe_load(CONFIG_DEFAULT.read).freeze
|
|
12
12
|
|
|
13
13
|
private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
3
|
+
require "rubocop"
|
|
4
4
|
|
|
5
|
-
require_relative
|
|
6
|
-
require_relative
|
|
7
|
-
require_relative
|
|
5
|
+
require_relative "rubocop/eightyfourcodes"
|
|
6
|
+
require_relative "rubocop/eightyfourcodes/version"
|
|
7
|
+
require_relative "rubocop/eightyfourcodes/inject"
|
|
8
8
|
|
|
9
9
|
RuboCop::EightyFourCodes::Inject.defaults!
|
|
10
10
|
|
|
11
|
-
require_relative
|
|
11
|
+
require_relative "rubocop/cop/eightyfourcodes_cops"
|
metadata
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubocop-eightyfourcodes
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
-
|
|
7
|
+
- 84codes
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: rubocop
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
15
15
|
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: 1.69.0
|
|
16
19
|
- - "<"
|
|
17
20
|
- !ruby/object:Gem::Version
|
|
18
21
|
version: '2'
|
|
@@ -20,29 +23,83 @@ dependencies:
|
|
|
20
23
|
prerelease: false
|
|
21
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
25
|
requirements:
|
|
26
|
+
- - ">="
|
|
27
|
+
- !ruby/object:Gem::Version
|
|
28
|
+
version: 1.69.0
|
|
23
29
|
- - "<"
|
|
24
30
|
- !ruby/object:Gem::Version
|
|
25
31
|
version: '2'
|
|
32
|
+
- !ruby/object:Gem::Dependency
|
|
33
|
+
name: rubocop-minitest
|
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - ">="
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '0'
|
|
39
|
+
type: :runtime
|
|
40
|
+
prerelease: false
|
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
42
|
+
requirements:
|
|
43
|
+
- - ">="
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: '0'
|
|
46
|
+
- !ruby/object:Gem::Dependency
|
|
47
|
+
name: rubocop-performance
|
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
|
49
|
+
requirements:
|
|
50
|
+
- - ">="
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: '0'
|
|
53
|
+
type: :runtime
|
|
54
|
+
prerelease: false
|
|
55
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
56
|
+
requirements:
|
|
57
|
+
- - ">="
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '0'
|
|
60
|
+
- !ruby/object:Gem::Dependency
|
|
61
|
+
name: rubocop-rake
|
|
62
|
+
requirement: !ruby/object:Gem::Requirement
|
|
63
|
+
requirements:
|
|
64
|
+
- - ">="
|
|
65
|
+
- !ruby/object:Gem::Version
|
|
66
|
+
version: '0'
|
|
67
|
+
type: :runtime
|
|
68
|
+
prerelease: false
|
|
69
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
70
|
+
requirements:
|
|
71
|
+
- - ">="
|
|
72
|
+
- !ruby/object:Gem::Version
|
|
73
|
+
version: '0'
|
|
74
|
+
- !ruby/object:Gem::Dependency
|
|
75
|
+
name: rubocop-sequel
|
|
76
|
+
requirement: !ruby/object:Gem::Requirement
|
|
77
|
+
requirements:
|
|
78
|
+
- - ">="
|
|
79
|
+
- !ruby/object:Gem::Version
|
|
80
|
+
version: '0'
|
|
81
|
+
type: :runtime
|
|
82
|
+
prerelease: false
|
|
83
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
84
|
+
requirements:
|
|
85
|
+
- - ">="
|
|
86
|
+
- !ruby/object:Gem::Version
|
|
87
|
+
version: '0'
|
|
26
88
|
description: 'A plugin for the RuboCop code style enforcing & linting tool.
|
|
27
89
|
|
|
28
90
|
'
|
|
29
91
|
email:
|
|
30
|
-
-
|
|
92
|
+
- developers@84codes.com
|
|
31
93
|
executables: []
|
|
32
94
|
extensions: []
|
|
33
95
|
extra_rdoc_files:
|
|
34
96
|
- LICENSE.md
|
|
35
97
|
- README.md
|
|
36
98
|
files:
|
|
37
|
-
- ".rspec"
|
|
38
|
-
- ".rubocop.yml"
|
|
39
|
-
- CHANGELOG.md
|
|
40
|
-
- Gemfile
|
|
41
|
-
- Gemfile.lock
|
|
42
99
|
- LICENSE.md
|
|
43
100
|
- README.md
|
|
44
|
-
- Rakefile
|
|
45
101
|
- config/default.yml
|
|
102
|
+
- config/eightyfourcodes.yml
|
|
46
103
|
- lib/rubocop-eightyfourcodes.rb
|
|
47
104
|
- lib/rubocop/cop/eighty_four_codes/command_literal_injection.rb
|
|
48
105
|
- lib/rubocop/cop/eighty_four_codes/ensure_redirect.rb
|
|
@@ -58,9 +115,7 @@ files:
|
|
|
58
115
|
- lib/rubocop/eightyfourcodes.rb
|
|
59
116
|
- lib/rubocop/eightyfourcodes/inject.rb
|
|
60
117
|
- lib/rubocop/eightyfourcodes/version.rb
|
|
61
|
-
|
|
62
|
-
- sig/rubocop/eightyfourcodes.rbs
|
|
63
|
-
homepage: https://github.com/84codes/rubocop-eightyfourcodes/
|
|
118
|
+
homepage: https://github.com/84codes/rubocop-eightyfourcodes
|
|
64
119
|
licenses:
|
|
65
120
|
- MIT
|
|
66
121
|
metadata:
|
|
@@ -72,14 +127,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
72
127
|
requirements:
|
|
73
128
|
- - ">="
|
|
74
129
|
- !ruby/object:Gem::Version
|
|
75
|
-
version:
|
|
130
|
+
version: 3.4.0
|
|
76
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
132
|
requirements:
|
|
78
133
|
- - ">="
|
|
79
134
|
- !ruby/object:Gem::Version
|
|
80
135
|
version: '0'
|
|
81
136
|
requirements: []
|
|
82
|
-
rubygems_version: 3.6.
|
|
137
|
+
rubygems_version: 3.6.9
|
|
83
138
|
specification_version: 4
|
|
84
139
|
summary: This is a collection of cops developed and used by 84codes AB.
|
|
85
140
|
test_files: []
|
data/.rspec
DELETED
data/.rubocop.yml
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
plugins:
|
|
2
|
-
- rubocop-rspec
|
|
3
|
-
- rubocop-rake
|
|
4
|
-
|
|
5
|
-
AllCops:
|
|
6
|
-
NewCops: enable
|
|
7
|
-
Exclude:
|
|
8
|
-
- 'lib/rubocop/cop/gitlab_security/*.rb'
|
|
9
|
-
- 'spec/rubocop/cop/gitlab_security/*.rb'
|
|
10
|
-
# avoid linting installed gems when running in GitHub Actions
|
|
11
|
-
- '**/vendor/bundle/**/*'
|
|
12
|
-
Naming/FileName:
|
|
13
|
-
Exclude:
|
|
14
|
-
- lib/rubocop-eightyfourcodes.rb
|
|
15
|
-
RSpec/ExampleLength:
|
|
16
|
-
Max: 10
|
data/CHANGELOG.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## 0.0.3 (2024-10-23)
|
|
4
|
-
|
|
5
|
-
- Recreated entire project using <https://github.com/rubocop/rubocop-extension-generator>
|
|
6
|
-
- Added `EnsureRedirect`
|
|
7
|
-
|
|
8
|
-
## 0.0.2 (2020-09-24)
|
|
9
|
-
|
|
10
|
-
- Added `RubyVersionFile`: Ensure we read Gemfile ruby version from `.ruby-version` file
|
|
11
|
-
|
|
12
|
-
## 0.0.1 (2019-09-11)
|
|
13
|
-
|
|
14
|
-
- Forked from gitlab-security
|
|
15
|
-
- Added `CommandLiteralInjection`: Passing user input to `` and %x without sanitization and parameterization can result in command injection)
|
data/Gemfile
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
source 'https://rubygems.org'
|
|
4
|
-
|
|
5
|
-
# Specify your gem's dependencies in rubocop-eightyfourcodes.gemspec
|
|
6
|
-
gemspec
|
|
7
|
-
|
|
8
|
-
group :development, :test do
|
|
9
|
-
gem 'rake'
|
|
10
|
-
gem 'rspec'
|
|
11
|
-
gem 'rubocop'
|
|
12
|
-
gem 'rubocop-rake'
|
|
13
|
-
gem 'rubocop-rspec'
|
|
14
|
-
gem 'yard'
|
|
15
|
-
end
|
data/Gemfile.lock
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
rubocop-eightyfourcodes (0.0.4)
|
|
5
|
-
rubocop (< 2)
|
|
6
|
-
|
|
7
|
-
GEM
|
|
8
|
-
remote: https://rubygems.org/
|
|
9
|
-
specs:
|
|
10
|
-
ast (2.4.2)
|
|
11
|
-
diff-lcs (1.6.0)
|
|
12
|
-
json (2.10.2)
|
|
13
|
-
language_server-protocol (3.17.0.4)
|
|
14
|
-
lint_roller (1.1.0)
|
|
15
|
-
parallel (1.26.3)
|
|
16
|
-
parser (3.3.7.1)
|
|
17
|
-
ast (~> 2.4.1)
|
|
18
|
-
racc
|
|
19
|
-
racc (1.8.1)
|
|
20
|
-
rainbow (3.1.1)
|
|
21
|
-
rake (13.2.1)
|
|
22
|
-
regexp_parser (2.10.0)
|
|
23
|
-
rspec (3.13.0)
|
|
24
|
-
rspec-core (~> 3.13.0)
|
|
25
|
-
rspec-expectations (~> 3.13.0)
|
|
26
|
-
rspec-mocks (~> 3.13.0)
|
|
27
|
-
rspec-core (3.13.3)
|
|
28
|
-
rspec-support (~> 3.13.0)
|
|
29
|
-
rspec-expectations (3.13.3)
|
|
30
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
31
|
-
rspec-support (~> 3.13.0)
|
|
32
|
-
rspec-mocks (3.13.2)
|
|
33
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
34
|
-
rspec-support (~> 3.13.0)
|
|
35
|
-
rspec-support (3.13.2)
|
|
36
|
-
rubocop (1.74.0)
|
|
37
|
-
json (~> 2.3)
|
|
38
|
-
language_server-protocol (~> 3.17.0.2)
|
|
39
|
-
lint_roller (~> 1.1.0)
|
|
40
|
-
parallel (~> 1.10)
|
|
41
|
-
parser (>= 3.3.0.2)
|
|
42
|
-
rainbow (>= 2.2.2, < 4.0)
|
|
43
|
-
regexp_parser (>= 2.9.3, < 3.0)
|
|
44
|
-
rubocop-ast (>= 1.38.0, < 2.0)
|
|
45
|
-
ruby-progressbar (~> 1.7)
|
|
46
|
-
unicode-display_width (>= 2.4.0, < 4.0)
|
|
47
|
-
rubocop-ast (1.40.0)
|
|
48
|
-
parser (>= 3.3.1.0)
|
|
49
|
-
rubocop-rake (0.7.1)
|
|
50
|
-
lint_roller (~> 1.1)
|
|
51
|
-
rubocop (>= 1.72.1)
|
|
52
|
-
rubocop-rspec (3.5.0)
|
|
53
|
-
lint_roller (~> 1.1)
|
|
54
|
-
rubocop (~> 1.72, >= 1.72.1)
|
|
55
|
-
ruby-progressbar (1.13.0)
|
|
56
|
-
unicode-display_width (3.1.4)
|
|
57
|
-
unicode-emoji (~> 4.0, >= 4.0.4)
|
|
58
|
-
unicode-emoji (4.0.4)
|
|
59
|
-
yard (0.9.37)
|
|
60
|
-
|
|
61
|
-
PLATFORMS
|
|
62
|
-
arm64-darwin-23
|
|
63
|
-
ruby
|
|
64
|
-
|
|
65
|
-
DEPENDENCIES
|
|
66
|
-
rake
|
|
67
|
-
rspec
|
|
68
|
-
rubocop
|
|
69
|
-
rubocop-eightyfourcodes!
|
|
70
|
-
rubocop-rake
|
|
71
|
-
rubocop-rspec
|
|
72
|
-
yard
|
|
73
|
-
|
|
74
|
-
BUNDLED WITH
|
|
75
|
-
2.6.4
|
data/Rakefile
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'bundler/gem_tasks'
|
|
4
|
-
require 'rspec/core/rake_task'
|
|
5
|
-
require 'rubocop/rake_task'
|
|
6
|
-
|
|
7
|
-
RuboCop::RakeTask.new
|
|
8
|
-
|
|
9
|
-
task default: %i[spec rubocop]
|
|
10
|
-
|
|
11
|
-
RSpec::Core::RakeTask.new(:spec) do |spec|
|
|
12
|
-
spec.pattern = FileList['spec/**/*_spec.rb']
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
desc 'Generate a new cop with a template'
|
|
16
|
-
task :new_cop, [:cop] do |_task, args|
|
|
17
|
-
require 'rubocop'
|
|
18
|
-
|
|
19
|
-
cop_name = args.fetch(:cop) do
|
|
20
|
-
warn 'usage: bundle exec rake new_cop[Department/Name]'
|
|
21
|
-
exit!
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
generator = RuboCop::Cop::Generator.new(cop_name)
|
|
25
|
-
|
|
26
|
-
generator.write_source
|
|
27
|
-
generator.write_spec
|
|
28
|
-
generator.inject_require(root_file_path: 'lib/rubocop/cop/eightyfourcodes_cops.rb')
|
|
29
|
-
generator.inject_config(config_file_path: 'config/default.yml')
|
|
30
|
-
|
|
31
|
-
puts generator.todo
|
|
32
|
-
end
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative 'lib/rubocop/eightyfourcodes/version'
|
|
4
|
-
|
|
5
|
-
Gem::Specification.new do |spec|
|
|
6
|
-
spec.name = 'rubocop-eightyfourcodes'
|
|
7
|
-
spec.version = RuboCop::EightyFourCodes::VERSION
|
|
8
|
-
spec.authors = ['Anders Bälter']
|
|
9
|
-
spec.email = ['anders@84codes.com']
|
|
10
|
-
|
|
11
|
-
spec.summary = 'This is a collection of cops developed and used by 84codes AB.'
|
|
12
|
-
spec.description = <<~DESCRIPTION
|
|
13
|
-
A plugin for the RuboCop code style enforcing & linting tool.
|
|
14
|
-
DESCRIPTION
|
|
15
|
-
spec.homepage = 'https://github.com/84codes/rubocop-eightyfourcodes/'
|
|
16
|
-
spec.license = 'MIT'
|
|
17
|
-
spec.required_ruby_version = '>= 2.6.0'
|
|
18
|
-
|
|
19
|
-
spec.metadata = {
|
|
20
|
-
'rubygems_mfa_required' => 'true'
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
# Specify which files should be added to the gem when it is released.
|
|
24
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
25
|
-
spec.files = Dir.chdir(__dir__) do
|
|
26
|
-
`git ls-files -z`.split("\x0").reject do |f|
|
|
27
|
-
(File.expand_path(f) == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|circleci)|appveyor)})
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
spec.require_paths = ['lib']
|
|
32
|
-
spec.add_dependency 'rubocop', '< 2'
|
|
33
|
-
spec.extra_rdoc_files = ['LICENSE.md', 'README.md']
|
|
34
|
-
end
|