galasa-dev / projectmanagement

Project Management repo for Issues and ZenHub
7 stars 3 forks source link

Contribution guidelines need documenting #1867

Open KirbyKatcher opened 1 month ago

KirbyKatcher commented 1 month ago

As a galasa contributor, I want to know what coding standards and best practices are used, so that I can contribute to the same level of standard as other contributors.

Tasks

KirbyKatcher commented 1 month ago

Suggestion for: Instantiating a Gson object

import dev.galasa.framework.spi.utils.GalasaGson;

...

public GalasaGson gson = new GalasaGson();
KirbyKatcher commented 1 month ago

Suggestion for: Indent spacing. The guidelines in the docs above all mention a 2 space indent. I think it is more clear to identify indents using a 4 space indent and would like to suggest we use that instead in all our code.

techcobweb commented 1 month ago

Javadoc comments not always required, even on public methods, if it's obvious what they are doing and to what.

Votes for this please ?

techcobweb commented 1 month ago

Methods should have one return statement. It should always be at the end of the method.

This applies to Java and Golang.

techcobweb commented 1 month ago

For java code, we should agree on a checkstyle file, and then start using that in all projects.

At no point should anyone abritrarily re-format all the code in a file (manually or with a tool). This means we loose track of any blame data that git holds... which can be useful.

@Mark-J-Lawrence has a suggested check-style file. (where is it Mark?)

Mark-J-Lawrence commented 1 month ago

I'm introducing a checkstyle file within the SDV Manager PR currently open: https://github.com/galasa-dev/managers/pull/940/files#diff-35672840481769694ece09fc2f30d4b6dff8e5cd3cf72796a6bd69cfdd88ef4e

(along with PMD, & Spotbugs static analysis, which I highly recommend)

techcobweb commented 1 month ago
techcobweb commented 1 month ago