A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/rubocop/rubocop/commit/3676d664880673ab9c439272e69547796d8dfdee below:

Cut 1.76.2 · rubocop/rubocop@3676d66 · GitHub

File tree Expand file treeCollapse file tree 10 files changed

+82

-14

lines changed

Filter options

Expand file treeCollapse file tree 10 files changed

+82

-14

lines changed Original file line number Diff line number Diff line change

@@ -39,7 +39,7 @@ output by `rubocop -V`, include them as well. Here's an example:

39 39 40 40

```

41 41

$ [bundle exec] rubocop -V

42 -

1.76.1 (using Parser 3.3.5.0, rubocop-ast 1.32.3, analyzing as Ruby 3.3, running on ruby 3.3.5) [x86_64-linux]

42 +

1.76.2 (using Parser 3.3.5.0, rubocop-ast 1.32.3, analyzing as Ruby 3.3, running on ruby 3.3.5) [x86_64-linux]

43 43

- rubocop-performance 1.22.1

44 44

- rubocop-rspec 3.1.0

45 45

```

Original file line number Diff line number Diff line change

@@ -11,6 +11,8 @@

11 11 12 12

## master (unreleased)

13 13 14 +

## 1.76.2 (2025-06-17)

15 + 14 16

### Bug fixes

15 17 16 18

* [#14273](https://github.com/rubocop/rubocop/issues/14273): Fix an error for `Lint/EmptyInterpolation` when using a boolean literal inside interpolation. ([@koic][])

Original file line number Diff line number Diff line change

@@ -17,7 +17,7 @@ do so.

17 17 18 18

```console

19 19

$ rubocop -V

20 -

1.76.1 (using Parser 3.3.5.0, rubocop-ast 1.32.3, analyzing as Ruby 3.3, running on ruby 3.3.5) [x86_64-linux]

20 +

1.76.2 (using Parser 3.3.5.0, rubocop-ast 1.32.3, analyzing as Ruby 3.3, running on ruby 3.3.5) [x86_64-linux]

21 21

- rubocop-performance 1.22.1

22 22

- rubocop-rspec 3.1.0

23 23

```

Original file line number Diff line number Diff line change

@@ -3063,7 +3063,7 @@ Naming/PredicateMethod:

3063 3063

Description: 'Checks that predicate methods end with `?` and non-predicate methods do not.'

3064 3064

Enabled: pending

3065 3065

VersionAdded: '1.76'

3066 -

VersionChanged: '<<next>>'

3066 +

VersionChanged: '1.76'

3067 3067

# In `aggressive` mode, the cop will register an offense for predicate methods that

3068 3068

# may return a non-boolean value.

3069 3069

# In `conservative` mode, the cop will *not* register an offense for predicate methods

Original file line number Diff line number Diff line change

@@ -2,6 +2,6 @@ name: rubocop

2 2

title: RuboCop

3 3

# We always provide version without patch here (e.g. 1.1),

4 4

# as patch versions should not appear in the docs.

5 -

version: ~

5 +

version: '1.76'

6 6

nav:

7 7

- modules/ROOT/nav.adoc

Original file line number Diff line number Diff line change

@@ -257,7 +257,9 @@ intent of the program).

257 257

----

258 258

# bad

259 259

x || 1..2

260 +

x - 1..2

260 261

(x || 1..2)

262 +

x || 1..y || 2

261 263

1..2.to_a

262 264 263 265

# good, unambiguous

@@ -271,6 +273,7 @@ a..b

271 273 272 274

# good, ambiguity removed

273 275

x || (1..2)

276 +

(x - 1)..2

274 277

(x || 1)..2

275 278

(x || 1)..(y || 2)

276 279

(1..2).to_a

@@ -7977,10 +7980,10 @@ URI::RFC2396_PARSER.make_regexp('http://example.com')

7977 7980

|===

7978 7981 7979 7982

Checks for redundant access modifiers, including those with no

