rubocop-sane_conditionals 1.0.0 → 1.0.1
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/lib/rubocop/cop/style/no_unless.rb +2 -1
- data/lib/rubocop-sane_conditionals/version.rb +1 -1
- metadata +14 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 37b01bed64073895541d1f18865e4a4e0122a7bbd9482e46d2b4600a0aa172ce
|
|
4
|
+
data.tar.gz: 2255d24b02bc8d981b84502ac109953dfba47b989df7573e867bd993f1389df3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3b066293223f7cdf908a1df62e0d6e1c434d6cd911896241a4e3011a4565452cc0e947b3c2faa38b09600f2b2c6b32c6e20929518c146a9b7db9323f17d346f3
|
|
7
|
+
data.tar.gz: 128feed49dab59c933010b103388500cd6d3e05818f75d789886df67fbaa99add8f38796810827ee7f01b813401d5cb1b969970ca34ce9be3cbf9ab53d9d7800
|
|
@@ -74,7 +74,8 @@ module RuboCop
|
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
def requires_parens?(condition_node)
|
|
77
|
-
condition_node.and_type? || condition_node.or_type?
|
|
77
|
+
condition_node.and_type? || condition_node.or_type? ||
|
|
78
|
+
(condition_node.send_type? && condition_node.binary_operation?)
|
|
78
79
|
end
|
|
79
80
|
|
|
80
81
|
def autocorrect_modifier(corrector, node, negated_condition)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubocop-sane_conditionals
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Federico
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-03-
|
|
11
|
+
date: 2026-03-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rubocop
|
|
@@ -25,9 +25,17 @@ dependencies:
|
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '1.0'
|
|
27
27
|
description: |
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
Ruby is a beautiful language. It is expressive, elegant, and reads almost like
|
|
29
|
+
English. This is exactly the problem.
|
|
30
|
+
|
|
31
|
+
At some point, someone decided that because Ruby can read like English, it
|
|
32
|
+
should read like English - and then they implemented the wrong kind of
|
|
33
|
+
English. The kind where the subject comes last.
|
|
34
|
+
|
|
35
|
+
This gem provides RuboCop cops that ban `unless` and multiline modifier
|
|
36
|
+
conditionals, replacing them with explicit `if` forms that are easier to
|
|
37
|
+
read, reason about, and review without mentally untangling a sentence that
|
|
38
|
+
somebody wrote backwards and then had the nerve to commit.
|
|
31
39
|
email:
|
|
32
40
|
executables: []
|
|
33
41
|
extensions: []
|
|
@@ -63,5 +71,5 @@ requirements: []
|
|
|
63
71
|
rubygems_version: 3.4.10
|
|
64
72
|
signing_key:
|
|
65
73
|
specification_version: 4
|
|
66
|
-
summary: RuboCop cops for
|
|
74
|
+
summary: RuboCop cops for people who want to read code, not decode it.
|
|
67
75
|
test_files: []
|