Bug 40950 - Don't forbid 'falsy' in codespell
Summary: Don't forbid 'falsy' in codespell
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor
Assignee: Tomás Cohen Arazi (tcohen)
QA Contact: Testopia
URL:
Keywords:
Depends on: 38201
Blocks:
  Show dependency treegraph
 
Reported: 2025-10-03 15:08 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2025-10-06 15:17 UTC (History)
4 users (show)

See Also:
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:


Attachments
Bug 40950: Add 'falsy' programming idiom to codespell dictionary (2.13 KB, patch)
2025-10-03 15:15 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 40950: Add 'falsy' programming idiom to codespell dictionary (2.20 KB, patch)
2025-10-06 07:21 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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