Skip to content

Commit

Permalink
Merge pull request #49 from halohalospecial/compile3
Browse files Browse the repository at this point in the history
Add `Work Directory` option
  • Loading branch information
halohalospecial authored Jun 29, 2016
2 parents 51cd498 + 0c5502d commit d6c55c9
Show file tree
Hide file tree
Showing 3 changed files with 197 additions and 102 deletions.
51 changes: 41 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,40 @@ Lint your Elm files in Atom with [linter](https://github.com/atom-community/lint
## Installation

1. [Install `elm`](http://elm-lang.org/install).
1. `$ apm install linter`
1. `$ apm install language-elm`
1. `$ apm install linter-elm-make`
1. `$ which elm-make` and set that as your executable path in this installed package's configuration.
1. Install [`linter`](https://github.com/atom-community/linter), [`language-elm`](https://github.com/atom-community/language-elm), and [`linter-elm-make`](https://github.com/atom-community/linter-elm-make) from the Settings view (`Edit` > `Preferences` > `Install`) or by running these from the command line:
```
apm install linter
apm install language-elm
apm install linter-elm-make
```
1. Run `which elm-make` (Unix/Linux) or `where.exe elm-make` (Windows) from the command line and set the result as your executable path in this installed package's configuration.

## Configuration

#### Lint On The Fly
#### `Lint On The Fly`
By default, linting is only done after saving the file. If you want to lint while typing, turn on the `Lint On The Fly` option in the package settings. Also make sure that the `Lint As You Type` option is enabled in the [linter](https://github.com/atom-community/linter) package settings.

#### Always Compile Main
#### `Always Compile Main`
If enabled, the main file(s) will always be compiled instead of the active file. The main file can be set using `Linter Elm Make: Set Main Path`. If not set, the linter will look for `Main.elm` files in the source directories. Take note that if this is enabled, modules unreachable from the main modules will not be linted. Disabled by default.

#### Report Warnings
#### `Report Warnings`
Show `elm-make` warnings. Enabled by default.

#### `Work Directory`
- If this is not blank, the linter will copy the source files from the project directory into this directory and use this as the working directory for `elm-make`. This can be an absolute path or relative to the path of `elm-package.json`.

If `Lint On The Fly` is disabled, this option will prevent the linter from using your project directory's `elm-stuff`. This can be useful if you're using other tools to build your output files.

- If this is blank and `Lint On The Fly` is enabled, the linter will create a temporary directory before running the first linting process for the project. It will then copy the source files from the project directory into the temporary directory. The linter will do all of this again when Atom gets restarted. Setting the value of `Work Directory` will shorten the duration of the first lint after a restart since the linter does not need to create a temporary directory and copy files anymore.

- If this is blank and `Lint On The Fly` is disabled, the linter will use the project directory as the working directory for `elm-make`.

If this option is not blank, a file watcher will watch the project directory for source file changes and synchronize those with the work directory.

IMPORTANT WARNING: If the work directory is inside the project directory and you want to change the value of `Work Directory`, delete the work directory first! Else, the linter will consider the work directory as part of your project.

If this option makes no sense and/or is confusing, just leave it blank. :)

## Quick Fixes

#### `Linter Elm Make: Quick Fix`
Expand All @@ -44,14 +62,27 @@ You may also add something like this in your `keymap.cson`:
'f6': 'core:confirm'
```

## Other Useful Commands
## Useful Commands

#### `Linter Elm Make: Set Main Path`
Sets the main path of the project and saves it to `elm-package.json`.

Example:
```
"linter-elm-make": {
"mainPath": "Todo.elm"
}
```
The main path is only relevant if `Always Compile Main` is enabled. See [above](https://github.com/mybuddymichael/linter-elm-make#always-compile-main).

#### `Linter Elm Make: Clear Project Build Artifacts`
Deletes the `.elmi` and `.elmo` files in your project's build artifacts directory (e.g. elm-stuff/build-artifacts/0.17.0/user/project/1.0.0). This is useful after toggling `Lint On The Fly` and/or `Always Compile Main` to prevent confusing lint results. If using a work directory or temporary directory, the artifact files of that directory will also be deleted.

#### `Linter Elm Make: Toggle Lint On The Fly`

#### `Linter Elm Make: Toggle Always Compile Main`

#### `Linter Elm Make: Clear Project Build Artifacts`
Deletes the `*.elmi` and `*.elmo` files in your project's build artifacts directory (e.g. elm-stuff/build-artifacts/0.17.0/user/project/1.0.0). This is useful after toggling `Lint On The Fly` and/or `Always Compile Main` to prevent confusing lint results.
#### `Linter Elm Make: Toggle Report Warnings`

## Prior Art

Expand Down
Loading

0 comments on commit d6c55c9

Please sign in to comment.