Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jozic/scalafmt-config
Scalafmt configuration file used across several projects
https://github.com/jozic/scalafmt-config
Last synced: about 20 hours ago
JSON representation
Scalafmt configuration file used across several projects
- Host: GitHub
- URL: https://github.com/jozic/scalafmt-config
- Owner: jozic
- License: mit
- Created: 2018-11-23T00:36:18.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-23T05:11:36.000Z (almost 6 years ago)
- Last Synced: 2023-03-14T10:51:40.567Z (over 1 year ago)
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scalafmt-config
[Scalafmt](https://github.com/scalameta/scalafmt) configuration file used across several projects## How To Use
1. In your main project that needs scalafmt config file, add a new submodule
```bash
git submodule add https://github.com/jozic/scalafmt-config.git
```
Please note it uses `https` and not `git` protocol to allow Travis CI (or other tools) to access submodule repo without additional configurations)
2. In your main project setup scalafmt to use config file from submodule
- SBT
- add sbt-scalafmt plugin (if not yet)
```scala
addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "1.6.0-RC4")
```
- set `scalafmtConfig` key to point to the config file from submodule
```scala
scalafmtConfig := Some(root.base / "scalafmt-config/.scalafmt.conf")
```
- Maven
- setup maven plugin accordinly (if not yet) - https://github.com/SimonJPegg/mvn_scalafmt
- set `configLocation` to point to the config file from submodule
```xml
${project.basedir}/scalafmt-config/.scalafmt.conf
```
3. When cloning a fresh copy of main project (or just updating another fork) don't forget to get submodule
```bash
git clone --recursive my-project-that-uses-scalafmt-config-as-submodule-git-url
```
or
```bash
git clone my-project-that-uses-scalafmt-config-as-submodule-git-url
git pull --recurse-submodules
```
4. If you push updates to `.scalafmt.conf`, don't forget to update main project to point to the latest commit of submodule