Project

General

Profile

Code Style Guide » History » Version 14

Sergey Smolov, 01/31/2020 04:34 PM

1 1 Sergey Smolov
h1. Code Style Guide
2
3 9 Sergey Smolov
In Retrascope project we use "Google Java Style Guide":https://google.github.io/styleguide/javaguide.html and "How to Write Doc Comments for the Javadoc Tool":http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html recommendations for Javadoc comments.
4 1 Sergey Smolov
5 12 Sergey Smolov
Also we start every Java class with the following license agreement (substitute "2015" with current year):
6 1 Sergey Smolov
7 5 Sergey Smolov
<pre><code class="java">
8 1 Sergey Smolov
/*
9 4 Andrei Tatarnikov
 * Copyright 2015 ISP RAS (http://www.ispras.ru), UniTESK Lab (http://www.unitesk.com)
10 1 Sergey Smolov
 *
11
 * Licensed under the Apache License, Version 2.0 (the "License");
12
 * you may not use this file except in compliance with the License.
13
 * You may obtain a copy of the License at
14
 *
15
 *     http://www.apache.org/licenses/LICENSE-2.0
16
 *
17
 * Unless required by applicable law or agreed to in writing, software
18
 * distributed under the License is distributed on an "AS IS" BASIS,
19
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
 * See the License for the specific language governing permissions and
21
 * limitations under the License.
22
 */
23 5 Sergey Smolov
</code></pre>
24 1 Sergey Smolov
25
and with the following author data:
26
27 5 Sergey Smolov
<pre><code class="java">
28 1 Sergey Smolov
/**
29
 * Class description.
30
 *
31
 * @author <a href="mailto:ivanov@mail.ru">Ivan Ivanov</a>
32
 */
33 5 Sergey Smolov
</code></pre>
34 13 Sergey Smolov
35
Also we use Gradle "checkstyle":https://docs.gradle.org/current/userguide/checkstyle_plugin.html plugin in the project build script. To check the coding style, run the following command:
36 14 Sergey Smolov
<pre><code class="shell">
37 13 Sergey Smolov
$ ./gradlew checkstyleMain checkstyleTest
38 14 Sergey Smolov
</code></pre>