Skip to content

Commit 2c5a398

Browse files
Mill, SBT and Scalafix docs added
1 parent 5dcbd7b commit 2c5a398

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

docs/docs/contributing/tools/mill.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Here's an example of how to test a project that uses mill:
2+
3+
```bash
4+
mill utest.jvm[2.12.8].test
5+
```
6+
7+
- `utest.jvm` - the name of the compiled module (obtain from `build.sc`)
8+
- `2.12.8` – Scala cross-compile version
9+
- `test` – task to run on the module specified with the specified Scala version
10+
11+
To get mill of the most recent version, first, find it in https://github.com/lihaoyi/mill/releases (e.g. `0.4.2-1-020e28`). Copy the download link and substitute it in the following command instead of `https://github.com/lihaoyi/mill/releases/download/0.4.1/0.4.1`:
12+
13+
```
14+
# From http://www.lihaoyi.com/mill/
15+
sudo sh -c '(echo "#!/usr/bin/env sh" && curl -L https://github.com/lihaoyi/mill/releases/download/0.4.1/0.4.1) > /usr/local/bin/mill && chmod +x /usr/local/bin/mill'
16+
```

docs/docs/contributing/tools/sbt.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SBT Commands Cheat Sheet
2+
The basics of working with Dotty codebase are documented [here](http://dotty.epfl.ch/docs/contributing/getting-started.html) and [here](http://dotty.epfl.ch/docs/contributing/workflow.html). Below is a cheat sheet of some frequently used commands (to be used from SBT console – `sbt`).
3+
4+
5+
| Command | Description |
6+
|------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|
7+
| `dotc ../issues/Playground.scala` | Compile the given file – path relative to the Dotty directory. Output the compiled class files to the Dotty directory itself. |
8+
| `dotr Playground` | Run the compiled class `Playground`. Dotty directory is on classpath by default. |
9+
| `repl` | Start REPL |
10+
| `testOnly dotty.tools.dotc.CompilationTests -- *pos` | Run test (method) `pos` from `CompilationTests` suite. |
11+
| `testCompilation sample` | In all test suites, run test files containing the word `sample` in their title. |
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Working with Scalafix
2+
3+
First, create a new rule as follows (command from https://scalacenter.github.io/scalafix/docs/developers/setup.html):
4+
5+
```bash
6+
sbt new scalacenter/scalafix.g8 --repo="Repository Name"
7+
```
8+
9+
To run the rule against some codebase:
10+
11+
```bash
12+
scalafix -r file:scalafix/rules/src/main/scala/fix/YourRule.scala your/code/base/
13+
```
14+
15+
Where `YourRule.scala` is the rule you developed and `your/code/base` is the code base you are running the rule against.

0 commit comments

Comments
 (0)