Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit 639c692

Browse files
Merge pull request #89 from mauricerkelly/readme-updates
Expand and tidy the README
2 parents c667118 + 928eca0 commit 639c692

File tree

1 file changed

+39
-12
lines changed

1 file changed

+39
-12
lines changed

README.md

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This linter plugin for [Linter][linter] provides an interface to elixirc/mix.
44
It will be used with files that have the "source.elixir" syntax
55
(ie. `*.ex; *.exs`).
66

7-
There are limitations with ElixirC that:
7+
There are limitations with Elixirc that:
88

99
- In case of compilation error, it will only show first error
1010
- It does not work with buffers, so linting on fly is disabled
@@ -22,14 +22,14 @@ $ apm install linter-elixirc
2222

2323
### Method 2: In Atom
2424

25-
1. Edit > Preferences (Ctrl+,)
25+
1. Edit > Preferences (Ctrl+, or Cmd+,)
2626
2. Install > Search "linter-elixirc" > Install
2727

2828
## Settings
2929

3030
Plugin should work with default settings. If not:
3131

32-
1. Edit > Preferences (Ctrl+,)
32+
1. Edit > Preferences (Ctrl+, or Cmd+,)
3333

3434
2. Packages > Search "linter-elixirc" > Settings
3535

@@ -44,16 +44,43 @@ Plugin should work with default settings. If not:
4444

4545
## Usage
4646

47-
If you open folder with mix project (`mix.exs` exists in project's root
48-
folder), linter will use `mix compile` to include all dependencies, unless you
49-
enable "Always use elixirc" setting.
47+
The operation of the linter is dependent on the type of Elixir files you are working with:
5048

51-
If you open single file, linter will use `elixirc`. This will try to find
52-
dependencies in a place where mix projects do (\_build/dev/lib/\*/ebin). If
53-
dependency path is different, then every external dependency will trigger
54-
CompileError.
49+
### Mix Projects
5550

56-
Since `*.ex` files are not compiled by `mix compile`, they are always linted
57-
using `elixirc`.
51+
If you open a folder containing a Mix project (i.e. the file `mix.exs` exists
52+
in the root folder of the project), the linter will use `mix compile` to
53+
include all dependencies, unless you enable "Always use elixirc" setting.
54+
55+
### Single .ex Files
56+
57+
If you open a single `.ex` file, the linter will use `elixirc`. This will try
58+
to find dependency build artifacts in the location where Mix projects normally
59+
output to (`\_build/dev/lib/\*/ebin`). If your build output path is different,
60+
then every external dependency will trigger a compile error.
61+
62+
### Elixir Scripts
63+
64+
Since `.exs` files are not compiled by `mix compile`, they are always linted
65+
using `elixirc`, even if they appear within a Mix project.
66+
67+
### ExUnit Test files
68+
69+
ExUnit tests are always organised within `.exs` files, so they will also be
70+
linted using `elixirc`. Test files can have extra dependencies that will not
71+
be found within the normal dev build artifact directory. Instead, test files
72+
are linted using the test build artifact directory (`\_build/test/lib/\*/ebin`).
73+
74+
## Why Do I Still See Dependency Errors?
75+
76+
Whether you're using the Mix or `elixirc` options for linting, it is still
77+
possible to encounter false positive errors in your lint output, particularly
78+
relating to dependencies. It can help to perform a `mix compile` from a
79+
terminal to keep the project build output directory fresh, and a `mix test`
80+
will help if you are seeing particular problems with errors in ExUnit test
81+
files.
82+
83+
Sometimes Mix can get confused when files are renamed, so it can also help
84+
to perform the occasional `mix do clean, compile`.
5885

5986
[linter]: https://github.com/AtomLinter/Linter "Linter"

0 commit comments

Comments
 (0)