7980 -

code, those which are repeated, and leading `public` modifiers in a

7981 -

class or module body. Conditionally-defined methods are considered as

7982 -

always being defined, and thus access modifiers guarding such methods

7983 -

are not redundant.

7983 +

code, those which are repeated, those which are on top-level, and

7984 +

leading `public` modifiers in a class or module body.

7985 +

Conditionally-defined methods are considered as always being defined,

7986 +

and thus access modifiers guarding such methods are not redundant.

7984 7987 7985 7988

This cop has `ContextCreatingMethods` option. The default setting value

7986 7989

is an empty array that means no method is specified.

@@ -8035,6 +8038,12 @@ class Foo

8035 8038

private # this is redundant (no following methods are defined)

8036 8039

end

8037 8040 8041 +

# bad

8042 +

private # this is useless (access modifiers have no effect on top-level)

8043 + 8044 +

def method

8045 +

end

8046 + 8038 8047

# good

8039 8048

class Foo

8040 8049

private # this is not redundant (a method is defined)

@@ -8248,6 +8257,9 @@ This cop emulates Ruby warning "block supersedes default value argument" which

8248 8257

applies to `Array.new`, `Array#fetch`, `Hash#fetch`, `ENV.fetch` and

8249 8258

`Thread#fetch`.

8250 8259 8260 +

A `fetch` call without a receiver is considered a custom method and does not register

8261 +

an offense.

8262 + 8251 8263

