mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 21:24:33 +08:00
Compare commits
885 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80ab12c7b6 | ||
|
|
ce91972c94 | ||
|
|
168768b326 | ||
|
|
8b46fa3ee7 | ||
|
|
22e7a6f6c2 | ||
|
|
1ba1a9ef0e | ||
|
|
fea666bd27 | ||
|
|
730752523b | ||
|
|
d9bad6c0b8 | ||
|
|
b41eecd31b | ||
|
|
e84c9b300b | ||
|
|
efa95e2657 | ||
|
|
56641e0230 | ||
|
|
507f164a09 | ||
|
|
92d515c211 | ||
|
|
59829bc194 | ||
|
|
d9931b9891 | ||
|
|
3aa58ca179 | ||
|
|
5826b4927c | ||
|
|
6eb68b4507 | ||
|
|
3c799abb44 | ||
|
|
3b8fb39b4a | ||
|
|
7b78f2b846 | ||
|
|
e7317e05ea | ||
|
|
381fff0e4c | ||
|
|
5ce97f8cdb | ||
|
|
42a1fc2d29 | ||
|
|
bb7481effb | ||
|
|
7d4a83ecd4 | ||
|
|
eb6015c6fd | ||
|
|
4496c9b3c1 | ||
|
|
4129c356e8 | ||
|
|
c6a5cbb3c7 | ||
|
|
a76f056bd9 | ||
|
|
a730a6d5d5 | ||
|
|
79d1b99067 | ||
|
|
135de34d22 | ||
|
|
5542db1507 | ||
|
|
3321685940 | ||
|
|
7053d468cc | ||
|
|
27146ade32 | ||
|
|
4f02edc3f8 | ||
|
|
166435dbf1 | ||
|
|
ca0cdd26fc | ||
|
|
6b819dd74a | ||
|
|
90b1ea230d | ||
|
|
67d7caee30 | ||
|
|
bc0abc3b96 | ||
|
|
181bc69c8c | ||
|
|
47ad24c221 | ||
|
|
8d8b295ef5 | ||
|
|
bb08b81bf7 | ||
|
|
36c35d840b | ||
|
|
88fa0b9294 | ||
|
|
1a9b8a58c7 | ||
|
|
33b4a90507 | ||
|
|
85b3a4a5c6 | ||
|
|
092748caac | ||
|
|
2f13c2d263 | ||
|
|
b41836130c | ||
|
|
5a8ba75265 | ||
|
|
67d49c75a8 | ||
|
|
0427ee84b4 | ||
|
|
f6ae056d02 | ||
|
|
3e3801e81e | ||
|
|
89db85121c | ||
|
|
26e5948617 | ||
|
|
42f5e8c62c | ||
|
|
28819eedd3 | ||
|
|
937138dad4 | ||
|
|
143af2b9fd | ||
|
|
781bf1502f | ||
|
|
5e64acc6ab | ||
|
|
4ee28d3129 | ||
|
|
9d908ecc66 | ||
|
|
3b7c86e401 | ||
|
|
57736cdccc | ||
|
|
57b9d8bc0e | ||
|
|
652d991077 | ||
|
|
e6745a3811 | ||
|
|
e5ea809094 | ||
|
|
8cb6d043b4 | ||
|
|
8c76b88392 | ||
|
|
975cc7af8f | ||
|
|
d0f2a0ae94 | ||
|
|
9b89ec3d86 | ||
|
|
4234d39d87 | ||
|
|
381fe1badf | ||
|
|
07b596efb5 | ||
|
|
70604828fa | ||
|
|
ab7e5b264f | ||
|
|
c88ebc5e70 | ||
|
|
42cbff29f8 | ||
|
|
bf17bbf898 | ||
|
|
aa047b5ba3 | ||
|
|
6b919e88be | ||
|
|
bfc79bd2aa | ||
|
|
fb6fd80bd2 | ||
|
|
7943bfab96 | ||
|
|
3303f596e5 | ||
|
|
df90725c85 | ||
|
|
edd3114394 | ||
|
|
f0152bca98 | ||
|
|
afa20d96ca | ||
|
|
79e42fed14 | ||
|
|
f444abdfe6 | ||
|
|
722c3e8dae | ||
|
|
bff3d253e9 | ||
|
|
77c5802fc7 | ||
|
|
a223253f35 | ||
|
|
d390abd721 | ||
|
|
53db52e713 | ||
|
|
63abd2dfef | ||
|
|
5f64f8dc57 | ||
|
|
c10da0e390 | ||
|
|
548ee56f40 | ||
|
|
e6ba936a0c | ||
|
|
7f0954b89e | ||
|
|
c6aae3bcfc | ||
|
|
4c6f67a3d0 | ||
|
|
5d65f93033 | ||
|
|
eae124e8ce | ||
|
|
114198e082 | ||
|
|
2f3bce5a1d | ||
|
|
b34274ab10 | ||
|
|
69b7ec1c4c | ||
|
|
737ed31de5 | ||
|
|
46c743a247 | ||
|
|
01331266a8 | ||
|
|
ce0b14979e | ||
|
|
893ac34cca | ||
|
|
c36f3e78e4 | ||
|
|
2303b05baa | ||
|
|
fcc2c3ba71 | ||
|
|
2eb68f6d23 | ||
|
|
104980e40b | ||
|
|
5bbce34605 | ||
|
|
9e95032b30 | ||
|
|
59f8c35a2f | ||
|
|
24d277384c | ||
|
|
3a010f68b8 | ||
|
|
23a8208498 | ||
|
|
7f31065fce | ||
|
|
61c1ddd904 | ||
|
|
99361b2ca9 | ||
|
|
495bce32e9 | ||
|
|
f0f0cc3c18 | ||
|
|
784d1a9a62 | ||
|
|
6428162f79 | ||
|
|
2ed53108c4 | ||
|
|
751838621a | ||
|
|
d7395906ba | ||
|
|
fb7099d440 | ||
|
|
df806c511c | ||
|
|
4b6691f602 | ||
|
|
d4841cedf2 | ||
|
|
c820089c44 | ||
|
|
f02e2ec54c | ||
|
|
4813165614 | ||
|
|
16b43a5708 | ||
|
|
2ef3f9806c | ||
|
|
2e8c8085a6 | ||
|
|
042b351b7a | ||
|
|
81423701b0 | ||
|
|
abcefe7a6e | ||
|
|
864d0861e4 | ||
|
|
9a0ece1ecb | ||
|
|
6d14dc0ac0 | ||
|
|
02af53b8b0 | ||
|
|
ce64e349cd | ||
|
|
e85eb82401 | ||
|
|
3bebcb5d48 | ||
|
|
cdf89f8269 | ||
|
|
8c31e2f04a | ||
|
|
435a072181 | ||
|
|
5be6a2b4e0 | ||
|
|
669aeb2c9d | ||
|
|
e3080e2c1b | ||
|
|
cfffdab856 | ||
|
|
1dbba6849f | ||
|
|
2f1d1b7826 | ||
|
|
5fe45f3219 | ||
|
|
6a29641872 | ||
|
|
89273b65b8 | ||
|
|
3eb6d7b3db | ||
|
|
e1e8f0dae1 | ||
|
|
000c37e775 | ||
|
|
442d672d8a | ||
|
|
a92627e1e1 | ||
|
|
32c8bd1fa4 | ||
|
|
8768a309b8 | ||
|
|
ad998211f8 | ||
|
|
8ec9615400 | ||
|
|
a3a052b55a | ||
|
|
1427a090df | ||
|
|
dfff73795a | ||
|
|
80ef7ea2d0 | ||
|
|
67ea571659 | ||
|
|
5f03bae41c | ||
|
|
b0fac47060 | ||
|
|
365ffae6c4 | ||
|
|
f0da35b958 | ||
|
|
a22ab78dd7 | ||
|
|
a6012d853c | ||
|
|
d9a12348d0 | ||
|
|
03384a5d6f | ||
|
|
a5cf7e854b | ||
|
|
8a0213f1fd | ||
|
|
c6a6a37931 | ||
|
|
7eae06d3f3 | ||
|
|
fd31987f23 | ||
|
|
413529f603 | ||
|
|
be2c0c3af5 | ||
|
|
5505f2323d | ||
|
|
6aef52f026 | ||
|
|
cf883aa5a8 | ||
|
|
e5746d9a83 | ||
|
|
4fc27f099b | ||
|
|
32dbf5942e | ||
|
|
163f0ab06e | ||
|
|
26460a77a7 | ||
|
|
c4328f2a31 | ||
|
|
37a1d24a36 | ||
|
|
38009b8e58 | ||
|
|
70a9176de0 | ||
|
|
89e5491862 | ||
|
|
883978ece9 | ||
|
|
f53b25d256 | ||
|
|
f8aeb5c5a4 | ||
|
|
ffa45fa3fb | ||
|
|
a8b987a1c3 | ||
|
|
8012e5b60f | ||
|
|
707a42167f | ||
|
|
09cbd70d9b | ||
|
|
b8cecca8c8 | ||
|
|
fefc093e70 | ||
|
|
90457fdb6b | ||
|
|
52c2400786 | ||
|
|
3300b1aca7 | ||
|
|
c3d4e0983b | ||
|
|
5b6df0a85f | ||
|
|
1a69c9c88c | ||
|
|
0d10653a7c | ||
|
|
89039187da | ||
|
|
7487ecb957 | ||
|
|
3140abcd0c | ||
|
|
3050a132b5 | ||
|
|
21a8b9f1e3 | ||
|
|
1ee56713b8 | ||
|
|
e88243687a | ||
|
|
f1bf795b8b | ||
|
|
690b1a5bb1 | ||
|
|
926ad47a49 | ||
|
|
a6caa85a58 | ||
|
|
bf196ba17c | ||
|
|
df9bee88f6 | ||
|
|
aca1edb476 | ||
|
|
6ebe24b5ff | ||
|
|
752e6f0ab9 | ||
|
|
5dbac4ab9c | ||
|
|
b235e08b3c | ||
|
|
a0d4eb3699 | ||
|
|
82b15fb706 | ||
|
|
7a48750610 | ||
|
|
d072d2654c | ||
|
|
a24f0b4d5f | ||
|
|
422908a572 | ||
|
|
ba6f08f3d4 | ||
|
|
3ba7d02708 | ||
|
|
1fb0de2a8e | ||
|
|
d21581016e | ||
|
|
800d029b46 | ||
|
|
b32fdfe816 | ||
|
|
19cc724807 | ||
|
|
2885c57e3e | ||
|
|
5ce1e9b0b4 | ||
|
|
0b9c0c2200 | ||
|
|
b47a0c9519 | ||
|
|
c0c634c5ec | ||
|
|
81c73da3b9 | ||
|
|
3e11cbd18d | ||
|
|
70b95f16c3 | ||
|
|
9f63bec12c | ||
|
|
7ce481c8f6 | ||
|
|
a4ed9a1c35 | ||
|
|
37daedafed | ||
|
|
626572a539 | ||
|
|
771581a945 | ||
|
|
4d426bf287 | ||
|
|
de29ff26ff | ||
|
|
067601e9db | ||
|
|
17a2f554e3 | ||
|
|
08d3523962 | ||
|
|
3c38fdb1bb | ||
|
|
a7b3b84899 | ||
|
|
03b25dd39b | ||
|
|
79135dfe13 | ||
|
|
d7ced31fe2 | ||
|
|
e46c17e8ef | ||
|
|
f03370e183 | ||
|
|
d882c434a1 | ||
|
|
3ac12b6939 | ||
|
|
dd995d9aa9 | ||
|
|
6288c8b08e | ||
|
|
b8bf7b220d | ||
|
|
91c1fc3bb3 | ||
|
|
20b9dfdb4a | ||
|
|
6e9040da75 | ||
|
|
0a9dc7b4ba | ||
|
|
6543d0e902 | ||
|
|
a47deeae40 | ||
|
|
452460b8cd | ||
|
|
cf14d0aa53 | ||
|
|
0a5de2b42b | ||
|
|
6fc016ad05 | ||
|
|
766636e0c4 | ||
|
|
a6de3f3727 | ||
|
|
eec8b9da60 | ||
|
|
8037f472ef | ||
|
|
e273f678ff | ||
|
|
f12d312aa4 | ||
|
|
d0284f22ea | ||
|
|
a4932679b5 | ||
|
|
bcf63eea96 | ||
|
|
37107df6f3 | ||
|
|
c2e4b553d0 | ||
|
|
e960e54eca | ||
|
|
2e85eed756 | ||
|
|
bffb26cb72 | ||
|
|
f2db164268 | ||
|
|
bd1e639681 | ||
|
|
9c0c6efbd0 | ||
|
|
d6d6fcf928 | ||
|
|
8b0879212f | ||
|
|
cdc3bc9238 | ||
|
|
08affaad7a | ||
|
|
d1fc084b2d | ||
|
|
6efa37d35b | ||
|
|
86af4be0d0 | ||
|
|
a50e049e74 | ||
|
|
d09e8bc99e | ||
|
|
c0b2090fbb | ||
|
|
7f176390fc | ||
|
|
56b7dca623 | ||
|
|
cbaa7eb3c7 | ||
|
|
6644563949 | ||
|
|
d8a53cc7a5 | ||
|
|
fabebb3a47 | ||
|
|
721183116e | ||
|
|
7e7447bb93 | ||
|
|
4bbb10b46a | ||
|
|
4f72023e16 | ||
|
|
f23811770a | ||
|
|
84475ff6f1 | ||
|
|
b1b05e6e66 | ||
|
|
9bcf8a2336 | ||
|
|
1d7acad891 | ||
|
|
0fcd5e79a9 | ||
|
|
cb0a5c7a36 | ||
|
|
5bbe77101d | ||
|
|
4f3190daa8 | ||
|
|
3b96ab43fb | ||
|
|
1f21eb0c42 | ||
|
|
4a11a6337e | ||
|
|
ba38688dff | ||
|
|
bbf02d837e | ||
|
|
08606b88d0 | ||
|
|
7919db0db5 | ||
|
|
1b264b8662 | ||
|
|
78724f4cd3 | ||
|
|
a1654cfb58 | ||
|
|
5f613a5fd6 | ||
|
|
1d87c844b0 | ||
|
|
5792bd6e29 | ||
|
|
f534db1ef9 | ||
|
|
24fda01a0e | ||
|
|
e5f33c6598 | ||
|
|
f7c4c403eb | ||
|
|
8550fa6059 | ||
|
|
3ec20a730d | ||
|
|
c499825a0b | ||
|
|
48057407ec | ||
|
|
4bf260e953 | ||
|
|
63e76875d5 | ||
|
|
1c9ad77866 | ||
|
|
6619e1ac53 | ||
|
|
73ca1e7191 | ||
|
|
5345a5dd81 | ||
|
|
73a204dd00 | ||
|
|
c19f2aa302 | ||
|
|
f1ed654ca5 | ||
|
|
0e3778e335 | ||
|
|
e55d07cf6f | ||
|
|
9a3be907ea | ||
|
|
ebab81b220 | ||
|
|
13060a3492 | ||
|
|
38d25fc7c0 | ||
|
|
5052eca5cb | ||
|
|
2cfa09e02d | ||
|
|
c899ff3523 | ||
|
|
39c892eff4 | ||
|
|
a6a8c90126 | ||
|
|
c7292ce892 | ||
|
|
57a04701c3 | ||
|
|
cbc029b2b8 | ||
|
|
9226e13b31 | ||
|
|
3db564f774 | ||
|
|
fdd37acc1f | ||
|
|
2760cf7018 | ||
|
|
dc61d46e28 | ||
|
|
3346b200bf | ||
|
|
92668b6beb | ||
|
|
b4bcbfcc3b | ||
|
|
f4af9157e1 | ||
|
|
0d14380d8a | ||
|
|
f2b353fa09 | ||
|
|
6f32f002e7 | ||
|
|
9eda079e02 | ||
|
|
146769c616 | ||
|
|
9e97a6914e | ||
|
|
1d4f985538 | ||
|
|
8176f79fa1 | ||
|
|
d2b0ae8108 | ||
|
|
ef641dda80 | ||
|
|
fcd5e18a99 | ||
|
|
121ecf9262 | ||
|
|
0a384a49d3 | ||
|
|
7e28a61fac | ||
|
|
44512bb8af | ||
|
|
51b6fa4aa2 | ||
|
|
6746cb3333 | ||
|
|
d18511f322 | ||
|
|
2ab64514d0 | ||
|
|
a0baeec591 | ||
|
|
9481f307fb | ||
|
|
ff0bd14efe | ||
|
|
66212966dd | ||
|
|
a05a16b109 | ||
|
|
e74d43fb25 | ||
|
|
1c89495d77 | ||
|
|
4b4b09593b | ||
|
|
d90673ab5b | ||
|
|
1b779fbc08 | ||
|
|
f538bb440a | ||
|
|
1b3fa9828c | ||
|
|
c25582076c | ||
|
|
531868f759 | ||
|
|
7c73901199 | ||
|
|
dd7b2188ab | ||
|
|
f64f9aba16 | ||
|
|
3948638dbe | ||
|
|
d045de2618 | ||
|
|
1f4dbb82ec | ||
|
|
9e8f2b0840 | ||
|
|
0b4507ed56 | ||
|
|
d30da203b9 | ||
|
|
7dd460303d | ||
|
|
d1d5292178 | ||
|
|
b96105bebb | ||
|
|
6858b4a259 | ||
|
|
90f2875f29 | ||
|
|
f8d3ffb60e | ||
|
|
e4faf82cab | ||
|
|
8e24a1a916 | ||
|
|
5d6b4ef73f | ||
|
|
ba9b056a57 | ||
|
|
3ec09f7826 | ||
|
|
f58a5cba05 | ||
|
|
ed8104b6ab | ||
|
|
dd7501ee48 | ||
|
|
ad98cb7448 | ||
|
|
51341fbe36 | ||
|
|
25068de91d | ||
|
|
c41dbe2ba9 | ||
|
|
945dd2fa26 | ||
|
|
b9fb62a4cd | ||
|
|
b25794e81b | ||
|
|
acdc99b94d | ||
|
|
88d328739f | ||
|
|
9171791646 | ||
|
|
71bb62c858 | ||
|
|
6aab3fe209 | ||
|
|
93180239b9 | ||
|
|
fa036ca72c | ||
|
|
e3ca8831ea | ||
|
|
f34c089685 | ||
|
|
4bee0f1743 | ||
|
|
4b841b5586 | ||
|
|
5f206d900e | ||
|
|
6212c22b5a | ||
|
|
4ef2c81e95 | ||
|
|
2ac9e2a29e | ||
|
|
b5a7593577 | ||
|
|
20e4e3f9db | ||
|
|
39fd7a0961 | ||
|
|
cdda96154e | ||
|
|
73f9f3da23 | ||
|
|
f01611464a | ||
|
|
f75848b32c | ||
|
|
be02ba4ed7 | ||
|
|
709788084f | ||
|
|
ef7b4af917 | ||
|
|
cae40e1c34 | ||
|
|
caac5c93d6 | ||
|
|
2846e86217 | ||
|
|
9dbebf1cb3 | ||
|
|
70ea7a1338 | ||
|
|
4c14e6a5fd | ||
|
|
70f2873699 | ||
|
|
90048ac933 | ||
|
|
7af33637e8 | ||
|
|
34318aedf4 | ||
|
|
3d74a4f8a6 | ||
|
|
b7e0321890 | ||
|
|
86c035466b | ||
|
|
6c8e2f73f8 | ||
|
|
adc914a675 | ||
|
|
aa0203320b | ||
|
|
77aacf0c91 | ||
|
|
9c3daf3a66 | ||
|
|
320c74ce1a | ||
|
|
3e65e85178 | ||
|
|
02c0d5bcb9 | ||
|
|
9bdd5771ef | ||
|
|
b3829d043d | ||
|
|
68b5591299 | ||
|
|
3ba9cad878 | ||
|
|
395cabc22a | ||
|
|
90695c5082 | ||
|
|
e94a594e2e | ||
|
|
d14db50c44 | ||
|
|
f4395f5b8c | ||
|
|
bc3ccd6e04 | ||
|
|
2ea83939a5 | ||
|
|
0261dd2f51 | ||
|
|
2000436dfd | ||
|
|
eae3f70e75 | ||
|
|
f57ad883f2 | ||
|
|
7fa0d3dcc4 | ||
|
|
0ed07a9ef5 | ||
|
|
3bda132988 | ||
|
|
b8359c1114 | ||
|
|
3b38a83ae9 | ||
|
|
be21aa5cda | ||
|
|
d999eb1f35 | ||
|
|
cc1aece1e0 | ||
|
|
b7ec11c93d | ||
|
|
12409fa73d | ||
|
|
e5b5ce9f51 | ||
|
|
7eae781291 | ||
|
|
87986520d6 | ||
|
|
3dd2d9dedd | ||
|
|
bf1ac8e822 | ||
|
|
ea49cc759f | ||
|
|
adad9a21ab | ||
|
|
e984497ec9 | ||
|
|
607750eb02 | ||
|
|
ab3646862c | ||
|
|
5960a9ae4b | ||
|
|
04ed87c882 | ||
|
|
2b2e766dc6 | ||
|
|
eae8ffafb8 | ||
|
|
2a56475cf7 | ||
|
|
a8915d885b | ||
|
|
a26b3319a1 | ||
|
|
8891b7c349 | ||
|
|
fd0467f992 | ||
|
|
947360f714 | ||
|
|
17676f6a6d | ||
|
|
626e47f5c9 | ||
|
|
58ceb21cbc | ||
|
|
56658fd3ad | ||
|
|
143c3cd09f | ||
|
|
8e7e810db6 | ||
|
|
aa5c82b171 | ||
|
|
560749cf9e | ||
|
|
1900b76005 | ||
|
|
a59f5776fa | ||
|
|
169a6e26b2 | ||
|
|
e82bcdb8a6 | ||
|
|
a6c6e24d61 | ||
|
|
9d50a06d48 | ||
|
|
d50e603177 | ||
|
|
b278927102 | ||
|
|
6bbbb9456c | ||
|
|
e5b920e387 | ||
|
|
993f02ad80 | ||
|
|
213a901ccd | ||
|
|
4025030d86 | ||
|
|
532686102e | ||
|
|
bd32b7c856 | ||
|
|
d84fcf6c3c | ||
|
|
3c067941f1 | ||
|
|
f09e6d638f | ||
|
|
ddb3e6d57a | ||
|
|
cbf0568061 | ||
|
|
a4a4bba884 | ||
|
|
f9e99d81a4 | ||
|
|
1a13963f0d | ||
|
|
0b163ec656 | ||
|
|
b7fcec4d17 | ||
|
|
fba4cfeae9 | ||
|
|
87743faf2a | ||
|
|
24e26b419a | ||
|
|
dbe9352935 | ||
|
|
56e67c5811 | ||
|
|
21ac9bdcaf | ||
|
|
f1f2a22228 | ||
|
|
9bbea8b830 | ||
|
|
a55b8d10b0 | ||
|
|
0868cb769d | ||
|
|
7f1c411b5e | ||
|
|
b01470cbbc | ||
|
|
5c86ffd321 | ||
|
|
43d7e8fde9 | ||
|
|
f380d8508e | ||
|
|
c48106f484 | ||
|
|
96e25d471c | ||
|
|
5901e1a879 | ||
|
|
9e09b7ca35 | ||
|
|
b4513fc4b0 | ||
|
|
78af99c256 | ||
|
|
44070d8a45 | ||
|
|
99e9417ef9 | ||
|
|
bfba216e61 | ||
|
|
f00435e356 | ||
|
|
150015d0dc | ||
|
|
8bbf1425bf | ||
|
|
f516cac47c | ||
|
|
169e4b67d3 | ||
|
|
6e7b7b23e5 | ||
|
|
97ed25a8bf | ||
|
|
0948dcc435 | ||
|
|
395aba19c3 | ||
|
|
b3adf241c3 | ||
|
|
91bb948b90 | ||
|
|
a97ef49c51 | ||
|
|
6e4dccc0e0 | ||
|
|
0ae4ea23c8 | ||
|
|
68ac4d1095 | ||
|
|
f64f0bb48c | ||
|
|
df72c5f1c1 | ||
|
|
9ba2d209a8 | ||
|
|
e0fe97e0a8 | ||
|
|
7b62a15739 | ||
|
|
580bd36773 | ||
|
|
7086769289 | ||
|
|
f1d5bcbf98 | ||
|
|
f8beaa9e3e | ||
|
|
a9333c2866 | ||
|
|
0ed4a5bbcc | ||
|
|
044c762c85 | ||
|
|
d476578a40 | ||
|
|
8f2e1c393f | ||
|
|
43b04d4e5b | ||
|
|
87f125ddcf | ||
|
|
24486fa628 | ||
|
|
fddbfdef12 | ||
|
|
a746ea2bfc | ||
|
|
c1f0956d9b | ||
|
|
3d016f1697 | ||
|
|
8e3bf10592 | ||
|
|
8bf5d144ed | ||
|
|
244c5a8ce5 | ||
|
|
ea01cc708b | ||
|
|
ed26ddc09c | ||
|
|
ee3142b601 | ||
|
|
79f02fce69 | ||
|
|
d4ce201cc2 | ||
|
|
cc5ad6491f | ||
|
|
09e43ab16b | ||
|
|
339930ad68 | ||
|
|
b6112aedc3 | ||
|
|
6212d9a515 | ||
|
|
192f211a0e | ||
|
|
aef11cc0d2 | ||
|
|
1980245b94 | ||
|
|
261c29c3d0 | ||
|
|
228aee71a5 | ||
|
|
b7169c33e7 | ||
|
|
aa015ec4db | ||
|
|
3c85c7ef65 | ||
|
|
adc038f327 | ||
|
|
c4eca7c417 | ||
|
|
c253fb72e3 | ||
|
|
9d7c48038c | ||
|
|
08d141edfb | ||
|
|
1f26fc4013 | ||
|
|
f526fc68d1 | ||
|
|
3afff5a24c | ||
|
|
707b539969 | ||
|
|
2600524274 | ||
|
|
81d0eccfab | ||
|
|
7c10249c52 | ||
|
|
c2f7b379ee | ||
|
|
774c02552f | ||
|
|
aba4160553 | ||
|
|
795122a042 | ||
|
|
18ec66bd21 | ||
|
|
935a132d8f | ||
|
|
b78ee18898 | ||
|
|
4cd20b821f | ||
|
|
a366d325a7 | ||
|
|
f82ab76833 | ||
|
|
61a0716837 | ||
|
|
02fdfcda58 | ||
|
|
ad8b260519 | ||
|
|
faaa11567a | ||
|
|
88ffdb4736 | ||
|
|
4923d48d53 | ||
|
|
764da48c57 | ||
|
|
c467db3ed9 | ||
|
|
484a70f0c0 | ||
|
|
9cdd8b67b2 | ||
|
|
5323f000aa | ||
|
|
04b25c8ee2 | ||
|
|
4179177830 | ||
|
|
a034364994 | ||
|
|
cc114e2d0a | ||
|
|
a88a6d5285 | ||
|
|
c898d5d130 | ||
|
|
db003a4361 | ||
|
|
6167f75628 | ||
|
|
a56e801567 | ||
|
|
e9086dd55c | ||
|
|
63c66dc5d2 | ||
|
|
634bf73f52 | ||
|
|
0702e4699e | ||
|
|
cc84c19451 | ||
|
|
fc94fd4deb | ||
|
|
8faa11752c | ||
|
|
7179f92e44 | ||
|
|
1a4456cf2a | ||
|
|
8a9b28daf9 | ||
|
|
6f2d868baf | ||
|
|
023ade872e | ||
|
|
212e3b0b2f | ||
|
|
5f5540c574 | ||
|
|
5ed99734bd | ||
|
|
03973c0d09 | ||
|
|
fa30d90221 | ||
|
|
d0e3302253 | ||
|
|
209cd54783 | ||
|
|
fefb8efff8 | ||
|
|
41178425ab | ||
|
|
73d8c3b80a | ||
|
|
65880fec78 | ||
|
|
217284360d | ||
|
|
e3c81911d6 | ||
|
|
9ef266d050 | ||
|
|
a728f074f7 | ||
|
|
94270402cb | ||
|
|
ccbdfcd76f | ||
|
|
de6cd961a8 | ||
|
|
6b3086237a | ||
|
|
cb8ad9fbd8 | ||
|
|
e6bd4373f9 | ||
|
|
649934230b | ||
|
|
5ff4e27e17 | ||
|
|
238201805d | ||
|
|
5f024eda09 | ||
|
|
04362c746d | ||
|
|
e722841fa3 | ||
|
|
2768bf15ba | ||
|
|
589c8dbd94 | ||
|
|
2ac9e454d6 | ||
|
|
3aa5e0f9dc | ||
|
|
c1fee3f23a | ||
|
|
9a389b564c | ||
|
|
3e8ae65278 | ||
|
|
ab5e44249d | ||
|
|
399a0d3c98 | ||
|
|
16d0c52d24 | ||
|
|
1e6b1d9be2 | ||
|
|
ac4bac8ea4 | ||
|
|
a7b8cb4fe3 | ||
|
|
daab1a08db | ||
|
|
f8e61ff907 | ||
|
|
eb38c4b3f1 | ||
|
|
c2cfe2326d | ||
|
|
8517e901ff | ||
|
|
79ffdde267 | ||
|
|
c52fffcd47 | ||
|
|
845e588b71 | ||
|
|
0012c78b02 | ||
|
|
4ed35f7247 | ||
|
|
c4cb1c7050 | ||
|
|
c57b031876 | ||
|
|
06132954b1 | ||
|
|
9f8c37e17c | ||
|
|
4446cf15be | ||
|
|
3418574770 | ||
|
|
d368f090ae | ||
|
|
95be2bf1ff | ||
|
|
d7d54d09da | ||
|
|
338c233710 | ||
|
|
9ade656661 | ||
|
|
44397dd6db | ||
|
|
2a861dfd40 | ||
|
|
d9579dbbe9 | ||
|
|
11339ca730 | ||
|
|
e3749c4a75 | ||
|
|
f6d18a0b10 | ||
|
|
7bf3a749d0 | ||
|
|
3e4db9ed5c | ||
|
|
0e71e8b465 | ||
|
|
846bfb47b2 | ||
|
|
81a8c77d20 | ||
|
|
9c849da8c4 | ||
|
|
9b4963847d | ||
|
|
6dc737cda1 | ||
|
|
899b61c5cc | ||
|
|
f937b98e27 | ||
|
|
baa44bb3a7 | ||
|
|
8980591937 | ||
|
|
8062d6207e | ||
|
|
6c10be8992 | ||
|
|
014c924630 | ||
|
|
04fbea6e80 | ||
|
|
0d37aaac7a | ||
|
|
ac6bc6d0ae | ||
|
|
ad986a8d82 | ||
|
|
e8bea510df | ||
|
|
61a5880747 | ||
|
|
324838adae | ||
|
|
27f1915745 | ||
|
|
dfa38ff0dd | ||
|
|
0da4c6e4ad | ||
|
|
0c4606651f | ||
|
|
5453e0e1a4 | ||
|
|
7952ebe77e | ||
|
|
a01fab2ee6 | ||
|
|
37df1f8ceb | ||
|
|
aa54c10bae | ||
|
|
2a081e81db | ||
|
|
f235c4b3b9 | ||
|
|
8b707b4cdc | ||
|
|
b413e03b69 | ||
|
|
dbf051e62b | ||
|
|
f369aa65a2 | ||
|
|
fcd62342d5 | ||
|
|
6e1a5d4189 | ||
|
|
b2e2bbd042 | ||
|
|
d9e12cb047 | ||
|
|
d3ed1e52ba | ||
|
|
72f002de94 | ||
|
|
8141ced0d0 | ||
|
|
5df735555c | ||
|
|
a42999a639 | ||
|
|
976c048e6e | ||
|
|
870e75eb64 | ||
|
|
5155a35a80 | ||
|
|
a782e06223 | ||
|
|
6d6cd6663e | ||
|
|
021f59b3f4 | ||
|
|
d22b9bf1a6 | ||
|
|
ac0abc7c1f | ||
|
|
6ef31073dd | ||
|
|
0de3d24338 | ||
|
|
c9a6b04dc7 | ||
|
|
c1a2aa27f3 | ||
|
|
4999ad7e78 | ||
|
|
344e0fec97 | ||
|
|
6b20c906b3 | ||
|
|
eda3878a6c | ||
|
|
cb8643ce74 | ||
|
|
1e9b36cdbf | ||
|
|
0dd356aa52 | ||
|
|
d5b4f6f7e7 | ||
|
|
da692b2e2d | ||
|
|
f78db619d4 | ||
|
|
9ca133feb0 | ||
|
|
f002c2c9f0 | ||
|
|
fd42e8e935 | ||
|
|
d49daeb816 | ||
|
|
b8591e1034 | ||
|
|
6dc69b2144 | ||
|
|
14025c725f | ||
|
|
13a8f9c061 | ||
|
|
3251d95a91 | ||
|
|
42ae06a288 | ||
|
|
9ddf1b6a05 | ||
|
|
00a3859304 | ||
|
|
ca7fa31c61 | ||
|
|
cf174d3b9b |
2
CONTRIBUTING.md → .github/CONTRIBUTING.md
vendored
2
CONTRIBUTING.md → .github/CONTRIBUTING.md
vendored
@@ -3,7 +3,7 @@
|
|||||||
Have fun, and work on whatever floats your boat. Take It Easy :tm:.
|
Have fun, and work on whatever floats your boat. Take It Easy :tm:.
|
||||||
|
|
||||||
For help with contributing to ALE, see `:help ale-development` in Vim, or view
|
For help with contributing to ALE, see `:help ale-development` in Vim, or view
|
||||||
the help file online [here](/w0rp/ale/blob/master/doc/ale-development.txt).
|
the help file online [here](/doc/ale-development.txt).
|
||||||
|
|
||||||
## Creating Issues
|
## Creating Issues
|
||||||
|
|
||||||
17
.github/ISSUE_TEMPLATE/report-a-bug.md
vendored
17
.github/ISSUE_TEMPLATE/report-a-bug.md
vendored
@@ -23,14 +23,13 @@ about: Report a bug with ALE.
|
|||||||
|
|
||||||
Operating System: <!-- Describe your operating system version. -->
|
Operating System: <!-- Describe your operating system version. -->
|
||||||
|
|
||||||
### :ALEInfo
|
|
||||||
|
|
||||||
<!-- Paste the output of :ALEInfo here. Try :ALEInfoToClipboard -->
|
|
||||||
<!-- Make sure to run :ALEInfo from the buffer where the bug occurred. -->
|
|
||||||
|
|
||||||
## What went wrong
|
## What went wrong
|
||||||
|
|
||||||
<!-- Describe what went wrong here. -->
|
<!-- Describe what went wrong here. Be specific. -->
|
||||||
|
|
||||||
|
Something went wrong in specifically this place, and I also searched through both open and closed issues for the same problem before reporting a bug here.
|
||||||
|
|
||||||
|
Are you having trouble configuring ALE? Try asking for help on [Stack Exchange](https://vi.stackexchange.com/) or perhaps on [Reddit](https://www.reddit.com/r/vim/) instead. The GitHub issue tracker should be used for reporting bugs or asking for new features.
|
||||||
|
|
||||||
## Reproducing the bug
|
## Reproducing the bug
|
||||||
|
|
||||||
@@ -38,3 +37,9 @@ Operating System: <!-- Describe your operating system version. -->
|
|||||||
|
|
||||||
1. I did this.
|
1. I did this.
|
||||||
2. Then this happened.
|
2. Then this happened.
|
||||||
|
|
||||||
|
### :ALEInfo
|
||||||
|
|
||||||
|
<!-- Paste the output of :ALEInfo here. Try :ALEInfoToClipboard -->
|
||||||
|
<!-- Make sure to run :ALEInfo from the buffer where the bug occurred. -->
|
||||||
|
<!-- Read the output. You might figure out what went wrong yourself. -->
|
||||||
|
|||||||
13
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
13
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<!--
|
||||||
|
Before creating a pull request, do the following.
|
||||||
|
|
||||||
|
* Read the Contributing guide linked above first.
|
||||||
|
* Read the documentation that comes with ALE with `:help ale-dev`.
|
||||||
|
|
||||||
|
Have fun!
|
||||||
|
-->
|
||||||
|
|
||||||
|
Where are the tests? Have you added tests? Have you updated the tests? Read the
|
||||||
|
comment above and the documentation referenced in it first. Write tests!
|
||||||
|
|
||||||
|
Seriously, read `:help ale-dev` and write tests.
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,6 +1,10 @@
|
|||||||
!.editorconfig
|
!.editorconfig
|
||||||
*.obj
|
*.obj
|
||||||
|
# Ignore all hidden files everywhere.
|
||||||
|
# Use `git add -f` to add hidden files.
|
||||||
.*
|
.*
|
||||||
|
__pycache__
|
||||||
|
*.pyc
|
||||||
/doc/tags
|
/doc/tags
|
||||||
/init.vim
|
/init.vim
|
||||||
/test/ale-info-test-file
|
/test/ale-info-test-file
|
||||||
|
|||||||
@@ -3,5 +3,10 @@ sudo: required
|
|||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
language: generic
|
language: generic
|
||||||
|
env:
|
||||||
|
- OPTIONS=--vim-80-only
|
||||||
|
- OPTIONS=--vim-81-only
|
||||||
|
- OPTIONS=--neovim-only
|
||||||
|
- OPTIONS=--linters-only
|
||||||
script: |
|
script: |
|
||||||
./run-tests -v
|
./run-tests -v $OPTIONS
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
FROM tweekmonster/vim-testbed:latest
|
FROM tweekmonster/vim-testbed:latest
|
||||||
|
|
||||||
RUN install_vim -tag v8.0.0027 -build \
|
RUN install_vim -tag v8.0.0027 -build \
|
||||||
|
-tag v8.1.0519 -build \
|
||||||
-tag neovim:v0.2.0 -build \
|
-tag neovim:v0.2.0 -build \
|
||||||
-tag neovim:v0.3.0 -build
|
-tag neovim:v0.3.5 -build
|
||||||
|
|
||||||
ENV PACKAGES="\
|
ENV PACKAGES="\
|
||||||
bash \
|
bash \
|
||||||
|
|||||||
2
LICENSE
2
LICENSE
@@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2016-2018, w0rp <devw0rp@gmail.com>
|
Copyright (c) 2016-2019, w0rp <devw0rp@gmail.com>
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
<!--
|
|
||||||
Before creating a pull request, do the following.
|
|
||||||
|
|
||||||
* Read the Contributing guide linked above first.
|
|
||||||
* Read the documentation that comes with ALE with `:help ale-development`.
|
|
||||||
|
|
||||||
Have fun!
|
|
||||||
-->
|
|
||||||
304
README.md
304
README.md
@@ -1,12 +1,13 @@
|
|||||||
# Asynchronous Lint Engine [](https://travis-ci.org/w0rp/ale) [](https://ci.appveyor.com/project/w0rp/ale)
|
# Asynchronous Lint Engine [](https://travis-ci.com/w0rp/ale) [](https://ci.appveyor.com/project/w0rp/ale) [](https://gitter.im/vim-ale/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
ALE (Asynchronous Lint Engine) is a plugin for providing linting in NeoVim
|
ALE (Asynchronous Lint Engine) is a plugin providing linting (syntax checking
|
||||||
0.2.0+ and Vim 8 while you edit your text files.
|
and semantic errors) in NeoVim 0.2.0+ and Vim 8 while you edit your text files,
|
||||||
|
and acts as a Vim [Language Server Protocol](https://langserver.org/) client.
|
||||||
|
|
||||||

|
<img src="https://user-images.githubusercontent.com/3518142/59195938-3a81b100-8b85-11e9-8e8d-6a601b1db908.gif" alt="A linting example with the darkspectrum color scheme in GVim." title="A linting example with the darkspectrum color scheme in GVim.">
|
||||||
|
|
||||||
ALE makes use of NeoVim and Vim 8 job control functions and timers to
|
ALE makes use of NeoVim and Vim 8 job control functions and timers to
|
||||||
run linters on the contents of text buffers and return errors as
|
run linters on the contents of text buffers and return errors as
|
||||||
@@ -25,14 +26,18 @@ features, including:
|
|||||||
|
|
||||||
* Diagnostics (via Language Server Protocol linters)
|
* Diagnostics (via Language Server Protocol linters)
|
||||||
* Go To Definition (`:ALEGoToDefinition`)
|
* Go To Definition (`:ALEGoToDefinition`)
|
||||||
* Completion (`let g:ale_completion_enabled = 1`)
|
* Completion (Built in completion support, or with Deoplete)
|
||||||
* Finding references (`:ALEFindReferences`)
|
* Finding references (`:ALEFindReferences`)
|
||||||
* Hover information (`:ALEHover`)
|
* Hover information (`:ALEHover`)
|
||||||
|
* Symbol search (`:ALESymbolSearch`)
|
||||||
|
|
||||||
If you don't care about Language Server Protocol, ALE won't load any of the code
|
If you don't care about Language Server Protocol, ALE won't load any of the code
|
||||||
for working with it unless needed. One of ALE's general missions is that you
|
for working with it unless needed. One of ALE's general missions is that you
|
||||||
won't pay for the features that you don't use.
|
won't pay for the features that you don't use.
|
||||||
|
|
||||||
|
If you enjoy this plugin, feel free to contribute or check out the author's
|
||||||
|
other content at [w0rp.com](https://w0rp.com).
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
1. [Supported Languages and Tools](#supported-languages)
|
1. [Supported Languages and Tools](#supported-languages)
|
||||||
@@ -43,10 +48,12 @@ won't pay for the features that you don't use.
|
|||||||
4. [Go To Definition](#usage-go-to-definition)
|
4. [Go To Definition](#usage-go-to-definition)
|
||||||
5. [Find References](#usage-find-references)
|
5. [Find References](#usage-find-references)
|
||||||
6. [Hovering](#usage-hover)
|
6. [Hovering](#usage-hover)
|
||||||
|
7. [Symbol Search](#usage-symbol-search)
|
||||||
3. [Installation](#installation)
|
3. [Installation](#installation)
|
||||||
1. [Installation with Vim package management](#standard-installation)
|
1. [Installation with Vim package management](#standard-installation)
|
||||||
2. [Installation with Pathogen](#installation-with-pathogen)
|
2. [Installation with Pathogen](#installation-with-pathogen)
|
||||||
3. [Installation with Vundle](#installation-with-vundle)
|
3. [Installation with Vundle](#installation-with-vundle)
|
||||||
|
4. [Installation with Vim-Plug](#installation-with-vim-plug)
|
||||||
4. [Contributing](#contributing)
|
4. [Contributing](#contributing)
|
||||||
5. [FAQ](#faq)
|
5. [FAQ](#faq)
|
||||||
1. [How do I disable particular linters?](#faq-disable-linters)
|
1. [How do I disable particular linters?](#faq-disable-linters)
|
||||||
@@ -61,134 +68,20 @@ won't pay for the features that you don't use.
|
|||||||
10. [How can I run linters only when I save files?](#faq-lint-on-save)
|
10. [How can I run linters only when I save files?](#faq-lint-on-save)
|
||||||
11. [How can I use the quickfix list instead of the loclist?](#faq-quickfix)
|
11. [How can I use the quickfix list instead of the loclist?](#faq-quickfix)
|
||||||
12. [How can I check JSX files with both stylelint and eslint?](#faq-jsx-stylelint-eslint)
|
12. [How can I check JSX files with both stylelint and eslint?](#faq-jsx-stylelint-eslint)
|
||||||
13. [Will this plugin eat all of my laptop battery power?](#faq-my-battery-is-sad)
|
13. [How can I check Vue files with ESLint?](#faq-vue-eslint)
|
||||||
14. [How can I configure my C or C++ project?](#faq-c-configuration)
|
14. [Will this plugin eat all of my laptop battery power?](#faq-my-battery-is-sad)
|
||||||
15. [How can I configure ALE differently for different buffers?](#faq-buffer-configuration)
|
15. [How can I configure my C or C++ project?](#faq-c-configuration)
|
||||||
16. [How can I configure the height of the list in which ALE displays errors?](#faq-list-window-height)
|
16. [How can I configure ALE differently for different buffers?](#faq-buffer-configuration)
|
||||||
|
17. [How can I configure the height of the list in which ALE displays errors?](#faq-list-window-height)
|
||||||
|
18. [How can I see what ALE has configured for the current file?](#faq-get-info)
|
||||||
|
|
||||||
<a name="supported-languages"></a>
|
<a name="supported-languages"></a>
|
||||||
|
|
||||||
## 1. Supported Languages and Tools
|
## 1. Supported Languages and Tools
|
||||||
|
|
||||||
This plugin supports the following languages and tools. All available
|
ALE supports a wide variety of languages and tools. See the
|
||||||
tools will be run in combination, so they can be complementary.
|
[full list](supported-tools.md) in the
|
||||||
|
[Supported Languages and Tools](supported-tools.md) page.
|
||||||
<!--
|
|
||||||
Keep the table rows sorted alphabetically by the language name,
|
|
||||||
and the tools in the tools column sorted alphabetically by the tool
|
|
||||||
name. That seems to be the fairest way to arrange this table.
|
|
||||||
|
|
||||||
Remember to also update doc/ale.txt, which has a similar list with different
|
|
||||||
formatting.
|
|
||||||
-->
|
|
||||||
|
|
||||||
**Notes:**
|
|
||||||
|
|
||||||
* *^ No linters for text or Vim help filetypes are enabled by default.*
|
|
||||||
* *!! These linters check only files on disk. See `:help ale-lint-file-linters`*
|
|
||||||
|
|
||||||
| Language | Tools |
|
|
||||||
| -------- | ----- |
|
|
||||||
| ASM | [gcc](https://gcc.gnu.org) |
|
|
||||||
| Ansible | [ansible-lint](https://github.com/willthames/ansible-lint) |
|
|
||||||
| API Blueprint | [drafter](https://github.com/apiaryio/drafter) |
|
|
||||||
| AsciiDoc | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [write-good](https://github.com/btford/write-good) |
|
|
||||||
| Awk | [gawk](https://www.gnu.org/software/gawk/)|
|
|
||||||
| Bash | [language-server](https://github.com/mads-hartmann/bash-language-server), shell [-n flag](https://www.gnu.org/software/bash/manual/bash.html#index-set), [shellcheck](https://www.shellcheck.net/), [shfmt](https://github.com/mvdan/sh) |
|
|
||||||
| Bourne Shell | shell [-n flag](http://linux.die.net/man/1/sh), [shellcheck](https://www.shellcheck.net/), [shfmt](https://github.com/mvdan/sh) |
|
|
||||||
| C | [cppcheck](http://cppcheck.sourceforge.net), [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint), [clang](http://clang.llvm.org/), [clangtidy](http://clang.llvm.org/extra/clang-tidy/) !!, [clang-format](https://clang.llvm.org/docs/ClangFormat.html), [flawfinder](https://www.dwheeler.com/flawfinder/), [gcc](https://gcc.gnu.org/) |
|
|
||||||
| C++ (filetype cpp) | [clang](http://clang.llvm.org/), [clangcheck](http://clang.llvm.org/docs/ClangCheck.html) !!, [clangtidy](http://clang.llvm.org/extra/clang-tidy/) !!, [clang-format](https://clang.llvm.org/docs/ClangFormat.html), [cppcheck](http://cppcheck.sourceforge.net), [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint) !!, [cquery](https://github.com/cquery-project/cquery), [flawfinder](https://www.dwheeler.com/flawfinder/), [gcc](https://gcc.gnu.org/) |
|
|
||||||
| CUDA | [nvcc](http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html) |
|
|
||||||
| C# | [mcs](http://www.mono-project.com/docs/about-mono/languages/csharp/) see:`help ale-cs-mcs` for details, [mcsc](http://www.mono-project.com/docs/about-mono/languages/csharp/) !! see:`help ale-cs-mcsc` for details and configuration|
|
|
||||||
| Chef | [foodcritic](http://www.foodcritic.io/) |
|
|
||||||
| Clojure | [joker](https://github.com/candid82/joker) |
|
|
||||||
| CloudFormation | [cfn-python-lint](https://github.com/awslabs/cfn-python-lint) |
|
|
||||||
| CMake | [cmakelint](https://github.com/richq/cmake-lint) |
|
|
||||||
| CoffeeScript | [coffee](http://coffeescript.org/), [coffeelint](https://www.npmjs.com/package/coffeelint) |
|
|
||||||
| Crystal | [crystal](https://crystal-lang.org/) !! |
|
|
||||||
| CSS | [csslint](http://csslint.net/), [prettier](https://github.com/prettier/prettier), [stylelint](https://github.com/stylelint/stylelint) |
|
|
||||||
| Cucumber | [cucumber](https://cucumber.io/) |
|
|
||||||
| Cython (pyrex filetype) | [cython](http://cython.org/) |
|
|
||||||
| D | [dmd](https://dlang.org/dmd-linux.html) |
|
|
||||||
| Dafny | [dafny](https://rise4fun.com/Dafny) !! |
|
|
||||||
| Dart | [dartanalyzer](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer_cli) !!, [language_server](https://github.com/natebosch/dart_language_server), [dartfmt](https://github.com/dart-lang/sdk/tree/master/utils/dartfmt) |
|
|
||||||
| Dockerfile | [hadolint](https://github.com/hadolint/hadolint) |
|
|
||||||
| Elixir | [credo](https://github.com/rrrene/credo), [dialyxir](https://github.com/jeremyjh/dialyxir), [dogma](https://github.com/lpil/dogma), [mix](https://hexdocs.pm/mix/Mix.html) !!|
|
|
||||||
| Elm | [elm-format](https://github.com/avh4/elm-format), [elm-make](https://github.com/elm-lang/elm-make) |
|
|
||||||
| Erb | [erb](https://apidock.com/ruby/ERB), [erubi](https://github.com/jeremyevans/erubi), [erubis](https://github.com/kwatch/erubis) |
|
|
||||||
| Erlang | [erlc](http://erlang.org/doc/man/erlc.html), [SyntaxErl](https://github.com/ten0s/syntaxerl) |
|
|
||||||
| Fish | fish [-n flag](https://linux.die.net/man/1/fish)
|
|
||||||
| Fortran | [gcc](https://gcc.gnu.org/) |
|
|
||||||
| Fountain | [proselint](http://proselint.com/) |
|
|
||||||
| FusionScript | [fusion-lint](https://github.com/RyanSquared/fusionscript) |
|
|
||||||
| Git Commit Messages | [gitlint](https://github.com/jorisroovers/gitlint) |
|
|
||||||
| GLSL | [glslang](https://github.com/KhronosGroup/glslang), [glslls](https://github.com/svenstaro/glsl-language-server) |
|
|
||||||
| Go | [gofmt](https://golang.org/cmd/gofmt/), [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports), [go vet](https://golang.org/cmd/vet/) !!, [golint](https://godoc.org/github.com/golang/lint), [gotype](https://godoc.org/golang.org/x/tools/cmd/gotype) !!, [gometalinter](https://github.com/alecthomas/gometalinter) !!, [go build](https://golang.org/cmd/go/) !!, [gosimple](https://github.com/dominikh/go-tools/tree/master/cmd/gosimple) !!, [staticcheck](https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck) !! |
|
|
||||||
| GraphQL | [eslint](http://eslint.org/), [gqlint](https://github.com/happylinks/gqlint), [prettier](https://github.com/prettier/prettier) |
|
|
||||||
| Haml | [haml-lint](https://github.com/brigade/haml-lint) |
|
|
||||||
| Handlebars | [ember-template-lint](https://github.com/rwjblue/ember-template-lint) |
|
|
||||||
| Haskell | [brittany](https://github.com/lspitzner/brittany), [ghc](https://www.haskell.org/ghc/), [stack-ghc](https://haskellstack.org/), [stack-build](https://haskellstack.org/) !!, [ghc-mod](https://github.com/DanielG/ghc-mod), [stack-ghc-mod](https://github.com/DanielG/ghc-mod), [hlint](https://hackage.haskell.org/package/hlint), [hdevtools](https://hackage.haskell.org/package/hdevtools), [hfmt](https://github.com/danstiner/hfmt) |
|
|
||||||
| HTML | [alex](https://github.com/wooorm/alex) !!, [HTMLHint](http://htmlhint.com/), [proselint](http://proselint.com/), [tidy](http://www.html-tidy.org/), [write-good](https://github.com/btford/write-good) |
|
|
||||||
| Idris | [idris](http://www.idris-lang.org/) |
|
|
||||||
| Java | [checkstyle](http://checkstyle.sourceforge.net), [javac](http://www.oracle.com/technetwork/java/javase/downloads/index.html), [google-java-format](https://github.com/google/google-java-format), [PMD](https://pmd.github.io/) |
|
|
||||||
| JavaScript | [eslint](http://eslint.org/), [flow](https://flowtype.org/), [jscs](http://jscs.info/), [jshint](http://jshint.com/), [prettier](https://github.com/prettier/prettier), [prettier-eslint](https://github.com/prettier/prettier-eslint-cli), [prettier-standard](https://github.com/sheerun/prettier-standard), [standard](http://standardjs.com/), [xo](https://github.com/sindresorhus/xo)
|
|
||||||
| JSON | [fixjson](https://github.com/rhysd/fixjson), [jsonlint](http://zaa.ch/jsonlint/), [jq](https://stedolan.github.io/jq/), [prettier](https://github.com/prettier/prettier) |
|
|
||||||
| Kotlin | [kotlinc](https://kotlinlang.org) !!, [ktlint](https://ktlint.github.io) !! see `:help ale-integration-kotlin` for configuration instructions |
|
|
||||||
| LaTeX | [alex](https://github.com/wooorm/alex) !!, [chktex](http://www.nongnu.org/chktex/), [lacheck](https://www.ctan.org/pkg/lacheck), [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good) |
|
|
||||||
| Less | [lessc](https://www.npmjs.com/package/less), [prettier](https://github.com/prettier/prettier), [stylelint](https://github.com/stylelint/stylelint) |
|
|
||||||
| LLVM | [llc](https://llvm.org/docs/CommandGuide/llc.html) |
|
|
||||||
| Lua | [luac](https://www.lua.org/manual/5.1/luac.html), [luacheck](https://github.com/mpeterv/luacheck) |
|
|
||||||
| Mail | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale) |
|
|
||||||
| Make | [checkmake](https://github.com/mrtazz/checkmake) |
|
|
||||||
| Markdown | [alex](https://github.com/wooorm/alex) !!, [markdownlint](https://github.com/DavidAnson/markdownlint) !!, [mdl](https://github.com/mivok/markdownlint), [prettier](https://github.com/prettier/prettier), [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [remark-lint](https://github.com/wooorm/remark-lint) !!, [textlint](https://textlint.github.io/), [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good) |
|
|
||||||
| MATLAB | [mlint](https://www.mathworks.com/help/matlab/ref/mlint.html) |
|
|
||||||
| Mercury | [mmc](http://mercurylang.org) !! |
|
|
||||||
| NASM | [nasm](https://www.nasm.us/) !! |
|
|
||||||
| Nim | [nim check](https://nim-lang.org/docs/nimc.html) !! |
|
|
||||||
| nix | [nix-instantiate](http://nixos.org/nix/manual/#sec-nix-instantiate) |
|
|
||||||
| nroff | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good)|
|
|
||||||
| Objective-C | [clang](http://clang.llvm.org/) |
|
|
||||||
| Objective-C++ | [clang](http://clang.llvm.org/) |
|
|
||||||
| OCaml | [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-ocaml-merlin` for configuration instructions, [ols](https://github.com/freebroccolo/ocaml-language-server) |
|
|
||||||
| Perl | [perl -c](https://perl.org/), [perl-critic](https://metacpan.org/pod/Perl::Critic), [perltidy](https://metacpan.org/pod/distribution/Perl-Tidy/bin/perltidy) |
|
|
||||||
| PHP | [hack](http://hacklang.org/), [hackfmt](https://github.com/facebook/flow/tree/master/hack/hackfmt), [langserver](https://github.com/felixfbecker/php-language-server), [phan](https://github.com/phan/phan) see `:help ale-php-phan` to instructions, [php -l](https://secure.php.net/), [phpcs](https://github.com/squizlabs/PHP_CodeSniffer), [phpmd](https://phpmd.org), [phpstan](https://github.com/phpstan/phpstan), [phpcbf](https://github.com/squizlabs/PHP_CodeSniffer), [php-cs-fixer](http://cs.sensiolabs.org/) |
|
|
||||||
| PO | [alex](https://github.com/wooorm/alex) !!, [msgfmt](https://www.gnu.org/software/gettext/manual/html_node/msgfmt-Invocation.html), [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good) |
|
|
||||||
| Pod | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good) |
|
|
||||||
| Pony | [ponyc](https://github.com/ponylang/ponyc) |
|
|
||||||
| proto | [protoc-gen-lint](https://github.com/ckaznocha/protoc-gen-lint) |
|
|
||||||
| Pug | [pug-lint](https://github.com/pugjs/pug-lint) |
|
|
||||||
| Puppet | [puppet](https://puppet.com), [puppet-lint](https://puppet-lint.com) |
|
|
||||||
| Python | [autopep8](https://github.com/hhatto/autopep8), [black](https://github.com/ambv/black), [flake8](http://flake8.pycqa.org/en/latest/), [isort](https://github.com/timothycrosley/isort), [mypy](http://mypy-lang.org/), [prospector](http://github.com/landscapeio/prospector), [pycodestyle](https://github.com/PyCQA/pycodestyle), [pyls](https://github.com/palantir/python-language-server), [pyre](https://github.com/facebook/pyre-check), [pylint](https://www.pylint.org/) !!, [yapf](https://github.com/google/yapf) |
|
|
||||||
| QML | [qmlfmt](https://github.com/jesperhh/qmlfmt), [qmllint](https://github.com/qt/qtdeclarative/tree/5.11/tools/qmllint) |
|
|
||||||
| R | [lintr](https://github.com/jimhester/lintr) |
|
|
||||||
| ReasonML | [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-reasonml-ols` for configuration instructions, [ols](https://github.com/freebroccolo/ocaml-language-server), [refmt](https://github.com/reasonml/reason-cli) |
|
|
||||||
| reStructuredText | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [rstcheck](https://github.com/myint/rstcheck), [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good) |
|
|
||||||
| Re:VIEW | [redpen](http://redpen.cc/) |
|
|
||||||
| RPM spec | [rpmlint](https://github.com/rpm-software-management/rpmlint) (disabled by default; see `:help ale-integration-spec`) |
|
|
||||||
| Ruby | [brakeman](http://brakemanscanner.org/) !!, [rails_best_practices](https://github.com/flyerhzm/rails_best_practices) !!, [reek](https://github.com/troessner/reek), [rubocop](https://github.com/bbatsov/rubocop), [ruby](https://www.ruby-lang.org), [rufo](https://github.com/ruby-formatter/rufo) |
|
|
||||||
| Rust | cargo !! (see `:help ale-integration-rust` for configuration instructions), [rls](https://github.com/rust-lang-nursery/rls), [rustc](https://www.rust-lang.org/), [rustfmt](https://github.com/rust-lang-nursery/rustfmt) |
|
|
||||||
| SASS | [sass-lint](https://www.npmjs.com/package/sass-lint), [stylelint](https://github.com/stylelint/stylelint) |
|
|
||||||
| SCSS | [prettier](https://github.com/prettier/prettier), [sass-lint](https://www.npmjs.com/package/sass-lint), [scss-lint](https://github.com/brigade/scss-lint), [stylelint](https://github.com/stylelint/stylelint) |
|
|
||||||
| Scala | [fsc](https://www.scala-lang.org/old/sites/default/files/linuxsoft_archives/docu/files/tools/fsc.html), [scalac](http://scala-lang.org), [scalafmt](https://scalameta.org/scalafmt/), [scalastyle](http://www.scalastyle.org) |
|
|
||||||
| Slim | [slim-lint](https://github.com/sds/slim-lint) |
|
|
||||||
| SML | [smlnj](http://www.smlnj.org/) |
|
|
||||||
| Solidity | [solhint](https://github.com/protofire/solhint), [solium](https://github.com/duaraghav8/Solium) |
|
|
||||||
| Stylus | [stylelint](https://github.com/stylelint/stylelint) |
|
|
||||||
| SQL | [sqlint](https://github.com/purcell/sqlint) |
|
|
||||||
| Swift | [swiftlint](https://github.com/realm/SwiftLint), [swiftformat](https://github.com/nicklockwood/SwiftFormat) |
|
|
||||||
| Tcl | [nagelfar](http://nagelfar.sourceforge.net) !! |
|
|
||||||
| Terraform | [tflint](https://github.com/wata727/tflint) |
|
|
||||||
| Texinfo | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good)|
|
|
||||||
| Text^ | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [textlint](https://textlint.github.io/), [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good) |
|
|
||||||
| Thrift | [thrift](http://thrift.apache.org/) |
|
|
||||||
| TypeScript | [eslint](http://eslint.org/), [prettier](https://github.com/prettier/prettier), [tslint](https://github.com/palantir/tslint), tsserver, typecheck |
|
|
||||||
| Verilog | [iverilog](https://github.com/steveicarus/iverilog), [verilator](http://www.veripool.org/projects/verilator/wiki/Intro) |
|
|
||||||
| Vim | [vint](https://github.com/Kuniwak/vint) |
|
|
||||||
| Vim help^ | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good) |
|
|
||||||
| Vue | [prettier](https://github.com/prettier/prettier) |
|
|
||||||
| XHTML | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good) |
|
|
||||||
| XML | [xmllint](http://xmlsoft.org/xmllint.html) |
|
|
||||||
| YAML | [swaglint](https://github.com/byCedric/swaglint), [yamllint](https://yamllint.readthedocs.io/) |
|
|
||||||
|
|
||||||
<a name="usage"></a>
|
<a name="usage"></a>
|
||||||
|
|
||||||
@@ -208,7 +101,7 @@ new buffers or as you make edits to your files.
|
|||||||
The behaviour of linting can be configured with a variety of options,
|
The behaviour of linting can be configured with a variety of options,
|
||||||
documented in [the Vim help file](doc/ale.txt). For more information on the
|
documented in [the Vim help file](doc/ale.txt). For more information on the
|
||||||
options ALE offers, consult `:help ale-options` for global options and `:help
|
options ALE offers, consult `:help ale-options` for global options and `:help
|
||||||
ale-linter-options` for options specified to particular linters.
|
ale-integration-options` for options specified to particular linters.
|
||||||
|
|
||||||
<a name="usage-fixing"></a>
|
<a name="usage-fixing"></a>
|
||||||
|
|
||||||
@@ -228,12 +121,18 @@ let b:ale_fixers = ['prettier', 'eslint']
|
|||||||
let b:ale_fixers = {'javascript': ['prettier', 'eslint']}
|
let b:ale_fixers = {'javascript': ['prettier', 'eslint']}
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also configure your fixers from vimrc using `g:ale_fixers`, before
|
You can also configure your fixers from vimrc using `g:ale_fixers`, before or
|
||||||
or after ALE has been loaded.
|
after ALE has been loaded.
|
||||||
|
|
||||||
|
A `*` in place of the filetype will apply a List of fixers to all files which
|
||||||
|
do not match some filetype in the Dictionary.
|
||||||
|
|
||||||
|
Note that using a plain List for `g:ale_fixers` is not supported.
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
" In ~/.vim/vimrc, or somewhere similar.
|
" In ~/.vim/vimrc, or somewhere similar.
|
||||||
let g:ale_fixers = {
|
let g:ale_fixers = {
|
||||||
|
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
|
||||||
\ 'javascript': ['eslint'],
|
\ 'javascript': ['eslint'],
|
||||||
\}
|
\}
|
||||||
```
|
```
|
||||||
@@ -260,11 +159,36 @@ ALE offers some support for completion via hijacking of omnicompletion while you
|
|||||||
type. All of ALE's completion information must come from Language Server
|
type. All of ALE's completion information must come from Language Server
|
||||||
Protocol linters, or from `tsserver` for TypeScript.
|
Protocol linters, or from `tsserver` for TypeScript.
|
||||||
|
|
||||||
|
ALE integrates with [Deoplete](https://github.com/Shougo/deoplete.nvim) as a
|
||||||
|
completion source, named `'ale'`. You can configure Deoplete to only use ALE as
|
||||||
|
the source of completion information, or mix it with other sources.
|
||||||
|
|
||||||
|
```vim
|
||||||
|
" Use ALE and also some plugin 'foobar' as completion sources for all code.
|
||||||
|
call deoplete#custom#option('sources', {
|
||||||
|
\ '_': ['ale', 'foobar'],
|
||||||
|
\})
|
||||||
|
```
|
||||||
|
|
||||||
|
ALE also offers its own automatic completion support, which does not require any
|
||||||
|
other plugins, and can be enabled by changing a setting before ALE is loaded.
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
" Enable completion where available.
|
" Enable completion where available.
|
||||||
|
" This setting must be set before ALE is loaded.
|
||||||
|
"
|
||||||
|
" You should not turn this setting on if you wish to use ALE as a completion
|
||||||
|
" source for other completion plugins, like Deoplete.
|
||||||
let g:ale_completion_enabled = 1
|
let g:ale_completion_enabled = 1
|
||||||
```
|
```
|
||||||
|
|
||||||
|
ALE provides an omni-completion function you can use for triggering
|
||||||
|
completion manually with `<C-x><C-o>`.
|
||||||
|
|
||||||
|
```vim
|
||||||
|
set omnifunc=ale#completion#OmniFunc
|
||||||
|
```
|
||||||
|
|
||||||
See `:help ale-completion` for more information.
|
See `:help ale-completion` for more information.
|
||||||
|
|
||||||
<a name="usage-go-to-definition"></a>
|
<a name="usage-go-to-definition"></a>
|
||||||
@@ -295,11 +219,24 @@ ALE supports "hover" information for printing brief information about symbols at
|
|||||||
the cursor taken from Language Server Protocol linters and `tsserver` with the
|
the cursor taken from Language Server Protocol linters and `tsserver` with the
|
||||||
`ALEHover` command.
|
`ALEHover` command.
|
||||||
|
|
||||||
On vim/gvim with `balloon` support you can see the information in a tooltip
|
The information can be displayed in a `balloon` tooltip in Vim or GVim by
|
||||||
that appears under the mouse when you mouseover a symbol.
|
hovering your mouse over symbols. Mouse hovering is enabled by default in GVim,
|
||||||
|
and needs to be configured for Vim 8.1+ in terminals.
|
||||||
|
|
||||||
See `:help ale-hover` for more information.
|
See `:help ale-hover` for more information.
|
||||||
|
|
||||||
|
<a name="usage-symbol-search"></a>
|
||||||
|
|
||||||
|
### 2.vii Symbol Search
|
||||||
|
|
||||||
|
ALE supports searching for workspace symbols via Language Server Protocol
|
||||||
|
linters with the `ALESymbolSearch` command.
|
||||||
|
|
||||||
|
Search queries can be performed to find functions, types, and more which are
|
||||||
|
similar to a given query string.
|
||||||
|
|
||||||
|
See `:help ale-symbol-search` for more information.
|
||||||
|
|
||||||
<a name="installation"></a>
|
<a name="installation"></a>
|
||||||
|
|
||||||
## 3. Installation
|
## 3. Installation
|
||||||
@@ -321,14 +258,14 @@ any other tools. Simply clone the plugin into your `pack` directory.
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir -p ~/.vim/pack/git-plugins/start
|
mkdir -p ~/.vim/pack/git-plugins/start
|
||||||
git clone https://github.com/w0rp/ale.git ~/.vim/pack/git-plugins/start/ale
|
git clone --depth 1 https://github.com/w0rp/ale.git ~/.vim/pack/git-plugins/start/ale
|
||||||
```
|
```
|
||||||
|
|
||||||
#### NeoVim on Unix
|
#### NeoVim on Unix
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir -p ~/.local/share/nvim/site/pack/git-plugins/start
|
mkdir -p ~/.local/share/nvim/site/pack/git-plugins/start
|
||||||
git clone https://github.com/w0rp/ale.git ~/.local/share/nvim/site/pack/git-plugins/start/ale
|
git clone --depth 1 https://github.com/w0rp/ale.git ~/.local/share/nvim/site/pack/git-plugins/start/ale
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Vim 8 on Windows
|
#### Vim 8 on Windows
|
||||||
@@ -336,7 +273,7 @@ git clone https://github.com/w0rp/ale.git ~/.local/share/nvim/site/pack/git-plug
|
|||||||
```bash
|
```bash
|
||||||
# Run these commands in the "Git for Windows" Bash terminal
|
# Run these commands in the "Git for Windows" Bash terminal
|
||||||
mkdir -p ~/vimfiles/pack/git-plugins/start
|
mkdir -p ~/vimfiles/pack/git-plugins/start
|
||||||
git clone https://github.com/w0rp/ale.git ~/vimfiles/pack/git-plugins/start/ale
|
git clone --depth 1 https://github.com/w0rp/ale.git ~/vimfiles/pack/git-plugins/start/ale
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Generating Vim help files
|
#### Generating Vim help files
|
||||||
@@ -383,6 +320,18 @@ Plugin 'w0rp/ale'
|
|||||||
|
|
||||||
See the Vundle documentation for more information.
|
See the Vundle documentation for more information.
|
||||||
|
|
||||||
|
<a name="installation-with-vim-plug"></a>
|
||||||
|
|
||||||
|
### 3.iiii. Installation with Vim-Plug
|
||||||
|
|
||||||
|
You can install this plugin using [Vim-Plug](https://github.com/junegunn/vim-plug)
|
||||||
|
by adding the GitHub path for this repository to your `~/.vimrc`
|
||||||
|
and running `:PlugInstall`.
|
||||||
|
|
||||||
|
```vim
|
||||||
|
Plug 'w0rp/ale'
|
||||||
|
```
|
||||||
|
|
||||||
<a name="contributing"></a>
|
<a name="contributing"></a>
|
||||||
|
|
||||||
## 4. Contributing
|
## 4. Contributing
|
||||||
@@ -524,8 +473,16 @@ let g:airline#extensions#ale#enabled = 1
|
|||||||
```
|
```
|
||||||
|
|
||||||
If you don't want to use vim-airline, you can implement your own statusline
|
If you don't want to use vim-airline, you can implement your own statusline
|
||||||
function without adding any other plugins. ALE provides a function for counting
|
function without adding any other plugins. ALE provides some functions to
|
||||||
the number of problems for this purpose, named `ale#statusline#Count`.
|
assist in this endeavour, including:
|
||||||
|
|
||||||
|
* `ale#statusline#Count`: Which returns the number of problems found by ALE
|
||||||
|
for a specified buffer.
|
||||||
|
* `ale#statusline#FirstProblem`: Which returns a dictionary containing the
|
||||||
|
full loclist details of the first problem of a specified type found by ALE
|
||||||
|
in a buffer. (e.g. The first style warning in the current buffer.)
|
||||||
|
This can be useful for displaying more detailed information such as the
|
||||||
|
line number of the first problem in a file.
|
||||||
|
|
||||||
Say you want to display all errors as one figure, and all non-errors as another
|
Say you want to display all errors as one figure, and all non-errors as another
|
||||||
figure. You can do the following:
|
figure. You can do the following:
|
||||||
@@ -547,7 +504,8 @@ endfunction
|
|||||||
set statusline=%{LinterStatus()}
|
set statusline=%{LinterStatus()}
|
||||||
```
|
```
|
||||||
|
|
||||||
See `:help ale#statusline#Count()` for more information.
|
See `:help ale#statusline#Count()` or `:help ale#statusline#FirstProblem()`
|
||||||
|
for more information.
|
||||||
|
|
||||||
<a name="faq-lightline"></a>
|
<a name="faq-lightline"></a>
|
||||||
|
|
||||||
@@ -569,7 +527,7 @@ There are 3 global options that allow customizing the echoed message.
|
|||||||
* `%...code...%` is an optional error code, and most characters can be
|
* `%...code...%` is an optional error code, and most characters can be
|
||||||
written between the `%` characters.
|
written between the `%` characters.
|
||||||
* `%linter%` is the linter name
|
* `%linter%` is the linter name
|
||||||
* `%severity` is the severity type
|
* `%severity%` is the severity type
|
||||||
- `g:ale_echo_msg_error_str` is the string used for error severity.
|
- `g:ale_echo_msg_error_str` is the string used for error severity.
|
||||||
- `g:ale_echo_msg_warning_str` is the string used for warning severity.
|
- `g:ale_echo_msg_warning_str` is the string used for warning severity.
|
||||||
|
|
||||||
@@ -583,7 +541,7 @@ let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
|
|||||||
|
|
||||||
Will give you:
|
Will give you:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
See `:help g:ale_echo_msg_format` for more information.
|
See `:help g:ale_echo_msg_format` for more information.
|
||||||
|
|
||||||
@@ -701,16 +659,16 @@ options in a jsx.vim ftplugin file.
|
|||||||
|
|
||||||
```vim
|
```vim
|
||||||
" In ~/.vim/ftplugin/jsx.vim, or somewhere similar.
|
" In ~/.vim/ftplugin/jsx.vim, or somewhere similar.
|
||||||
|
let b:ale_linter_aliases = ['css', 'javascript']
|
||||||
let b:ale_linters = ['stylelint', 'eslint']
|
let b:ale_linters = ['stylelint', 'eslint']
|
||||||
let b:ale_linter_aliases = ['css']
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Or if you want, you can configure the linters from your vimrc file.
|
Or if you want, you can configure the linters from your vimrc file.
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
" In ~/.vim/vimrc, or somewhere similar.
|
" In ~/.vim/vimrc, or somewhere similar.
|
||||||
|
let g:ale_linter_aliases = {'jsx': ['css', 'javascript']}
|
||||||
let g:ale_linters = {'jsx': ['stylelint', 'eslint']}
|
let g:ale_linters = {'jsx': ['stylelint', 'eslint']}
|
||||||
let g:ale_linter_aliases = {'jsx': 'css'}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
ALE will alias the `jsx` filetype so it uses the `css` filetype linters, and
|
ALE will alias the `jsx` filetype so it uses the `css` filetype linters, and
|
||||||
@@ -718,9 +676,40 @@ use the original Array of selected linters for `jsx` from the `g:ale_linters`
|
|||||||
object. All available linters will be used for the filetype `javascript`, and
|
object. All available linters will be used for the filetype `javascript`, and
|
||||||
no linter will be run twice for the same file.
|
no linter will be run twice for the same file.
|
||||||
|
|
||||||
|
<a name="faq-vue-eslint"></a>
|
||||||
|
|
||||||
|
### 5.xiii. How can I check Vue files with ESLint?
|
||||||
|
|
||||||
|
To check Vue files with ESLint, your ESLint project configuration file must be
|
||||||
|
configured to use the [Vue plugin](https://github.com/vuejs/eslint-plugin-vue).
|
||||||
|
After that, you need to configure ALE so it will run the JavaScript ESLint
|
||||||
|
linter on your files. The settings you need are similar to the settings needed
|
||||||
|
for checking JSX code with both stylelint and ESLint, in the previous section.
|
||||||
|
|
||||||
|
```vim
|
||||||
|
" In ~/.vim/ftplugin/vue.vim, or somewhere similar.
|
||||||
|
|
||||||
|
" Run both javascript and vue linters for vue files.
|
||||||
|
let b:ale_linter_aliases = ['javascript', 'vue']
|
||||||
|
" Select the eslint and vls linters.
|
||||||
|
let b:ale_linters = ['eslint', 'vls']
|
||||||
|
```
|
||||||
|
|
||||||
|
Run `:ALEInfo` to see which linters are available after telling ALE to run
|
||||||
|
JavaScript linters on Vue files. Not all linters support checking Vue files.
|
||||||
|
|
||||||
|
If you don't want to configure your linters in ftplugin files for some reason,
|
||||||
|
you can configure them from your vimrc file instead.
|
||||||
|
|
||||||
|
```vim
|
||||||
|
" In ~/.vim/vimrc, or somewhere similar.
|
||||||
|
let g:ale_linter_aliases = {'vue': ['vue', 'javascript']}
|
||||||
|
let g:ale_linters = {'vue': ['eslint', 'vls']}
|
||||||
|
```
|
||||||
|
|
||||||
<a name="faq-my-battery-is-sad"></a>
|
<a name="faq-my-battery-is-sad"></a>
|
||||||
|
|
||||||
### 5.xiii. Will this plugin eat all of my laptop battery power?
|
### 5.xiv. Will this plugin eat all of my laptop battery power?
|
||||||
|
|
||||||
ALE takes advantage of the power of various tools to check your code. This of
|
ALE takes advantage of the power of various tools to check your code. This of
|
||||||
course means that CPU time will be used to continuously check your code. If you
|
course means that CPU time will be used to continuously check your code. If you
|
||||||
@@ -733,11 +722,10 @@ while you type. ALE uses a timeout which is cancelled and reset every time you
|
|||||||
type, and this delay can be increased so linters are run less often. See
|
type, and this delay can be increased so linters are run less often. See
|
||||||
`:help g:ale_lint_delay` for more information.
|
`:help g:ale_lint_delay` for more information.
|
||||||
|
|
||||||
If you don't wish to run linters while you type, you can disable that
|
If you don't wish to run linters while you type, you can disable that behaviour.
|
||||||
behaviour. Set `g:ale_lint_on_text_changed` to `never` or `normal`. You won't
|
Set `g:ale_lint_on_text_changed` to `never`. You won't get as frequent error
|
||||||
get as frequent error checking, but ALE shouldn't block your ability to edit a
|
checking, but ALE shouldn't block your ability to edit a document after you save
|
||||||
document after you save a file, so the asynchronous nature of the plugin will
|
a file, so the asynchronous nature of the plugin will still be an advantage.
|
||||||
still be an advantage.
|
|
||||||
|
|
||||||
If you are still concerned, you can turn the automatic linting off altogether,
|
If you are still concerned, you can turn the automatic linting off altogether,
|
||||||
including the option `g:ale_lint_on_enter`, and you can run ALE manually with
|
including the option `g:ale_lint_on_enter`, and you can run ALE manually with
|
||||||
@@ -745,7 +733,7 @@ including the option `g:ale_lint_on_enter`, and you can run ALE manually with
|
|||||||
|
|
||||||
<a name="faq-c-configuration"></a>
|
<a name="faq-c-configuration"></a>
|
||||||
|
|
||||||
### 5.xiv. How can I configure my C or C++ project?
|
### 5.xv. How can I configure my C or C++ project?
|
||||||
|
|
||||||
The structure of C and C++ projects varies wildly from project to project, with
|
The structure of C and C++ projects varies wildly from project to project, with
|
||||||
many different build tools being used for building them, and many different
|
many different build tools being used for building them, and many different
|
||||||
@@ -771,7 +759,7 @@ used for executing local vimrc files which can be shared in your project.
|
|||||||
|
|
||||||
<a name="faq-buffer-configuration"></a>
|
<a name="faq-buffer-configuration"></a>
|
||||||
|
|
||||||
### 5.xv. How can I configure ALE differently for different buffers?
|
### 5.xvi. How can I configure ALE differently for different buffers?
|
||||||
|
|
||||||
ALE offers various ways to configure which linters or fixers are run, and
|
ALE offers various ways to configure which linters or fixers are run, and
|
||||||
other settings. For the majority of ALE's settings, they can either be
|
other settings. For the majority of ALE's settings, they can either be
|
||||||
@@ -807,7 +795,7 @@ Buffer-local variables for settings always override the global settings.
|
|||||||
|
|
||||||
<a name="faq-list-window-height"></a>
|
<a name="faq-list-window-height"></a>
|
||||||
|
|
||||||
### 5.xvi. How can I configure the height of the list in which ALE displays errors?
|
### 5.xvii. How can I configure the height of the list in which ALE displays errors?
|
||||||
|
|
||||||
To set a default height for the error list, use the `g:ale_list_window_size` variable.
|
To set a default height for the error list, use the `g:ale_list_window_size` variable.
|
||||||
|
|
||||||
@@ -815,3 +803,13 @@ To set a default height for the error list, use the `g:ale_list_window_size` var
|
|||||||
" Show 5 lines of errors (default: 10)
|
" Show 5 lines of errors (default: 10)
|
||||||
let g:ale_list_window_size = 5
|
let g:ale_list_window_size = 5
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<a name="faq-get-info"></a>
|
||||||
|
|
||||||
|
### 5.xviii. How can I see what ALE has configured for the current file?
|
||||||
|
|
||||||
|
Run the following to see what is currently configured:
|
||||||
|
|
||||||
|
```vim
|
||||||
|
:ALEInfo
|
||||||
|
```
|
||||||
|
|||||||
54
ale_linters/ada/gcc.vim
Normal file
54
ale_linters/ada/gcc.vim
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
" Author: Martino Pilia <martino.pilia@gmail.com>
|
||||||
|
" Description: Lint Ada files with GCC
|
||||||
|
|
||||||
|
call ale#Set('ada_gcc_executable', 'gcc')
|
||||||
|
|
||||||
|
" -gnatwa: activate most optional warnings
|
||||||
|
" -gnatq: try semantic analysis even if syntax errors have been found
|
||||||
|
call ale#Set('ada_gcc_options', '-gnatwa -gnatq')
|
||||||
|
|
||||||
|
function! ale_linters#ada#gcc#GetCommand(buffer) abort
|
||||||
|
" Build a suitable output file name. The output file is specified because
|
||||||
|
" the .ali file may be created even if no code generation is attempted.
|
||||||
|
" The output file name must match the source file name (except for the
|
||||||
|
" extension), so here we cannot use the null file as output.
|
||||||
|
let l:tmp_dir = fnamemodify(ale#command#CreateDirectory(a:buffer), ':p')
|
||||||
|
let l:out_file = l:tmp_dir . fnamemodify(bufname(a:buffer), ':t:r') . '.o'
|
||||||
|
|
||||||
|
" -gnatc: Check syntax and semantics only (no code generation attempted)
|
||||||
|
return '%e -x ada -c -gnatc'
|
||||||
|
\ . ' -o ' . ale#Escape(l:out_file)
|
||||||
|
\ . ' -I ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||||
|
\ . ale#Pad(ale#Var(a:buffer, 'ada_gcc_options'))
|
||||||
|
\ . ' %t'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" For the message format please refer to:
|
||||||
|
" https://gcc.gnu.org/onlinedocs/gnat_ugn/Output-and-Error-Message-Control.html
|
||||||
|
" https://gcc.gnu.org/onlinedocs/gnat_ugn/Warning-Message-Control.html
|
||||||
|
function! ale_linters#ada#gcc#Handle(buffer, lines) abort
|
||||||
|
" Error format: <filename>:<lnum>:<col>: <text>
|
||||||
|
" Warning format: <filename>:<lnum>:<col>: warning: <text>
|
||||||
|
let l:re = '\v(.+):([0-9]+):([0-9]+):\s+(warning:)?\s*(.+)\s*'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:re)
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'bufnr': a:buffer,
|
||||||
|
\ 'lnum': str2nr(l:match[2]),
|
||||||
|
\ 'col': str2nr(l:match[3]),
|
||||||
|
\ 'type': l:match[4] is# 'warning:' ? 'W' : 'E',
|
||||||
|
\ 'text': l:match[5],
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('ada', {
|
||||||
|
\ 'name': 'gcc',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'ada_gcc_executable')},
|
||||||
|
\ 'command': function('ale_linters#ada#gcc#GetCommand'),
|
||||||
|
\ 'callback': 'ale_linters#ada#gcc#Handle',
|
||||||
|
\})
|
||||||
@@ -1,6 +1,12 @@
|
|||||||
" Author: Bjorn Neergaard <bjorn@neersighted.com>
|
" Author: Bjorn Neergaard <bjorn@neersighted.com>
|
||||||
" Description: ansible-lint for ansible-yaml files
|
" Description: ansible-lint for ansible-yaml files
|
||||||
|
|
||||||
|
call ale#Set('ansible_ansible_lint_executable', 'ansible-lint')
|
||||||
|
|
||||||
|
function! ale_linters#ansible#ansible_lint#GetExecutable(buffer) abort
|
||||||
|
return ale#Var(a:buffer, 'ansible_ansible_lint_executable')
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#ansible#ansible_lint#Handle(buffer, lines) abort
|
function! ale_linters#ansible#ansible_lint#Handle(buffer, lines) abort
|
||||||
for l:line in a:lines[:10]
|
for l:line in a:lines[:10]
|
||||||
if match(l:line, '^Traceback') >= 0
|
if match(l:line, '^Traceback') >= 0
|
||||||
@@ -42,8 +48,9 @@ function! ale_linters#ansible#ansible_lint#Handle(buffer, lines) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('ansible', {
|
call ale#linter#Define('ansible', {
|
||||||
\ 'name': 'ansible',
|
\ 'name': 'ansible_lint',
|
||||||
\ 'executable': 'ansible',
|
\ 'aliases': ['ansible', 'ansible-lint'],
|
||||||
\ 'command': 'ansible-lint -p %t',
|
\ 'executable': function('ale_linters#ansible#ansible_lint#GetExecutable'),
|
||||||
|
\ 'command': '%e -p %t',
|
||||||
\ 'callback': 'ale_linters#ansible#ansible_lint#Handle',
|
\ 'callback': 'ale_linters#ansible#ansible_lint#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -16,10 +16,12 @@ function! ale_linters#apiblueprint#drafter#HandleErrors(buffer, lines) abort
|
|||||||
\ 'lnum': l:match[3] + 0,
|
\ 'lnum': l:match[3] + 0,
|
||||||
\ 'col': l:match[4] + 0,
|
\ 'col': l:match[4] + 0,
|
||||||
\}
|
\}
|
||||||
|
|
||||||
if l:match[5] isnot# ''
|
if l:match[5] isnot# ''
|
||||||
let l:item.end_lnum = l:match[6] + 0
|
let l:item.end_lnum = l:match[6] + 0
|
||||||
let l:item.end_col = l:match[7] + 0
|
let l:item.end_col = l:match[7] + 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call add(l:output, l:item)
|
call add(l:output, l:item)
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
@@ -31,6 +33,6 @@ call ale#linter#Define('apiblueprint', {
|
|||||||
\ 'name': 'drafter',
|
\ 'name': 'drafter',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable': 'drafter',
|
\ 'executable': 'drafter',
|
||||||
\ 'command': 'drafter --use-line-num --validate %t',
|
\ 'command': 'drafter --use-line-num --validate',
|
||||||
\ 'callback': 'ale_linters#apiblueprint#drafter#HandleErrors',
|
\ 'callback': 'ale_linters#apiblueprint#drafter#HandleErrors',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -1,11 +1,4 @@
|
|||||||
" Author: Johannes Wienke <languitar@semipol.de>
|
" Author: Johannes Wienke <languitar@semipol.de>
|
||||||
" Description: alex for asciidoc files
|
" Description: alex for asciidoc files
|
||||||
|
|
||||||
call ale#linter#Define('help', {
|
call ale#handlers#alex#DefineLinter('asciidoc', '--text')
|
||||||
\ 'name': 'alex',
|
|
||||||
\ 'executable': 'alex',
|
|
||||||
\ 'command': 'alex %s -t',
|
|
||||||
\ 'output_stream': 'stderr',
|
|
||||||
\ 'callback': 'ale#handlers#alex#Handle',
|
|
||||||
\ 'lint_file': 1,
|
|
||||||
\})
|
|
||||||
|
|||||||
9
ale_linters/asciidoc/textlint.vim
Normal file
9
ale_linters/asciidoc/textlint.vim
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
" Author: TANIGUCHI Masaya <ta2gch@gmail.com>
|
||||||
|
" Description: textlint for AsciiDoc files
|
||||||
|
|
||||||
|
call ale#linter#Define('asciidoc', {
|
||||||
|
\ 'name': 'textlint',
|
||||||
|
\ 'executable': function('ale#handlers#textlint#GetExecutable'),
|
||||||
|
\ 'command': function('ale#handlers#textlint#GetCommand'),
|
||||||
|
\ 'callback': 'ale#handlers#textlint#HandleTextlintOutput',
|
||||||
|
\})
|
||||||
9
ale_linters/asciidoc/vale.vim
Normal file
9
ale_linters/asciidoc/vale.vim
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
" Author: Jeff Kreeftmeijer https://github.com/jeffkreeftmeijer
|
||||||
|
" Description: vale for AsciiDoc files
|
||||||
|
|
||||||
|
call ale#linter#Define('asciidoc', {
|
||||||
|
\ 'name': 'vale',
|
||||||
|
\ 'executable': 'vale',
|
||||||
|
\ 'command': 'vale --output=line %t',
|
||||||
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
|
\})
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
|
||||||
" Description: write-good for AsciiDoc files
|
|
||||||
|
|
||||||
call ale#linter#Define('asciidoc', {
|
|
||||||
\ 'name': 'write-good',
|
|
||||||
\ 'executable_callback': 'ale#handlers#writegood#GetExecutable',
|
|
||||||
\ 'command_callback': 'ale#handlers#writegood#GetCommand',
|
|
||||||
\ 'callback': 'ale#handlers#writegood#Handle',
|
|
||||||
\})
|
|
||||||
4
ale_linters/asciidoc/writegood.vim
Normal file
4
ale_linters/asciidoc/writegood.vim
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
||||||
|
" Description: write-good for AsciiDoc files
|
||||||
|
|
||||||
|
call ale#handlers#writegood#DefineLinter('asciidoc')
|
||||||
@@ -4,15 +4,13 @@
|
|||||||
call ale#Set('asm_gcc_executable', 'gcc')
|
call ale#Set('asm_gcc_executable', 'gcc')
|
||||||
call ale#Set('asm_gcc_options', '-Wall')
|
call ale#Set('asm_gcc_options', '-Wall')
|
||||||
|
|
||||||
function! ale_linters#asm#gcc#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'asm_gcc_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#asm#gcc#GetCommand(buffer) abort
|
function! ale_linters#asm#gcc#GetCommand(buffer) abort
|
||||||
return ale#Escape(ale_linters#asm#gcc#GetExecutable(a:buffer))
|
" `-o /dev/null` or `-o null` is needed to catch all errors,
|
||||||
\ . ' -x assembler -fsyntax-only '
|
" -fsyntax-only doesn't catch everything.
|
||||||
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
return '%e -x assembler'
|
||||||
\ . ' ' . ale#Var(a:buffer, 'asm_gcc_options') . ' -'
|
\ . ' -o ' . g:ale#util#nul_file
|
||||||
|
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||||
|
\ . ' ' . ale#Var(a:buffer, 'asm_gcc_options') . ' -'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#asm#gcc#Handle(buffer, lines) abort
|
function! ale_linters#asm#gcc#Handle(buffer, lines) abort
|
||||||
@@ -33,7 +31,7 @@ endfunction
|
|||||||
call ale#linter#Define('asm', {
|
call ale#linter#Define('asm', {
|
||||||
\ 'name': 'gcc',
|
\ 'name': 'gcc',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable_callback': 'ale_linters#asm#gcc#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'asm_gcc_executable')},
|
||||||
\ 'command_callback': 'ale_linters#asm#gcc#GetCommand',
|
\ 'command': function('ale_linters#asm#gcc#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#asm#gcc#Handle',
|
\ 'callback': 'ale_linters#asm#gcc#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -1,30 +1,22 @@
|
|||||||
" Author: kmarc <korondi.mark@gmail.com>
|
" Author: kmarc <korondi.mark@gmail.com>
|
||||||
" Description: This file adds support for using GNU awk with sripts.
|
" Description: This file adds support for using GNU awk with sripts.
|
||||||
|
|
||||||
let g:ale_awk_gawk_executable =
|
call ale#Set('awk_gawk_executable', 'gawk')
|
||||||
\ get(g:, 'ale_awk_gawk_executable', 'gawk')
|
call ale#Set('awk_gawk_options', '')
|
||||||
|
|
||||||
let g:ale_awk_gawk_options =
|
|
||||||
\ get(g:, 'ale_awk_gawk_options', '')
|
|
||||||
|
|
||||||
function! ale_linters#awk#gawk#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'awk_gawk_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#awk#gawk#GetCommand(buffer) abort
|
function! ale_linters#awk#gawk#GetCommand(buffer) abort
|
||||||
" note the --source 'BEGIN ...' is to prevent
|
" note the --source 'BEGIN ...' is to prevent
|
||||||
" gawk from attempting to execute the body of the script
|
" gawk from attempting to execute the body of the script
|
||||||
" it is linting.
|
" it is linting.
|
||||||
return ale_linters#awk#gawk#GetExecutable(a:buffer)
|
return '%e --source ' . ale#Escape('BEGIN { exit } END { exit 1 }')
|
||||||
\ . " --source 'BEGIN { exit } END { exit 1 }'"
|
\ . ale#Pad(ale#Var(a:buffer, 'awk_gawk_options'))
|
||||||
\ . ' ' . ale#Var(a:buffer, 'awk_gawk_options')
|
\ . ' -f %t --lint /dev/null'
|
||||||
\ . ' ' . '-f %t --lint /dev/null'
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('awk', {
|
call ale#linter#Define('awk', {
|
||||||
\ 'name': 'gawk',
|
\ 'name': 'gawk',
|
||||||
\ 'executable_callback': 'ale_linters#awk#gawk#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'awk_gawk_executable')},
|
||||||
\ 'command_callback': 'ale_linters#awk#gawk#GetCommand',
|
\ 'command': function('ale_linters#awk#gawk#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#gawk#HandleGawkFormat',
|
\ 'callback': 'ale#handlers#gawk#HandleGawkFormat',
|
||||||
\ 'output_stream': 'both'
|
\ 'output_stream': 'both'
|
||||||
\})
|
\})
|
||||||
|
|||||||
75
ale_linters/bib/bibclean.vim
Normal file
75
ale_linters/bib/bibclean.vim
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
" Author: Horacio Sanson - https://github.com/hsanson
|
||||||
|
" Description: Support for bibclean linter for BibTeX files.
|
||||||
|
|
||||||
|
call ale#Set('bib_bibclean_executable', 'bibclean')
|
||||||
|
|
||||||
|
function! ale_linters#bib#bibclean#GetCommand(buffer) abort
|
||||||
|
let l:executable = ale#Var(a:buffer, 'bib_bibclean_executable')
|
||||||
|
|
||||||
|
return ale#Escape(l:executable) . ' -file-position '
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#bib#bibclean#get_type(str) abort
|
||||||
|
if a:str is# '??'
|
||||||
|
return 'E'
|
||||||
|
else
|
||||||
|
return 'W'
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#bib#bibclean#match_msg(line) abort
|
||||||
|
return matchlist(a:line, '^\(.*\) "stdin", line \(.*\): \(.*\)$')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#bib#bibclean#match_entry(line) abort
|
||||||
|
return matchlist(a:line, 'Entry input byte=.* line=\(.*\) column=\(.*\) output .*$')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#bib#bibclean#match_value(line) abort
|
||||||
|
return matchlist(a:line, 'Value input byte=.* line=\(.*\) column=\(.*\) output .*$')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#bib#bibclean#Handle(buffer, lines) abort
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
let l:type = 'E'
|
||||||
|
let l:msg = ''
|
||||||
|
|
||||||
|
for l:line in a:lines
|
||||||
|
if empty(l:msg)
|
||||||
|
let l:mlist = ale_linters#bib#bibclean#match_msg(l:line)
|
||||||
|
|
||||||
|
if !empty(l:mlist)
|
||||||
|
let l:msg = l:mlist[3]
|
||||||
|
let l:type = ale_linters#bib#bibclean#get_type(l:mlist[1])
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
if l:type is# 'E'
|
||||||
|
let l:mlist = ale_linters#bib#bibclean#match_entry(l:line)
|
||||||
|
else
|
||||||
|
let l:mlist = ale_linters#bib#bibclean#match_value(l:line)
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !empty(l:mlist)
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': l:mlist[1],
|
||||||
|
\ 'col': l:mlist[2],
|
||||||
|
\ 'text': l:msg,
|
||||||
|
\ 'type': l:type
|
||||||
|
\})
|
||||||
|
|
||||||
|
let l:msg = ''
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('bib', {
|
||||||
|
\ 'name': 'bibclean',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'bib_bibclean_executable')},
|
||||||
|
\ 'command': function('ale_linters#bib#bibclean#GetCommand'),
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'callback': 'ale_linters#bib#bibclean#Handle',
|
||||||
|
\})
|
||||||
14
ale_linters/c/ccls.vim
Normal file
14
ale_linters/c/ccls.vim
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
" Author: Ye Jingchen <ye.jingchen@gmail.com>, Ben Falconer <ben@falconers.me.uk>, jtalowell <jtalowell@protonmail.com>
|
||||||
|
" Description: A language server for C
|
||||||
|
|
||||||
|
call ale#Set('c_ccls_executable', 'ccls')
|
||||||
|
call ale#Set('c_ccls_init_options', {})
|
||||||
|
|
||||||
|
call ale#linter#Define('c', {
|
||||||
|
\ 'name': 'ccls',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'c_ccls_executable')},
|
||||||
|
\ 'command': '%e',
|
||||||
|
\ 'project_root': function('ale#handlers#ccls#GetProjectRoot'),
|
||||||
|
\ 'initialization_options': {b -> ale#Var(b, 'c_ccls_init_options')},
|
||||||
|
\})
|
||||||
@@ -4,29 +4,21 @@
|
|||||||
call ale#Set('c_clang_executable', 'clang')
|
call ale#Set('c_clang_executable', 'clang')
|
||||||
call ale#Set('c_clang_options', '-std=c11 -Wall')
|
call ale#Set('c_clang_options', '-std=c11 -Wall')
|
||||||
|
|
||||||
function! ale_linters#c#clang#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'c_clang_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#c#clang#GetCommand(buffer, output) abort
|
function! ale_linters#c#clang#GetCommand(buffer, output) abort
|
||||||
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
||||||
|
|
||||||
" -iquote with the directory the file is in makes #include work for
|
" -iquote with the directory the file is in makes #include work for
|
||||||
" headers in the same directory.
|
" headers in the same directory.
|
||||||
return ale#Escape(ale_linters#c#clang#GetExecutable(a:buffer))
|
return '%e -S -x c -fsyntax-only'
|
||||||
\ . ' -S -x c -fsyntax-only '
|
\ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||||
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) . ' '
|
\ . ale#Pad(l:cflags)
|
||||||
\ . l:cflags
|
\ . ale#Pad(ale#Var(a:buffer, 'c_clang_options')) . ' -'
|
||||||
\ . ale#Var(a:buffer, 'c_clang_options') . ' -'
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('c', {
|
call ale#linter#Define('c', {
|
||||||
\ 'name': 'clang',
|
\ 'name': 'clang',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable_callback': 'ale_linters#c#clang#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'c_clang_executable')},
|
||||||
\ 'command_chain': [
|
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#c#clang#GetCommand'))},
|
||||||
\ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'},
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||||
\ {'callback': 'ale_linters#c#clang#GetCommand'}
|
|
||||||
\ ],
|
|
||||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
|
||||||
\})
|
\})
|
||||||
|
|||||||
17
ale_linters/c/clangd.vim
Normal file
17
ale_linters/c/clangd.vim
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
" Author: Andrey Melentyev <andrey.melentyev@protonmail.com>
|
||||||
|
" Description: Clangd language server
|
||||||
|
|
||||||
|
call ale#Set('c_clangd_executable', 'clangd')
|
||||||
|
call ale#Set('c_clangd_options', '')
|
||||||
|
|
||||||
|
function! ale_linters#c#clangd#GetCommand(buffer) abort
|
||||||
|
return '%e' . ale#Pad(ale#Var(a:buffer, 'c_clangd_options'))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('c', {
|
||||||
|
\ 'name': 'clangd',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'c_clangd_executable')},
|
||||||
|
\ 'command': function('ale_linters#c#clangd#GetCommand'),
|
||||||
|
\ 'project_root': function('ale#c#FindProjectRoot'),
|
||||||
|
\})
|
||||||
@@ -10,45 +10,30 @@ call ale#Set('c_clangtidy_executable', 'clang-tidy')
|
|||||||
" Consult the check list in clang-tidy's documentation:
|
" Consult the check list in clang-tidy's documentation:
|
||||||
" http://clang.llvm.org/extra/clang-tidy/checks/list.html
|
" http://clang.llvm.org/extra/clang-tidy/checks/list.html
|
||||||
|
|
||||||
call ale#Set('c_clangtidy_checks', ['*'])
|
call ale#Set('c_clangtidy_checks', [])
|
||||||
" Set this option to manually set some options for clang-tidy.
|
" Set this option to manually set some options for clang-tidy to use as compile
|
||||||
|
" flags.
|
||||||
" This will disable compile_commands.json detection.
|
" This will disable compile_commands.json detection.
|
||||||
call ale#Set('c_clangtidy_options', '')
|
call ale#Set('c_clangtidy_options', '')
|
||||||
|
" Set this option to manually set options for clang-tidy directly.
|
||||||
|
call ale#Set('c_clangtidy_extra_options', '')
|
||||||
call ale#Set('c_build_dir', '')
|
call ale#Set('c_build_dir', '')
|
||||||
|
|
||||||
function! ale_linters#c#clangtidy#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'c_clangtidy_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:GetBuildDirectory(buffer) abort
|
|
||||||
" Don't include build directory for header files, as compile_commands.json
|
|
||||||
" files don't consider headers to be translation units, and provide no
|
|
||||||
" commands for compiling header files.
|
|
||||||
if expand('#' . a:buffer) =~# '\v\.(h|hpp)$'
|
|
||||||
return ''
|
|
||||||
endif
|
|
||||||
|
|
||||||
let l:build_dir = ale#Var(a:buffer, 'c_build_dir')
|
|
||||||
|
|
||||||
" c_build_dir has the priority if defined
|
|
||||||
if !empty(l:build_dir)
|
|
||||||
return l:build_dir
|
|
||||||
endif
|
|
||||||
|
|
||||||
return ale#c#FindCompileCommands(a:buffer)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#c#clangtidy#GetCommand(buffer) abort
|
function! ale_linters#c#clangtidy#GetCommand(buffer) abort
|
||||||
let l:checks = join(ale#Var(a:buffer, 'c_clangtidy_checks'), ',')
|
let l:checks = join(ale#Var(a:buffer, 'c_clangtidy_checks'), ',')
|
||||||
let l:build_dir = s:GetBuildDirectory(a:buffer)
|
let l:build_dir = ale#c#GetBuildDirectory(a:buffer)
|
||||||
|
|
||||||
" Get the extra options if we couldn't find a build directory.
|
" Get the extra options if we couldn't find a build directory.
|
||||||
let l:options = empty(l:build_dir)
|
let l:options = empty(l:build_dir)
|
||||||
\ ? ale#Var(a:buffer, 'c_clangtidy_options')
|
\ ? ale#Var(a:buffer, 'c_clangtidy_options')
|
||||||
\ : ''
|
\ : ''
|
||||||
|
|
||||||
return ale#Escape(ale_linters#c#clangtidy#GetExecutable(a:buffer))
|
" Get the options to pass directly to clang-tidy
|
||||||
|
let l:extra_options = ale#Var(a:buffer, 'c_clangtidy_extra_options')
|
||||||
|
|
||||||
|
return '%e'
|
||||||
\ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
|
\ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
|
||||||
|
\ . (!empty(l:extra_options) ? ' ' . ale#Escape(l:extra_options) : '')
|
||||||
\ . ' %s'
|
\ . ' %s'
|
||||||
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
||||||
\ . (!empty(l:options) ? ' -- ' . l:options : '')
|
\ . (!empty(l:options) ? ' -- ' . l:options : '')
|
||||||
@@ -57,8 +42,8 @@ endfunction
|
|||||||
call ale#linter#Define('c', {
|
call ale#linter#Define('c', {
|
||||||
\ 'name': 'clangtidy',
|
\ 'name': 'clangtidy',
|
||||||
\ 'output_stream': 'stdout',
|
\ 'output_stream': 'stdout',
|
||||||
\ 'executable_callback': 'ale_linters#c#clangtidy#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'c_clangtidy_executable')},
|
||||||
\ 'command_callback': 'ale_linters#c#clangtidy#GetCommand',
|
\ 'command': function('ale_linters#c#clangtidy#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -4,36 +4,25 @@
|
|||||||
call ale#Set('c_cppcheck_executable', 'cppcheck')
|
call ale#Set('c_cppcheck_executable', 'cppcheck')
|
||||||
call ale#Set('c_cppcheck_options', '--enable=style')
|
call ale#Set('c_cppcheck_options', '--enable=style')
|
||||||
|
|
||||||
function! ale_linters#c#cppcheck#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'c_cppcheck_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#c#cppcheck#GetCommand(buffer) abort
|
function! ale_linters#c#cppcheck#GetCommand(buffer) abort
|
||||||
" Search upwards from the file for compile_commands.json.
|
let l:cd_command = ale#handlers#cppcheck#GetCdCommand(a:buffer)
|
||||||
"
|
let l:compile_commands_option = ale#handlers#cppcheck#GetCompileCommandsOptions(a:buffer)
|
||||||
" If we find it, we'll `cd` to where the compile_commands.json file is,
|
let l:buffer_path_include = empty(l:compile_commands_option)
|
||||||
" then use the file to set up import paths, etc.
|
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
|
||||||
let l:compile_commmands_path = ale#path#FindNearestFile(a:buffer, 'compile_commands.json')
|
|
||||||
|
|
||||||
let l:cd_command = !empty(l:compile_commmands_path)
|
|
||||||
\ ? ale#path#CdString(fnamemodify(l:compile_commmands_path, ':h'))
|
|
||||||
\ : ''
|
|
||||||
let l:compile_commands_option = !empty(l:compile_commmands_path)
|
|
||||||
\ ? '--project=compile_commands.json '
|
|
||||||
\ : ''
|
\ : ''
|
||||||
|
|
||||||
return l:cd_command
|
return l:cd_command
|
||||||
\ . ale#Escape(ale_linters#c#cppcheck#GetExecutable(a:buffer))
|
\ . '%e -q --language=c'
|
||||||
\ . ' -q --language=c '
|
\ . ale#Pad(l:compile_commands_option)
|
||||||
\ . l:compile_commands_option
|
\ . ale#Pad(ale#Var(a:buffer, 'c_cppcheck_options'))
|
||||||
\ . ale#Var(a:buffer, 'c_cppcheck_options')
|
\ . l:buffer_path_include
|
||||||
\ . ' %t'
|
\ . ' %t'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('c', {
|
call ale#linter#Define('c', {
|
||||||
\ 'name': 'cppcheck',
|
\ 'name': 'cppcheck',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\ 'executable_callback': 'ale_linters#c#cppcheck#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'c_cppcheck_executable')},
|
||||||
\ 'command_callback': 'ale_linters#c#cppcheck#GetCommand',
|
\ 'command': function('ale_linters#c#cppcheck#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
|
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
|
||||||
\})
|
\})
|
||||||
|
|||||||
30
ale_linters/c/cquery.vim
Normal file
30
ale_linters/c/cquery.vim
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
" Author: Ben Falconer <ben@falconers.me.uk>, jtalowell <jtalowell@protonmail.com>
|
||||||
|
" Description: A language server for C
|
||||||
|
|
||||||
|
call ale#Set('c_cquery_executable', 'cquery')
|
||||||
|
call ale#Set('c_cquery_cache_directory', expand('~/.cache/cquery'))
|
||||||
|
|
||||||
|
function! ale_linters#c#cquery#GetProjectRoot(buffer) abort
|
||||||
|
" Try to find cquery configuration files first.
|
||||||
|
let l:config = ale#path#FindNearestFile(a:buffer, '.cquery')
|
||||||
|
|
||||||
|
if !empty(l:config)
|
||||||
|
return fnamemodify(l:config, ':h')
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Fall back on default project root detection.
|
||||||
|
return ale#c#FindProjectRoot(a:buffer)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#c#cquery#GetInitializationOptions(buffer) abort
|
||||||
|
return {'cacheDirectory': ale#Var(a:buffer, 'c_cquery_cache_directory')}
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('c', {
|
||||||
|
\ 'name': 'cquery',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'c_cquery_executable')},
|
||||||
|
\ 'command': '%e',
|
||||||
|
\ 'project_root': function('ale_linters#c#cquery#GetProjectRoot'),
|
||||||
|
\ 'initialization_options': function('ale_linters#c#cquery#GetInitializationOptions'),
|
||||||
|
\})
|
||||||
@@ -6,26 +6,20 @@ call ale#Set('c_flawfinder_options', '')
|
|||||||
call ale#Set('c_flawfinder_minlevel', 1)
|
call ale#Set('c_flawfinder_minlevel', 1)
|
||||||
call ale#Set('c_flawfinder_error_severity', 6)
|
call ale#Set('c_flawfinder_error_severity', 6)
|
||||||
|
|
||||||
function! ale_linters#c#flawfinder#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'c_flawfinder_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#c#flawfinder#GetCommand(buffer) abort
|
function! ale_linters#c#flawfinder#GetCommand(buffer) abort
|
||||||
|
" Set the minimum vulnerability level for flawfinder to bother with
|
||||||
|
let l:minlevel = ' --minlevel=' . ale#Var(a:buffer, 'c_flawfinder_minlevel')
|
||||||
|
|
||||||
" Set the minimum vulnerability level for flawfinder to bother with
|
return '%e -CDQS'
|
||||||
let l:minlevel = ' --minlevel=' . ale#Var(a:buffer, 'c_flawfinder_minlevel')
|
\ . ale#Pad(ale#Var(a:buffer, 'c_flawfinder_options'))
|
||||||
|
\ . l:minlevel
|
||||||
return ale#Escape(ale_linters#c#flawfinder#GetExecutable(a:buffer))
|
\ . ' %t'
|
||||||
\ . ' -CDQS'
|
|
||||||
\ . ale#Var(a:buffer, 'c_flawfinder_options')
|
|
||||||
\ . l:minlevel
|
|
||||||
\ . ' %t'
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('c', {
|
call ale#linter#Define('c', {
|
||||||
\ 'name': 'flawfinder',
|
\ 'name': 'flawfinder',
|
||||||
\ 'output_stream': 'stdout',
|
\ 'output_stream': 'stdout',
|
||||||
\ 'executable_callback': 'ale_linters#c#flawfinder#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'c_flawfinder_executable')},
|
||||||
\ 'command_callback': 'ale_linters#c#flawfinder#GetCommand',
|
\ 'command': function('ale_linters#c#flawfinder#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#flawfinder#HandleFlawfinderFormat',
|
\ 'callback': 'ale#handlers#flawfinder#HandleFlawfinderFormat',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -4,29 +4,25 @@
|
|||||||
call ale#Set('c_gcc_executable', 'gcc')
|
call ale#Set('c_gcc_executable', 'gcc')
|
||||||
call ale#Set('c_gcc_options', '-std=c11 -Wall')
|
call ale#Set('c_gcc_options', '-std=c11 -Wall')
|
||||||
|
|
||||||
function! ale_linters#c#gcc#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'c_gcc_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#c#gcc#GetCommand(buffer, output) abort
|
function! ale_linters#c#gcc#GetCommand(buffer, output) abort
|
||||||
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
||||||
|
|
||||||
" -iquote with the directory the file is in makes #include work for
|
" -iquote with the directory the file is in makes #include work for
|
||||||
" headers in the same directory.
|
" headers in the same directory.
|
||||||
return ale#Escape(ale_linters#c#gcc#GetExecutable(a:buffer))
|
"
|
||||||
\ . ' -S -x c -fsyntax-only '
|
" `-o /dev/null` or `-o null` is needed to catch all errors,
|
||||||
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) . ' '
|
" -fsyntax-only doesn't catch everything.
|
||||||
\ . l:cflags
|
return '%e -S -x c'
|
||||||
\ . ale#Var(a:buffer, 'c_gcc_options') . ' -'
|
\ . ' -o ' . g:ale#util#nul_file
|
||||||
|
\ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||||
|
\ . ale#Pad(l:cflags)
|
||||||
|
\ . ale#Pad(ale#Var(a:buffer, 'c_gcc_options')) . ' -'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('c', {
|
call ale#linter#Define('c', {
|
||||||
\ 'name': 'gcc',
|
\ 'name': 'gcc',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable_callback': 'ale_linters#c#gcc#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'c_gcc_executable')},
|
||||||
\ 'command_chain': [
|
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#c#gcc#GetCommand'))},
|
||||||
\ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'},
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||||
\ {'callback': 'ale_linters#c#gcc#GetCommand'}
|
|
||||||
\ ],
|
|
||||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
|
||||||
\})
|
\})
|
||||||
|
|||||||
54
ale_linters/chef/cookstyle.vim
Normal file
54
ale_linters/chef/cookstyle.vim
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
" Author: Raphael Hoegger - https://github.com/pfuender
|
||||||
|
" Description: Cookstyle (RuboCop based), a code style analyzer for Ruby files
|
||||||
|
|
||||||
|
call ale#Set('chef_cookstyle_executable', 'cookstyle')
|
||||||
|
call ale#Set('chef_cookstyle_options', '')
|
||||||
|
|
||||||
|
function! ale_linters#chef#cookstyle#GetCommand(buffer) abort
|
||||||
|
let l:options = ale#Var(a:buffer, 'chef_cookstyle_options')
|
||||||
|
|
||||||
|
return '%e' . ale#Pad(escape(l:options, '~')) . ' --force-exclusion --format json --stdin ' . ' %s'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#chef#cookstyle#Handle(buffer, lines) abort
|
||||||
|
if len(a:lines) == 0
|
||||||
|
return []
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:errors = ale#util#FuzzyJSONDecode(a:lines[0], {})
|
||||||
|
|
||||||
|
if !has_key(l:errors, 'summary')
|
||||||
|
\|| l:errors['summary']['offense_count'] == 0
|
||||||
|
\|| empty(l:errors['files'])
|
||||||
|
return []
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:error in l:errors['files'][0]['offenses']
|
||||||
|
let l:start_col = str2nr(l:error['location']['start_column'])
|
||||||
|
let l:end_col = str2nr(l:error['location']['last_column'])
|
||||||
|
|
||||||
|
if !l:end_col
|
||||||
|
let l:end_col = l:start_col + 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': str2nr(l:error['location']['line']),
|
||||||
|
\ 'col': l:start_col,
|
||||||
|
\ 'end_col': l:end_col,
|
||||||
|
\ 'code': l:error['cop_name'],
|
||||||
|
\ 'text': l:error['message'],
|
||||||
|
\ 'type': l:error['severity'] is? 'convention' ? 'W' : 'E',
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('chef', {
|
||||||
|
\ 'name': 'cookstyle',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'chef_cookstyle_executable')},
|
||||||
|
\ 'command': function('ale_linters#chef#cookstyle#GetCommand'),
|
||||||
|
\ 'callback': 'ale_linters#chef#cookstyle#Handle',
|
||||||
|
\})
|
||||||
@@ -6,17 +6,10 @@
|
|||||||
call ale#Set('chef_foodcritic_executable', 'foodcritic')
|
call ale#Set('chef_foodcritic_executable', 'foodcritic')
|
||||||
call ale#Set('chef_foodcritic_options', '')
|
call ale#Set('chef_foodcritic_options', '')
|
||||||
|
|
||||||
function! ale_linters#chef#foodcritic#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'chef_foodcritic_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#chef#foodcritic#GetCommand(buffer) abort
|
function! ale_linters#chef#foodcritic#GetCommand(buffer) abort
|
||||||
let l:executable = ale_linters#chef#foodcritic#GetExecutable(a:buffer)
|
|
||||||
let l:options = ale#Var(a:buffer, 'chef_foodcritic_options')
|
let l:options = ale#Var(a:buffer, 'chef_foodcritic_options')
|
||||||
|
|
||||||
return ale#Escape(l:executable)
|
return '%e' . ale#Pad(escape(l:options, '~')) . ' %s'
|
||||||
\ . (!empty(l:options) ? ' ' . escape(l:options, '~') : '')
|
|
||||||
\ . ' %s'
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#chef#foodcritic#Handle(buffer, lines) abort
|
function! ale_linters#chef#foodcritic#Handle(buffer, lines) abort
|
||||||
@@ -41,8 +34,8 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('chef', {
|
call ale#linter#Define('chef', {
|
||||||
\ 'name': 'foodcritic',
|
\ 'name': 'foodcritic',
|
||||||
\ 'executable_callback': 'ale_linters#chef#foodcritic#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'chef_foodcritic_executable')},
|
||||||
\ 'command_callback': 'ale_linters#chef#foodcritic#GetCommand',
|
\ 'command': function('ale_linters#chef#foodcritic#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#chef#foodcritic#Handle',
|
\ 'callback': 'ale_linters#chef#foodcritic#Handle',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
\})
|
\})
|
||||||
|
|||||||
34
ale_linters/clojure/clj_kondo.vim
Normal file
34
ale_linters/clojure/clj_kondo.vim
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
" Author: Masashi Iizuka <liquidz.uo@gmail.com>
|
||||||
|
" Description: linter for clojure using clj-kondo https://github.com/borkdude/clj-kondo
|
||||||
|
|
||||||
|
function! ale_linters#clojure#clj_kondo#HandleCljKondoFormat(buffer, lines) abort
|
||||||
|
" output format
|
||||||
|
" <filename>:<line>:<column>: <issue type>: <message>
|
||||||
|
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):(\d+):? ((Exception|error|warning): ?(.+))$'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
let l:type = 'E'
|
||||||
|
|
||||||
|
if l:match[4] is? 'warning'
|
||||||
|
let l:type = 'W'
|
||||||
|
endif
|
||||||
|
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': l:match[1] + 0,
|
||||||
|
\ 'col': l:match[2] + 0,
|
||||||
|
\ 'text': l:match[3],
|
||||||
|
\ 'type': l:type,
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('clojure', {
|
||||||
|
\ 'name': 'clj-kondo',
|
||||||
|
\ 'output_stream': 'stdout',
|
||||||
|
\ 'executable': 'clj-kondo',
|
||||||
|
\ 'command': 'clj-kondo --lint %t',
|
||||||
|
\ 'callback': 'ale_linters#clojure#clj_kondo#HandleCljKondoFormat',
|
||||||
|
\})
|
||||||
@@ -9,9 +9,11 @@ function! ale_linters#clojure#joker#HandleJokerFormat(buffer, lines) abort
|
|||||||
|
|
||||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
let l:type = 'E'
|
let l:type = 'E'
|
||||||
|
|
||||||
if l:match[4] is? 'Parse warning'
|
if l:match[4] is? 'Parse warning'
|
||||||
let l:type = 'W'
|
let l:type = 'W'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'lnum': l:match[1] + 0,
|
\ 'lnum': l:match[1] + 0,
|
||||||
\ 'col': l:match[2] + 0,
|
\ 'col': l:match[2] + 0,
|
||||||
@@ -27,6 +29,6 @@ call ale#linter#Define('clojure', {
|
|||||||
\ 'name': 'joker',
|
\ 'name': 'joker',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable': 'joker',
|
\ 'executable': 'joker',
|
||||||
\ 'command': 'joker --lint %t',
|
\ 'command': 'joker --working-dir %s --lint %t',
|
||||||
\ 'callback': 'ale_linters#clojure#joker#HandleJokerFormat',
|
\ 'callback': 'ale_linters#clojure#joker#HandleJokerFormat',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('cmake', {
|
call ale#linter#Define('cmake', {
|
||||||
\ 'name': 'cmakelint',
|
\ 'name': 'cmakelint',
|
||||||
\ 'executable_callback': 'ale_linters#cmake#cmakelint#Executable',
|
\ 'executable': function('ale_linters#cmake#cmakelint#Executable'),
|
||||||
\ 'command_callback': 'ale_linters#cmake#cmakelint#Command',
|
\ 'command': function('ale_linters#cmake#cmakelint#Command'),
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('coffee', {
|
call ale#linter#Define('coffee', {
|
||||||
\ 'name': 'coffee',
|
\ 'name': 'coffee',
|
||||||
\ 'executable_callback': 'ale_linters#coffee#coffee#GetExecutable',
|
\ 'executable': function('ale_linters#coffee#coffee#GetExecutable'),
|
||||||
\ 'command_callback': 'ale_linters#coffee#coffee#GetCommand',
|
\ 'command': function('ale_linters#coffee#coffee#GetCommand'),
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('coffee', {
|
call ale#linter#Define('coffee', {
|
||||||
\ 'name': 'coffeelint',
|
\ 'name': 'coffeelint',
|
||||||
\ 'executable_callback': 'ale_linters#coffee#coffeelint#GetExecutable',
|
\ 'executable': function('ale_linters#coffee#coffeelint#GetExecutable'),
|
||||||
\ 'command_callback': 'ale_linters#coffee#coffeelint#GetCommand',
|
\ 'command': function('ale_linters#coffee#coffeelint#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#coffee#coffeelint#Handle',
|
\ 'callback': 'ale_linters#coffee#coffeelint#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
14
ale_linters/cpp/ccls.vim
Normal file
14
ale_linters/cpp/ccls.vim
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
" Author: Ye Jingchen <ye.jingchen@gmail.com>, Ben Falconer <ben@falconers.me.uk>, jtalowell <jtalowell@protonmail.com>
|
||||||
|
" Description: A language server for C++
|
||||||
|
|
||||||
|
call ale#Set('cpp_ccls_executable', 'ccls')
|
||||||
|
call ale#Set('cpp_ccls_init_options', {})
|
||||||
|
|
||||||
|
call ale#linter#Define('cpp', {
|
||||||
|
\ 'name': 'ccls',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'cpp_ccls_executable')},
|
||||||
|
\ 'command': '%e',
|
||||||
|
\ 'project_root': function('ale#handlers#ccls#GetProjectRoot'),
|
||||||
|
\ 'initialization_options': {b -> ale#Var(b, 'cpp_ccls_init_options')},
|
||||||
|
\})
|
||||||
@@ -4,29 +4,21 @@
|
|||||||
call ale#Set('cpp_clang_executable', 'clang++')
|
call ale#Set('cpp_clang_executable', 'clang++')
|
||||||
call ale#Set('cpp_clang_options', '-std=c++14 -Wall')
|
call ale#Set('cpp_clang_options', '-std=c++14 -Wall')
|
||||||
|
|
||||||
function! ale_linters#cpp#clang#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'cpp_clang_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#cpp#clang#GetCommand(buffer, output) abort
|
function! ale_linters#cpp#clang#GetCommand(buffer, output) abort
|
||||||
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
||||||
|
|
||||||
" -iquote with the directory the file is in makes #include work for
|
" -iquote with the directory the file is in makes #include work for
|
||||||
" headers in the same directory.
|
" headers in the same directory.
|
||||||
return ale#Escape(ale_linters#cpp#clang#GetExecutable(a:buffer))
|
return '%e -S -x c++ -fsyntax-only'
|
||||||
\ . ' -S -x c++ -fsyntax-only '
|
\ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||||
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) . ' '
|
\ . ale#Pad(l:cflags)
|
||||||
\ . l:cflags
|
\ . ale#Pad(ale#Var(a:buffer, 'cpp_clang_options')) . ' -'
|
||||||
\ . ale#Var(a:buffer, 'cpp_clang_options') . ' -'
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('cpp', {
|
call ale#linter#Define('cpp', {
|
||||||
\ 'name': 'clang',
|
\ 'name': 'clang',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable_callback': 'ale_linters#cpp#clang#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'cpp_clang_executable')},
|
||||||
\ 'command_chain': [
|
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#cpp#clang#GetCommand'))},
|
||||||
\ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'},
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||||
\ {'callback': 'ale_linters#cpp#clang#GetCommand'},
|
|
||||||
\ ],
|
|
||||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -5,10 +5,6 @@ call ale#Set('cpp_clangcheck_executable', 'clang-check')
|
|||||||
call ale#Set('cpp_clangcheck_options', '')
|
call ale#Set('cpp_clangcheck_options', '')
|
||||||
call ale#Set('c_build_dir', '')
|
call ale#Set('c_build_dir', '')
|
||||||
|
|
||||||
function! ale_linters#cpp#clangcheck#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'cpp_clangcheck_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#cpp#clangcheck#GetCommand(buffer) abort
|
function! ale_linters#cpp#clangcheck#GetCommand(buffer) abort
|
||||||
let l:user_options = ale#Var(a:buffer, 'cpp_clangcheck_options')
|
let l:user_options = ale#Var(a:buffer, 'cpp_clangcheck_options')
|
||||||
|
|
||||||
@@ -16,24 +12,24 @@ function! ale_linters#cpp#clangcheck#GetCommand(buffer) abort
|
|||||||
let l:build_dir = ale#Var(a:buffer, 'c_build_dir')
|
let l:build_dir = ale#Var(a:buffer, 'c_build_dir')
|
||||||
|
|
||||||
if empty(l:build_dir)
|
if empty(l:build_dir)
|
||||||
let l:build_dir = ale#c#FindCompileCommands(a:buffer)
|
let [l:root, l:json_file] = ale#c#FindCompileCommands(a:buffer)
|
||||||
|
let l:build_dir = ale#path#Dirname(l:json_file)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" The extra arguments in the command are used to prevent .plist files from
|
" The extra arguments in the command are used to prevent .plist files from
|
||||||
" being generated. These are only added if no build directory can be
|
" being generated. These are only added if no build directory can be
|
||||||
" detected.
|
" detected.
|
||||||
return ale#Escape(ale_linters#cpp#clangcheck#GetExecutable(a:buffer))
|
return '%e -analyze %s'
|
||||||
\ . ' -analyze %s'
|
|
||||||
\ . (empty(l:build_dir) ? ' -extra-arg -Xclang -extra-arg -analyzer-output=text' : '')
|
\ . (empty(l:build_dir) ? ' -extra-arg -Xclang -extra-arg -analyzer-output=text' : '')
|
||||||
\ . (!empty(l:user_options) ? ' ' . l:user_options : '')
|
\ . ale#Pad(l:user_options)
|
||||||
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('cpp', {
|
call ale#linter#Define('cpp', {
|
||||||
\ 'name': 'clangcheck',
|
\ 'name': 'clangcheck',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable_callback': 'ale_linters#cpp#clangcheck#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'cpp_clangcheck_executable')},
|
||||||
\ 'command_callback': 'ale_linters#cpp#clangcheck#GetCommand',
|
\ 'command': function('ale_linters#cpp#clangcheck#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
\})
|
\})
|
||||||
|
|||||||
17
ale_linters/cpp/clangd.vim
Normal file
17
ale_linters/cpp/clangd.vim
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
" Author: Andrey Melentyev <andrey.melentyev@protonmail.com>
|
||||||
|
" Description: Clangd language server
|
||||||
|
|
||||||
|
call ale#Set('cpp_clangd_executable', 'clangd')
|
||||||
|
call ale#Set('cpp_clangd_options', '')
|
||||||
|
|
||||||
|
function! ale_linters#cpp#clangd#GetCommand(buffer) abort
|
||||||
|
return '%e' . ale#Pad(ale#Var(a:buffer, 'cpp_clangd_options'))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('cpp', {
|
||||||
|
\ 'name': 'clangd',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'cpp_clangd_executable')},
|
||||||
|
\ 'command': function('ale_linters#cpp#clangd#GetCommand'),
|
||||||
|
\ 'project_root': function('ale#c#FindProjectRoot'),
|
||||||
|
\})
|
||||||
@@ -4,45 +4,30 @@
|
|||||||
|
|
||||||
call ale#Set('cpp_clangtidy_executable', 'clang-tidy')
|
call ale#Set('cpp_clangtidy_executable', 'clang-tidy')
|
||||||
" Set this option to check the checks clang-tidy will apply.
|
" Set this option to check the checks clang-tidy will apply.
|
||||||
call ale#Set('cpp_clangtidy_checks', ['*'])
|
call ale#Set('cpp_clangtidy_checks', [])
|
||||||
" Set this option to manually set some options for clang-tidy.
|
" Set this option to manually set some options for clang-tidy to use as compile
|
||||||
|
" flags.
|
||||||
" This will disable compile_commands.json detection.
|
" This will disable compile_commands.json detection.
|
||||||
call ale#Set('cpp_clangtidy_options', '')
|
call ale#Set('cpp_clangtidy_options', '')
|
||||||
|
" Set this option to manually set options for clang-tidy directly.
|
||||||
|
call ale#Set('cpp_clangtidy_extra_options', '')
|
||||||
call ale#Set('c_build_dir', '')
|
call ale#Set('c_build_dir', '')
|
||||||
|
|
||||||
function! ale_linters#cpp#clangtidy#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'cpp_clangtidy_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:GetBuildDirectory(buffer) abort
|
|
||||||
" Don't include build directory for header files, as compile_commands.json
|
|
||||||
" files don't consider headers to be translation units, and provide no
|
|
||||||
" commands for compiling header files.
|
|
||||||
if expand('#' . a:buffer) =~# '\v\.(h|hpp)$'
|
|
||||||
return ''
|
|
||||||
endif
|
|
||||||
|
|
||||||
let l:build_dir = ale#Var(a:buffer, 'c_build_dir')
|
|
||||||
|
|
||||||
" c_build_dir has the priority if defined
|
|
||||||
if !empty(l:build_dir)
|
|
||||||
return l:build_dir
|
|
||||||
endif
|
|
||||||
|
|
||||||
return ale#c#FindCompileCommands(a:buffer)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#cpp#clangtidy#GetCommand(buffer) abort
|
function! ale_linters#cpp#clangtidy#GetCommand(buffer) abort
|
||||||
let l:checks = join(ale#Var(a:buffer, 'cpp_clangtidy_checks'), ',')
|
let l:checks = join(ale#Var(a:buffer, 'cpp_clangtidy_checks'), ',')
|
||||||
let l:build_dir = s:GetBuildDirectory(a:buffer)
|
let l:build_dir = ale#c#GetBuildDirectory(a:buffer)
|
||||||
|
|
||||||
" Get the extra options if we couldn't find a build directory.
|
" Get the extra options if we couldn't find a build directory.
|
||||||
let l:options = empty(l:build_dir)
|
let l:options = empty(l:build_dir)
|
||||||
\ ? ale#Var(a:buffer, 'cpp_clangtidy_options')
|
\ ? ale#Var(a:buffer, 'cpp_clangtidy_options')
|
||||||
\ : ''
|
\ : ''
|
||||||
|
|
||||||
return ale#Escape(ale_linters#cpp#clangtidy#GetExecutable(a:buffer))
|
" Get the options to pass directly to clang-tidy
|
||||||
|
let l:extra_options = ale#Var(a:buffer, 'cpp_clangtidy_extra_options')
|
||||||
|
|
||||||
|
return '%e'
|
||||||
\ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
|
\ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
|
||||||
|
\ . (!empty(l:extra_options) ? ' ' . ale#Escape(l:extra_options) : '')
|
||||||
\ . ' %s'
|
\ . ' %s'
|
||||||
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
||||||
\ . (!empty(l:options) ? ' -- ' . l:options : '')
|
\ . (!empty(l:options) ? ' -- ' . l:options : '')
|
||||||
@@ -51,8 +36,8 @@ endfunction
|
|||||||
call ale#linter#Define('cpp', {
|
call ale#linter#Define('cpp', {
|
||||||
\ 'name': 'clangtidy',
|
\ 'name': 'clangtidy',
|
||||||
\ 'output_stream': 'stdout',
|
\ 'output_stream': 'stdout',
|
||||||
\ 'executable_callback': 'ale_linters#cpp#clangtidy#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'cpp_clangtidy_executable')},
|
||||||
\ 'command_callback': 'ale_linters#cpp#clangtidy#GetCommand',
|
\ 'command': function('ale_linters#cpp#clangtidy#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
\})
|
\})
|
||||||
|
|||||||
32
ale_linters/cpp/clazy.vim
Normal file
32
ale_linters/cpp/clazy.vim
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
" Description: clazy linter for cpp files (clang-based and Qt-oriented)
|
||||||
|
|
||||||
|
call ale#Set('cpp_clazy_executable', 'clazy-standalone')
|
||||||
|
" Set this option to check the checks clazy will apply.
|
||||||
|
call ale#Set('cpp_clazy_checks', ['level1'])
|
||||||
|
" Set this option to manually set some options for clazy.
|
||||||
|
" This will disable compile_commands.json detection.
|
||||||
|
call ale#Set('cpp_clazy_options', '')
|
||||||
|
call ale#Set('c_build_dir', '')
|
||||||
|
|
||||||
|
function! ale_linters#cpp#clazy#GetCommand(buffer) abort
|
||||||
|
let l:checks = join(ale#Var(a:buffer, 'cpp_clazy_checks'), ',')
|
||||||
|
let l:build_dir = ale#c#GetBuildDirectory(a:buffer)
|
||||||
|
|
||||||
|
" Get the extra options if we couldn't find a build directory.
|
||||||
|
let l:options = ale#Var(a:buffer, 'cpp_clazy_options')
|
||||||
|
|
||||||
|
return '%e'
|
||||||
|
\ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
|
||||||
|
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
||||||
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
|
\ . ' %s'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('cpp', {
|
||||||
|
\ 'name': 'clazy',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'cpp_clazy_executable')},
|
||||||
|
\ 'command': function('ale_linters#cpp#clazy#GetCommand'),
|
||||||
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\})
|
||||||
@@ -4,36 +4,25 @@
|
|||||||
call ale#Set('cpp_cppcheck_executable', 'cppcheck')
|
call ale#Set('cpp_cppcheck_executable', 'cppcheck')
|
||||||
call ale#Set('cpp_cppcheck_options', '--enable=style')
|
call ale#Set('cpp_cppcheck_options', '--enable=style')
|
||||||
|
|
||||||
function! ale_linters#cpp#cppcheck#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'cpp_cppcheck_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#cpp#cppcheck#GetCommand(buffer) abort
|
function! ale_linters#cpp#cppcheck#GetCommand(buffer) abort
|
||||||
" Search upwards from the file for compile_commands.json.
|
let l:cd_command = ale#handlers#cppcheck#GetCdCommand(a:buffer)
|
||||||
"
|
let l:compile_commands_option = ale#handlers#cppcheck#GetCompileCommandsOptions(a:buffer)
|
||||||
" If we find it, we'll `cd` to where the compile_commands.json file is,
|
let l:buffer_path_include = empty(l:compile_commands_option)
|
||||||
" then use the file to set up import paths, etc.
|
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
|
||||||
let l:compile_commmands_path = ale#path#FindNearestFile(a:buffer, 'compile_commands.json')
|
|
||||||
|
|
||||||
let l:cd_command = !empty(l:compile_commmands_path)
|
|
||||||
\ ? ale#path#CdString(fnamemodify(l:compile_commmands_path, ':h'))
|
|
||||||
\ : ''
|
|
||||||
let l:compile_commands_option = !empty(l:compile_commmands_path)
|
|
||||||
\ ? '--project=compile_commands.json '
|
|
||||||
\ : ''
|
\ : ''
|
||||||
|
|
||||||
return l:cd_command
|
return l:cd_command
|
||||||
\ . ale#Escape(ale_linters#cpp#cppcheck#GetExecutable(a:buffer))
|
\ . '%e -q --language=c++'
|
||||||
\ . ' -q --language=c++ '
|
\ . ale#Pad(l:compile_commands_option)
|
||||||
\ . l:compile_commands_option
|
\ . ale#Pad(ale#Var(a:buffer, 'cpp_cppcheck_options'))
|
||||||
\ . ale#Var(a:buffer, 'cpp_cppcheck_options')
|
\ . l:buffer_path_include
|
||||||
\ . ' %t'
|
\ . ' %t'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('cpp', {
|
call ale#linter#Define('cpp', {
|
||||||
\ 'name': 'cppcheck',
|
\ 'name': 'cppcheck',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\ 'executable_callback': 'ale_linters#cpp#cppcheck#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'cpp_cppcheck_executable')},
|
||||||
\ 'command_callback': 'ale_linters#cpp#cppcheck#GetCommand',
|
\ 'command': function('ale_linters#cpp#cppcheck#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
|
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -4,23 +4,17 @@
|
|||||||
call ale#Set('cpp_cpplint_executable', 'cpplint')
|
call ale#Set('cpp_cpplint_executable', 'cpplint')
|
||||||
call ale#Set('cpp_cpplint_options', '')
|
call ale#Set('cpp_cpplint_options', '')
|
||||||
|
|
||||||
function! ale_linters#cpp#cpplint#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'cpp_cpplint_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#cpp#cpplint#GetCommand(buffer) abort
|
function! ale_linters#cpp#cpplint#GetCommand(buffer) abort
|
||||||
let l:options = ale#Var(a:buffer, 'cpp_cpplint_options')
|
let l:options = ale#Var(a:buffer, 'cpp_cpplint_options')
|
||||||
|
|
||||||
return ale#Escape(ale_linters#cpp#cpplint#GetExecutable(a:buffer))
|
return '%e' . ale#Pad(l:options) . ' %s'
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
|
||||||
\ . ' %s'
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('cpp', {
|
call ale#linter#Define('cpp', {
|
||||||
\ 'name': 'cpplint',
|
\ 'name': 'cpplint',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable_callback': 'ale_linters#cpp#cpplint#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'cpp_cpplint_executable')},
|
||||||
\ 'command_callback': 'ale_linters#cpp#cpplint#GetCommand',
|
\ 'command': function('ale_linters#cpp#cpplint#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#cpplint#HandleCppLintFormat',
|
\ 'callback': 'ale#handlers#cpplint#HandleCppLintFormat',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -5,18 +5,15 @@ call ale#Set('cpp_cquery_executable', 'cquery')
|
|||||||
call ale#Set('cpp_cquery_cache_directory', expand('~/.cache/cquery'))
|
call ale#Set('cpp_cquery_cache_directory', expand('~/.cache/cquery'))
|
||||||
|
|
||||||
function! ale_linters#cpp#cquery#GetProjectRoot(buffer) abort
|
function! ale_linters#cpp#cquery#GetProjectRoot(buffer) abort
|
||||||
let l:project_root = ale#path#FindNearestFile(a:buffer, 'compile_commands.json')
|
" Try to find cquery configuration files first.
|
||||||
|
let l:config = ale#path#FindNearestFile(a:buffer, '.cquery')
|
||||||
|
|
||||||
return !empty(l:project_root) ? fnamemodify(l:project_root, ':h') : ''
|
if !empty(l:config)
|
||||||
endfunction
|
return fnamemodify(l:config, ':h')
|
||||||
|
endif
|
||||||
|
|
||||||
function! ale_linters#cpp#cquery#GetExecutable(buffer) abort
|
" Fall back on default project root detection.
|
||||||
return ale#Var(a:buffer, 'cpp_cquery_executable')
|
return ale#c#FindProjectRoot(a:buffer)
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#cpp#cquery#GetCommand(buffer) abort
|
|
||||||
let l:executable = ale_linters#cpp#cquery#GetExecutable(a:buffer)
|
|
||||||
return ale#Escape(l:executable)
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#cpp#cquery#GetInitializationOptions(buffer) abort
|
function! ale_linters#cpp#cquery#GetInitializationOptions(buffer) abort
|
||||||
@@ -26,9 +23,8 @@ endfunction
|
|||||||
call ale#linter#Define('cpp', {
|
call ale#linter#Define('cpp', {
|
||||||
\ 'name': 'cquery',
|
\ 'name': 'cquery',
|
||||||
\ 'lsp': 'stdio',
|
\ 'lsp': 'stdio',
|
||||||
\ 'executable_callback': 'ale_linters#cpp#cquery#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'cpp_cquery_executable')},
|
||||||
\ 'command_callback': 'ale_linters#cpp#cquery#GetCommand',
|
\ 'command': '%e',
|
||||||
\ 'project_root_callback': 'ale_linters#cpp#cquery#GetProjectRoot',
|
\ 'project_root': function('ale_linters#cpp#cquery#GetProjectRoot'),
|
||||||
\ 'initialization_options_callback': 'ale_linters#cpp#cquery#GetInitializationOptions',
|
\ 'initialization_options': function('ale_linters#cpp#cquery#GetInitializationOptions'),
|
||||||
\ 'language': 'cpp',
|
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -6,26 +6,20 @@ call ale#Set('cpp_flawfinder_options', '')
|
|||||||
call ale#Set('cpp_flawfinder_minlevel', 1)
|
call ale#Set('cpp_flawfinder_minlevel', 1)
|
||||||
call ale#Set('c_flawfinder_error_severity', 6)
|
call ale#Set('c_flawfinder_error_severity', 6)
|
||||||
|
|
||||||
function! ale_linters#cpp#flawfinder#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'cpp_flawfinder_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#cpp#flawfinder#GetCommand(buffer) abort
|
function! ale_linters#cpp#flawfinder#GetCommand(buffer) abort
|
||||||
|
" Set the minimum vulnerability level for flawfinder to bother with
|
||||||
|
let l:minlevel = ' --minlevel=' . ale#Var(a:buffer, 'cpp_flawfinder_minlevel')
|
||||||
|
|
||||||
" Set the minimum vulnerability level for flawfinder to bother with
|
return '%e -CDQS'
|
||||||
let l:minlevel = ' --minlevel=' . ale#Var(a:buffer, 'cpp_flawfinder_minlevel')
|
\ . ale#Var(a:buffer, 'cpp_flawfinder_options')
|
||||||
|
\ . l:minlevel
|
||||||
return ale#Escape(ale_linters#cpp#flawfinder#GetExecutable(a:buffer))
|
\ . ' %t'
|
||||||
\ . ' -CDQS'
|
|
||||||
\ . ale#Var(a:buffer, 'cpp_flawfinder_options')
|
|
||||||
\ . l:minlevel
|
|
||||||
\ . ' %t'
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('cpp', {
|
call ale#linter#Define('cpp', {
|
||||||
\ 'name': 'flawfinder',
|
\ 'name': 'flawfinder',
|
||||||
\ 'output_stream': 'stdout',
|
\ 'output_stream': 'stdout',
|
||||||
\ 'executable_callback': 'ale_linters#cpp#flawfinder#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'cpp_flawfinder_executable')},
|
||||||
\ 'command_callback': 'ale_linters#cpp#flawfinder#GetCommand',
|
\ 'command': function('ale_linters#cpp#flawfinder#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#flawfinder#HandleFlawfinderFormat',
|
\ 'callback': 'ale#handlers#flawfinder#HandleFlawfinderFormat',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -4,30 +4,26 @@
|
|||||||
call ale#Set('cpp_gcc_executable', 'gcc')
|
call ale#Set('cpp_gcc_executable', 'gcc')
|
||||||
call ale#Set('cpp_gcc_options', '-std=c++14 -Wall')
|
call ale#Set('cpp_gcc_options', '-std=c++14 -Wall')
|
||||||
|
|
||||||
function! ale_linters#cpp#gcc#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'cpp_gcc_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#cpp#gcc#GetCommand(buffer, output) abort
|
function! ale_linters#cpp#gcc#GetCommand(buffer, output) abort
|
||||||
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
||||||
|
|
||||||
" -iquote with the directory the file is in makes #include work for
|
" -iquote with the directory the file is in makes #include work for
|
||||||
" headers in the same directory.
|
" headers in the same directory.
|
||||||
return ale#Escape(ale_linters#cpp#gcc#GetExecutable(a:buffer))
|
"
|
||||||
\ . ' -S -x c++ -fsyntax-only '
|
" `-o /dev/null` or `-o null` is needed to catch all errors,
|
||||||
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) . ' '
|
" -fsyntax-only doesn't catch everything.
|
||||||
\ . l:cflags
|
return '%e -S -x c++'
|
||||||
\ . ale#Var(a:buffer, 'cpp_gcc_options') . ' -'
|
\ . ' -o ' . g:ale#util#nul_file
|
||||||
|
\ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||||
|
\ . ale#Pad(l:cflags)
|
||||||
|
\ . ale#Pad(ale#Var(a:buffer, 'cpp_gcc_options')) . ' -'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('cpp', {
|
call ale#linter#Define('cpp', {
|
||||||
\ 'name': 'gcc',
|
\ 'name': 'gcc',
|
||||||
\ 'aliases': ['g++'],
|
\ 'aliases': ['g++'],
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable_callback': 'ale_linters#cpp#gcc#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'cpp_gcc_executable')},
|
||||||
\ 'command_chain': [
|
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#cpp#gcc#GetCommand'))},
|
||||||
\ {'callback': 'ale#c#GetMakeCommand', 'output_stream': 'stdout'},
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||||
\ {'callback': 'ale_linters#cpp#gcc#GetCommand'},
|
|
||||||
\ ],
|
|
||||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
|
||||||
\})
|
\})
|
||||||
|
|||||||
57
ale_linters/crystal/ameba.vim
Normal file
57
ale_linters/crystal/ameba.vim
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
" Author: Harrison Bachrach - https://github.com/HarrisonB
|
||||||
|
" Description: Ameba, a linter for crystal files
|
||||||
|
|
||||||
|
call ale#Set('crystal_ameba_executable', 'bin/ameba')
|
||||||
|
|
||||||
|
function! ale_linters#crystal#ameba#GetCommand(buffer) abort
|
||||||
|
let l:executable = ale#Var(a:buffer, 'crystal_ameba_executable')
|
||||||
|
|
||||||
|
return ale#Escape(l:executable)
|
||||||
|
\ . ' --format json '
|
||||||
|
\ . ale#Escape(expand('#' . a:buffer . ':p'))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Handle output from ameba
|
||||||
|
function! ale_linters#crystal#ameba#HandleAmebaOutput(buffer, lines) abort
|
||||||
|
if len(a:lines) == 0
|
||||||
|
return []
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:errors = ale#util#FuzzyJSONDecode(a:lines[0], {})
|
||||||
|
|
||||||
|
if !has_key(l:errors, 'summary')
|
||||||
|
\|| l:errors['summary']['issues_count'] == 0
|
||||||
|
\|| empty(l:errors['sources'])
|
||||||
|
return []
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:error in l:errors['sources'][0]['issues']
|
||||||
|
let l:start_col = str2nr(l:error['location']['column'])
|
||||||
|
let l:end_col = str2nr(l:error['end_location']['column'])
|
||||||
|
|
||||||
|
if !l:end_col
|
||||||
|
let l:end_col = l:start_col + 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': str2nr(l:error['location']['line']),
|
||||||
|
\ 'col': l:start_col,
|
||||||
|
\ 'end_col': l:end_col,
|
||||||
|
\ 'code': l:error['rule_name'],
|
||||||
|
\ 'text': l:error['message'],
|
||||||
|
\ 'type': 'W',
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('crystal', {
|
||||||
|
\ 'name': 'ameba',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'crystal_ameba_executable')},
|
||||||
|
\ 'command': function('ale_linters#crystal#ameba#GetCommand'),
|
||||||
|
\ 'callback': 'ale_linters#crystal#ameba#HandleAmebaOutput',
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\})
|
||||||
@@ -26,6 +26,6 @@ call ale#linter#Define('crystal', {
|
|||||||
\ 'executable': 'crystal',
|
\ 'executable': 'crystal',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
\ 'command_callback': 'ale_linters#crystal#crystal#GetCommand',
|
\ 'command': function('ale_linters#crystal#crystal#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#crystal#crystal#Handle',
|
\ 'callback': 'ale_linters#crystal#crystal#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
let g:ale_cs_mcs_options = get(g:, 'ale_cs_mcs_options', '')
|
let g:ale_cs_mcs_options = get(g:, 'ale_cs_mcs_options', '')
|
||||||
|
|
||||||
function! ale_linters#cs#mcs#GetCommand(buffer) abort
|
function! ale_linters#cs#mcs#GetCommand(buffer) abort
|
||||||
return 'mcs -unsafe --parse ' . ale#Var(a:buffer, 'cs_mcs_options') . ' %t'
|
let l:options = ale#Var(a:buffer, 'cs_mcs_options')
|
||||||
|
|
||||||
|
return 'mcs -unsafe --parse'
|
||||||
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
|
\ . ' %t'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#cs#mcs#Handle(buffer, lines) abort
|
function! ale_linters#cs#mcs#Handle(buffer, lines) abort
|
||||||
@@ -28,6 +32,6 @@ call ale#linter#Define('cs',{
|
|||||||
\ 'name': 'mcs',
|
\ 'name': 'mcs',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable': 'mcs',
|
\ 'executable': 'mcs',
|
||||||
\ 'command_callback': 'ale_linters#cs#mcs#GetCommand',
|
\ 'command': function('ale_linters#cs#mcs#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#cs#mcs#Handle',
|
\ 'callback': 'ale_linters#cs#mcs#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -29,16 +29,16 @@ function! ale_linters#cs#mcsc#GetCommand(buffer) abort
|
|||||||
\ : ''
|
\ : ''
|
||||||
|
|
||||||
" register temporary module target file with ale
|
" register temporary module target file with ale
|
||||||
let l:out = tempname()
|
" register temporary module target file with ALE.
|
||||||
call ale#engine#ManageFile(a:buffer, l:out)
|
let l:out = ale#command#CreateFile(a:buffer)
|
||||||
|
|
||||||
" The code is compiled as a module and the output is redirected to a
|
" The code is compiled as a module and the output is redirected to a
|
||||||
" temporary file.
|
" temporary file.
|
||||||
return ale#path#CdString(s:GetWorkingDirectory(a:buffer))
|
return ale#path#CdString(s:GetWorkingDirectory(a:buffer))
|
||||||
\ . 'mcs -unsafe'
|
\ . 'mcs -unsafe'
|
||||||
\ . ' ' . ale#Var(a:buffer, 'cs_mcsc_options')
|
\ . ale#Pad(ale#Var(a:buffer, 'cs_mcsc_options'))
|
||||||
\ . ' ' . l:lib_option
|
\ . ale#Pad(l:lib_option)
|
||||||
\ . ' ' . l:r_option
|
\ . ale#Pad(l:r_option)
|
||||||
\ . ' -out:' . l:out
|
\ . ' -out:' . l:out
|
||||||
\ . ' -t:module'
|
\ . ' -t:module'
|
||||||
\ . ' -recurse:' . ale#Escape('*.cs')
|
\ . ' -recurse:' . ale#Escape('*.cs')
|
||||||
@@ -75,7 +75,7 @@ call ale#linter#Define('cs',{
|
|||||||
\ 'name': 'mcsc',
|
\ 'name': 'mcsc',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable': 'mcs',
|
\ 'executable': 'mcs',
|
||||||
\ 'command_callback': 'ale_linters#cs#mcsc#GetCommand',
|
\ 'command': function('ale_linters#cs#mcsc#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#cs#mcsc#Handle',
|
\ 'callback': 'ale_linters#cs#mcsc#Handle',
|
||||||
\ 'lint_file': 1
|
\ 'lint_file': 1
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -13,6 +13,6 @@ endfunction
|
|||||||
call ale#linter#Define('css', {
|
call ale#linter#Define('css', {
|
||||||
\ 'name': 'csslint',
|
\ 'name': 'csslint',
|
||||||
\ 'executable': 'csslint',
|
\ 'executable': 'csslint',
|
||||||
\ 'command_callback': 'ale_linters#css#csslint#GetCommand',
|
\ 'command': function('ale_linters#css#csslint#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#css#HandleCSSLintFormat',
|
\ 'callback': 'ale#handlers#css#HandleCSSLintFormat',
|
||||||
\})
|
\})
|
||||||
|
|||||||
9
ale_linters/css/fecs.vim
Normal file
9
ale_linters/css/fecs.vim
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
" Author: harttle <yangjvn@126.com>
|
||||||
|
" Description: fecs for CSS files
|
||||||
|
|
||||||
|
call ale#linter#Define('css', {
|
||||||
|
\ 'name': 'fecs',
|
||||||
|
\ 'executable': function('ale#handlers#fecs#GetExecutable'),
|
||||||
|
\ 'command': function('ale#handlers#fecs#GetCommand'),
|
||||||
|
\ 'callback': 'ale#handlers#fecs#Handle',
|
||||||
|
\})
|
||||||
@@ -4,21 +4,16 @@ call ale#Set('css_stylelint_executable', 'stylelint')
|
|||||||
call ale#Set('css_stylelint_options', '')
|
call ale#Set('css_stylelint_options', '')
|
||||||
call ale#Set('css_stylelint_use_global', get(g:, 'ale_use_global_executables', 0))
|
call ale#Set('css_stylelint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
|
|
||||||
function! ale_linters#css#stylelint#GetExecutable(buffer) abort
|
|
||||||
return ale#node#FindExecutable(a:buffer, 'css_stylelint', [
|
|
||||||
\ 'node_modules/.bin/stylelint',
|
|
||||||
\])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#css#stylelint#GetCommand(buffer) abort
|
function! ale_linters#css#stylelint#GetCommand(buffer) abort
|
||||||
return ale_linters#css#stylelint#GetExecutable(a:buffer)
|
return '%e ' . ale#Pad(ale#Var(a:buffer, 'css_stylelint_options'))
|
||||||
\ . ' ' . ale#Var(a:buffer, 'css_stylelint_options')
|
|
||||||
\ . ' --stdin-filename %s'
|
\ . ' --stdin-filename %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('css', {
|
call ale#linter#Define('css', {
|
||||||
\ 'name': 'stylelint',
|
\ 'name': 'stylelint',
|
||||||
\ 'executable_callback': 'ale_linters#css#stylelint#GetExecutable',
|
\ 'executable': {b -> ale#node#FindExecutable(b, 'css_stylelint', [
|
||||||
\ 'command_callback': 'ale_linters#css#stylelint#GetCommand',
|
\ 'node_modules/.bin/stylelint',
|
||||||
|
\ ])},
|
||||||
|
\ 'command': function('ale_linters#css#stylelint#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
|
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ function! ale_linters#cucumber#cucumber#Handle(buffer, lines) abort
|
|||||||
endtry
|
endtry
|
||||||
|
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
for l:element in get(l:json, 'elements', [])
|
for l:element in get(l:json, 'elements', [])
|
||||||
for l:step in l:element['steps']
|
for l:step in l:element['steps']
|
||||||
if l:step['result']['status'] is# 'undefined'
|
if l:step['result']['status'] is# 'undefined'
|
||||||
@@ -40,6 +41,6 @@ endfunction
|
|||||||
call ale#linter#Define('cucumber', {
|
call ale#linter#Define('cucumber', {
|
||||||
\ 'name': 'cucumber',
|
\ 'name': 'cucumber',
|
||||||
\ 'executable': 'cucumber',
|
\ 'executable': 'cucumber',
|
||||||
\ 'command_callback': 'ale_linters#cucumber#cucumber#GetCommand',
|
\ 'command': function('ale_linters#cucumber#cucumber#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#cucumber#cucumber#Handle'
|
\ 'callback': 'ale_linters#cucumber#cucumber#Handle'
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -4,20 +4,14 @@
|
|||||||
call ale#Set('cuda_nvcc_executable', 'nvcc')
|
call ale#Set('cuda_nvcc_executable', 'nvcc')
|
||||||
call ale#Set('cuda_nvcc_options', '-std=c++11')
|
call ale#Set('cuda_nvcc_options', '-std=c++11')
|
||||||
|
|
||||||
function! ale_linters#cuda#nvcc#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'cuda_nvcc_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#cuda#nvcc#GetCommand(buffer) abort
|
function! ale_linters#cuda#nvcc#GetCommand(buffer) abort
|
||||||
" Unused: use ale#util#nul_file
|
" Unused: use ale#util#nul_file
|
||||||
" let l:output_file = tempname() . '.ii'
|
" let l:output_file = ale#util#Tempname() . '.ii'
|
||||||
" call ale#engine#ManageFile(a:buffer, l:output_file)
|
" call ale#command#ManageFile(a:buffer, l:output_file)
|
||||||
|
return '%e -cuda'
|
||||||
return ale#Escape(ale_linters#cuda#nvcc#GetExecutable(a:buffer))
|
\ . ale#Pad(ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer)))
|
||||||
\ . ' -cuda '
|
\ . ale#Pad(ale#Var(a:buffer, 'cuda_nvcc_options'))
|
||||||
\ . ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer))
|
\ . ' %s -o ' . g:ale#util#nul_file
|
||||||
\ . ale#Var(a:buffer, 'cuda_nvcc_options') . ' %s'
|
|
||||||
\ . ' -o ' . g:ale#util#nul_file
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#cuda#nvcc#HandleNVCCFormat(buffer, lines) abort
|
function! ale_linters#cuda#nvcc#HandleNVCCFormat(buffer, lines) abort
|
||||||
@@ -28,7 +22,6 @@ function! ale_linters#cuda#nvcc#HandleNVCCFormat(buffer, lines) abort
|
|||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
|
||||||
let l:item = {
|
let l:item = {
|
||||||
\ 'lnum': str2nr(l:match[2]),
|
\ 'lnum': str2nr(l:match[2]),
|
||||||
\ 'type': l:match[4] =~# 'error' ? 'E' : 'W',
|
\ 'type': l:match[4] =~# 'error' ? 'E' : 'W',
|
||||||
@@ -49,8 +42,8 @@ endfunction
|
|||||||
call ale#linter#Define('cuda', {
|
call ale#linter#Define('cuda', {
|
||||||
\ 'name': 'nvcc',
|
\ 'name': 'nvcc',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable_callback': 'ale_linters#cuda#nvcc#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'cuda_nvcc_executable')},
|
||||||
\ 'command_callback': 'ale_linters#cuda#nvcc#GetCommand',
|
\ 'command': function('ale_linters#cuda#nvcc#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#cuda#nvcc#HandleNVCCFormat',
|
\ 'callback': 'ale_linters#cuda#nvcc#HandleNVCCFormat',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
\})
|
\})
|
||||||
|
|||||||
26
ale_linters/cypher/cypher_lint.vim
Normal file
26
ale_linters/cypher/cypher_lint.vim
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
" Author: Francisco Lopes <francisco@oblita.com>
|
||||||
|
" Description: Linting for Neo4j's Cypher
|
||||||
|
|
||||||
|
function! ale_linters#cypher#cypher_lint#Handle(buffer, lines) abort
|
||||||
|
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+): (.*)$'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': l:match[2] + 0,
|
||||||
|
\ 'col': l:match[3] + 0,
|
||||||
|
\ 'text': l:match[4],
|
||||||
|
\ 'type': 'E',
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('cypher', {
|
||||||
|
\ 'name': 'cypher_lint',
|
||||||
|
\ 'executable': 'cypher-lint',
|
||||||
|
\ 'command': 'cypher-lint',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'callback': 'ale_linters#cypher#cypher_lint#Handle',
|
||||||
|
\})
|
||||||
22
ale_linters/d/dls.vim
Normal file
22
ale_linters/d/dls.vim
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
" Author: aurieh <me@aurieh.me>
|
||||||
|
" Description: A Language Server implementation for D
|
||||||
|
|
||||||
|
call ale#Set('d_dls_executable', 'dls')
|
||||||
|
|
||||||
|
function! ale_linters#d#dls#GetExecutable(buffer) abort
|
||||||
|
return ale#Var(a:buffer, 'd_dls_executable')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#d#dls#FindProjectRoot(buffer) abort
|
||||||
|
" Note: this will return . if dub config is empty
|
||||||
|
" dls can run outside DUB projects just fine
|
||||||
|
return fnamemodify(ale#d#FindDUBConfig(a:buffer), ':h')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('d', {
|
||||||
|
\ 'name': 'dls',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': function('ale_linters#d#dls#GetExecutable'),
|
||||||
|
\ 'command': function('ale_linters#d#dls#GetExecutable'),
|
||||||
|
\ 'project_root': function('ale_linters#d#dls#FindProjectRoot'),
|
||||||
|
\})
|
||||||
@@ -1,28 +1,14 @@
|
|||||||
" Author: w0rp <devw0rp@gmail.com>
|
" Author: w0rp <devw0rp@gmail.com>
|
||||||
" Description: "dmd for D files"
|
" Description: "dmd for D files"
|
||||||
|
|
||||||
function! s:FindDUBConfig(buffer) abort
|
function! ale_linters#d#dmd#GetDUBCommand(buffer) abort
|
||||||
" Find a DUB configuration file in ancestor paths.
|
|
||||||
" The most DUB-specific names will be tried first.
|
|
||||||
for l:possible_filename in ['dub.sdl', 'dub.json', 'package.json']
|
|
||||||
let l:dub_file = ale#path#FindNearestFile(a:buffer, l:possible_filename)
|
|
||||||
|
|
||||||
if !empty(l:dub_file)
|
|
||||||
return l:dub_file
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
|
|
||||||
return ''
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#d#dmd#DUBCommand(buffer) abort
|
|
||||||
" If we can't run dub, then skip this command.
|
" If we can't run dub, then skip this command.
|
||||||
if !executable('dub')
|
if !executable('dub')
|
||||||
" Returning an empty string skips to the DMD command.
|
" Returning an empty string skips to the DMD command.
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:dub_file = s:FindDUBConfig(a:buffer)
|
let l:dub_file = ale#d#FindDUBConfig(a:buffer)
|
||||||
|
|
||||||
if empty(l:dub_file)
|
if empty(l:dub_file)
|
||||||
return ''
|
return ''
|
||||||
@@ -35,7 +21,18 @@ function! ale_linters#d#dmd#DUBCommand(buffer) abort
|
|||||||
\ . ' && dub describe --import-paths'
|
\ . ' && dub describe --import-paths'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#d#dmd#DMDCommand(buffer, dub_output) abort
|
function! ale_linters#d#dmd#RunDUBCommand(buffer) abort
|
||||||
|
let l:command = ale_linters#d#dmd#GetDUBCommand(a:buffer)
|
||||||
|
|
||||||
|
if empty(l:command)
|
||||||
|
" If we can't run DUB, just run DMD.
|
||||||
|
return ale_linters#d#dmd#DMDCommand(a:buffer, [], {})
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ale#command#Run(a:buffer, l:command, function('ale_linters#d#dmd#DMDCommand'))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#d#dmd#DMDCommand(buffer, dub_output, meta) abort
|
||||||
let l:import_list = []
|
let l:import_list = []
|
||||||
|
|
||||||
" Build a list of import paths generated from DUB, if available.
|
" Build a list of import paths generated from DUB, if available.
|
||||||
@@ -71,9 +68,7 @@ endfunction
|
|||||||
call ale#linter#Define('d', {
|
call ale#linter#Define('d', {
|
||||||
\ 'name': 'dmd',
|
\ 'name': 'dmd',
|
||||||
\ 'executable': 'dmd',
|
\ 'executable': 'dmd',
|
||||||
\ 'command_chain': [
|
\ 'command': function('ale_linters#d#dmd#RunDUBCommand'),
|
||||||
\ {'callback': 'ale_linters#d#dmd#DUBCommand', 'output_stream': 'stdout'},
|
|
||||||
\ {'callback': 'ale_linters#d#dmd#DMDCommand', 'output_stream': 'stderr'},
|
|
||||||
\ ],
|
|
||||||
\ 'callback': 'ale_linters#d#dmd#Handle',
|
\ 'callback': 'ale_linters#d#dmd#Handle',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ function! ale_linters#dafny#dafny#Handle(buffer, lines) abort
|
|||||||
\ 'type': l:match[4] =~# '^Error' ? 'E' : 'W'
|
\ 'type': l:match[4] =~# '^Error' ? 'E' : 'W'
|
||||||
\ })
|
\ })
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
return l:output
|
return l:output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -3,15 +3,10 @@
|
|||||||
|
|
||||||
call ale#Set('dart_dartanalyzer_executable', 'dartanalyzer')
|
call ale#Set('dart_dartanalyzer_executable', 'dartanalyzer')
|
||||||
|
|
||||||
function! ale_linters#dart#dartanalyzer#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'dart_dartanalyzer_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#dart#dartanalyzer#GetCommand(buffer) abort
|
function! ale_linters#dart#dartanalyzer#GetCommand(buffer) abort
|
||||||
let l:executable = ale_linters#dart#dartanalyzer#GetExecutable(a:buffer)
|
|
||||||
let l:path = ale#path#FindNearestFile(a:buffer, '.packages')
|
let l:path = ale#path#FindNearestFile(a:buffer, '.packages')
|
||||||
|
|
||||||
return ale#Escape(l:executable)
|
return '%e'
|
||||||
\ . (!empty(l:path) ? ' --packages ' . ale#Escape(l:path) : '')
|
\ . (!empty(l:path) ? ' --packages ' . ale#Escape(l:path) : '')
|
||||||
\ . ' %s'
|
\ . ' %s'
|
||||||
endfunction
|
endfunction
|
||||||
@@ -34,8 +29,8 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('dart', {
|
call ale#linter#Define('dart', {
|
||||||
\ 'name': 'dartanalyzer',
|
\ 'name': 'dartanalyzer',
|
||||||
\ 'executable_callback': 'ale_linters#dart#dartanalyzer#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'dart_dartanalyzer_executable')},
|
||||||
\ 'command_callback': 'ale_linters#dart#dartanalyzer#GetCommand',
|
\ 'command': function('ale_linters#dart#dartanalyzer#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#dart#dartanalyzer#Handle',
|
\ 'callback': 'ale_linters#dart#dartanalyzer#Handle',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -3,10 +3,6 @@
|
|||||||
|
|
||||||
call ale#Set('dart_language_server_executable', 'dart_language_server')
|
call ale#Set('dart_language_server_executable', 'dart_language_server')
|
||||||
|
|
||||||
function! ale_linters#dart#language_server#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'dart_language_server_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#dart#language_server#GetProjectRoot(buffer) abort
|
function! ale_linters#dart#language_server#GetProjectRoot(buffer) abort
|
||||||
" Note: pub only looks for pubspec.yaml, there's no point in adding
|
" Note: pub only looks for pubspec.yaml, there's no point in adding
|
||||||
" support for pubspec.yml
|
" support for pubspec.yml
|
||||||
@@ -18,8 +14,7 @@ endfunction
|
|||||||
call ale#linter#Define('dart', {
|
call ale#linter#Define('dart', {
|
||||||
\ 'name': 'language_server',
|
\ 'name': 'language_server',
|
||||||
\ 'lsp': 'stdio',
|
\ 'lsp': 'stdio',
|
||||||
\ 'executable_callback': 'ale_linters#dart#language_server#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'dart_language_server_executable')},
|
||||||
\ 'command_callback': 'ale_linters#dart#language_server#GetExecutable',
|
\ 'command': '%e',
|
||||||
\ 'language': 'dart',
|
\ 'project_root': function('ale_linters#dart#language_server#GetProjectRoot'),
|
||||||
\ 'project_root_callback': 'ale_linters#dart#language_server#GetProjectRoot',
|
|
||||||
\})
|
\})
|
||||||
|
|||||||
61
ale_linters/dockerfile/dockerfile_lint.vim
Normal file
61
ale_linters/dockerfile/dockerfile_lint.vim
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
" Author: Alexander Olofsson <alexander.olofsson@liu.se>
|
||||||
|
|
||||||
|
call ale#Set('dockerfile_dockerfile_lint_executable', 'dockerfile_lint')
|
||||||
|
call ale#Set('dockerfile_dockerfile_lint_options', '')
|
||||||
|
|
||||||
|
function! ale_linters#dockerfile#dockerfile_lint#GetType(type) abort
|
||||||
|
if a:type is? 'error'
|
||||||
|
return 'E'
|
||||||
|
elseif a:type is? 'warn'
|
||||||
|
return 'W'
|
||||||
|
endif
|
||||||
|
|
||||||
|
return 'I'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#dockerfile#dockerfile_lint#Handle(buffer, lines) abort
|
||||||
|
try
|
||||||
|
let l:data = json_decode(join(a:lines, ''))
|
||||||
|
catch
|
||||||
|
return []
|
||||||
|
endtry
|
||||||
|
|
||||||
|
if empty(l:data)
|
||||||
|
" Should never happen, but it's better to be on the safe side
|
||||||
|
return []
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:messages = []
|
||||||
|
|
||||||
|
for l:type in ['error', 'warn', 'info']
|
||||||
|
for l:object in l:data[l:type]['data']
|
||||||
|
let l:line = get(l:object, 'line', -1)
|
||||||
|
let l:message = l:object['message']
|
||||||
|
|
||||||
|
if get(l:object, 'description', 'None') isnot# 'None'
|
||||||
|
let l:message = l:message . '. ' . l:object['description']
|
||||||
|
endif
|
||||||
|
|
||||||
|
call add(l:messages, {
|
||||||
|
\ 'lnum': l:line,
|
||||||
|
\ 'text': l:message,
|
||||||
|
\ 'type': ale_linters#dockerfile#dockerfile_lint#GetType(l:type),
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:messages
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#dockerfile#dockerfile_lint#GetCommand(buffer) abort
|
||||||
|
return '%e' . ale#Pad(ale#Var(a:buffer, 'dockerfile_dockerfile_lint_options'))
|
||||||
|
\ . ' -p -j -f'
|
||||||
|
\ . ' %t'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('dockerfile', {
|
||||||
|
\ 'name': 'dockerfile_lint',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'dockerfile_dockerfile_lint_executable')},
|
||||||
|
\ 'command': function('ale_linters#dockerfile#dockerfile_lint#GetCommand'),
|
||||||
|
\ 'callback': 'ale_linters#dockerfile#dockerfile_lint#Handle',
|
||||||
|
\})
|
||||||
@@ -82,16 +82,18 @@ endfunction
|
|||||||
|
|
||||||
function! ale_linters#dockerfile#hadolint#GetCommand(buffer) abort
|
function! ale_linters#dockerfile#hadolint#GetCommand(buffer) abort
|
||||||
let l:command = ale_linters#dockerfile#hadolint#GetExecutable(a:buffer)
|
let l:command = ale_linters#dockerfile#hadolint#GetExecutable(a:buffer)
|
||||||
|
|
||||||
if l:command is# 'docker'
|
if l:command is# 'docker'
|
||||||
return 'docker run --rm -i ' . ale#Var(a:buffer, 'dockerfile_hadolint_docker_image')
|
return 'docker run --rm -i ' . ale#Var(a:buffer, 'dockerfile_hadolint_docker_image')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return 'hadolint -'
|
return 'hadolint -'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
call ale#linter#Define('dockerfile', {
|
call ale#linter#Define('dockerfile', {
|
||||||
\ 'name': 'hadolint',
|
\ 'name': 'hadolint',
|
||||||
\ 'executable_callback': 'ale_linters#dockerfile#hadolint#GetExecutable',
|
\ 'executable': function('ale_linters#dockerfile#hadolint#GetExecutable'),
|
||||||
\ 'command_callback': 'ale_linters#dockerfile#hadolint#GetCommand',
|
\ 'command': function('ale_linters#dockerfile#hadolint#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#dockerfile#hadolint#Handle',
|
\ 'callback': 'ale_linters#dockerfile#hadolint#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -11,10 +11,18 @@ function! ale_linters#elixir#credo#Handle(buffer, lines) abort
|
|||||||
let l:type = l:match[3]
|
let l:type = l:match[3]
|
||||||
let l:text = l:match[4]
|
let l:text = l:match[4]
|
||||||
|
|
||||||
if l:type is# 'C'
|
" Refactoring opportunities
|
||||||
let l:type = 'E'
|
if l:type is# 'F'
|
||||||
elseif l:type is# 'R'
|
|
||||||
let l:type = 'W'
|
let l:type = 'W'
|
||||||
|
" Consistency
|
||||||
|
elseif l:type is# 'C'
|
||||||
|
let l:type = 'W'
|
||||||
|
" Software Design
|
||||||
|
elseif l:type is# 'D'
|
||||||
|
let l:type = 'I'
|
||||||
|
" Code Readability
|
||||||
|
elseif l:type is# 'R'
|
||||||
|
let l:type = 'I'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
@@ -29,9 +37,27 @@ function! ale_linters#elixir#credo#Handle(buffer, lines) abort
|
|||||||
return l:output
|
return l:output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#elixir#credo#GetMode() abort
|
||||||
|
if get(g:, 'ale_elixir_credo_strict', 0)
|
||||||
|
return '--strict'
|
||||||
|
else
|
||||||
|
return 'suggest'
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#elixir#credo#GetCommand(buffer) abort
|
||||||
|
let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer)
|
||||||
|
let l:mode = ale_linters#elixir#credo#GetMode()
|
||||||
|
|
||||||
|
return ale#path#CdString(l:project_root)
|
||||||
|
\ . 'mix help credo && '
|
||||||
|
\ . 'mix credo ' . ale_linters#elixir#credo#GetMode()
|
||||||
|
\ . ' --format=flycheck --read-from-stdin %s'
|
||||||
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('elixir', {
|
call ale#linter#Define('elixir', {
|
||||||
\ 'name': 'credo',
|
\ 'name': 'credo',
|
||||||
\ 'executable': 'mix',
|
\ 'executable': 'mix',
|
||||||
\ 'command': 'mix help credo && mix credo suggest --format=flycheck --read-from-stdin %s',
|
\ 'command': function('ale_linters#elixir#credo#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#elixir#credo#Handle',
|
\ 'callback': 'ale_linters#elixir#credo#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -25,10 +25,17 @@ function! ale_linters#elixir#dialyxir#Handle(buffer, lines) abort
|
|||||||
return l:output
|
return l:output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#elixir#dialyxir#GetCommand(buffer) abort
|
||||||
|
let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer)
|
||||||
|
|
||||||
|
return ale#path#CdString(l:project_root)
|
||||||
|
\ . ' mix help dialyzer && mix dialyzer'
|
||||||
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('elixir', {
|
call ale#linter#Define('elixir', {
|
||||||
\ 'name': 'dialyxir',
|
\ 'name': 'dialyxir',
|
||||||
\ 'executable': 'mix',
|
\ 'executable': 'mix',
|
||||||
\ 'command': 'mix dialyzer',
|
\ 'command': function('ale_linters#elixir#dialyxir#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#elixir#dialyxir#Handle',
|
\ 'callback': 'ale_linters#elixir#dialyxir#Handle',
|
||||||
\})
|
\})
|
||||||
|
|
||||||
|
|||||||
@@ -29,10 +29,17 @@ function! ale_linters#elixir#dogma#Handle(buffer, lines) abort
|
|||||||
return l:output
|
return l:output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#elixir#dogma#GetCommand(buffer) abort
|
||||||
|
let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer)
|
||||||
|
|
||||||
|
return ale#path#CdString(l:project_root)
|
||||||
|
\ . ' mix help dogma && mix dogma %s --format=flycheck'
|
||||||
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('elixir', {
|
call ale#linter#Define('elixir', {
|
||||||
\ 'name': 'dogma',
|
\ 'name': 'dogma',
|
||||||
\ 'executable': 'mix',
|
\ 'executable': 'mix',
|
||||||
\ 'command': 'mix help dogma && mix dogma %s --format=flycheck',
|
\ 'command': function('ale_linters#elixir#dogma#GetCommand'),
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
\ 'callback': 'ale_linters#elixir#dogma#Handle',
|
\ 'callback': 'ale_linters#elixir#dogma#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
21
ale_linters/elixir/elixir_ls.vim
Normal file
21
ale_linters/elixir/elixir_ls.vim
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
" Author: Jon Parise <jon@indelible.org>
|
||||||
|
" Description: ElixirLS integration (https://github.com/JakeBecker/elixir-ls)
|
||||||
|
|
||||||
|
call ale#Set('elixir_elixir_ls_release', 'elixir-ls')
|
||||||
|
call ale#Set('elixir_elixir_ls_config', {})
|
||||||
|
|
||||||
|
function! ale_linters#elixir#elixir_ls#GetExecutable(buffer) abort
|
||||||
|
let l:dir = ale#path#Simplify(ale#Var(a:buffer, 'elixir_elixir_ls_release'))
|
||||||
|
let l:cmd = has('win32') ? '\language_server.bat' : '/language_server.sh'
|
||||||
|
|
||||||
|
return l:dir . l:cmd
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('elixir', {
|
||||||
|
\ 'name': 'elixir-ls',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': function('ale_linters#elixir#elixir_ls#GetExecutable'),
|
||||||
|
\ 'command': function('ale_linters#elixir#elixir_ls#GetExecutable'),
|
||||||
|
\ 'project_root': function('ale#handlers#elixir#FindMixUmbrellaRoot'),
|
||||||
|
\ 'lsp_config': {b -> ale#Var(b, 'elixir_elixir_ls_config')},
|
||||||
|
\})
|
||||||
@@ -10,7 +10,6 @@ function! ale_linters#elixir#mix#Handle(buffer, lines) abort
|
|||||||
"
|
"
|
||||||
" TODO: Warning format
|
" TODO: Warning format
|
||||||
" warning: variable "foobar" does not exist and is being expanded to "foobar()", please use parentheses to remove the ambiguity or change the variable name
|
" warning: variable "foobar" does not exist and is being expanded to "foobar()", please use parentheses to remove the ambiguity or change the variable name
|
||||||
|
|
||||||
let l:pattern = '\v\(([^\)]+Error)\) ([^:]+):([^:]+): (.+)$'
|
let l:pattern = '\v\(([^\)]+Error)\) ([^:]+):([^:]+): (.+)$'
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
@@ -30,32 +29,24 @@ function! ale_linters#elixir#mix#Handle(buffer, lines) abort
|
|||||||
return l:output
|
return l:output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#elixir#mix#FindProjectRoot(buffer) abort
|
|
||||||
let l:mix_file = ale#path#FindNearestFile(a:buffer, 'mix.exs')
|
|
||||||
if !empty(l:mix_file)
|
|
||||||
return fnamemodify(l:mix_file, ':p:h')
|
|
||||||
endif
|
|
||||||
return '.'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#elixir#mix#GetCommand(buffer) abort
|
function! ale_linters#elixir#mix#GetCommand(buffer) abort
|
||||||
let l:project_root = ale_linters#elixir#mix#FindProjectRoot(a:buffer)
|
let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer)
|
||||||
|
|
||||||
let l:temp_dir = ale#engine#CreateDirectory(a:buffer)
|
let l:temp_dir = ale#command#CreateDirectory(a:buffer)
|
||||||
|
|
||||||
let l:mix_build_path = has('win32')
|
let l:mix_build_path = has('win32')
|
||||||
\ ? 'set MIX_BUILD_PATH=' . ale#Escape(l:temp_dir) . ' &&'
|
\ ? 'set MIX_BUILD_PATH=' . ale#Escape(l:temp_dir) . ' &&'
|
||||||
\ : 'MIX_BUILD_PATH=' . ale#Escape(l:temp_dir)
|
\ : 'MIX_BUILD_PATH=' . ale#Escape(l:temp_dir)
|
||||||
|
|
||||||
return ale#path#CdString(l:project_root)
|
return ale#path#CdString(l:project_root)
|
||||||
\ . l:mix_build_path
|
\ . l:mix_build_path
|
||||||
\ . ' mix compile %s'
|
\ . ' mix compile %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('elixir', {
|
call ale#linter#Define('elixir', {
|
||||||
\ 'name': 'mix',
|
\ 'name': 'mix',
|
||||||
\ 'executable': 'mix',
|
\ 'executable': 'mix',
|
||||||
\ 'command_callback': 'ale_linters#elixir#mix#GetCommand',
|
\ 'command': function('ale_linters#elixir#mix#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#elixir#mix#Handle',
|
\ 'callback': 'ale_linters#elixir#mix#Handle',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
\})
|
\})
|
||||||
|
|||||||
22
ale_linters/elm/elm_lsp.vim
Normal file
22
ale_linters/elm/elm_lsp.vim
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
" Author: antew - https://github.com/antew
|
||||||
|
" Description: LSP integration for elm, currently supports diagnostics (linting)
|
||||||
|
|
||||||
|
call ale#Set('elm_lsp_executable', 'elm-lsp')
|
||||||
|
call ale#Set('elm_lsp_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
|
|
||||||
|
function! elm_lsp#GetRootDir(buffer) abort
|
||||||
|
let l:elm_json = ale#path#FindNearestFile(a:buffer, 'elm.json')
|
||||||
|
|
||||||
|
return !empty(l:elm_json) ? fnamemodify(l:elm_json, ':p:h') : ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('elm', {
|
||||||
|
\ 'name': 'elm_lsp',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#node#FindExecutable(b, 'elm_lsp', [
|
||||||
|
\ 'node_modules/.bin/elm-lsp',
|
||||||
|
\ ])},
|
||||||
|
\ 'command': '%e --stdio',
|
||||||
|
\ 'project_root': function('elm_lsp#GetRootDir'),
|
||||||
|
\ 'language': 'elm'
|
||||||
|
\})
|
||||||
@@ -4,12 +4,6 @@
|
|||||||
call ale#Set('elm_make_executable', 'elm')
|
call ale#Set('elm_make_executable', 'elm')
|
||||||
call ale#Set('elm_make_use_global', get(g:, 'ale_use_global_executables', 0))
|
call ale#Set('elm_make_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
|
|
||||||
function! ale_linters#elm#make#GetExecutable(buffer) abort
|
|
||||||
return ale#node#FindExecutable(a:buffer, 'elm_make', [
|
|
||||||
\ 'node_modules/.bin/elm',
|
|
||||||
\])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#elm#make#Handle(buffer, lines) abort
|
function! ale_linters#elm#make#Handle(buffer, lines) abort
|
||||||
let l:output = []
|
let l:output = []
|
||||||
let l:unparsed_lines = []
|
let l:unparsed_lines = []
|
||||||
@@ -128,14 +122,7 @@ function! ale_linters#elm#make#HandleElm018Line(line, output) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#elm#make#FileIsBuffer(path) abort
|
function! ale_linters#elm#make#FileIsBuffer(path) abort
|
||||||
let l:is_windows = has('win32')
|
return ale#path#IsTempName(a:path)
|
||||||
let l:temp_dir = l:is_windows ? $TMP : $TMPDIR
|
|
||||||
|
|
||||||
if has('win32')
|
|
||||||
return a:path[0:len(l:temp_dir) - 1] is? l:temp_dir
|
|
||||||
else
|
|
||||||
return a:path[0:len(l:temp_dir) - 1] is# l:temp_dir
|
|
||||||
endif
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#elm#make#ParseMessage(message) abort
|
function! ale_linters#elm#make#ParseMessage(message) abort
|
||||||
@@ -143,47 +130,111 @@ function! ale_linters#elm#make#ParseMessage(message) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#elm#make#ParseMessageItem(item) abort
|
function! ale_linters#elm#make#ParseMessageItem(item) abort
|
||||||
if type(a:item) == type('')
|
if type(a:item) is v:t_string
|
||||||
return a:item
|
return a:item
|
||||||
else
|
else
|
||||||
return a:item.string
|
return a:item.string
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Return the command to execute the linter in the projects directory.
|
function! ale_linters#elm#make#GetPackageFile(buffer) abort
|
||||||
" If it doesn't, then this will fail when imports are needed.
|
|
||||||
function! ale_linters#elm#make#GetCommand(buffer) abort
|
|
||||||
let l:elm_json = ale#path#FindNearestFile(a:buffer, 'elm.json')
|
let l:elm_json = ale#path#FindNearestFile(a:buffer, 'elm.json')
|
||||||
let l:elm_exe = ale_linters#elm#make#GetExecutable(a:buffer)
|
|
||||||
|
|
||||||
if empty(l:elm_json)
|
if empty(l:elm_json)
|
||||||
" Fallback to Elm 0.18
|
" Fallback to Elm 0.18
|
||||||
let l:elm_json = ale#path#FindNearestFile(a:buffer, 'elm-package.json')
|
let l:elm_json = ale#path#FindNearestFile(a:buffer, 'elm-package.json')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
return l:elm_json
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#elm#make#IsVersionGte19(buffer) abort
|
||||||
|
let l:elm_json = ale_linters#elm#make#GetPackageFile(a:buffer)
|
||||||
|
|
||||||
|
if l:elm_json =~# '-package'
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#elm#make#GetRootDir(buffer) abort
|
||||||
|
let l:elm_json = ale_linters#elm#make#GetPackageFile(a:buffer)
|
||||||
|
|
||||||
if empty(l:elm_json)
|
if empty(l:elm_json)
|
||||||
|
return ''
|
||||||
|
else
|
||||||
|
return fnamemodify(l:elm_json, ':p:h')
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#elm#make#IsTest(buffer) abort
|
||||||
|
let l:root_dir = ale_linters#elm#make#GetRootDir(a:buffer)
|
||||||
|
|
||||||
|
if empty(l:root_dir)
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:tests_dir = join([l:root_dir, 'tests', ''], has('win32') ? '\' : '/')
|
||||||
|
|
||||||
|
let l:buffer_path = fnamemodify(bufname(a:buffer), ':p')
|
||||||
|
|
||||||
|
if stridx(l:buffer_path, l:tests_dir) == 0
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Return the command to execute the linter in the projects directory.
|
||||||
|
" If it doesn't, then this will fail when imports are needed.
|
||||||
|
function! ale_linters#elm#make#GetCommand(buffer) abort
|
||||||
|
let l:executable = ale_linters#elm#make#GetExecutable(a:buffer)
|
||||||
|
let l:root_dir = ale_linters#elm#make#GetRootDir(a:buffer)
|
||||||
|
let l:is_v19 = ale_linters#elm#make#IsVersionGte19(a:buffer)
|
||||||
|
let l:is_using_elm_test = l:executable =~# 'elm-test$'
|
||||||
|
|
||||||
|
if empty(l:root_dir)
|
||||||
let l:dir_set_cmd = ''
|
let l:dir_set_cmd = ''
|
||||||
else
|
else
|
||||||
let l:root_dir = fnamemodify(l:elm_json, ':p:h')
|
|
||||||
let l:dir_set_cmd = 'cd ' . ale#Escape(l:root_dir) . ' && '
|
let l:dir_set_cmd = 'cd ' . ale#Escape(l:root_dir) . ' && '
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" elm-test needs to know the path of elm-make if elm isn't installed globally.
|
||||||
|
" https://github.com/rtfeldman/node-test-runner/blob/57728f10668f2d2ab3179e7e3208bcfa9a1f19aa/README.md#--compiler
|
||||||
|
if l:is_v19 && l:is_using_elm_test
|
||||||
|
let l:elm_make_executable = ale#node#FindExecutable(a:buffer, 'elm_make', ['node_modules/.bin/elm'])
|
||||||
|
let l:elm_test_compiler_flag = ' --compiler ' . l:elm_make_executable . ' '
|
||||||
|
else
|
||||||
|
let l:elm_test_compiler_flag = ' '
|
||||||
|
endif
|
||||||
|
|
||||||
" The elm compiler, at the time of this writing, uses '/dev/null' as
|
" The elm compiler, at the time of this writing, uses '/dev/null' as
|
||||||
" a sort of flag to tell the compiler not to generate an output file,
|
" a sort of flag to tell the compiler not to generate an output file,
|
||||||
" which is why this is hard coded here.
|
" which is why this is hard coded here.
|
||||||
" Source: https://github.com/elm-lang/elm-compiler/blob/19d5a769b30ec0b2fc4475985abb4cd94cd1d6c3/builder/src/Generate/Output.hs#L253
|
" Source: https://github.com/elm-lang/elm-compiler/blob/19d5a769b30ec0b2fc4475985abb4cd94cd1d6c3/builder/src/Generate/Output.hs#L253
|
||||||
let l:elm_cmd = ale#Escape(l:elm_exe)
|
return l:dir_set_cmd . '%e make --report=json --output=/dev/null' . l:elm_test_compiler_flag . '%t'
|
||||||
\ . ' make'
|
endfunction
|
||||||
\ . ' --report=json'
|
|
||||||
\ . ' --output=/dev/null'
|
|
||||||
|
|
||||||
return l:dir_set_cmd . ' ' . l:elm_cmd . ' %t'
|
function! ale_linters#elm#make#GetExecutable(buffer) abort
|
||||||
|
let l:is_test = ale_linters#elm#make#IsTest(a:buffer)
|
||||||
|
let l:is_v19 = ale_linters#elm#make#IsVersionGte19(a:buffer)
|
||||||
|
|
||||||
|
if l:is_test && l:is_v19
|
||||||
|
return ale#node#FindExecutable(
|
||||||
|
\ a:buffer,
|
||||||
|
\ 'elm_make',
|
||||||
|
\ ['node_modules/.bin/elm-test', 'node_modules/.bin/elm']
|
||||||
|
\)
|
||||||
|
else
|
||||||
|
return ale#node#FindExecutable(a:buffer, 'elm_make', ['node_modules/.bin/elm'])
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('elm', {
|
call ale#linter#Define('elm', {
|
||||||
\ 'name': 'make',
|
\ 'name': 'make',
|
||||||
\ 'executable_callback': 'ale_linters#elm#make#GetExecutable',
|
\ 'executable': function('ale_linters#elm#make#GetExecutable'),
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\ 'command_callback': 'ale_linters#elm#make#GetCommand',
|
\ 'command': function('ale_linters#elm#make#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#elm#make#Handle'
|
\ 'callback': 'ale_linters#elm#make#Handle'
|
||||||
\})
|
\})
|
||||||
|
|||||||
93
ale_linters/erlang/dialyzer.vim
Normal file
93
ale_linters/erlang/dialyzer.vim
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
" Author: Autoine Gagne - https://github.com/AntoineGagne
|
||||||
|
" Description: Define a checker that runs dialyzer on Erlang files.
|
||||||
|
|
||||||
|
let g:ale_erlang_dialyzer_executable =
|
||||||
|
\ get(g:, 'ale_erlang_dialyzer_executable', 'dialyzer')
|
||||||
|
let g:ale_erlang_dialyzer_plt_file =
|
||||||
|
\ get(g:, 'ale_erlang_dialyzer_plt_file', '')
|
||||||
|
let g:ale_erlang_dialyzer_rebar3_profile =
|
||||||
|
\ get(g:, 'ale_erlang_dialyzer_rebar3_profile', 'default')
|
||||||
|
|
||||||
|
function! ale_linters#erlang#dialyzer#GetRebar3Profile(buffer) abort
|
||||||
|
return ale#Var(a:buffer, 'erlang_dialyzer_rebar3_profile')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#erlang#dialyzer#FindPlt(buffer) abort
|
||||||
|
let l:plt_file = ''
|
||||||
|
let l:rebar3_profile = ale_linters#erlang#dialyzer#GetRebar3Profile(a:buffer)
|
||||||
|
let l:plt_file_directory = ale#path#FindNearestDirectory(a:buffer, '_build' . l:rebar3_profile)
|
||||||
|
|
||||||
|
if !empty(l:plt_file_directory)
|
||||||
|
let l:plt_file = split(globpath(l:plt_file_directory, '/*_plt'), '\n')
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !empty(l:plt_file)
|
||||||
|
return l:plt_file[0]
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !empty($REBAR_PLT_DIR)
|
||||||
|
return expand('$REBAR_PLT_DIR/dialyzer/plt')
|
||||||
|
endif
|
||||||
|
|
||||||
|
return expand('$HOME/.dialyzer_plt')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#erlang#dialyzer#GetPlt(buffer) abort
|
||||||
|
let l:plt_file = ale#Var(a:buffer, 'erlang_dialyzer_plt_file')
|
||||||
|
|
||||||
|
if !empty(l:plt_file)
|
||||||
|
return l:plt_file
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ale_linters#erlang#dialyzer#FindPlt(a:buffer)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#erlang#dialyzer#GetExecutable(buffer) abort
|
||||||
|
return ale#Var(a:buffer, 'erlang_dialyzer_executable')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#erlang#dialyzer#GetCommand(buffer) abort
|
||||||
|
let l:command = ale#Escape(ale_linters#erlang#dialyzer#GetExecutable(a:buffer))
|
||||||
|
\ . ' -n'
|
||||||
|
\ . ' --plt ' . ale#Escape(ale_linters#erlang#dialyzer#GetPlt(a:buffer))
|
||||||
|
\ . ' -Wunmatched_returns'
|
||||||
|
\ . ' -Werror_handling'
|
||||||
|
\ . ' -Wrace_conditions'
|
||||||
|
\ . ' -Wunderspecs'
|
||||||
|
\ . ' %s'
|
||||||
|
|
||||||
|
return l:command
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#erlang#dialyzer#Handle(buffer, lines) abort
|
||||||
|
" Match patterns like the following:
|
||||||
|
"
|
||||||
|
" erl_tidy_prv_fmt.erl:3: Callback info about the provider behaviour is not available
|
||||||
|
let l:pattern = '^\S\+:\(\d\+\): \(.\+\)$'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:line in a:lines
|
||||||
|
let l:match = matchlist(l:line, l:pattern)
|
||||||
|
|
||||||
|
if len(l:match) != 0
|
||||||
|
let l:code = l:match[2]
|
||||||
|
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': str2nr(l:match[1]),
|
||||||
|
\ 'lcol': 0,
|
||||||
|
\ 'text': l:code,
|
||||||
|
\ 'type': 'W'
|
||||||
|
\})
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('erlang', {
|
||||||
|
\ 'name': 'dialyzer',
|
||||||
|
\ 'executable': function('ale_linters#erlang#dialyzer#GetExecutable'),
|
||||||
|
\ 'command': function('ale_linters#erlang#dialyzer#GetCommand'),
|
||||||
|
\ 'callback': function('ale_linters#erlang#dialyzer#Handle'),
|
||||||
|
\ 'lint_file': 1
|
||||||
|
\})
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
let g:ale_erlang_erlc_options = get(g:, 'ale_erlang_erlc_options', '')
|
let g:ale_erlang_erlc_options = get(g:, 'ale_erlang_erlc_options', '')
|
||||||
|
|
||||||
function! ale_linters#erlang#erlc#GetCommand(buffer) abort
|
function! ale_linters#erlang#erlc#GetCommand(buffer) abort
|
||||||
let l:output_file = tempname()
|
let l:output_file = ale#util#Tempname()
|
||||||
call ale#engine#ManageFile(a:buffer, l:output_file)
|
call ale#command#ManageFile(a:buffer, l:output_file)
|
||||||
|
|
||||||
return 'erlc -o ' . ale#Escape(l:output_file)
|
return 'erlc -o ' . ale#Escape(l:output_file)
|
||||||
\ . ' ' . ale#Var(a:buffer, 'erlang_erlc_options')
|
\ . ' ' . ale#Var(a:buffer, 'erlang_erlc_options')
|
||||||
@@ -91,6 +91,6 @@ endfunction
|
|||||||
call ale#linter#Define('erlang', {
|
call ale#linter#Define('erlang', {
|
||||||
\ 'name': 'erlc',
|
\ 'name': 'erlc',
|
||||||
\ 'executable': 'erlc',
|
\ 'executable': 'erlc',
|
||||||
\ 'command_callback': 'ale_linters#erlang#erlc#GetCommand',
|
\ 'command': function('ale_linters#erlang#erlc#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#erlang#erlc#Handle',
|
\ 'callback': 'ale_linters#erlang#erlc#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -3,24 +3,22 @@
|
|||||||
|
|
||||||
call ale#Set('erlang_syntaxerl_executable', 'syntaxerl')
|
call ale#Set('erlang_syntaxerl_executable', 'syntaxerl')
|
||||||
|
|
||||||
|
function! ale_linters#erlang#syntaxerl#RunHelpCommand(buffer) abort
|
||||||
|
let l:executable = ale#Var(a:buffer, 'erlang_syntaxerl_executable')
|
||||||
|
|
||||||
function! ale_linters#erlang#syntaxerl#GetExecutable(buffer) abort
|
return ale#command#Run(
|
||||||
return ale#Var(a:buffer, 'erlang_syntaxerl_executable')
|
\ a:buffer,
|
||||||
|
\ ale#Escape(l:executable) . ' -h',
|
||||||
|
\ function('ale_linters#erlang#syntaxerl#GetCommand'),
|
||||||
|
\)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#erlang#syntaxerl#GetCommand(buffer, output, meta) abort
|
||||||
function! ale_linters#erlang#syntaxerl#FeatureCheck(buffer) abort
|
|
||||||
return s:GetEscapedExecutable(a:buffer) . ' -h'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
|
||||||
function! ale_linters#erlang#syntaxerl#GetCommand(buffer, output) abort
|
|
||||||
let l:use_b_option = match(a:output, '\C\V-b, --base\>') > -1
|
let l:use_b_option = match(a:output, '\C\V-b, --base\>') > -1
|
||||||
|
|
||||||
return s:GetEscapedExecutable(a:buffer) . (l:use_b_option ? ' -b %s %t' : ' %t')
|
return '%e' . (l:use_b_option ? ' -b %s %t' : ' %t')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! ale_linters#erlang#syntaxerl#Handle(buffer, lines) abort
|
function! ale_linters#erlang#syntaxerl#Handle(buffer, lines) abort
|
||||||
let l:pattern = '\v\C:(\d+):( warning:)? (.+)'
|
let l:pattern = '\v\C:(\d+):( warning:)? (.+)'
|
||||||
let l:loclist = []
|
let l:loclist = []
|
||||||
@@ -36,18 +34,9 @@ function! ale_linters#erlang#syntaxerl#Handle(buffer, lines) abort
|
|||||||
return l:loclist
|
return l:loclist
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! s:GetEscapedExecutable(buffer) abort
|
|
||||||
return ale#Escape(ale_linters#erlang#syntaxerl#GetExecutable(a:buffer))
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
|
||||||
call ale#linter#Define('erlang', {
|
call ale#linter#Define('erlang', {
|
||||||
\ 'name': 'syntaxerl',
|
\ 'name': 'syntaxerl',
|
||||||
\ 'executable_callback': 'ale_linters#erlang#syntaxerl#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'erlang_syntaxerl_executable')},
|
||||||
\ 'command_chain': [
|
\ 'command': {b -> ale_linters#erlang#syntaxerl#RunHelpCommand(b)},
|
||||||
\ {'callback': 'ale_linters#erlang#syntaxerl#FeatureCheck'},
|
|
||||||
\ {'callback': 'ale_linters#erlang#syntaxerl#GetCommand'},
|
|
||||||
\ ],
|
|
||||||
\ 'callback': 'ale_linters#erlang#syntaxerl#Handle',
|
\ 'callback': 'ale_linters#erlang#syntaxerl#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ call ale#linter#Define('eruby', {
|
|||||||
\ 'aliases': ['erubylint'],
|
\ 'aliases': ['erubylint'],
|
||||||
\ 'executable': 'erb',
|
\ 'executable': 'erb',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'command_callback': 'ale_linters#eruby#erb#GetCommand',
|
\ 'command': function('ale_linters#eruby#erb#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
|
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
|
||||||
\})
|
\})
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
" Author: Eddie Lebow https://github.com/elebow
|
" Author: Eddie Lebow https://github.com/elebow
|
||||||
" Description: eruby checker using `erubi`
|
" Description: eruby checker using `erubi`
|
||||||
|
|
||||||
function! ale_linters#eruby#erubi#CheckErubi(buffer) abort
|
function! ale_linters#eruby#erubi#GetCommand(buffer, output, meta) abort
|
||||||
return 'ruby -r erubi/capture_end -e ' . ale#Escape('""')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#eruby#erubi#GetCommand(buffer, check_erubi_output) abort
|
|
||||||
let l:rails_root = ale#ruby#FindRailsRoot(a:buffer)
|
let l:rails_root = ale#ruby#FindRailsRoot(a:buffer)
|
||||||
|
|
||||||
if (!empty(a:check_erubi_output))
|
if !empty(a:output)
|
||||||
" The empty command in CheckErubi returns nothing if erubi runs and
|
" The empty command in CheckErubi returns nothing if erubi runs and
|
||||||
" emits an error if erubi is not present
|
" emits an error if erubi is not present
|
||||||
return ''
|
return ''
|
||||||
@@ -27,9 +23,10 @@ endfunction
|
|||||||
call ale#linter#Define('eruby', {
|
call ale#linter#Define('eruby', {
|
||||||
\ 'name': 'erubi',
|
\ 'name': 'erubi',
|
||||||
\ 'executable': 'ruby',
|
\ 'executable': 'ruby',
|
||||||
\ 'command_chain': [
|
\ 'command': {buffer -> ale#command#Run(
|
||||||
\ {'callback': 'ale_linters#eruby#erubi#CheckErubi'},
|
\ buffer,
|
||||||
\ {'callback': 'ale_linters#eruby#erubi#GetCommand', 'output_stream': 'stderr'},
|
\ 'ruby -r erubi/capture_end -e ' . ale#Escape('""'),
|
||||||
\ ],
|
\ function('ale_linters#eruby#erubi#GetCommand'),
|
||||||
|
\ )},
|
||||||
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
|
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -18,6 +18,6 @@ call ale#linter#Define('eruby', {
|
|||||||
\ 'name': 'erubis',
|
\ 'name': 'erubis',
|
||||||
\ 'executable': 'erubis',
|
\ 'executable': 'erubis',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'command_callback': 'ale_linters#eruby#erubis#GetCommand',
|
\ 'command': function('ale_linters#eruby#erubis#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
|
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
|
||||||
\})
|
\})
|
||||||
|
|||||||
62
ale_linters/eruby/ruumba.vim
Normal file
62
ale_linters/eruby/ruumba.vim
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
" Author: aclemons - https://github.com/aclemons
|
||||||
|
" based on the ale rubocop linter
|
||||||
|
" Description: Ruumba, RuboCop linting for ERB templates.
|
||||||
|
|
||||||
|
call ale#Set('eruby_ruumba_executable', 'ruumba')
|
||||||
|
call ale#Set('eruby_ruumba_options', '')
|
||||||
|
|
||||||
|
function! ale_linters#eruby#ruumba#GetCommand(buffer) abort
|
||||||
|
let l:executable = ale#Var(a:buffer, 'eruby_ruumba_executable')
|
||||||
|
|
||||||
|
return ale#handlers#ruby#EscapeExecutable(l:executable, 'ruumba')
|
||||||
|
\ . ' --format json --force-exclusion '
|
||||||
|
\ . ale#Var(a:buffer, 'eruby_ruumba_options')
|
||||||
|
\ . ' --stdin ' . ale#Escape(expand('#' . a:buffer . ':p'))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#eruby#ruumba#Handle(buffer, lines) abort
|
||||||
|
try
|
||||||
|
let l:errors = json_decode(a:lines[0])
|
||||||
|
catch
|
||||||
|
return []
|
||||||
|
endtry
|
||||||
|
|
||||||
|
if !has_key(l:errors, 'summary')
|
||||||
|
\|| l:errors['summary']['offense_count'] == 0
|
||||||
|
\|| empty(l:errors['files'])
|
||||||
|
return []
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:error in l:errors['files'][0]['offenses']
|
||||||
|
let l:start_col = l:error['location']['column'] + 0
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': l:error['location']['line'] + 0,
|
||||||
|
\ 'col': l:start_col,
|
||||||
|
\ 'end_col': l:start_col + l:error['location']['length'] - 1,
|
||||||
|
\ 'code': l:error['cop_name'],
|
||||||
|
\ 'text': l:error['message'],
|
||||||
|
\ 'type': ale_linters#eruby#ruumba#GetType(l:error['severity']),
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#eruby#ruumba#GetType(severity) abort
|
||||||
|
if a:severity is? 'convention'
|
||||||
|
\|| a:severity is? 'warning'
|
||||||
|
\|| a:severity is? 'refactor'
|
||||||
|
return 'W'
|
||||||
|
endif
|
||||||
|
|
||||||
|
return 'E'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('eruby', {
|
||||||
|
\ 'name': 'ruumba',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'eruby_ruumba_executable')},
|
||||||
|
\ 'command': function('ale_linters#eruby#ruumba#GetCommand'),
|
||||||
|
\ 'callback': 'ale_linters#eruby#ruumba#Handle',
|
||||||
|
\})
|
||||||
@@ -2,18 +2,10 @@
|
|||||||
" Description: gcc for Fortran files
|
" Description: gcc for Fortran files
|
||||||
|
|
||||||
" This option can be set to 0 to use -ffixed-form
|
" This option can be set to 0 to use -ffixed-form
|
||||||
if !exists('g:ale_fortran_gcc_use_free_form')
|
call ale#Set('fortran_gcc_use_free_form', 1)
|
||||||
let g:ale_fortran_gcc_use_free_form = 1
|
call ale#Set('fortran_gcc_executable', 'gcc')
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:ale_fortran_gcc_executable')
|
|
||||||
let g:ale_fortran_gcc_executable = 'gcc'
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Set this option to change the GCC options for warnings for Fortran.
|
" Set this option to change the GCC options for warnings for Fortran.
|
||||||
if !exists('g:ale_fortran_gcc_options')
|
call ale#Set('fortran_gcc_options', '-Wall')
|
||||||
let g:ale_fortran_gcc_options = '-Wall'
|
|
||||||
endif
|
|
||||||
|
|
||||||
function! ale_linters#fortran#gcc#Handle(buffer, lines) abort
|
function! ale_linters#fortran#gcc#Handle(buffer, lines) abort
|
||||||
" We have to match a starting line and a later ending line together,
|
" We have to match a starting line and a later ending line together,
|
||||||
@@ -61,26 +53,20 @@ function! ale_linters#fortran#gcc#Handle(buffer, lines) abort
|
|||||||
return l:output
|
return l:output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#fortran#gcc#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'fortran_gcc_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#fortran#gcc#GetCommand(buffer) abort
|
function! ale_linters#fortran#gcc#GetCommand(buffer) abort
|
||||||
let l:layout_option = ale#Var(a:buffer, 'fortran_gcc_use_free_form')
|
let l:layout_option = ale#Var(a:buffer, 'fortran_gcc_use_free_form')
|
||||||
\ ? '-ffree-form'
|
\ ? '-ffree-form'
|
||||||
\ : '-ffixed-form'
|
\ : '-ffixed-form'
|
||||||
|
|
||||||
return ale_linters#fortran#gcc#GetExecutable(a:buffer)
|
return '%e -S -x f95 -fsyntax-only ' . l:layout_option
|
||||||
\ . ' -S -x f95 -fsyntax-only '
|
\ . ale#Pad(ale#Var(a:buffer, 'fortran_gcc_options'))
|
||||||
\ . l:layout_option . ' '
|
\ . ' -'
|
||||||
\ . ale#Var(a:buffer, 'fortran_gcc_options') . ' '
|
|
||||||
\ . '-'
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('fortran', {
|
call ale#linter#Define('fortran', {
|
||||||
\ 'name': 'gcc',
|
\ 'name': 'gcc',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable_callback': 'ale_linters#fortran#gcc#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'fortran_gcc_executable')},
|
||||||
\ 'command_callback': 'ale_linters#fortran#gcc#GetCommand',
|
\ 'command': function('ale_linters#fortran#gcc#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#fortran#gcc#Handle',
|
\ 'callback': 'ale_linters#fortran#gcc#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
19
ale_linters/fortran/language_server.vim
Normal file
19
ale_linters/fortran/language_server.vim
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
" Author: unpairedbracket ben.spiers22@gmail.com
|
||||||
|
" Description: A language server for fortran
|
||||||
|
|
||||||
|
call ale#Set('fortran_language_server_executable', 'fortls')
|
||||||
|
call ale#Set('fortran_language_server_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
|
|
||||||
|
function! ale_linters#fortran#language_server#GetProjectRoot(buffer) abort
|
||||||
|
let l:fortls_file = ale#path#FindNearestFile(a:buffer, '.fortls')
|
||||||
|
|
||||||
|
return !empty(l:fortls_file) ? fnamemodify(l:fortls_file, ':h') : ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('fortran', {
|
||||||
|
\ 'name': 'language_server',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'fortran_language_server_executable')},
|
||||||
|
\ 'command': '%e',
|
||||||
|
\ 'project_root': function('ale_linters#fortran#language_server#GetProjectRoot'),
|
||||||
|
\})
|
||||||
@@ -1,19 +1,11 @@
|
|||||||
" Author: RyanSquared <vandor2012@gmail.com>
|
" Author: RyanSquared <vandor2012@gmail.com>
|
||||||
" Description: `fusion-lint` linter for FusionScript files
|
" Description: `fusion-lint` linter for FusionScript files
|
||||||
|
|
||||||
let g:ale_fuse_fusionlint_executable =
|
call ale#Set('fuse_fusionlint_executable', 'fusion-lint')
|
||||||
\ get(g:, 'ale_fuse_fusionlint_executable', 'fusion-lint')
|
call ale#Set('fuse_fusionlint_options', '')
|
||||||
|
|
||||||
let g:ale_fuse_fusionlint_options =
|
|
||||||
\ get(g:, 'ale_fuse_fusionlint_options', '')
|
|
||||||
|
|
||||||
function! ale_linters#fuse#fusionlint#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'fuse_fusionlint_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#fuse#fusionlint#GetCommand(buffer) abort
|
function! ale_linters#fuse#fusionlint#GetCommand(buffer) abort
|
||||||
return ale#Escape(ale_linters#fuse#fusionlint#GetExecutable(a:buffer))
|
return '%e' . ale#Pad(ale#Var(a:buffer, 'fuse_fusionlint_options'))
|
||||||
\ . ' ' . ale#Var(a:buffer, 'fuse_fusionlint_options')
|
|
||||||
\ . ' --filename %s -i'
|
\ . ' --filename %s -i'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -35,7 +27,7 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('fuse', {
|
call ale#linter#Define('fuse', {
|
||||||
\ 'name': 'fusionlint',
|
\ 'name': 'fusionlint',
|
||||||
\ 'executable_callback': 'ale_linters#fuse#fusionlint#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'fuse_fusionlint_executable')},
|
||||||
\ 'command_callback': 'ale_linters#fuse#fusionlint#GetCommand',
|
\ 'command': function('ale_linters#fuse#fusionlint#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#fuse#fusionlint#Handle',
|
\ 'callback': 'ale_linters#fuse#fusionlint#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
" Author: Nick Yamane <nick.diego@gmail.com>
|
" Author: Nick Yamane <nick.diego@gmail.com>
|
||||||
" Description: gitlint for git commit message files
|
" Description: gitlint for git commit message files
|
||||||
|
|
||||||
let g:ale_gitcommit_gitlint_executable =
|
call ale#Set('gitcommit_gitlint_executable', 'gitlint')
|
||||||
\ get(g:, 'ale_gitcommit_gitlint_executable', 'gitlint')
|
call ale#Set('gitcommit_gitlint_options', '')
|
||||||
let g:ale_gitcommit_gitlint_options = get(g:, 'ale_gitcommit_gitlint_options', '')
|
call ale#Set('gitcommit_gitlint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
let g:ale_gitcommit_gitlint_use_global = get(g:, 'ale_gitcommit_gitlint_use_global', get(g:, 'ale_use_global_executables', 0))
|
|
||||||
|
|
||||||
|
|
||||||
function! ale_linters#gitcommit#gitlint#GetExecutable(buffer) abort
|
function! ale_linters#gitcommit#gitlint#GetExecutable(buffer) abort
|
||||||
return ale#python#FindExecutable(a:buffer, 'gitcommit_gitlint', ['gitlint'])
|
return ale#python#FindExecutable(a:buffer, 'gitcommit_gitlint', ['gitlint'])
|
||||||
@@ -13,12 +11,9 @@ endfunction
|
|||||||
|
|
||||||
function! ale_linters#gitcommit#gitlint#GetCommand(buffer) abort
|
function! ale_linters#gitcommit#gitlint#GetCommand(buffer) abort
|
||||||
let l:options = ale#Var(a:buffer, 'gitcommit_gitlint_options')
|
let l:options = ale#Var(a:buffer, 'gitcommit_gitlint_options')
|
||||||
let l:executable = ale_linters#gitcommit#gitlint#GetExecutable(a:buffer)
|
|
||||||
return ale#Escape(l:executable)
|
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
|
||||||
\ . ' lint'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
return '%e' . ale#Pad(l:options) . ' lint'
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#gitcommit#gitlint#Handle(buffer, lines) abort
|
function! ale_linters#gitcommit#gitlint#Handle(buffer, lines) abort
|
||||||
" Matches patterns line the following:
|
" Matches patterns line the following:
|
||||||
@@ -28,8 +23,10 @@ function! ale_linters#gitcommit#gitlint#Handle(buffer, lines) abort
|
|||||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
let l:code = l:match[2]
|
let l:code = l:match[2]
|
||||||
|
|
||||||
if l:code is# 'T2' && !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
|
if !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
|
||||||
continue
|
if l:code is# 'T2' || l:code is# 'B2'
|
||||||
|
continue
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:item = {
|
let l:item = {
|
||||||
@@ -45,12 +42,10 @@ function! ale_linters#gitcommit#gitlint#Handle(buffer, lines) abort
|
|||||||
return l:output
|
return l:output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
call ale#linter#Define('gitcommit', {
|
call ale#linter#Define('gitcommit', {
|
||||||
\ 'name': 'gitlint',
|
\ 'name': 'gitlint',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable_callback': 'ale_linters#gitcommit#gitlint#GetExecutable',
|
\ 'executable': function('ale_linters#gitcommit#gitlint#GetExecutable'),
|
||||||
\ 'command_callback': 'ale_linters#gitcommit#gitlint#GetCommand',
|
\ 'command': function('ale_linters#gitcommit#gitlint#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#gitcommit#gitlint#Handle',
|
\ 'callback': 'ale_linters#gitcommit#gitlint#Handle',
|
||||||
\})
|
\})
|
||||||
|
|
||||||
|
|||||||
@@ -4,19 +4,13 @@
|
|||||||
" TODO: Once https://github.com/KhronosGroup/glslang/pull/1047 is accepted,
|
" TODO: Once https://github.com/KhronosGroup/glslang/pull/1047 is accepted,
|
||||||
" we can use stdin.
|
" we can use stdin.
|
||||||
|
|
||||||
let g:ale_glsl_glslang_executable =
|
call ale#Set('glsl_glslang_executable', 'glslangValidator')
|
||||||
\ get(g:, 'ale_glsl_glslang_executable', 'glslangValidator')
|
call ale#Set('glsl_glslang_options', '')
|
||||||
|
|
||||||
let g:ale_glsl_glslang_options = get(g:, 'ale_glsl_glslang_options', '')
|
|
||||||
|
|
||||||
function! ale_linters#glsl#glslang#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'glsl_glslang_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#glsl#glslang#GetCommand(buffer) abort
|
function! ale_linters#glsl#glslang#GetCommand(buffer) abort
|
||||||
return ale_linters#glsl#glslang#GetExecutable(a:buffer)
|
return '%e'
|
||||||
\ . ' ' . ale#Var(a:buffer, 'glsl_glslang_options')
|
\ . ale#Pad(ale#Var(a:buffer, 'glsl_glslang_options'))
|
||||||
\ . ' ' . '-C %t'
|
\ . ' -C %t'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#glsl#glslang#Handle(buffer, lines) abort
|
function! ale_linters#glsl#glslang#Handle(buffer, lines) abort
|
||||||
@@ -40,7 +34,7 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('glsl', {
|
call ale#linter#Define('glsl', {
|
||||||
\ 'name': 'glslang',
|
\ 'name': 'glslang',
|
||||||
\ 'executable_callback': 'ale_linters#glsl#glslang#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'glsl_glslang_executable')},
|
||||||
\ 'command_callback': 'ale_linters#glsl#glslang#GetCommand',
|
\ 'command': function('ale_linters#glsl#glslang#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#glsl#glslang#Handle',
|
\ 'callback': 'ale_linters#glsl#glslang#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -4,18 +4,15 @@
|
|||||||
call ale#Set('glsl_glslls_executable', 'glslls')
|
call ale#Set('glsl_glslls_executable', 'glslls')
|
||||||
call ale#Set('glsl_glslls_logfile', '')
|
call ale#Set('glsl_glslls_logfile', '')
|
||||||
|
|
||||||
function! ale_linters#glsl#glslls#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'glsl_glslls_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#glsl#glslls#GetCommand(buffer) abort
|
function! ale_linters#glsl#glslls#GetCommand(buffer) abort
|
||||||
let l:executable = ale_linters#glsl#glslls#GetExecutable(a:buffer)
|
|
||||||
let l:logfile = ale#Var(a:buffer, 'glsl_glslls_logfile')
|
let l:logfile = ale#Var(a:buffer, 'glsl_glslls_logfile')
|
||||||
let l:logfile_args = ''
|
let l:logfile_args = ''
|
||||||
|
|
||||||
if l:logfile isnot# ''
|
if l:logfile isnot# ''
|
||||||
let l:logfile_args = ' --verbose -l ' . l:logfile
|
let l:logfile_args = ' --verbose -l ' . l:logfile
|
||||||
endif
|
endif
|
||||||
return ale#Escape(l:executable) . l:logfile_args . ' --stdin'
|
|
||||||
|
return '%e' . l:logfile_args . ' --stdin'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#glsl#glslls#GetProjectRoot(buffer) abort
|
function! ale_linters#glsl#glslls#GetProjectRoot(buffer) abort
|
||||||
@@ -27,8 +24,7 @@ endfunction
|
|||||||
call ale#linter#Define('glsl', {
|
call ale#linter#Define('glsl', {
|
||||||
\ 'name': 'glslls',
|
\ 'name': 'glslls',
|
||||||
\ 'lsp': 'stdio',
|
\ 'lsp': 'stdio',
|
||||||
\ 'executable_callback': 'ale_linters#glsl#glslls#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'glsl_glslls_executable')},
|
||||||
\ 'command_callback': 'ale_linters#glsl#glslls#GetCommand',
|
\ 'command': function('ale_linters#glsl#glslls#GetCommand'),
|
||||||
\ 'language': 'glsl',
|
\ 'project_root': function('ale_linters#glsl#glslls#GetProjectRoot'),
|
||||||
\ 'project_root_callback': 'ale_linters#glsl#glslls#GetProjectRoot',
|
|
||||||
\})
|
\})
|
||||||
|
|||||||
29
ale_linters/go/bingo.vim
Normal file
29
ale_linters/go/bingo.vim
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
" Author: Jerko Steiner <https://github.com/jeremija>
|
||||||
|
" Description: https://github.com/saibing/bingo
|
||||||
|
|
||||||
|
call ale#Set('go_bingo_executable', 'bingo')
|
||||||
|
call ale#Set('go_bingo_options', '--mode stdio')
|
||||||
|
|
||||||
|
function! ale_linters#go#bingo#GetCommand(buffer) abort
|
||||||
|
return '%e' . ale#Pad(ale#Var(a:buffer, 'go_bingo_options'))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#go#bingo#FindProjectRoot(buffer) abort
|
||||||
|
let l:project_root = ale#path#FindNearestFile(a:buffer, 'go.mod')
|
||||||
|
let l:mods = ':h'
|
||||||
|
|
||||||
|
if empty(l:project_root)
|
||||||
|
let l:project_root = ale#path#FindNearestDirectory(a:buffer, '.git')
|
||||||
|
let l:mods = ':h:h'
|
||||||
|
endif
|
||||||
|
|
||||||
|
return !empty(l:project_root) ? fnamemodify(l:project_root, l:mods) : ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('go', {
|
||||||
|
\ 'name': 'bingo',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'go_bingo_executable')},
|
||||||
|
\ 'command': function('ale_linters#go#bingo#GetCommand'),
|
||||||
|
\ 'project_root': function('ale_linters#go#bingo#FindProjectRoot'),
|
||||||
|
\})
|
||||||
@@ -3,38 +3,15 @@
|
|||||||
" Description: go build for Go files
|
" Description: go build for Go files
|
||||||
" inspired by work from dzhou121 <dzhou121@gmail.com>
|
" inspired by work from dzhou121 <dzhou121@gmail.com>
|
||||||
|
|
||||||
|
call ale#Set('go_go_executable', 'go')
|
||||||
call ale#Set('go_gobuild_options', '')
|
call ale#Set('go_gobuild_options', '')
|
||||||
|
|
||||||
function! ale_linters#go#gobuild#ResetEnv() abort
|
function! ale_linters#go#gobuild#GetCommand(buffer) abort
|
||||||
unlet! s:go_env
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#go#gobuild#GoEnv(buffer) abort
|
|
||||||
if exists('s:go_env')
|
|
||||||
return ''
|
|
||||||
endif
|
|
||||||
|
|
||||||
return 'go env GOPATH GOROOT'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#go#gobuild#GetCommand(buffer, goenv_output) abort
|
|
||||||
let l:options = ale#Var(a:buffer, 'go_gobuild_options')
|
let l:options = ale#Var(a:buffer, 'go_gobuild_options')
|
||||||
|
|
||||||
if !exists('s:go_env')
|
|
||||||
let s:go_env = {
|
|
||||||
\ 'GOPATH': a:goenv_output[0],
|
|
||||||
\ 'GOROOT': a:goenv_output[1],
|
|
||||||
\}
|
|
||||||
endif
|
|
||||||
|
|
||||||
let l:gopath_env_command = has('win32')
|
|
||||||
\ ? 'set GOPATH=' . ale#Escape(s:go_env.GOPATH) . ' && '
|
|
||||||
\ : 'GOPATH=' . ale#Escape(s:go_env.GOPATH) . ' '
|
|
||||||
|
|
||||||
" Run go test in local directory with relative path
|
" Run go test in local directory with relative path
|
||||||
return l:gopath_env_command
|
return ale#path#BufferCdString(a:buffer)
|
||||||
\ . ale#path#BufferCdString(a:buffer)
|
\ . ale#Var(a:buffer, 'go_go_executable') . ' test'
|
||||||
\ . 'go test'
|
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
\ . ' -c -o /dev/null ./'
|
\ . ' -c -o /dev/null ./'
|
||||||
endfunction
|
endfunction
|
||||||
@@ -45,7 +22,6 @@ function! ale_linters#go#gobuild#GetMatches(lines) abort
|
|||||||
" file.go:27: missing argument for Printf("%s"): format reads arg 2, have only 1 args
|
" file.go:27: missing argument for Printf("%s"): format reads arg 2, have only 1 args
|
||||||
" file.go:53:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
|
" file.go:53:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
|
||||||
" file.go:5:2: expected declaration, found 'STRING' "log"
|
" file.go:5:2: expected declaration, found 'STRING' "log"
|
||||||
|
|
||||||
" go test returns relative paths so use tail of filename as part of pattern matcher
|
" go test returns relative paths so use tail of filename as part of pattern matcher
|
||||||
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:? (.+)$'
|
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:? (.+)$'
|
||||||
|
|
||||||
@@ -70,12 +46,11 @@ function! ale_linters#go#gobuild#Handler(buffer, lines) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('go', {
|
call ale#linter#Define('go', {
|
||||||
\ 'name': 'go build',
|
\ 'name': 'gobuild',
|
||||||
\ 'executable': 'go',
|
\ 'aliases': ['go build'],
|
||||||
\ 'command_chain': [
|
\ 'executable': {b -> ale#Var(b, 'go_go_executable')},
|
||||||
\ {'callback': 'ale_linters#go#gobuild#GoEnv', 'output_stream': 'stdout'},
|
\ 'command': function('ale_linters#go#gobuild#GetCommand'),
|
||||||
\ {'callback': 'ale_linters#go#gobuild#GetCommand', 'output_stream': 'stderr'},
|
\ 'output_stream': 'stderr',
|
||||||
\ ],
|
|
||||||
\ 'callback': 'ale_linters#go#gobuild#Handler',
|
\ 'callback': 'ale_linters#go#gobuild#Handler',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
\})
|
\})
|
||||||
|
|||||||
56
ale_linters/go/golangci_lint.vim
Normal file
56
ale_linters/go/golangci_lint.vim
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
" Author: Sascha Grunert <mail@saschagrunert.de>
|
||||||
|
" Description: Adds support of golangci-lint
|
||||||
|
|
||||||
|
call ale#Set('go_golangci_lint_options', '--enable-all')
|
||||||
|
call ale#Set('go_golangci_lint_executable', 'golangci-lint')
|
||||||
|
call ale#Set('go_golangci_lint_package', 0)
|
||||||
|
|
||||||
|
function! ale_linters#go#golangci_lint#GetCommand(buffer) abort
|
||||||
|
let l:filename = expand('#' . a:buffer . ':t')
|
||||||
|
let l:options = ale#Var(a:buffer, 'go_golangci_lint_options')
|
||||||
|
let l:lint_package = ale#Var(a:buffer, 'go_golangci_lint_package')
|
||||||
|
|
||||||
|
if l:lint_package
|
||||||
|
return ale#path#BufferCdString(a:buffer)
|
||||||
|
\ . '%e run '
|
||||||
|
\ . l:options
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ale#path#BufferCdString(a:buffer)
|
||||||
|
\ . '%e run '
|
||||||
|
\ . ale#Escape(l:filename)
|
||||||
|
\ . ' ' . l:options
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#go#golangci_lint#GetMatches(lines) abort
|
||||||
|
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:?:?:?\s\*?(.+)$'
|
||||||
|
|
||||||
|
return ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#go#golangci_lint#Handler(buffer, lines) abort
|
||||||
|
let l:dir = expand('#' . a:buffer . ':p:h')
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale_linters#go#golangci_lint#GetMatches(a:lines)
|
||||||
|
" l:match[1] will already be an absolute path, output from
|
||||||
|
" golangci_lint
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
|
||||||
|
\ 'lnum': l:match[2] + 0,
|
||||||
|
\ 'col': l:match[3] + 0,
|
||||||
|
\ 'type': 'E',
|
||||||
|
\ 'text': l:match[4],
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('go', {
|
||||||
|
\ 'name': 'golangci-lint',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'go_golangci_lint_executable')},
|
||||||
|
\ 'command': function('ale_linters#go#golangci_lint#GetCommand'),
|
||||||
|
\ 'callback': 'ale_linters#go#golangci_lint#Handler',
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\})
|
||||||
@@ -1,10 +1,21 @@
|
|||||||
" Author: neersighted <bjorn@neersighted.com>
|
" Author: neersighted <bjorn@neersighted.com>
|
||||||
" Description: golint for Go files
|
" Description: golint for Go files
|
||||||
|
|
||||||
|
call ale#Set('go_golint_executable', 'golint')
|
||||||
|
call ale#Set('go_golint_options', '')
|
||||||
|
|
||||||
|
function! ale_linters#go#golint#GetCommand(buffer) abort
|
||||||
|
let l:options = ale#Var(a:buffer, 'go_golint_options')
|
||||||
|
|
||||||
|
return '%e'
|
||||||
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
|
\ . ' %t'
|
||||||
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('go', {
|
call ale#linter#Define('go', {
|
||||||
\ 'name': 'golint',
|
\ 'name': 'golint',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\ 'executable': 'golint',
|
\ 'executable': {b -> ale#Var(b, 'go_golint_executable')},
|
||||||
\ 'command': 'golint %t',
|
\ 'command': function('ale_linters#go#golint#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -5,12 +5,7 @@ call ale#Set('go_gometalinter_options', '')
|
|||||||
call ale#Set('go_gometalinter_executable', 'gometalinter')
|
call ale#Set('go_gometalinter_executable', 'gometalinter')
|
||||||
call ale#Set('go_gometalinter_lint_package', 0)
|
call ale#Set('go_gometalinter_lint_package', 0)
|
||||||
|
|
||||||
function! ale_linters#go#gometalinter#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'go_gometalinter_executable')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#go#gometalinter#GetCommand(buffer) abort
|
function! ale_linters#go#gometalinter#GetCommand(buffer) abort
|
||||||
let l:executable = ale_linters#go#gometalinter#GetExecutable(a:buffer)
|
|
||||||
let l:filename = expand('#' . a:buffer . ':t')
|
let l:filename = expand('#' . a:buffer . ':t')
|
||||||
let l:options = ale#Var(a:buffer, 'go_gometalinter_options')
|
let l:options = ale#Var(a:buffer, 'go_gometalinter_options')
|
||||||
let l:lint_package = ale#Var(a:buffer, 'go_gometalinter_lint_package')
|
let l:lint_package = ale#Var(a:buffer, 'go_gometalinter_lint_package')
|
||||||
@@ -19,12 +14,12 @@ function! ale_linters#go#gometalinter#GetCommand(buffer) abort
|
|||||||
" be calculated to absolute paths in the Handler
|
" be calculated to absolute paths in the Handler
|
||||||
if l:lint_package
|
if l:lint_package
|
||||||
return ale#path#BufferCdString(a:buffer)
|
return ale#path#BufferCdString(a:buffer)
|
||||||
\ . ale#Escape(l:executable)
|
\ . '%e'
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return ale#path#BufferCdString(a:buffer)
|
return ale#path#BufferCdString(a:buffer)
|
||||||
\ . ale#Escape(l:executable)
|
\ . '%e'
|
||||||
\ . ' --include=' . ale#Escape(ale#util#EscapePCRE(l:filename))
|
\ . ' --include=' . ale#Escape(ale#util#EscapePCRE(l:filename))
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
||||||
endfunction
|
endfunction
|
||||||
@@ -55,8 +50,8 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('go', {
|
call ale#linter#Define('go', {
|
||||||
\ 'name': 'gometalinter',
|
\ 'name': 'gometalinter',
|
||||||
\ 'executable_callback': 'ale_linters#go#gometalinter#GetExecutable',
|
\ 'executable': {b -> ale#Var(b, 'go_gometalinter_executable')},
|
||||||
\ 'command_callback': 'ale_linters#go#gometalinter#GetCommand',
|
\ 'command': function('ale_linters#go#gometalinter#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#go#gometalinter#Handler',
|
\ 'callback': 'ale_linters#go#gometalinter#Handler',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
\})
|
\})
|
||||||
|
|||||||
30
ale_linters/go/gopls.vim
Normal file
30
ale_linters/go/gopls.vim
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
" Author: w0rp <devw0rp@gmail.com>
|
||||||
|
" Author: Jerko Steiner <https://github.com/jeremija>
|
||||||
|
" Description: https://github.com/saibing/gopls
|
||||||
|
|
||||||
|
call ale#Set('go_gopls_executable', 'gopls')
|
||||||
|
call ale#Set('go_gopls_options', '--mode stdio')
|
||||||
|
|
||||||
|
function! ale_linters#go#gopls#GetCommand(buffer) abort
|
||||||
|
return '%e' . ale#Pad(ale#Var(a:buffer, 'go_gopls_options'))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#go#gopls#FindProjectRoot(buffer) abort
|
||||||
|
let l:project_root = ale#path#FindNearestFile(a:buffer, 'go.mod')
|
||||||
|
let l:mods = ':h'
|
||||||
|
|
||||||
|
if empty(l:project_root)
|
||||||
|
let l:project_root = ale#path#FindNearestDirectory(a:buffer, '.git')
|
||||||
|
let l:mods = ':h:h'
|
||||||
|
endif
|
||||||
|
|
||||||
|
return !empty(l:project_root) ? fnamemodify(l:project_root, l:mods) : ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('go', {
|
||||||
|
\ 'name': 'gopls',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'go_gopls_executable')},
|
||||||
|
\ 'command': function('ale_linters#go#gopls#GetCommand'),
|
||||||
|
\ 'project_root': function('ale_linters#go#gopls#FindProjectRoot'),
|
||||||
|
\})
|
||||||
@@ -8,7 +8,7 @@ endfunction
|
|||||||
call ale#linter#Define('go', {
|
call ale#linter#Define('go', {
|
||||||
\ 'name': 'gosimple',
|
\ 'name': 'gosimple',
|
||||||
\ 'executable': 'gosimple',
|
\ 'executable': 'gosimple',
|
||||||
\ 'command_callback': 'ale_linters#go#gosimple#GetCommand',
|
\ 'command': function('ale_linters#go#gosimple#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#go#Handler',
|
\ 'callback': 'ale#handlers#go#Handler',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
|
|||||||
@@ -3,18 +3,17 @@
|
|||||||
|
|
||||||
function! ale_linters#go#gotype#GetCommand(buffer) abort
|
function! ale_linters#go#gotype#GetCommand(buffer) abort
|
||||||
if expand('#' . a:buffer . ':p') =~# '_test\.go$'
|
if expand('#' . a:buffer . ':p') =~# '_test\.go$'
|
||||||
return
|
return ''
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
return ale#path#BufferCdString(a:buffer) . ' gotype -e .'
|
||||||
return ale#path#BufferCdString(a:buffer) . ' gotype .'
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('go', {
|
call ale#linter#Define('go', {
|
||||||
\ 'name': 'gotype',
|
\ 'name': 'gotype',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable': 'gotype',
|
\ 'executable': 'gotype',
|
||||||
\ 'command_callback': 'ale_linters#go#gotype#GetCommand',
|
\ 'command': function('ale_linters#go#gotype#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#go#Handler',
|
\ 'callback': 'ale#handlers#go#Handler',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -4,15 +4,24 @@
|
|||||||
" Author: John Eikenberry <jae@zhar.net>
|
" Author: John Eikenberry <jae@zhar.net>
|
||||||
" Description: updated to work with go1.10
|
" Description: updated to work with go1.10
|
||||||
|
|
||||||
|
call ale#Set('go_go_executable', 'go')
|
||||||
|
call ale#Set('go_govet_options', '')
|
||||||
|
|
||||||
function! ale_linters#go#govet#GetCommand(buffer) abort
|
function! ale_linters#go#govet#GetCommand(buffer) abort
|
||||||
return ale#path#BufferCdString(a:buffer) . ' go vet .'
|
let l:options = ale#Var(a:buffer, 'go_govet_options')
|
||||||
|
|
||||||
|
return ale#path#BufferCdString(a:buffer) . ' '
|
||||||
|
\ . ale#Var(a:buffer, 'go_go_executable') . ' vet '
|
||||||
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
|
\ . ' .'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('go', {
|
call ale#linter#Define('go', {
|
||||||
\ 'name': 'go vet',
|
\ 'name': 'govet',
|
||||||
|
\ 'aliases': ['go vet'],
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable': 'go',
|
\ 'executable': {b -> ale#Var(b, 'go_go_executable')},
|
||||||
\ 'command_callback': 'ale_linters#go#govet#GetCommand',
|
\ 'command': function('ale_linters#go#govet#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#go#Handler',
|
\ 'callback': 'ale#handlers#go#Handler',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
\})
|
\})
|
||||||
|
|||||||
28
ale_linters/go/langserver.vim
Normal file
28
ale_linters/go/langserver.vim
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
" Author: Horacio Sanson <https://github.com/hsanson>
|
||||||
|
" Description: Support for go-langserver https://github.com/sourcegraph/go-langserver
|
||||||
|
|
||||||
|
call ale#Set('go_langserver_executable', 'go-langserver')
|
||||||
|
call ale#Set('go_langserver_options', '')
|
||||||
|
|
||||||
|
function! ale_linters#go#langserver#GetCommand(buffer) abort
|
||||||
|
let l:executable = [ale#Escape(ale#Var(a:buffer, 'go_langserver_executable'))]
|
||||||
|
let l:options = ale#Var(a:buffer, 'go_langserver_options')
|
||||||
|
let l:options = substitute(l:options, '-gocodecompletion', '', 'g')
|
||||||
|
let l:options = filter(split(l:options, ' '), 'empty(v:val) != 1')
|
||||||
|
|
||||||
|
if ale#Var(a:buffer, 'completion_enabled')
|
||||||
|
call add(l:options, '-gocodecompletion')
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:options = uniq(sort(l:options))
|
||||||
|
|
||||||
|
return join(extend(l:executable, l:options), ' ')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('go', {
|
||||||
|
\ 'name': 'golangserver',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'go_langserver_executable')},
|
||||||
|
\ 'command': function('ale_linters#go#langserver#GetCommand'),
|
||||||
|
\ 'project_root': function('ale#go#FindProjectRoot'),
|
||||||
|
\})
|
||||||
@@ -26,7 +26,7 @@ endfunction
|
|||||||
call ale#linter#Define('go', {
|
call ale#linter#Define('go', {
|
||||||
\ 'name': 'staticcheck',
|
\ 'name': 'staticcheck',
|
||||||
\ 'executable': 'staticcheck',
|
\ 'executable': 'staticcheck',
|
||||||
\ 'command_callback': 'ale_linters#go#staticcheck#GetCommand',
|
\ 'command': function('ale_linters#go#staticcheck#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#go#Handler',
|
\ 'callback': 'ale#handlers#go#Handler',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
call ale#linter#Define('graphql', {
|
call ale#linter#Define('graphql', {
|
||||||
\ 'name': 'eslint',
|
\ 'name': 'eslint',
|
||||||
\ 'executable_callback': 'ale#handlers#eslint#GetExecutable',
|
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
|
||||||
\ 'command_callback': 'ale#handlers#eslint#GetCommand',
|
\ 'command': function('ale#handlers#eslint#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#eslint#Handle',
|
\ 'callback': 'ale#handlers#eslint#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
" Author: Michiel Westerbeek <happylinks@gmail.com>
|
" Author: Michiel Westerbeek <happylinks@gmail.com>
|
||||||
" Description: Linter for GraphQL Schemas
|
" Description: Linter for GraphQL Schemas
|
||||||
|
|
||||||
|
function! ale_linters#graphql#gqlint#GetCommand(buffer) abort
|
||||||
|
return ale#path#BufferCdString(a:buffer)
|
||||||
|
\ . 'gqlint'
|
||||||
|
\ . ' --reporter=simple %t'
|
||||||
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('graphql', {
|
call ale#linter#Define('graphql', {
|
||||||
\ 'name': 'gqlint',
|
\ 'name': 'gqlint',
|
||||||
\ 'executable': 'gqlint',
|
\ 'executable': 'gqlint',
|
||||||
\ 'command': 'gqlint --reporter=simple %t',
|
\ 'command': function('ale_linters#graphql#gqlint#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
\})
|
\})
|
||||||
|
|||||||
22
ale_linters/hack/hack.vim
Normal file
22
ale_linters/hack/hack.vim
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
" Author: Fred Emmott <fe@fb.com>
|
||||||
|
" Description: Hack support via `hack lsp`
|
||||||
|
|
||||||
|
call ale#Set('hack_hack_executable', 'hh_client')
|
||||||
|
|
||||||
|
function! ale_linters#hack#hack#GetProjectRoot(buffer) abort
|
||||||
|
let l:hhconfig = ale#path#FindNearestFile(a:buffer, '.hhconfig')
|
||||||
|
|
||||||
|
return !empty(l:hhconfig) ? fnamemodify(l:hhconfig, ':h') : ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#hack#hack#GetExecutable(buffer) abort
|
||||||
|
return ale#Var(a:buffer, 'hack_hack_executable')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('hack', {
|
||||||
|
\ 'name': 'hack',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': function('ale_linters#hack#hack#GetExecutable'),
|
||||||
|
\ 'command': '%e lsp --from vim-ale',
|
||||||
|
\ 'project_root': function('ale_linters#hack#hack#GetProjectRoot'),
|
||||||
|
\})
|
||||||
40
ale_linters/hack/hhast.vim
Normal file
40
ale_linters/hack/hhast.vim
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
" Author: Fred Emmott <fe@fb.com>
|
||||||
|
" Description: Hack support via `hhast lsp`
|
||||||
|
|
||||||
|
call ale#Set('hack_hhast_executable', 'vendor/bin/hhast-lint')
|
||||||
|
|
||||||
|
function! ale_linters#hack#hhast#GetProjectRoot(buffer) abort
|
||||||
|
" Find the hack root, then figure out if it's also an HHAST root.
|
||||||
|
" Don't try to use lint configurations from vendor/foo/bar/hhast-lint.json
|
||||||
|
let l:hhconfig = ale#path#FindNearestFile(a:buffer, '.hhconfig')
|
||||||
|
|
||||||
|
if empty(l:hhconfig)
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:root = fnamemodify(l:hhconfig, ':h')
|
||||||
|
let l:hhast_config = findfile('hhast-lint.json', l:root)
|
||||||
|
|
||||||
|
return !empty(l:hhast_config) ? l:root : ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#hack#hhast#GetExecutable(buffer) abort
|
||||||
|
let l:root = ale_linters#hack#hhast#GetProjectRoot(a:buffer)
|
||||||
|
let l:relative = ale#Var(a:buffer, 'hack_hhast_executable')
|
||||||
|
let l:absolute = findfile(l:relative, l:root)
|
||||||
|
|
||||||
|
return !empty(l:absolute) ? l:absolute : ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#hack#hhast#GetInitializationOptions(buffer) abort
|
||||||
|
return {'lintMode': 'open-files'}
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('hack', {
|
||||||
|
\ 'name': 'hhast',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': function('ale_linters#hack#hhast#GetExecutable'),
|
||||||
|
\ 'command': '%e --mode lsp --from vim-ale',
|
||||||
|
\ 'project_root': function('ale_linters#hack#hhast#GetProjectRoot'),
|
||||||
|
\ 'initialization_options': function('ale_linters#hack#hhast#GetInitializationOptions'),
|
||||||
|
\})
|
||||||
@@ -1,6 +1,12 @@
|
|||||||
" Author: Patrick Lewis - https://github.com/patricklewis, thenoseman - https://github.com/thenoseman
|
" Author: Patrick Lewis - https://github.com/patricklewis, thenoseman - https://github.com/thenoseman
|
||||||
" Description: haml-lint for Haml files
|
" Description: haml-lint for Haml files
|
||||||
|
|
||||||
|
call ale#Set('haml_hamllint_executable', 'haml-lint')
|
||||||
|
|
||||||
|
function! ale_linters#haml#hamllint#GetExecutable(buffer) abort
|
||||||
|
return ale#Var(a:buffer, 'haml_hamllint_executable')
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#haml#hamllint#GetCommand(buffer) abort
|
function! ale_linters#haml#hamllint#GetCommand(buffer) abort
|
||||||
let l:prefix = ''
|
let l:prefix = ''
|
||||||
|
|
||||||
@@ -13,7 +19,7 @@ function! ale_linters#haml#hamllint#GetCommand(buffer) abort
|
|||||||
" See https://github.com/brigade/haml-lint/blob/master/lib/haml_lint/linter/rubocop.rb#L89
|
" See https://github.com/brigade/haml-lint/blob/master/lib/haml_lint/linter/rubocop.rb#L89
|
||||||
" HamlLint::Linter::RuboCop#rubocop_flags
|
" HamlLint::Linter::RuboCop#rubocop_flags
|
||||||
if !empty(l:rubocop_config_file_path)
|
if !empty(l:rubocop_config_file_path)
|
||||||
if ale#Has('win32')
|
if has('win32')
|
||||||
let l:prefix = 'set HAML_LINT_RUBOCOP_CONF=' . ale#Escape(l:rubocop_config_file_path) . ' &&'
|
let l:prefix = 'set HAML_LINT_RUBOCOP_CONF=' . ale#Escape(l:rubocop_config_file_path) . ' &&'
|
||||||
else
|
else
|
||||||
let l:prefix = 'HAML_LINT_RUBOCOP_CONF=' . ale#Escape(l:rubocop_config_file_path)
|
let l:prefix = 'HAML_LINT_RUBOCOP_CONF=' . ale#Escape(l:rubocop_config_file_path)
|
||||||
@@ -21,7 +27,7 @@ function! ale_linters#haml#hamllint#GetCommand(buffer) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
return (!empty(l:prefix) ? l:prefix . ' ' : '')
|
return (!empty(l:prefix) ? l:prefix . ' ' : '')
|
||||||
\ . 'haml-lint'
|
\ . ale_linters#haml#hamllint#GetExecutable(a:buffer)
|
||||||
\ . (!empty(l:hamllint_config_file_path) ? ' --config ' . ale#Escape(l:hamllint_config_file_path) : '')
|
\ . (!empty(l:hamllint_config_file_path) ? ' --config ' . ale#Escape(l:hamllint_config_file_path) : '')
|
||||||
\ . ' %t'
|
\ . ' %t'
|
||||||
endfunction
|
endfunction
|
||||||
@@ -45,7 +51,7 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('haml', {
|
call ale#linter#Define('haml', {
|
||||||
\ 'name': 'hamllint',
|
\ 'name': 'hamllint',
|
||||||
\ 'executable': 'haml-lint',
|
\ 'executable': function('ale_linters#haml#hamllint#GetExecutable'),
|
||||||
\ 'command_callback': 'ale_linters#haml#hamllint#GetCommand',
|
\ 'command': function('ale_linters#haml#hamllint#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#haml#hamllint#Handle'
|
\ 'callback': 'ale_linters#haml#hamllint#Handle'
|
||||||
\})
|
\})
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user