@@ -4,7 +4,7 @@ This linter plugin for [Linter][linter] provides an interface to elixirc/mix.
4
4
It will be used with files that have the "source.elixir" syntax
5
5
(ie. ` *.ex; *.exs ` ).
6
6
7
- There are limitations with ElixirC that:
7
+ There are limitations with Elixirc that:
8
8
9
9
- In case of compilation error, it will only show first error
10
10
- It does not work with buffers, so linting on fly is disabled
@@ -22,14 +22,14 @@ $ apm install linter-elixirc
22
22
23
23
### Method 2: In Atom
24
24
25
- 1 . Edit > Preferences (Ctrl+,)
25
+ 1 . Edit > Preferences (Ctrl+, or Cmd+, )
26
26
2 . Install > Search "linter-elixirc" > Install
27
27
28
28
## Settings
29
29
30
30
Plugin should work with default settings. If not:
31
31
32
- 1 . Edit > Preferences (Ctrl+,)
32
+ 1 . Edit > Preferences (Ctrl+, or Cmd+, )
33
33
34
34
2 . Packages > Search "linter-elixirc" > Settings
35
35
@@ -44,16 +44,43 @@ Plugin should work with default settings. If not:
44
44
45
45
## Usage
46
46
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:
50
48
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
55
50
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 ` .
58
85
59
86
[ linter ] : https://github.com/AtomLinter/Linter " Linter "
0 commit comments