Welcome to TuDB's contributing guide!
Please install the following before walking through the rest of this guide:
- Java 8
- Maven
- Python (required by pre-commit checks)
If you are a developer in China, please modify your Maven configurations in ~/.m2/settings.xml
to add the Aliyun Maven Central mirror:
<settings>
<mirrors>
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>https://maven.aliyun.com/repository/public/</url>
</mirror>
</mirrors>
</settings>
Run the following command to run the test suite: mvn -B clean install test --file pom.xml
.
We run several checks before every commit automatically with pre-commit
. Please install Python (required by pre-commit
)
if it's not pre-installed by your operating system. Then install pre-commit to run
the required checks when you commit your changes.
Once it's installed, run pre-commit install
to install the hooks that will be run automatically when you git commit
your changes. You can also run it via pre-commit run
on your changes or pre-commit run --all
to run the checks on
all files.
If you'd like to uninstall the pre-commit hooks, run pre-commit uninstall
.
To submit a change, please follow the following steps:
- Create a fork and push changes to a branch in your fork.
- Create a pull request from the branch in your fork.
- For Python code, We follows PEP 8 with one exception: lines can be up to 100 characters in length, not 79.
- For Java code, We follows Oracle’s Java code conventions and Scala guidelines below. The latter is preferred.
- For Scala code, We follows the official Scala style guide and Databricks Scala guide. The latter is preferred. To format Scala code, run ./dev/scalafmt prior to submitting a PR.