luckyframework / lucky

A full-featured Crystal web framework that catches bugs for you, runs incredibly fast, and helps you write code that lasts.
https://luckyframework.org
MIT License
2.57k stars 156 forks source link

Code cleaning #1771

Closed jwoertink closed 1 year ago

jwoertink commented 1 year ago

Purpose

Mainly just cleaning up some code, and getting the latest ameba setup

Description

We needed to update to the latest ameba which now takes the stance that .not_nil! shouldn't be used. Also after reading the recent articles about incremental compilation, it got me thinking about return types. I started adding a lot more; however, I skipped quite a few ...

There seems to be some cases where you don't put a return type like initialize, but it also got me thinking on other types like to_s. If the method is technically an override of a higher object / reference, and it doesn't have the return type in the stdlib, should it have it here? Probably not... There's also cases where a method is never intended to use the return value in which case we just say it returns Nil. What's the best way to determine which methods these are?

This can be an ongoing effort... some of these made perfect sense, but there's a few that are "iffy". If any stand out, we can remove it and think about it for later.

jwoertink commented 1 year ago

ok... so ameba now seems to require Crystal 1.5 or later (maybe 1.6?) But also, this issue https://github.com/luckyframework/lucky/issues/1299 seems to have been fixed by using Crystal 1.6 or later. Maybe the next release just makes that the minimum with 1.7 releasing today?