rubocop-github 0.23.0 → 0.24.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 +4 -4
- data/STYLEGUIDE.md +17 -0
- data/config/default.yml +1 -1
- data/lib/rubocop/cop/github/rails_view_render_literal.rb +1 -1
- data/lib/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56060d50404e2ea343a8a561777417e59b20e2ab42e9b804cc77a72e929742ca
|
4
|
+
data.tar.gz: f70290056aa82c4261ce602d5d4c469792cda56d8f3936d9c912e6664542d238
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ae85d5c7127a242d86f545152edae99daf6519ac0be04d6493f5c87022e47d12a4c252633674a4d645c7194ee9dfa0bc2b97e1c0c4234f8a1c2e18412b08e0e
|
7
|
+
data.tar.gz: 2ce828f524149d5b2630f622afae2e50afa322b7d3bd3ebb87ab337ab4dfe4be86502ee50f3603f43e6c7bc25ddfc2f5f49cb8ffa28d89adeab1486420c331c3
|
data/STYLEGUIDE.md
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
This is GitHub's Ruby Style Guide, inspired by [RuboCop's guide][rubocop-guide].
|
4
4
|
|
5
5
|
## Table of Contents
|
6
|
+
|
6
7
|
1. [Layout](#layout)
|
7
8
|
1. [Indentation](#indentation)
|
8
9
|
2. [Inline](#inline)
|
@@ -763,6 +764,22 @@ if x > 10
|
|
763
764
|
end
|
764
765
|
```
|
765
766
|
|
767
|
+
* Don't use `unless` with a negated condition.
|
768
|
+
<a name="no-unless-negation"></a><sup>[[link](#no-unless-negation)]</sup>
|
769
|
+
* <a href="https://docs.rubocop.org/rubocop/cops_style.html#stylenegatedunless">RuboCop rule: Style/NegatedUnless</a>
|
770
|
+
|
771
|
+
```ruby
|
772
|
+
# bad
|
773
|
+
unless !condition?
|
774
|
+
do_something
|
775
|
+
end
|
776
|
+
|
777
|
+
# good
|
778
|
+
if condition?
|
779
|
+
do_something
|
780
|
+
end
|
781
|
+
```
|
782
|
+
|
766
783
|
### Ternary operator
|
767
784
|
|
768
785
|
* Avoid the ternary operator (`?:`) except in cases where all expressions are extremely
|
data/config/default.yml
CHANGED
@@ -54,7 +54,7 @@ module RuboCop
|
|
54
54
|
|
55
55
|
if render_literal?(node) && node.arguments.count > 1
|
56
56
|
locals = node.arguments[1]
|
57
|
-
elsif
|
57
|
+
elsif option_pairs = render_with_options?(node)
|
58
58
|
locals = option_pairs.map { |pair| locals_key?(pair) }.compact.first
|
59
59
|
end
|
60
60
|
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-github
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.24.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-05-27 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rubocop
|
@@ -57,14 +57,14 @@ dependencies:
|
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 7.
|
60
|
+
version: 7.2.2.1
|
61
61
|
type: :development
|
62
62
|
prerelease: false
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: 7.
|
67
|
+
version: 7.2.2.1
|
68
68
|
- !ruby/object:Gem::Dependency
|
69
69
|
name: minitest
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
@@ -141,7 +141,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
141
141
|
requirements:
|
142
142
|
- - ">="
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
version: 3.
|
144
|
+
version: 3.1.0
|
145
145
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
146
|
requirements:
|
147
147
|
- - ">="
|