Commit Graph

251 Commits

Author SHA1 Message Date
Jon Parise
d3e7d3d5e7 Pass the buffer's filename to Credo
By default, Credo attributes input from STDIN as though it came from a
file named `stdin`. This change passes the buffer's filename, too, so
that Credo can use that information when applying its configuration.

This is a nice improvement because files like `mix.exs` are normally
excluded from Credo-based linting. Previously, ALE would show lint
warnings for those files as they were edited. Now, they are correctly
honor the Credo configuration and don't produce lint output.
2017-02-09 19:24:28 -08:00
w0rp
b0190fd080 Merge pull request #306 from ahmedelgabri/standardjs
Add standard linter
2017-02-09 18:56:40 +00:00
Daniel Lupu
d8efd4fa73 add xo support (#304)
* add xo support

* add documentation

* Fix a screw up when fixing conflicts

* Fix it harder
2017-02-09 18:54:49 +00:00
w0rp
943fe9b4b0 Merge pull request #295 from metakirby5/pr/coffeelint-local
Add support for locally installed coffee and coffeelint
2017-02-09 18:44:52 +00:00
w0rp
f67cf17070 Merge pull request #285 from medains/master
Linter addition of PHP Mess Detector
2017-02-09 18:43:26 +00:00
w0rp
c3ebe7bd9e Cover the Rust handler with some tests 2017-02-07 21:17:10 +00:00
Joshua Rubin
472631573e try fixing go build (#297)
* try fixing go build

* cache some system calls

* fix /dev/null

* use chained commands, use `go test -c` instead of `go tool compile`

* fix some unescaped shell commands

* fix a bug with explicitly setting GOPATH

* implement changes requested in code review. handle errors from multiple files. fix issue when starting a new package

* run `go env` as a job

* ensure all functions return the proper type

* fix loclist line numbers in some cases

* remove multibuffer support for now
2017-02-07 20:36:04 +00:00
w0rp
c0ac393297 #256 Attempt to fix Rust linter issues again 2017-02-07 15:19:37 +00:00
w0rp
da8408501c #256 Attempt to fix Rust linter issues 2017-02-07 15:15:22 +00:00
w0rp
a3b7056cad #289 Only use the --stdin-display-name flag if the flake8 version supports it 2017-02-06 11:12:27 +00:00
w0rp
a9a76241ac Merge pull request #307 from yous/rubocop-comment
Update comments for RuboCop pattern
2017-02-06 09:59:20 +00:00
w0rp
ccf78c40b1 Merge pull request #305 from notkild/master
Fix rust linting with cargo when multiple targets are present
2017-02-06 09:34:27 +00:00
notkild
0143eb6a53 Fix rust linting with cargo when multiple targets are present 2017-02-06 09:21:06 +01:00
Chayoung You
6f40cdca65
Update comments for RuboCop pattern 2017-02-06 15:13:13 +09:00
w0rp
9d85590421 Take the rubocop filename from the buffer number given to the function 2017-02-05 22:32:38 +00:00
w0rp
0a14bbe78d Merge pull request #299 from derekprior/dp-fix-rubocop-again
Fix Rubocop filename handling
2017-02-05 22:31:43 +00:00
Ahmed El Gabri
119695bd08
Add standard linter 2017-02-05 21:19:34 +01:00
w0rp
744d7d789f Merge pull request #294 from tpict/master
Add vint support for Neovim commands
2017-02-05 15:58:15 +00:00
w0rp
d953c68ebb Fix mypy error parsing when column numbers are included. 2017-02-04 19:47:37 +00:00
w0rp
829f87bc6a Fix #124 Finish implementing command chaining, and make it work for DMD 2017-02-04 18:30:30 +00:00
Derek Prior
f2fc7072b9
Fix Rubocop filename handling
In my previous change, I updated the Rubocop linter to pass the filename
to Rubocop. This change was tested on a file I expected Rubocop to
ignore and the experience in vim was as I expected. However, I soon
found that ALE wasn't finding errors in files that should not be
ignored. After investigation, I found a few issues that this commit
fixes:

1. We were not properly passing the current filename. We now use
   `expand` to get the filename.
2. The regular expression used in the callback was expecting the static
   value of `_` for the filename in output. We now use a looser regular
   expression that begins matching on the first `:`.
3. The linter was defined statically. By using the current filename when
   defining the command the linter would always use the filename of the
   first Ruby file the user opened. We now use a `command_callback` to
   inject the proper filename.

I tested these changes on a configuration with included and excluded
files and found it to work as I expected. Apologies for the earlier
incorrect change.
2017-02-03 16:03:52 -05:00
Ethan Chan
69ce8502a4 add support for locally installed coffee 2017-02-02 17:03:26 -08:00
Ethan Chan
1da187a6e5 add support for locally installed coffeelint 2017-02-02 16:56:09 -08:00
tpict
32c8d02d62 Add --enable-neovim flag to vint when appropriate 2017-02-02 19:48:18 +00:00
medains
ff096124c6 Linter addition of PHP Mess Detector 2017-02-01 16:28:51 +00:00
EinfachToll
e8123b3d5e Tell gcc to use C, not C++, when linting C source files
A regression bug introduced with PR #232
Ref #278
2017-02-01 11:22:21 +01:00
Łukasz Jan Niemier
a1458e9c07 Dockerfile linting via hadolint (#282)
* Add hadolint linter for Dockerfiles

* Fix path

* Fix typo

* Update docs
2017-01-30 15:27:26 +00:00
Derek Prior
a82ead0dc1
Enable Rubocop to exclude files based on config
When using `--stdin`, Rubocop requires that you also pass the associated
file name. ALE was previously passing `_` as the filename. By passing
the actual relative path to the file and enabling the
`--force-exclusion` option, we can get Rubocop to respect excluded files
in the configuration.

Closes #197
2017-01-27 16:29:58 -05:00
w0rp
d7ed49f849 Add a script for custom checks to enforce using the abort flag for functions and trailing whitespace, and fix existing issues. 2017-01-22 14:54:57 +00:00
w0rp
e4a4fcd26b Make the Erlang linter code match the style used in the rest of the codebase. Make the options match the new standard. 2017-01-22 13:51:57 +00:00
Magnus
cae153b3ac Add erlc lint for Erlang (#248) (#255)
* Add erlc lint for Erlang (#248)

* Ignore certain errors in Erlang .hrl files (#248)

A .hrl file does not need to have a -module definition. Additionally, it
is common to have unused elements in such a file, as the entities will
be used in a file including the header.

* Address change requests to Erlang linter
2017-01-22 13:42:18 +00:00
w0rp
9820899b9e Improve mypy handling a little bit more 2017-01-20 17:30:34 +00:00
w0rp
ea438be5c1 REVERT "Fix some naming conventions and use abort for all Rust functions, and disable the rust linters for now, re #256"
This reverts commit f412b4f96f.

Conflicts:
	doc/ale.txt
2017-01-19 20:21:54 +00:00
w0rp
2478d7d925 Merge pull request #262 from KenjiTakahashi/fix_swiftlint
Fix SwiftLint
2017-01-19 13:23:46 +00:00
Aswin
d45505e135 Fix using variable g:ale_python_mypy_options that was not defined 2017-01-18 16:01:36 +05:30
KenjiTakahashi
62b492c727 Fix SwiftLint
1. Should be defined for 'swift' files, not 'swiftlint'.
2. Use `--use-stdin` option instead of the stdin-wrapper.
2017-01-17 19:59:45 +01:00
w0rp
41686980fd Document the mypy options, and fix spacing issues, largely in the documentation 2017-01-15 13:20:23 +00:00
w0rp
35bdd6f478 Merge pull request #237 from keith/ks/mypy-linter
Add python mypy support
2017-01-15 13:05:37 +00:00
w0rp
f1ac7c9f73 Rename pylint _args variables to _options variables 2017-01-15 13:05:07 +00:00
w0rp
548ff299f4 Merge pull request #243 from SabatierBoris/master
Add options for pylint linter
2017-01-15 13:02:51 +00:00
Junfeng Li
8762a6fa66 Support C# linting with mono compiler mcs. (#250)
* Support netcore project linting.

* Support check on the fly.

* Remove debug.

* Rename csc.vim to mcs.vim as it should be.

* Update README.

* Update doc.

* Using `=~#` instead of `=~`.
2017-01-15 12:42:17 +00:00
Masahiro H
74e7a283c0 Improve Verilator support (#205) (#258)
* improve-verilator-support

* fix for linter
2017-01-15 12:39:13 +00:00
SABATIER Boris
0a9f9c0811 Add executable and arguments options for pylint linter 2017-01-13 10:59:39 +01:00
w0rp
f412b4f96f Fix some naming conventions and use abort for all Rust functions, and disable the rust linters for now, re #256 2017-01-13 09:23:03 +00:00
w0rp
3b486d3475 Prefix mandatory flake8 arguments with extra spaces so they will always work 2017-01-12 13:11:10 +00:00
w0rp
9191750b5b Fix #175 - Fix the error types for rubocop 2017-01-12 12:57:07 +00:00
EinfachToll
9c5f092b4f Add support for Rust using rustc and cargo (#230)
* Add rustc checker for rust files

* Add documentation for rustc

* Use a nice helper function

* Add cargo as linter

* Complete the doc for rust linters

* Put l: in front of every local variable

* Apply the requested stylistic changes
2017-01-12 09:33:55 +00:00
w0rp
75485d53f6 Merge pull request #245 from zefei/add-eslint-options
Add eslint option to pass in more options
2017-01-12 09:28:06 +00:00
Zefei Xuan
2c176a234e added eslint option to pass in more options 2017-01-05 00:28:32 -08:00
Zefei Xuan
5a0c3fd01e Added hack linter for php (#239)
* added hack linter

* updated docs for hack (hh_client)

* naming
2017-01-04 17:07:21 +00:00
w0rp
ed43b17201 Merge pull request #244 from icgood/fix-perlcritic-typo-exception
Fix typo in perlcritic linter dictionary
2017-01-04 13:10:35 +00:00
w0rp
c9b58136bf Merge pull request #236 from Chronial/patch-1
Pass file name to flake8
2017-01-04 12:57:40 +00:00
Ian Good
c97ad01bcb Fix typo in perlcritic linter dictionary
The linter validation logic was checking for `stdout`, `stderr`, or
`both`, resulting in an exception being thrown when loading the
perlcritic linter.
2017-01-03 14:55:23 -05:00
Keith Smiley
4566bd65c9
Add python mypy support
This adds support for the official optional python typechecker.
2016-12-30 16:12:30 -08:00
Chronial
e0928d0991 Pass file name to flake8 2016-12-30 17:06:49 +01:00
still-dreaming-1
2b251a2cee Fix PHP lint generic error without line number
This makes php output more specific error messages. The format is the normal one ALE expects, but on some systems ALE does not work with PHP unless the display_errors=1 option is used. Without that option php will only output a generic message without a line number like "Errors parsing index.php"
2016-12-28 11:10:47 -07:00
w0rp
fcfd8d5f56 Merge pull request #232 from grzebiel/master
Added ability to reload compilation flags for c and c++
2016-12-26 13:28:43 +00:00
grzebiel
9767fd8732 Added ability to reload compilation flags for c and c++ after loading plugin 2016-12-24 00:18:14 +01:00
Heyward Fann
e46ef0ae19 Redirect go build output to /dev/null
Named file file will be created after ALE, this can redirect the output to /dev/null if go build failed.
2016-12-23 14:56:44 +08:00
dzhou121
55827a9493 add go build for build errors (#180)
* add go build for build errors

* Add go build to doc and README

* Improvement for Go build

Go build works on package level, so copy over the other files
that belong to the same package to the temp folder as well.

* revert back to simple go build

* change gobuild script var name
2016-12-22 12:10:21 +00:00
diartyz
6c0996eb9c [enhancement] add node_modules support for stylelint & htmlhint (#226)
* Add node_modules support for stylelint

* add node_modules support for htmlhint

* fix stdin

* update doc about stylelint & htmlhint
2016-12-22 11:39:01 +00:00
w0rp
771bfe3b18 #193 Fix a parsing error for parsing errors with eslint 2016-12-22 11:16:22 +00:00
Eric Lehner
bda6df61a0 Elm file filter & Windows bug fixes (#223)
* Filters out unrelated errors in Elm linter

The function now filters out errors that are unrelated to the file,
those that were found in imported modules.

It does this by comparing the temp directory environment variable to the
file name in the elm output. If the file begins with the temp directory,
then it sould be included (it's from the buffer).

* Changing output to '/dev/null'

Turns out the compiler only accepts /dev/null as an ignorable name. It's
hard-coded here
https://github.com/elm-lang/elm-make/blob/master/src/Flags.hs

Changing this allows Windows linting to work. Otherwise the compiler
errors when using "nul"

* Fixes for Windows

Should now be able to successfully handle Windows.

Windows seemed to not handle the ";" properly, so I switched it to "&&",
which probably should've been done anyway to prevent false positives.

Oddly, matchend(l:error.file, l:temp_dir), and various other regex
solutions, couldn't properly match the two. Subsetting did though, hence
the new solution.

* Applying corrections

Made the file check case-insensitive for Windows, case-sensitive for
Unix/non-windows.

Added comment explaining hard coding of 'dev/null'

* Spelling correction

* Minor corrections

Actually uses the is_file_buffer variable now, added space between the
if statements, and added space between '-'
2016-12-16 10:41:21 +00:00
w0rp
4ad5c4757c Merge pull request #221 from rob-b/improve-formatting-of-haskell-linters
Improve formatting of ghc and hlint haskell linters
2016-12-14 19:13:19 +00:00
Rob Berry
0ffef758ae Improve formatting of ghc and hlint haskell linters
For ghc, it seemed that the conditional

```
if l:corrected_lines[-1] =~# ': error:$'
    let l:line = substitute(l:line, '\v^\s+', ' ', '')
endif
```

was never being reached. It's actually better to unconditionally
collapse whitespace anyway and so I simply removed the conditional
check.

For hlint I added more information about the error. This changes the
reported error from `Error:` to something like:
` Error: Avoid lambda. Found: \ x -> foo x Why not: foo`
2016-12-14 12:50:14 +00:00
David Mohundro
3418faf054 Add support for Swift with swiftlint (#214)
* Add support for swift with swiftlint

* Fix issue by adding '.swift' file extension
2016-12-13 15:28:20 +00:00
w0rp
88f4598ea2 Fix the proeslint linter for plaintext files 2016-12-13 10:19:19 +00:00
Eric Lehner
70e379cc46 Add Elm linting via elm-make (#213)
* Add support for Elm linting

* Adding documentation for Elm

* Adjusting spacing

* Addressing concerns listed in pull request

Removed the s:FindRootDirectory function as it does not make much sense
in this context. Adjusted the rest of the code to handle the removal of
that function, including using the ale#util function to find the nearest
file.

Ensured that when an empty filepath is found, the code does not attempt
to change directories.

Ensured that the linter would take from stdin using the wrapper.
2016-12-13 09:06:04 +00:00
diartyz
725957de6e add stylelint support 2016-12-06 21:14:14 +08:00
Krystian Paszkiewicz
ff8f3673eb Fix proper extension handling for tslint 2016-12-05 08:42:00 +00:00
Andrew Balmos
35307c0585 LaTeX Linters (#190)
* Add chktex linter

* Alias plaintex to tex

* Add lacheck linter

Closes #179

* Add the chktex warning code

This very useful to have when you want to suppress lint warnings with LaTeX
comments. chktex tends to be a bit noisy so this often needed.

* lacheck: Make regex less specific

To be more robust future changes in `stdin-wrapper`
2016-12-04 22:19:06 +00:00
kyrisu
bbdff82aee Add support for tslint.json file detection in tslint (#198)
* Add support for tslint.json file detection in tslint

* Fix tslint.json path building for tslint
2016-12-04 22:17:22 +00:00
Po Shan Cheah
5636626da1 Add options variable for ruby-rubocop 2016-12-01 12:28:27 -05:00
w0rp
66b183e1ba Fix #188: Revert to and older version of the Haskell linter, which works better 2016-11-28 09:53:07 +00:00
poohzrn
900b4cdff3 Add Proselint (#185)
* Add Proselint
- Markdown
- Tex
- Text

* Use ale#handler#HandleUnixFormatAsWarning

* Indentation
2016-11-28 09:36:11 +00:00
Alexander "Ace" Olofsson
e03df80a09 Add puppet linters (#183)
* Start adding Puppet linters

* Use the correct output stream for puppet parser

* Finish Puppet and puppet-lint linters

* Add Puppet information to documentation
2016-11-25 12:00:07 +00:00
Andrey Popp
f7e6236fe8 Add ocaml linter: merlin (#177)
* Add ocaml linter: merlin

* Add docs for ocaml-merlin integration.

* Remove annoying error message from ocaml merlin linter

* Update doc to list merlin linter
2016-11-23 15:19:36 +00:00
Andrey Popp
d700da8cb8 Flow linter improvements (#176)
* Fix flow linter to provide filename of the buffer

Related #173

* Fix flow linter not to fail on empty response

* Various improvement to message parsing
2016-11-21 09:53:18 +00:00
Marius Gedminas
713a6910d4 Add g:ale_python_flake8_executable (#174)
* Add g:ale_python_flake8_executable

Closes #172.

* Add g:ale_python_flake8_args

* Always add - to flake8 invocations
2016-11-14 17:52:31 +00:00
w0rp
7669550ae2 Merge pull request #170 from mkusher/typescript_typecheck_linter
Add typecheck linter for typescript
2016-11-10 16:20:28 +00:00
Aleh Kashnikau
0a3faa60f7 removed useless echom from typecheck.vim 2016-11-10 18:48:09 +03:00
Aleh Kashnikau
2e5f3899d1 Add typecheck linter for typescript 2016-11-10 18:41:02 +03:00
delianides
8d5353831e
flow linting should only happen on flow typed files. 2016-11-03 15:51:49 -04:00
Edward Larkey
8632e6b4e0 Added support for foodcritic
Adding support the foodcritic linter for Chef files.
Listing all issues as warnings for now
Doesn't get in the way of rubocop linting if ft=ruby.chef
Updated documentation

Closes #127
2016-11-01 15:36:08 -05:00
Zach Perrault
4088347901 Add FlowType support (#157)
* Add `javascript/flow` linter

* Add documentation for flow

* Remove a line from the docs that was from eslint

* Only run if flow gives output; Correct link in doc

* Address PR feedback #157
2016-11-01 09:00:08 +00:00
mshr-h
e3a8829d67 Add support for clang for c 2016-10-31 14:38:13 +09:00
w0rp
629e6a3675 Merge pull request #153 from keith/ks/shellcheck
Choose shell dialect based on vim syntax
2016-10-30 09:24:39 +00:00
w0rp
c4ab4855b7 Merge pull request #155 from deathmaz/feature/htmlhint-args
Added options variable for htmlhint
2016-10-30 09:21:55 +00:00
deathmaz
9a4645fc7f Default stdin in htmlhint options 2016-10-28 12:42:55 +03:00
Keith Smiley
5fc2f8f6c0
Choose shell dialect based on vim syntax
Shellcheck is smart enough to check the shebang in a given file to
determine which dialect to use. Unfortunately this doesn't work for
files without shebangs, even if it might be apparent what dialect should
be used, such as "bashrc" or "foo.bash". Luckily `filetype.vim` defines
specific vars based on which shell dialect is being used based on a huge
list of conditions. With this change we take those into account for all
the types shellcheck supports, otherwise we fallback to letting it try
and decide.
2016-10-27 18:46:58 -07:00
Keith Smiley
86cc2aab71
Add pylint formatter
This customizes the output format of pylint in order to use the same
pep8 parser
2016-10-27 18:38:26 -07:00
deathmaz
5b56103c69 Added optoins variable for htmlhint 2016-10-27 18:31:49 +03:00
w0rp
b9428b7db0 Merge #139 - Add Markdown linting support 2016-10-24 20:40:24 +01:00
Alex Layton
95373ddab5 Add support for mlint, a MATLAB linter (#145)
* Add support for mlint, a MATLAB linter

* Fix mlint linter as requested

* Clean up leftover loaded flag for mlint
2016-10-24 20:32:52 +01:00
w0rp
226b4ed586 Add node_modules support for JSHint, and use the global config as a fallback. 2016-10-23 13:25:50 +01:00
w0rp
36461b69d7 Support loading eslint from node_modules, re issue #118. 2016-10-23 13:04:41 +01:00
Bjorn Neergaard
f49f615ef6
Add support for dot-seperate linters, improve linter tests
This PR first and formost implements support for dot-seperate filetypes,
a very trivial change.

This closes #132

But more importantly, this PR vastly improves the test quality for
`ale#linter#Get`. It enables us to reset the state of ale's internal
linter cache, to facilitate better testing, as well as making use of
mocked linters instead of depending on linters on disk (which may
change). In addition, a dummy linter is defined to test the autoloading
behavior.

Header guards were removed from all linters as:

* A: ale won't try and load linters if they already exist in memory
* B: we can't reset state for testing if they can't be loaded again
2016-10-21 21:02:20 -05:00
w0rp
216eadbcbe Merge pull request #133 from ehzShelter/master
Added c++14 standard support and POSIX API compile time linker flags and ISO c++14 atomic and thread library support…
2016-10-21 18:08:25 +01:00
ehzShelter
1e83489691 make it less verbose for c and cpp 2016-10-21 20:02:20 +06:00
w0rp
5eee70cf37 Merge pull request #129 from neersighted/ansible
Add ansible-lint support and factor out PEP8 handler
2016-10-21 09:21:50 +01:00