Skip to content

Coding Guidelines

Hongliang Xu edited this page Jul 30, 2018 · 2 revisions

Code formatting

Use Google Java Style in eclipse/idea to format the code.

Dependencies between modules

The dependencies between the modules should be specified in in parent pom.xml.

  • uReplicator-Common provides common classes for other modules. It should not depend on other modules. Other modules can depend on this modules.
  • uReplicator-Manager, uReplicator-Controller, uReplicator-Worker are component level modules and there should be no cross dependency between them except for testing

License header

We use Apache License for the project. Please run mvn license:format command to verify the license header.

Setup

IntelliJ

Nothing to do, just import the project

Eclipse

Install the M2Eclipse plugin: http://eclipse.org/m2e/ or do mvn eclipse:eclipse.

Templates

IntelliJ file templates

You can set file templates in Preferences > Editor > File and Code Templates

Class

/*
* Copyright (C) 2015-2018 Uber Technologies, Inc. ([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*         http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
public class ${NAME} {
}