nus-cs2113-AY2122S2 / forum

3 stars 2 forks source link

Indentation for wrapped line #47

Open jltha opened 2 years ago

jltha commented 2 years ago

Under what circumstances do we have 8 spaces for our wrapped lines, and 4 spaces for other situations?

My team encountered a problem where checkstyle gives an error, saying that indentation should be 12 lines, e.g.

    public void foo() {
        String[] strings = {"a very long statement", 
            "another very long statement",};
    }

is accepted by checkstyle

vs

    public void foo() {
        String[] strings = {"a very long statement", 
                "another very long statement",};
    }

The module website mentions 8 spaces, which was what I originally thought to be correct, until checkstyle gave errors for some code which has wrapped line.

okkhoy commented 2 years ago

Hmmm.. let me check the checkstyle and update.

warrencxw commented 2 years ago

Since it has been 5 days since the issue was last brought up, can I check if there any updates to this @okkhoy? My team is also facing this issue and we would like to know what we should do in this situation, whether to keep to the checkstyle's 4 spacing for now, or to use 8 spaces and modify checkstyle instead.

okkhoy commented 2 years ago

Thanks for reminding; Hmmm... this is an issue due to my miss. I didn't incorporate the fix before publishing the tP repo 😕

In this case: