Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 06-02-2025, 01:39 AM   #1
lcosmin
Junior Member
lcosmin began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jun 2025
Device: Kobo Libra Color
Add type hints to the codebase?

What's the take on adding type hints to the codebase?

I noticed they're lacking (at least in the parts I looked over) and I was thinking of adding them (in small, incremental changes, of course), as they can be very benefic in detecting various bugs.

But I wanted to confirm first that this is something wanted, so that I don't wase time in vain.
lcosmin is offline   Reply With Quote
Old 06-02-2025, 11:25 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,251
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You are welcome to work on it if you feel like it, IME they are not worth the bother for a codebase as large and complex and mature and, dare I say it, as bug free as calibre. They will catch no more than 10% of real bugs for what is quite a large effort.

That said as long as your PRs come in a size that is reasonable to review and dont change any actual code, only add annotations, I will be willing to merge. But be aware this is a million line codebase. So unless you are willing to commit a few man months possibly a man year to it, you wont get anywhere useful.

I would suggest you identify some subsystem and work on making that type check first. go subsystem by subsystem
kovidgoyal is offline   Reply With Quote
Advert
Old 06-02-2025, 04:38 PM   #3
lcosmin
Junior Member
lcosmin began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jun 2025
Device: Kobo Libra Color
After going through many lines of code, I'm starting to agree that adding type hints is not worth the time.

Not that they're not useful, but the codebase would rather benefit from more serious modernization (e.g. cleanup, refactoring) than just type hints. And that's quite a big effort.
lcosmin is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add Type of File Column and file location csmall Library Management 6 04-07-2023 05:11 PM
[File Type Plugin] Automatically Add Covers to .djvu Files on Import hazel.noelle Plugins 4 01-07-2023 07:33 AM
Nova Pro doesn't work with type C - type C cables selmerry Onyx Boox 0 02-05-2020 07:41 AM
File Type Plugins and Add Format tools BetterRed Calibre 6 10-04-2019 07:35 AM
Automatic Adding Add file type to ignore list toomuchreading Calibre 5 01-14-2015 06:44 PM


All times are GMT -4. The time now is 09:03 PM.


MobileRead.com is a privately owned, operated and funded community.