[#safety-lintuselessdefaultvalueargument]

8252 8264

=== Safety

8253 8265 Original file line number Diff line number Diff line change

@@ -1206,13 +1206,13 @@ end

1206 1206

| Yes

1207 1207

| No

1208 1208

| 1.76

1209 -

| -

1209 +

| 1.76

1210 1210

|===

1211 1211 1212 1212

Checks that predicate methods end with `?` and non-predicate methods do not.

1213 1213 1214 1214

The names of predicate methods (methods that return a boolean value) should end

1215 -

in a question mark. Methods that dont return a boolean, shouldnt

1215 +

in a question mark. Methods that don't return a boolean, shouldn't

1216 1216

end in a question mark.

1217 1217 1218 1218

The cop assesses a predicate method as one that returns boolean values. Likewise,

@@ -1228,7 +1228,11 @@ return values are detected.

1228 1228 1229 1229

The cop also has `AllowedMethods` configuration in order to prevent the cop from

1230 1230

registering an offense from a method name that does not confirm to the naming

1231 -

guidelines. By default, `call` is allowed.

1231 +

guidelines. By default, `call` is allowed. The cop also has `AllowedPatterns`

1232 +

configuration to allow method names by regular expression.

1233 + 1234 +

The cop can furthermore be configured to allow all bang methods (method names

1235 +

ending with `!`), with `AllowBangMethods: true` (default false).

1232 1236 1233 1237

[#examples-namingpredicatemethod]

1234 1238

=== Examples

@@ -1292,6 +1296,28 @@ def foo?

1292 1296

end

1293 1297

----

1294 1298 1299 +

[#allowbangmethods_-false-_default_-namingpredicatemethod]

1300 +

==== AllowBangMethods: false (default)

1301 + 1302 +

[source,ruby]

1303 +

----

1304 +

# bad

1305 +

def save!

1306 +

true

1307 +

end

1308 +

----

1309 + 1310 +

[#allowbangmethods_-true-namingpredicatemethod]

1311 +

==== AllowBangMethods: true

1312 + 1313 +

[source,ruby]

1314 +

----

1315 +

# good

1316 +

def save!

1317 +

true

1318 +

end

1319 +

----

1320 + 1295 1321

[#configurable-attributes-namingpredicatemethod]

1296 1322

=== Configurable attributes

1297 1323

@@ -1305,6 +1331,14 @@ end

1305 1331

| AllowedMethods

1306 1332

| `call`

1307 1333

| Array

1334 + 1335 +

| AllowedPatterns

1336 +

| `[]`

1337 +

| Array

1338 + 1339 +

| AllowBangMethods

1340 +

| `false`

1341 +

| Boolean

1308 1342

|===

1309 1343 1310 1344

[#namingpredicateprefix]

Original file line number Diff line number Diff line change

@@ -125,7 +125,7 @@ following to your `.pre-commit-config.yaml` file:

125 125

[source,yaml]

126 126

----

127 127

- repo: https://github.com/rubocop/rubocop

128 -

rev: v1.76.1

128 +

rev: v1.76.2

129 129

hooks:

130 130

- id: rubocop

131 131

----

@@ -136,7 +136,7 @@ entries in `additional_dependencies`:

136 136

[source,yaml]

137 137

----

138 138

- repo: https://github.com/rubocop/rubocop

139 -

rev: v1.76.1

139 +

rev: v1.76.2

140 140

hooks:

141 141

- id: rubocop

142 142

additional_dependencies:

Original file line number Diff line number Diff line change

@@ -3,7 +3,7 @@

3 3

module RuboCop

4 4

# This module holds the RuboCop version information.

5 5

module Version

6 -

STRING = '1.76.1'

6 +

STRING = '1.76.2'

7 7 8 8

MSG = '%<version>s (using %<parser_version>s, ' \

9 9

'rubocop-ast %<rubocop_ast_version>s, ' \

Original file line number Diff line number Diff line change

@@ -0,0 +1,20 @@

1 +

### Bug fixes

2 + 3 +

* [#14273](https://github.com/rubocop/rubocop/issues/14273): Fix an error for `Lint/EmptyInterpolation` when using a boolean literal inside interpolation. ([@koic][])

4 +

* [#14260](https://github.com/rubocop/rubocop/issues/14260): Fix an error for `Lint/UselessDefaultValueArgument` when `fetch` call without a receiver. ([@koic][])

5 +

* [#14267](https://github.com/rubocop/rubocop/pull/14267): Fix an error for `Style/ConditionalAssignment` cop when using one-line branches. ([@viralpraxis][])

6 +

* [#14275](https://github.com/rubocop/rubocop/issues/14275): Fix false positives for `Style/RedundantParentheses` when using parenthesized one-line pattern matching in endless method definition. ([@koic][])

7 +

* [#14269](https://github.com/rubocop/rubocop/issues/14269): Fix false positives for `Style/RedundantSelf` when local variable assignment name is used in nested `if`. ([@koic][])

8 +

* [#14286](https://github.com/rubocop/rubocop/issues/14286): Fix incorrect autocorrect for `Lint/SafeNavigationChain` when a safe navigation is used on the left-hand side of a `-` operator when inside an array. ([@koic][])

9 + 10 +

### Changes

11 + 12 +

* [#14232](https://github.com/rubocop/rubocop/issues/14232): Add `AllowedPatterns` and `AllowBangMethods` configuration to `Naming/PredicateMethod`. ([@dvandersluis][])

13 +

* [#14268](https://github.com/rubocop/rubocop/pull/14268): Register operator expression range boundaries as offenses in `Lint/AmbiguousRange`. ([@lovro-bikic][])

14 +

* [#14264](https://github.com/rubocop/rubocop/pull/14264): Offend access modifiers used on top-level in `Lint/UselessAccessModifier`. ([@lovro-bikic][])

15 +

* [#14278](https://github.com/rubocop/rubocop/pull/14278): Register conditions wrapped in parentheses as offenses in `Style/MinMaxComparison`. ([@lovro-bikic][])

16 + 17 +

[@koic]: https://github.com/koic

18 +

[@viralpraxis]: https://github.com/viralpraxis

19 +

[@dvandersluis]: https://github.com/dvandersluis

20 +

[@lovro-bikic]: https://github.com/lovro-bikic

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4