dense-analysis / dense-analysis/ale
SML linter executes contents of buffer during linting
- Dominant language
- Vim Script
- Stars
- 14k
- Forks
- 1.5k
- Avg merge
- 17h 49m
- Merged PRs (30d)
- 1
Description
## Information
**VIM version**
VIM - Vi IMproved 8.1
Included patches: 1-2269, 3612, 3625, 3669, 3741
Operating System: Ubuntu 20.04
## What went wrong
The SML linters execute the contents of the Vim buffer during linting. This is bad if the code in the buffer causes side effects (e.g. creates or deletes files).
## Reproducing the bug
### smlnj linter
Make sure that there is no SML/NJ CM file in the current directory or in any directory above it.
1. `touch example.txt`
2. `echo 'val () = OS.FileSys.remove "example.txt";' > test.sml`
3. `vim test.sml`
4. Observe that example.txt has been deleted as a side effect of linting.
### smlnj-cm linter
1. `touch example.txt`
2. Create `sources.cm`:
```
Group is
$/basis.cm
test.sml
```
4. Create `test.sml`:
```
structure Test = struct
val () = OS.FileSys.remove "example.txt"
end
```
5. Observe that example.txt has been deleted as a side effect of linting.
@benknoble @jez
Contributor guide
Assessment
This issue has not been assessed yet.