This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
ale/ale_linters
Alex Wang fc6677d405 Avoid overriding parsed C/C++ -std=* flag
ALE appends flags from {c,cpp}_{clang,gcc}_options after those found by
parsing compile_commands.json or Makefile output. If -std=* flags are
present in both the ALE flags and parsed flags, the last one present
(i.e., ALE's -std=* flag) will determine the mode the compiler works in.
This can result in errors showing up in vim but not in the actual build
or vice-versa.

For example, say you have foo.cpp:

    #include <type_traits>
    int main() {
        return std::is_same_v<float, int>;
    }

If cpp_clang_options contains -std=c++17 and -std=c++14 is parsed from
compile_commands.json, then ALE would end up running something like:

    clang++ -S -x c++ -fsyntax-only -std=c++14 -std=c++17 - < foo.cpp

This would result in no errors showing up in Vim, but the actual build
would fail with:

    <stdin>:3:14: error: no template named 'is_same_v' in namespace 'std'; did you mean 'is_same'?
            return std::is_same_v<float, int>;
                   ~~~~~^~~~~~~~~
                        is_same
    /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/type_traits:872:61: note: 'is_same' declared here
    template <class _Tp, class _Up> struct _LIBCPP_TEMPLATE_VIS is_same           : public false_type {};
                                                                ^
    <stdin>:3:35: error: expected '(' for function-style cast or type construction
            return std::is_same_v<float, int>;
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~^
    2 errors generated.

as the actual build would not have the -std=c++17 flag added by ALE.

If cpp_clang_options contains -std=c++14 and -std=c++17 is parsed from
compile_commands.json, then the opposite problem would occur. ALE would
end up running something like:

    clang++ -S -x c++ -fsyntax-only -std=c++17 -std=c++14 - < foo.cpp

and would show an error on line 3 of foo.cpp:

    [clang] No template named 'is_same_v' in namespace 'std'; did you mean 'is_same'? (fix available)

The actual build, on the other hand, would succeed without any
complaints.

Removing -std=* from ALE's flags if it is already present in the parsed
flags ensures that the wrong -std=* flag is not used.

An alternative would have been to switch the order in which parsed flags
and ALE flags were concatenated when producing the command to execute,
but that could prevent a user from intentionally using ALE's flags to
override some other flags, e.g.  -W* flags to enable/disable warnings in
a project whose flags are not under the developer's control.

-std=* flags are also present in cuda/nvcc.vim, objc/clang.vim,
objcpp/clang.vim, and vhdl/ghdl.vim, but none of those linters appear to
parse compile_commands.json or `make` output.
2020-03-17 22:51:54 -04:00
..
ada #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
ansible #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
apiblueprint Improve ALE project style checking 2018-09-04 16:51:18 +01:00
asciidoc #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
asm Fix #2512 - Use -o /dev/null for gcc linting 2019-05-20 13:00:32 +01:00
awk #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
bib #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
c Avoid overriding parsed C/C++ -std=* flag 2020-03-17 22:51:54 -04:00
chef Adding new linter "cookstyle" for chef recipes (Issue #1187) (#2362) 2019-04-10 18:52:52 +01:00
clojure Add a linter for clojure using clj-kondo (#2377) 2019-04-10 20:59:58 +01:00
cloudformation Make CloudFormation linter work again with latest 2018-06-20 14:59:51 +02:00
cmake #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
coffee #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
cpp Avoid overriding parsed C/C++ -std=* flag 2020-03-17 22:51:54 -04:00
crystal Fix crystal-lang non file-tied message handling 2019-10-11 18:34:09 +02:00
cs Support csc, update mcsc (#2586) 2019-07-02 08:18:17 +01:00
css style: fecs related doc and vim scripts 2019-04-11 16:24:59 +08:00
cucumber #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
cuda #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
cypher Make Cypher linter dynamic 2019-02-06 20:29:58 -02:00
d #2132 - Replace command_chain and chain_with with ale#command#Run 2019-04-07 14:58:06 +01:00
dafny Improve ALE project style checking 2018-09-04 16:51:18 +01:00
dart #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
dockerfile #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
elixir #2132 - Implement feature tests with ale#Has 2019-04-07 15:34:39 +01:00
elm Elm language server params update 2019-09-04 00:20:12 +02:00
erlang Fix bug with detection of the PLT 2019-07-22 09:50:16 -04:00
eruby Move ale#handlers#ruby#EscapeExecutable to ale#ruby#EscapeExecutable 2019-08-13 01:52:13 -04:00
fish Fix #1373 - Fix a bug with Fish errors not being handled on Linux 2018-03-23 12:17:54 +00:00
fortran #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
fountain Add four spaces, not tabs. 2017-12-20 22:53:03 -06:00
fuse #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
gitcommit #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
glsl #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
go Support $GO111MODULE with Go tooling 2019-07-01 11:04:33 -04:00
graphql Fix for incorrect eslint output parsing for graphql files 2019-11-24 15:47:07 -08:00
hack #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
haml #2132 - Implement feature tests with ale#Has 2019-04-07 15:34:39 +01:00
handlebars #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
haskell #1791 Set the working directory for cabal and stack 2019-04-17 14:26:09 +01:00
help Add settings for the Alex linter 2019-02-02 16:20:14 +01:00
html style: fecs related doc and vim scripts 2019-04-11 16:24:59 +08:00
idris #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
ink Add support for ink-language-server 2019-08-07 16:35:12 -05:00
ispc #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
java Add support for javalsp configuration options. 2019-06-19 11:38:23 +09:00
javascript Allow the use of StandardX for StandardJS linting and fixing. 2019-10-21 20:46:54 -04:00
json support jsonlint local executable 2019-03-15 16:21:48 -05:00
julia #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
kotlin Fix #2440 - Fix the kotlinc command when Maven and Gradle are missing 2019-04-15 13:36:03 +01:00
less Remove +x bit from some files that don't need it. 2019-08-13 00:28:31 -04:00
llvm #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
lua #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
mail linter/markdown: adds support for languatool (#2155) 2019-03-09 13:55:54 +00:00
make Improve ALE project style checking 2018-09-04 16:51:18 +01:00
markdown mdl: Use JSON output instead of parsing text 2019-08-18 23:28:32 -04:00
matlab #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
mercury #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
nasm #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
nim Add nimcheck end_col options 2019-11-07 02:44:56 +09:00
nix Add a function for getting matches, and use it to simplify a lot of code 2017-04-18 00:35:53 +01:00
nroff Add settings for the Alex linter 2019-02-02 16:20:14 +01:00
objc Fix #2421 - Use compile_commands.json in build dirs to find roots 2019-05-20 19:57:08 +01:00
objcpp Fix #2421 - Use compile_commands.json in build dirs to find roots 2019-05-20 19:57:08 +01:00
ocaml #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
perl #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
perl6 #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
php Add the possiblity to add extra psalm options 2019-10-07 23:15:01 +02:00
po Add settings for the Alex linter 2019-02-02 16:20:14 +01:00
pod Add settings for the Alex linter 2019-02-02 16:20:14 +01:00
pony #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
powershell Default errorview in pwsh7 now concise 2019-11-09 13:43:00 +10:00
prolog #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
proto #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
pug Close #791 - Handle exceptions for puglint 2019-05-13 21:57:44 +01:00
puppet #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
purescript Add support for purescript language server (#2572) 2019-06-17 12:54:43 +01:00
pyrex #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
python Mypy: try to find folder containing mypy.ini to use as cwd. (#2385) 2020-01-02 14:35:21 +00:00
qml #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
r #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
racket Racket linting using raco (#2146) 2019-01-14 19:45:33 +00:00
reason Document and test reason-language-server 2019-06-09 00:12:11 +01:00
review redpen support for asciidoc, reST, LaTeX and Re:VIEW 2017-11-17 15:34:07 +09:00
rst #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
ruby Fix #2821 - Fix the debride linter after merging older code 2019-10-09 09:53:50 +01:00
rust support all cargo options for build/clippy 2019-06-25 11:22:36 +02:00
sass #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
scala Add linter for Scala Metals 2019-08-31 12:34:57 +08:00
scss #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
sh linter/sh: Improve parsing of error messages in different locales 2019-08-31 15:08:54 +08:00
slim #2132 - Implement feature tests with ale#Has 2019-04-07 15:34:39 +01:00
sml #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
solidity Add support for solc Solidity compiler (#2648) 2019-09-19 19:40:00 +01:00
spec #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
sql Add a function for getting matches, and use it to simplify a lot of code 2017-04-18 00:35:53 +01:00
stylus #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
sugarss #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
swift [lsp] Add Swift / SourceKit-LSP support (#2420) 2019-04-08 16:25:30 +01:00
tcl #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
terraform fix tflint handler for 0.11+ (#2775) 2019-10-07 20:14:22 +01:00
testft Add support for dot-seperate linters, improve linter tests 2016-10-21 21:02:20 -05:00
tex [linter] Add LSP support for LaTeX via texlab 2019-05-13 15:50:03 -03:00
texinfo Add settings for the Alex linter 2019-02-02 16:20:14 +01:00
text linter/markdown: adds support for languatool (#2155) 2019-03-09 13:55:54 +00:00
thrift #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
typescript Allow the use of StandardX for StandardJS linting and fixing. 2019-10-21 20:46:54 -04:00
verilog Correct vint-discovered advisory in vlog handler 2019-10-05 11:25:56 -07:00
vhdl #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
vim #2132 - Replace command_chain and chain_with with ale#command#Run 2019-04-07 14:58:06 +01:00
vue #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
xhtml Add settings for the Alex linter 2019-02-02 16:20:14 +01:00
xml #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
yaml #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
yang #2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00