nus-cs2113-AY2122S2 / forum

3 stars 2 forks source link

Gradle Variable Declaration Usage Distance #53

Open siewyangzhi opened 2 years ago

siewyangzhi commented 2 years ago

Good day, Gradle is given me this error regarding my styling and i dont seem to understand why am i having this error. This is because, per the coding convention, all my declarations are done at the start of the method.

Gradle Error: image

Code: image

okkhoy commented 2 years ago

You are required to declare the variables when needed, not at the beginning of the code block (that is in C, not java). We fall back to the Google style guide for this as it is not explicitly mentioned in our style guide.