Issue 18 continuance to add update functionality for properly sorted input and src files
It looks like issue 18 got shelved after a partial implementation so I thought I'd pick it up and give a go at finishing it out. I've done some foundational work and wanted to get your notes/feedback before I got too deep into it, tho by my estimation I'm approaching the half way done point.
The update command implementation has loads of foundational work done, many functions that will be called by the glint update command as well as a warning emitted when a user runs gleam run run n if legacy non 0 padded filenames are detected.
As per our discussion, I went with the update scanning and updating the entire project instead of passing a year based flag, for example. Since users will only have 2 release cycles with this update functionality I wanted to make sure that we hit as many subdirs as possible so people aren't dusting their projects off after a 1-2 year hiatus and being met with errors.
I went with a 'safe, non destructive' path to ensure no accidental 'destructive' operations. The gleam run update command will only generate a dry-run report, and encourage the user to use an --apply flag with the command to commit the destructive operation that will rename all legacy files to 0 padded.
I need some guidance on how to handle finding both a legacy and a modern file for the same day/year. i.e. input/2015/1.txt AND input/2015/01.txt It seems like ignoring may be the way to go, but a warning to refactor the legacy copy to something 0 padded may be useful.
I tried to isolate as much of this soon to be deprecated code away from the core codebase for easy removal.
You can see my claude.md for many more design decisions and obviously any deltas you want to see in the existing work or the plan in claude.md will be respected.
I look forward to your notes!
I have the massive bulk of this work done. I'm still holding off on the list.reverse refactor because I'm hoping you can provide more detail on how to soften the very heavy refactor requested to save a single small list.reverse. Though I guess if someone has done all 11 years in gleam the list could get kinda chonki. :thinking: I'm going to push all the other changes up now, and waiting for your feedback on the list.reverse before I pull all the tests out and privatize the vast majority of that module. (so my refactors don't cause any regressions)