Skip to content

Development Guidelines

Sebi1006 edited this page Jun 23, 2021 · 3 revisions

Scala Guidelines

In the Zeta API project we use the linter Scalastyle for the Scala language. The following is a fairly simple set of Scala and JavaScript guidelines. The Scalastyle is based on the linter rules.
The documentation can be found on the official page: www.scalastyle.org
All implemented rules and their usage can be found here: Available rules and documentation (V.1.0.0)
All linter rules for this project are configured in /api/scalastyle-config.xml

Usage

You can configure all rules globally and locally. To enable and disable the global linter rules in the project update the attribute "enabled" in the linter rule xml object: enabled=false or enabled=true

For a single code line add a comment to your code line: // scalastyle:ignore <linter-rule-name>

For a whole file (e.g. in tests) add the following comment on top of the page: // scalastyle:off

JavaScript Guidelines

Here you can find coding standards for source code in the JavaScript programming language. Like other programming style guides, the issues covered span not only aesthetic issues of formatting, but other types of conventions or coding standards as well. However, this document focuses primarily on the hard-and-fast rules that we follow universally.

Code Style

In the Zeta API project we use IntelliJ as favoured IDE. Therefore we use our own code style to format the written code.

Load the code style in IntelliJ

Go to: File -> Settings -> Editor -> Code Style -> Scheme

Now click on the gear symbol to import codeStyle.xml to import the scheme.

Detailed instructions can be found here:
https://www.jetbrains.com/help/idea/copying-code-style-settings.html

Note:
It is possible to configure the code style only for the project.
Click on the gear symbol and copy to project.