### _Why are the changes needed?_ Guidelines for Document and Code Contributions. - code style - documentation style - quick starts - sphinx-copybutton for copy button in code blocks - add kind:minor,help wanted,good first issue to doc issue template ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [x] Add screenshots for manual tests if appropriate <img width="1325" alt="image" src="https://user-images.githubusercontent.com/8326978/234193368-473e2a1d-2deb-4d91-901a-19cea58a489b.png"> - [x] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request Closes #4768 from yaooqinn/guide. Closes #4768 3a0bd395b [Kent Yao] Update docs/contributing/doc/build.rst 8fe4f6d14 [Kent Yao] Update docs/contributing/doc/build.rst a753bdde5 [Kent Yao] Guidelines for Document and Code contributions f8393fe8d [Kent Yao] Guidelines for Document and Code contributions 8f2d3ce82 [Kent Yao] Guidelines for Document and Code contributions 4f3a2128b [Kent Yao] Guidelines for Document and Code contributions Authored-by: Kent Yao <yao@apache.org> Signed-off-by: Cheng Pan <chengpan@apache.org>
3.9 KiB
IntelliJ IDEA Setup Guide
Copyright Profile
Every file needs to include the Apache license as a header. This can be automated in IntelliJ by adding a Copyright profile:
-
Go to "Settings/Preferences" → "Editor" → "Copyright" → "Copyright Profiles".
-
Add a new profile and name it "Apache".
-
Add the following text as the copyright text:
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. -
Go to "Editor" → "Copyright" and choose the "Apache" profile as the default profile for this project.
-
Click "Apply".
Required Plugins
Go to "Settings/Preferences" → "Plugins" and select the "Marketplace" tab. Search for the following plugins, install them, and restart the IDE if prompted:
You will also need to install the google-java-format plugin. However, a specific version of this plugin is required. Download google-java-format v1.7.0.6 and install it as follows. Make sure to NEVER update this plugin.
- Go to "Settings/Preferences" → "Plugins".
- Click the gear icon and select "Install Plugin from Disk".
- Navigate to the downloaded ZIP file and select it.
Formatter For Java
Kyuubi uses Spotless together with google-java-format to format the Java code.
It is recommended to automatically format your code by applying the following settings:
- Go to "Settings/Preferences" → "Other Settings" → "google-java-format Settings".
- Tick the checkbox to enable the plugin.
- Change the code style to "Default Google Java style".
- Go to "Settings/Preferences" → "Tools" → "Actions on Save".
- Select "Reformat code".
If you use the IDEA version is 2021.1 and below, please replace the above steps 4 and 5 by using the Save Actions plugin.
Formatter For Scala
Enable Scalafmt as follows:
- Go to "Settings/Preferences" → "Editor" → "Code Style" → "Scala"
- Set "Formatter" to "Scalafmt"
- Enable "Reformat on file save"
Checkstyle For Scala
Enable Scalastyle as follows:
- Go to "Settings/Preferences" → "Editor" → "Inspections".
- Search for "Scala style inspection" and enable it.