Documentation: coding style setting with examples (#471)

This commit is contained in:
paryoja 2021-06-26 02:30:40 +09:00 коммит произвёл GitHub
Родитель aed6eb6a9b
Коммит 38bd40019e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 22 добавлений и 14 удалений

Просмотреть файл

@ -28,16 +28,17 @@ This repository contains symbolic links which don't work properly on Windows. To
```sh
$ git config --local include.path ../dev/.gitconfig
$ git replace-symlinks # replace symlinks with junctions
$ git restore-symlinks # restore symlinks
$ #git restore-symlinks # use this to restore symlinks if you need
```
### Using IntelliJ
You can use the built-in sbt shell in IntelliJ without any problems. However, the built-in "Build Project" command may not work. To fix the issue, go to Project Structure -> Project Settings -> Modules and follow these steps:
- Mark `src/main/scala` and `src/main/scala-spark2` as "Sources" and `src/test/scala` and `src/test/scala-spark2` as "Tests" for the `spark2_4` module
- Mark `src/main/scala` and `src/main/scala-spark3` as "Sources" and `src/test/scala` and `src/test/scala-spark3` as "Tests" for the `spark3_0` module
- Remove the `root` and `hyperspace-sources` modules
- Mark `src/main/scala` and `src/main/scala-spark2` as "Sources" and `src/test/scala` and `src/test/scala-spark2` as "Tests" for the `spark2_4` module.
- Mark `src/main/scala` and `src/main/scala-spark3` as "Sources" and `src/test/scala` and `src/test/scala-spark3` as "Tests" for the `spark3_0` module.
- Remove the `root` and `hyperspace-sources` modules.
- An example of [Project Structure](./docs/assets/images/project_structure.png)
Additionally, you might have to run `sbt buildInfo` if you encounter an error like `object BuildInfo is not a member of package com.microsoft.hyperspace` for the first build.

Двоичные данные
docs/assets/images/project_structure.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 53 KiB

Двоичные данные
docs/assets/images/scalafmt_settings.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 72 KiB

Просмотреть файл

@ -8,6 +8,13 @@ Scala Coding Style
> Note: Databricks Style Guide will be preferred for conflict resolutions.
* For formatting, [scalafmt](https://scalameta.org/scalafmt) is used with the custom configuration (found in [/dev/.scalafmt.conf](/dev/.scalafmt.conf))
* Installation of `scalafmt` can be found [here](https://scalameta.org/scalafmt/docs/installation.html)
* Set scalafmt as the formatter
* Open Preferences (Settings if you use Windows) > Editor > Code Style > Scala
* Select Scalafmt as the formatter
* Check 'Reformat on file save'
* Select `./dev/.scalafmt.conf` for Configuration
![Setting](../assets/images/scalafmt_settings.png)
* Detailed installation of `scalafmt` can be found [here](https://scalameta.org/scalafmt/docs/installation.html)
* There is also a Scala style check using [scalastyle-config.xml](/scalastyle-config.xml), which is run automatically when you compile your project using `sbt`.