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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 145264fffb5808ff6c7f5dfe04ffbf1340fd91fd1e86e150f471a9c41f086a39
4
- data.tar.gz: fd868cb346b3296caee3e963831a43760ad7eb3c6f6ec430b818f3740c093034
3
+ metadata.gz: 37b01bed64073895541d1f18865e4a4e0122a7bbd9482e46d2b4600a0aa172ce
4
+ data.tar.gz: 2255d24b02bc8d981b84502ac109953dfba47b989df7573e867bd993f1389df3
5
5
  SHA512:
6
- metadata.gz: eb90cdf3cd716033916415e0ebe1fb2ea864a295828b6284cf93c17e3a418848f6f00f6fcabaf9977714edcdbc7fb9f4d9ba39f346589883938d96047fcea35e
7
- data.tar.gz: 962ae39df0757a3702fdd2f413b7ac3f98a185031f84eb859a9a23cc787955e3bb582de437941a50092035ce746b70937b576356f7d701bf6bda13e2ed9b4e03
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)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module SaneConditionals
5
- VERSION = '1.0.0'
5
+ VERSION = '1.0.1'
6
6
  end
7
7
  end
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.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 00:00:00.000000000 Z
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
- Enforces conditional style that does not require you to hold the entire
29
- sentence in working memory while your brain tries to figure out what
30
- "do_thing if !foo unless bar" means. It means you hate your colleagues.
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 humans who can read.
74
+ summary: RuboCop cops for people who want to read code, not decode it.
67
75
  test_files: []