Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Documentation: coding style setting with examples #471

Merged
merged 10 commits into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,36 @@ 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.

## Inspiration and Special Thanks

This project would not have been possible without the outstanding work from the following communities:

- [Apache Spark](https://spark.apache.org/): Unified Analytics Engine for Big Data, the engine that
- [Apache Spark](https://spark.apache.org/): Unified Analytics Engine for Big Data, the engine that
Hyperspace builds on top of.
- [Delta Lake](https://delta.io): Delta Lake is an open-source storage layer that brings ACID
transactions to Apache Spark™ and big data workloads. Hyperspace derives quite a bit of inspiration
from the way the Delta Lake community operates and pioneering of some surrounding ideas in the
context of data lakes (e.g., their novel use of optimistic concurrency).
- [Databricks](https://databricks.com/): Unified analytics platform. Many thanks to all the inspiration
- [Delta Lake](https://delta.io): Delta Lake is an open-source storage layer that brings ACID
transactions to Apache Spark™ and big data workloads. Hyperspace derives quite a bit of inspiration
from the way the Delta Lake community operates and pioneering of some surrounding ideas in the
context of data lakes (e.g., their novel use of optimistic concurrency).
- [Databricks](https://databricks.com/): Unified analytics platform. Many thanks to all the inspiration
they have provided us.
- [.NET for Apache Spark™](https://github.com/dotnet/spark): Hyperspace offers .NET bindings for
- [.NET for Apache Spark™](https://github.com/dotnet/spark): Hyperspace offers .NET bindings for
developers, thanks to the efforts of this team in collaborating and releasing the bindings just-in-time.
- [Minimal Mistakes](https://github.com/mmistakes/minimal-mistakes): The awesome theme behind
Hyperspace documentation.
- [Minimal Mistakes](https://github.com/mmistakes/minimal-mistakes): The awesome theme behind
Hyperspace documentation.

## Code of Conduct

Expand Down
Binary file added docs/assets/images/project_structure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/scalafmt_settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion docs/coding-guidelines/scala-coding-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.