[#119670] [Ruby master Feature#20859] Make Base64 to core class — "hsbt (Hiroshi SHIBATA) via ruby-core" <ruby-core@...>

Issue #20859 has been reported by hsbt (Hiroshi SHIBATA).

8 messages 2024/11/01

[#119683] [Ruby master Feature#20861] Add an environment variable for tuning the default thread quantum — "tenderlovemaking (Aaron Patterson) via ruby-core" <ruby-core@...>

Issue #20861 has been reported by tenderlovemaking (Aaron Patterson).

24 messages 2024/11/01

[#119724] [Ruby master Bug#20863] `zlib.c` calls `rb_str_set_len` and `rb_str_modify_expand`(and others) without holding the GVL. — "ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>

Issue #20863 has been reported by ioquatix (Samuel Williams).

8 messages 2024/11/05

[#119726] [Ruby master Feature#20864] Support `error:` keyword to `Kernel#warn` — "ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>

Issue #20864 has been reported by ioquatix (Samuel Williams).

14 messages 2024/11/05

[#119741] [Ruby master Bug#20869] IO buffer handling is inconsistent when seeking — "javanthropus (Jeremy Bopp) via ruby-core" <ruby-core@...>

Issue #20869 has been reported by javanthropus (Jeremy Bopp).

13 messages 2024/11/05

[#119751] [Ruby master Bug#20871] Including methods in Enumerable doesn't make them available in Array — "sanderd17 (Sander Deryckere) via ruby-core" <ruby-core@...>

Issue #20871 has been reported by sanderd17 (Sander Deryckere).

13 messages 2024/11/05

[#119769] [Ruby master Feature#20875] Atomic initialization for Ractor local storage — "ko1 (Koichi Sasada) via ruby-core" <ruby-core@...>

Issue #20875 has been reported by ko1 (Koichi Sasada).

12 messages 2024/11/06

[#119801] [Ruby master Feature#20878] A new C API to create a String by adopting a pointer: `rb_enc_str_adopt(const char *ptr, long len, long capa, rb_encoding *enc)` — "byroot (Jean Boussier) via ruby-core" <ruby-core@...>

Issue #20878 has been reported by byroot (Jean Boussier).

32 messages 2024/11/07

[#119852] [Ruby master Feature#20882] Provide Boolean(...) — "getajobmike (Mike Perham) via ruby-core" <ruby-core@...>

Issue #20882 has been reported by getajobmike (Mike Perham).

12 messages 2024/11/08

[#119881] [Ruby master Feature#20884] reserve "Ruby" toplevel module for Ruby language — "Dan0042 (Daniel DeLorme) via ruby-core" <ruby-core@...>

Issue #20884 has been reported by Dan0042 (Daniel DeLorme).

8 messages 2024/11/12

[#119897] [Ruby master Bug#20890] MacOS 15.1, Macbook pro 2024 m4, YJIT: Kernel Panic on network access, works w/o YJIT — "markus_d (Markus Doits) via ruby-core" <ruby-core@...>

Issue #20890 has been reported by markus_d (Markus Doits).

24 messages 2024/11/12

[#119988] [Ruby master Bug#20904] 3.4.0-preview2: Building miniruby.exe fails for mswin32 — "jun66j5 (Jun Omae) via ruby-core" <ruby-core@...>

Issue #20904 has been reported by jun66j5 (Jun Omae).

11 messages 2024/11/22

[#120002] [Ruby master Bug#20908] Ruby extension builds fail with GCC 15 which defaults to -std=gnu23 — "thesamesam (Sam James) via ruby-core" <ruby-core@...>

SXNzdWUgIzIwOTA4IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IHRoZXNhbWVzYW0gKFNhbSBKYW1lcyku

7 messages 2024/11/25

[#120016] [Ruby master Feature#20912] Move warning when redefining object_id to __id__ — "jhawthorn (John Hawthorn) via ruby-core" <ruby-core@...>

SXNzdWUgIzIwOTEyIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGpoYXd0aG9ybiAoSm9obiBIYXd0aG9y

11 messages 2024/11/27

[#120027] [Ruby master Misc#20913] Proposal: Adding Jeremy Evans and Burdette Lamar to www.ruby-lang.org's English Editorial Team — "st0012 (Stan Lo) via ruby-core" <ruby-core@...>

Issue #20913 has been reported by st0012 (Stan Lo).

6 messages 2024/11/27

[#120043] [Ruby master Bug#20919] IO#seek does not clear the character buffer in some cases while transcoding — "javanthropus (Jeremy Bopp) via ruby-core" <ruby-core@...>

Issue #20919 has been reported by javanthropus (Jeremy Bopp).

7 messages 2024/11/28

[ruby-core:120051] [Ruby master Feature#20922] Should not we omit parentheses in assert calls?

From: "mame (Yusuke Endoh) via ruby-core" <ruby-core@...>
Date: 2024-11-29 07:30:42 UTC
List: ruby-core #120051
Issue #20922 has been updated by mame (Yusuke Endoh).


FYI:

https://github.com/ruby/ruby/commit/6a39e6fc2d0db590ad605f7af9c99d32c64c6a22
https://github.com/ruby/ruby/commit/fc67091fc8dc4c7122499cd0d287cd34ff01bf30
https://github.com/ruby/ruby/commit/5b146eb5a15cce4c7a6ce279bd53e75a61d4a1f5

https://github.com/rubygems/rubygems/commit/e6a538b5c8104900e9a74f6a5fd154da319fb388
https://github.com/rubygems/rubygems/commit/984bb9b81574e778b3d40d039761d84259c1806d
https://github.com/rubygems/rubygems/commit/6ec39cd782d554127030ede12988f1720b08a2bf

https://github.com/rails/rails/commit/e69a7ee42dc09892477808f1243d029ce1abf311
https://github.com/rails/rails/commit/ac721c855203ac7570545c0e85fe086f8e94d94a
https://github.com/rails/rails/commit/951383bd9afa4a71c17e56d1d4eb5866da851483
https://github.com/rails/rails/commit/8a0f235fd3bd3f3c813fa7034c6d741831e55c3e
https://github.com/rails/rails/commit/99b48a5aebc0ff159a8102f2782eaee8ab5a32cd
https://github.com/rails/rails/commit/c33c03e80cbe9f27274b45fe55f93bad3af988fb
https://github.com/rails/rails/commit/f53f69bdc617d63587036cef84eb11ef2dfbc557
https://github.com/rails/rails/commit/7a65b463ab8d366db0cc49b9a49d37c59d4ce574
https://github.com/rails/rails/commit/82ba39202c9185af9060b70a8241cb41101364cf
https://github.com/rails/rails/commit/a2338c583349ebd48f3c9ec18f1df5c7cf21dfdb
...

----------------------------------------
Feature #20922: Should not we omit parentheses in assert calls?
https://bugs.ruby-lang.org/issues/20922#change-110786

* Author: mame (Yusuke Endoh)
* Status: Open
----------------------------------------
I often see the style of omitting parentheses in assert calls, but it leads to annoying warnings in the following case:

```
assert_equal -1, val    #=> warning: ambiguous first argument; put parentheses or a space even after `-` operator
assert_match /foo/, str #=> warning: ambiguous `/`; wrap regexp in parentheses or add a space after `/` operator
```

To deal with this warning, it is necessary to add parentheses only to *some* assert calls.

```
assert_equal 1, one
assert_equal 0, zero
assert_equal(-1, minus_one)
```

Obviously, this is not very cool.

I feel that by these warnings, Ruby says "we should not omit parentheses in assert calls". Is this what matz intended?

If it is the intent, I would like to add parentheses on all assert calls in tests of Ruby and default gems.
If it is not the intent, why don't we remove these warnings?

Note that, as far as I recall, I encountered this problem only with `assert_equal` and `assert_match`.
I don't write parentheses in `p`, `puts`, `attr_reader`, `include`, etc., but all of them rarely accept `-1` and `//` literally as the first argument in real code.
As a milder approach, I came up with an idea to stop the warning only when the method name starts with "assert". It is very ad-hoc, though.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/


In This Thread