Agilis-Ingenium / api.nubadoo.com

Backend for the Health Tracker App.
0 stars 0 forks source link

Trailing bracket on the data class? #8

Closed Warren-Byron closed 10 months ago

Warren-Byron commented 10 months ago

package ie.setu.domain

data class WorkOutPlan ( var planId: Int, var userId: Int, var planName: String, var schedule: String, var planDate: String )

Warren-Byron commented 10 months ago

POSTED ON SLACK:

Warren Byron 8:22 PM Question: Does the trailing bracket matter - like to put it against the margin - its a code style thing really as it doesn't affect the functionality? For example - look at where the bracket is at the end: data class WorkOutPlan ( var planId: Int, var planName: String, .... ) VS data class WorkOutPlan ( var planId: Int, var planName: String) Seems silly but it confuses me when the closing bracket is not on its own line - but the IDE seems to give me lightbulbs :bulb: !!! (edited)

Siobhan Drohan (SETU Lecturer) 10:08 AM @Warren Byron Have a look at this: https://github.com/pinterest/ktlint. This is a linter for kotlin that has built in rules for formatting kotlin code. It’s (or some similar tool) is what is giving the yellow warning in intellij. You can add custom rules to it (like your preference above). I will be bringing it in on the CI/CD step, as part of the GitHub workflow. (edited) :+1::skin-tone-2: 1