Bug 40950

Summary: Don't forbid 'falsy' in codespell
Product: Koha Reporter: Tomás Cohen Arazi (tcohen) <tomascohen>
Component: Test SuiteAssignee: Tomás Cohen Arazi (tcohen) <tomascohen>
Status: Pushed to main --- QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: jonathan.druart, martin.renvoize, matt.blenkinsop, tomascohen
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
25.11.00
Circulation function:
Bug Depends on: 38201    
Bug Blocks:    
Attachments: Bug 40950: Add 'falsy' programming idiom to codespell dictionary
Bug 40950: Add 'falsy' programming idiom to codespell dictionary

Description Tomás Cohen Arazi (tcohen) 2025-10-03 15:08:02 UTC
As a programmer, I like the 'falsy' idiom. It is totally relevant for Perl as we don't have booleans but 'falsy' values (empty string, empty array, undefined, etc).

I propose to add a codespell exception to allow it.
Comment 1 Tomás Cohen Arazi (tcohen) 2025-10-03 15:15:01 UTC
Created attachment 187408 [details] [review]
Bug 40950: Add 'falsy' programming idiom to codespell dictionary

The term 'falsy' is a standard JavaScript idiom referring to values
that evaluate to false in boolean contexts (false, 0, '', null,
undefined, NaN). This is widely used in modern JavaScript and is
part of the official ECMAScript specification terminology. I also
believe it is relevant for Perl.

Codespell currently flags 'falsy' as a misspelling, but this is
incorrect as it's legitimate technical terminology used throughout
our JavaScript codebase and documentation.

Changes:
- Add 'falsy' to codespell exceptions/dictionary
- Allows proper use of JavaScript terminology in code and comments

Test plan:
1. Apply patch
2. Run codespell on files containing 'falsy'
=> SUCCESS: No longer flagged as misspelling
3. Verify 'falsy' usage in JavaScript context works correctly
4. Sign off :-D

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Comment 2 Jonathan Druart 2025-10-06 07:21:50 UTC
Created attachment 187436 [details] [review]
Bug 40950: Add 'falsy' programming idiom to codespell dictionary

The term 'falsy' is a standard JavaScript idiom referring to values
that evaluate to false in boolean contexts (false, 0, '', null,
undefined, NaN). This is widely used in modern JavaScript and is
part of the official ECMAScript specification terminology. I also
believe it is relevant for Perl.

Codespell currently flags 'falsy' as a misspelling, but this is
incorrect as it's legitimate technical terminology used throughout
our JavaScript codebase and documentation.

Changes:
- Add 'falsy' to codespell exceptions/dictionary
- Allows proper use of JavaScript terminology in code and comments

Test plan:
1. Apply patch
2. Run codespell on files containing 'falsy'
=> SUCCESS: No longer flagged as misspelling
3. Verify 'falsy' usage in JavaScript context works correctly
4. Sign off :-D

Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 3 Lucas Gass (lukeg) 2025-10-06 15:17:28 UTC
Nice work everyone!

Pushed to main for 25.11