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.
* 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
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.
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
* 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
* 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 `=~`.
* 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
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"
* 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
* 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 '-'
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`
* 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.
* 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`
* Start adding Puppet linters
* Use the correct output stream for puppet parser
* Finish Puppet and puppet-lint linters
* Add Puppet information to documentation
* 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
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
* 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
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.
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
* Add Credo linter for Elixir
* Add requested changes
TODO: check if all message types are covered in `if` chain.
* Add information about Credo linter to README
* Add information about Credo linter to doc
* First pass at optimizing ale to autoload
First off, the structure/function names should be revised a bit,
but I will wait for @w0rp's input before unifying the naming style.
Second off, the docs probably need some more work, I just did some
simple find-and-replace work.
With that said, this pull brings major performance gains for ale. On my
slowest system, fully loading ale and all its code takes around 150ms.
I have moved all of ale's autoload-able code to autoload/, and in
addition, implemented lazy-loading of linters. This brings load time on
that same system down to 5ms.
The only downside of lazy loading is that `g:ale_linters` cannot be
changed at runtime; however, it also speeds up performance at runtime by
simplfying the logic greatly.
Please let me know what you think!
Closes#59
* Address Travis/Vint errors
For some reason, ale isn't running vint for me...
* Incorporate feedback, make fixes
Lazy-loading logic is much improved.
* Add header comments; remove incorrect workaround
* Remove unneeded plugin guards
* Fix lazy-loading linter logic
Set the wrong variable....
* Fix capitialization
* Ensure that php linter pattern does not include spaces:
PHP can return errors with extra spaces like the following:
`PHP Parse error: syntax error, unexpected end of file in t.php on line 4`
* Set option locally to buffer
* Rename noErrors variable according to the project's naming convention
* Make the jsonlint pattern a little better
* Implement an option to configure the echoed message, #48
Via `g:ale_echo_msg_format` where:
- `%s` is the error message itself
- `%linter%` is the linter name
- `%severity` is the severity type
e.g
let g:ale_echo_msg_fomat = '[%linter%] [%severity%] %s'
* Add new options for defining the string used for errors in echoed
message
`g:ale_echo_msg_error_str` and `g:ale_echo_msg_warning_str`
* Change text output of some linters
Now that the echoed message can be customized, no need to add the type
to the text variable.
* Update README & documentation file
* Fix some typos
* Sort the table of options alphabetically (except echo_msg_x_str options)
* Added echo warning str option to the doc
* Add c gcc option in the doc
* Add missing tag for eslint option in the doc
* Correct typo in doc (' ' instead of '.')
* add cpp linter
* correct typo in doc
* add filetype information for c++
* Add basic scala support using scalac
* Convert if to a ternary expression
* Better bounds check
* Code formatting
* Mention Scala in the documentation