IncredibleHannes / TPF2-Timetables

The Timetable mod for Transport Fever 2
GNU General Public License v3.0
32 stars 19 forks source link

Add type comments to every methode #12

Closed IncredibleHannes closed 3 years ago

IncredibleHannes commented 3 years ago

In order to make document the code better, we need a documentation of every methods parameter and return type in the style of:

---@param hasTimetable function lineId -> boolean
-- returns [{vehicleID: lineID}]`
Grisu118 commented 3 years ago

I like that, the annotation I added is from EmmyLua https://emmylua.github.io/annotations/class.html

I use VSCode with the following plugin https://marketplace.visualstudio.com/items?itemName=sumneko.lua which supports the annotations

IncredibleHannes commented 3 years ago

Thanks, I added it to my VSCode as well. This inspired me to set up luacheck as a linter, which will be integrated into the build process with #15