mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 21:24:33 +08:00
Compare commits
1212 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c3bd8a84f | ||
|
|
d1224a05c4 | ||
|
|
0e4a7a7187 | ||
|
|
36a3932ce8 | ||
|
|
67b71653f5 | ||
|
|
229da9b8ef | ||
|
|
7e4372bd1f | ||
|
|
f6fc1edcdc | ||
|
|
6e5a74285c | ||
|
|
164c711b3d | ||
|
|
107516c757 | ||
|
|
d14558da32 | ||
|
|
562862073f | ||
|
|
1d33d2cacf | ||
|
|
dbf530e87f | ||
|
|
ec5750f57b | ||
|
|
c525f49f09 | ||
|
|
722607b866 | ||
|
|
7a87520ba5 | ||
|
|
87217ae347 | ||
|
|
0678eb1f45 | ||
|
|
b769b67b2f | ||
|
|
ca2472a460 | ||
|
|
f0325d7322 | ||
|
|
c0279de661 | ||
|
|
763fcb8512 | ||
|
|
64c95d4881 | ||
|
|
57a93cbc04 | ||
|
|
6452c5e2f0 | ||
|
|
0cb3e36554 | ||
|
|
43e8f47e6e | ||
|
|
68b9399d4c | ||
|
|
434f22e44a | ||
|
|
440502dc93 | ||
|
|
92612a9eab | ||
|
|
1b1e53ef61 | ||
|
|
c112ee9dff | ||
|
|
bdd8d2399f | ||
|
|
b08fdd16b8 | ||
|
|
302f69e933 | ||
|
|
92e6e4d1ba | ||
|
|
7e1a9a9810 | ||
|
|
05d39bc1a9 | ||
|
|
b586eba4a4 | ||
|
|
6320ce6674 | ||
|
|
9258c73680 | ||
|
|
1995afa855 | ||
|
|
0a0535546f | ||
|
|
b7363bef7d | ||
|
|
32091fb8ad | ||
|
|
c572cfd2d2 | ||
|
|
2a575ca551 | ||
|
|
193a4b9336 | ||
|
|
f476c28b29 | ||
|
|
08cfd5f90c | ||
|
|
565ffa0dc5 | ||
|
|
857723e7d5 | ||
|
|
8a77290553 | ||
|
|
b6bf6ecdbc | ||
|
|
540952ca8e | ||
|
|
ad7ffe2875 | ||
|
|
2c2c7ceb1d | ||
|
|
acbe527e15 | ||
|
|
2096562899 | ||
|
|
fbbb8c17d9 | ||
|
|
1d0690f6d7 | ||
|
|
aea5de282e | ||
|
|
f64db199f1 | ||
|
|
7e20d9c639 | ||
|
|
7ec684206c | ||
|
|
b15706d9a9 | ||
|
|
d86371cd29 | ||
|
|
cfa3e6a924 | ||
|
|
82f8a04e18 | ||
|
|
478a2883a6 | ||
|
|
0ddf16194d | ||
|
|
0292e5a458 | ||
|
|
b6ccd60dd0 | ||
|
|
b5209d31e8 | ||
|
|
4941bd8d0e | ||
|
|
8b304f77b7 | ||
|
|
ab5257c344 | ||
|
|
89f8d3e456 | ||
|
|
5915a0ee39 | ||
|
|
608b6dafd4 | ||
|
|
5972b97223 | ||
|
|
fcb7932d7d | ||
|
|
f979da54d4 | ||
|
|
716b46e10d | ||
|
|
a3329ef3fc | ||
|
|
c2ab885384 | ||
|
|
5dc884b24d | ||
|
|
91b7a75afb | ||
|
|
dda132c1a2 | ||
|
|
33b3331b04 | ||
|
|
0f822b063c | ||
|
|
31e0f48d62 | ||
|
|
7c4decf804 | ||
|
|
b13f290390 | ||
|
|
23db293bdf | ||
|
|
52fe924a13 | ||
|
|
bb095df25e | ||
|
|
4df87eaadd | ||
|
|
c589e3d57d | ||
|
|
863fb60695 | ||
|
|
1832240cff | ||
|
|
65fc5d11c7 | ||
|
|
7ef55a8615 | ||
|
|
ea60fcea39 | ||
|
|
9dad25778f | ||
|
|
bc63325881 | ||
|
|
34e6368610 | ||
|
|
dffc162dd6 | ||
|
|
ef898fa303 | ||
|
|
be47e37bbc | ||
|
|
9849c79ff7 | ||
|
|
b28a6ddbe4 | ||
|
|
d562d53102 | ||
|
|
dd413a4732 | ||
|
|
038789f0ed | ||
|
|
acf9c92ab4 | ||
|
|
7cd25181b2 | ||
|
|
1d3b542031 | ||
|
|
8675bfc4ab | ||
|
|
7b50b3ec82 | ||
|
|
a5ec4143d2 | ||
|
|
042dec059a | ||
|
|
eddda2f8b5 | ||
|
|
045c92ed65 | ||
|
|
aa29c91cdc | ||
|
|
13c839cf16 | ||
|
|
f6af75aac4 | ||
|
|
e18aba1d7e | ||
|
|
5005871644 | ||
|
|
65fa901ef0 | ||
|
|
ba1540a545 | ||
|
|
2ef45ab745 | ||
|
|
adba2bd919 | ||
|
|
29acafdaf4 | ||
|
|
547716eabb | ||
|
|
112fcf7dd5 | ||
|
|
68d4a2216c | ||
|
|
ff388bbcd5 | ||
|
|
b5a5cdf920 | ||
|
|
eecbacb742 | ||
|
|
f1747901cc | ||
|
|
b6d1c41925 | ||
|
|
c9d66b861b | ||
|
|
7a1a534305 | ||
|
|
401b964e9c | ||
|
|
ff8d4c5286 | ||
|
|
5285b0b332 | ||
|
|
e98a3899da | ||
|
|
80342b119a | ||
|
|
d9a3722e06 | ||
|
|
1e34210f9a | ||
|
|
681c35169f | ||
|
|
d8f71c46da | ||
|
|
b0eaddadc9 | ||
|
|
3b0c67e42c | ||
|
|
c90b45c559 | ||
|
|
e2d3dca486 | ||
|
|
c165c7c5d1 | ||
|
|
48cae6afc4 | ||
|
|
0548cf9177 | ||
|
|
4d4d2d8122 | ||
|
|
2c9c5dec1e | ||
|
|
e43e7065da | ||
|
|
2495744fc3 | ||
|
|
87ffc9b55c | ||
|
|
d4b43d23f4 | ||
|
|
537d162ee7 | ||
|
|
4b56b91ac8 | ||
|
|
1568bf8128 | ||
|
|
73f61514c9 | ||
|
|
cc8e5502c8 | ||
|
|
0ad2547997 | ||
|
|
647c798eb7 | ||
|
|
f74e22b938 | ||
|
|
d2bea5c310 | ||
|
|
a7d51afda5 | ||
|
|
532594839c | ||
|
|
2cacba5758 | ||
|
|
91090f1af8 | ||
|
|
79aaec5a99 | ||
|
|
5577d567d1 | ||
|
|
1e574ed5f7 | ||
|
|
fdaac9bd78 | ||
|
|
31241e9ed8 | ||
|
|
e0c3cbd16f | ||
|
|
8afd9a70a6 | ||
|
|
e4821c7f2f | ||
|
|
af7eb2b979 | ||
|
|
1626fce1c9 | ||
|
|
fdde8af894 | ||
|
|
30c5bb3772 | ||
|
|
938c150880 | ||
|
|
d3cf02ecda | ||
|
|
65a99c1615 | ||
|
|
ad1aee0b89 | ||
|
|
96b90b45db | ||
|
|
c4956657dc | ||
|
|
fc151d7b30 | ||
|
|
55e09a4a2d | ||
|
|
7e793c9d71 | ||
|
|
09d3ecc49b | ||
|
|
7284270120 | ||
|
|
c8ee402cce | ||
|
|
a22def45b9 | ||
|
|
e06f2ded9d | ||
|
|
78d1f5f5df | ||
|
|
e7eb272714 | ||
|
|
0d046f5f01 | ||
|
|
55ca96bd83 | ||
|
|
d2a6d9a915 | ||
|
|
4825cce1cc | ||
|
|
7a88a3605c | ||
|
|
9152effa9f | ||
|
|
cebe7c3918 | ||
|
|
0700c2d900 | ||
|
|
fcfd1025cc | ||
|
|
2d3d6d3a10 | ||
|
|
92f20b0e51 | ||
|
|
7d932a239c | ||
|
|
b6efb5649e | ||
|
|
7a71186d62 | ||
|
|
fbc8ac9553 | ||
|
|
c6fc9cdb7b | ||
|
|
63ecc8341d | ||
|
|
d6bf13502a | ||
|
|
0e57ca3df3 | ||
|
|
440ef30b79 | ||
|
|
f66837818a | ||
|
|
85e0bd3314 | ||
|
|
e2a8f759d8 | ||
|
|
57e1b03435 | ||
|
|
3e1bd8d922 | ||
|
|
0d627d4613 | ||
|
|
159733c459 | ||
|
|
fba3c57872 | ||
|
|
2f9869de44 | ||
|
|
a4f8506227 | ||
|
|
acd1260339 | ||
|
|
2bd966c5cc | ||
|
|
f5fc746d00 | ||
|
|
83760a0952 | ||
|
|
122fdfd329 | ||
|
|
6650c9a901 | ||
|
|
499c154272 | ||
|
|
51b127a4fd | ||
|
|
6053f764bd | ||
|
|
daee4a4722 | ||
|
|
6b3927820b | ||
|
|
948035e13d | ||
|
|
0406af4484 | ||
|
|
a990188e27 | ||
|
|
fd261264d7 | ||
|
|
c977bb2d05 | ||
|
|
5d65980c42 | ||
|
|
6503b85d3d | ||
|
|
edb3a0c5e4 | ||
|
|
a43ada93e4 | ||
|
|
0ab689db0a | ||
|
|
4e821e64c7 | ||
|
|
bba6b4c23c | ||
|
|
b0114deabc | ||
|
|
09f9c21f1b | ||
|
|
e84ee4332f | ||
|
|
d4ea0423a2 | ||
|
|
f311a46f79 | ||
|
|
17f93b16ab | ||
|
|
17574e2fe1 | ||
|
|
21b460bb1d | ||
|
|
01318b6930 | ||
|
|
c07b3b9bfc | ||
|
|
ae7cd2c090 | ||
|
|
8254e507d6 | ||
|
|
b1a6abdda6 | ||
|
|
2e50aadd56 | ||
|
|
7dfe690b0b | ||
|
|
f99b027cc6 | ||
|
|
5160f814d9 | ||
|
|
6318a08e08 | ||
|
|
8dd542bed0 | ||
|
|
d07b5b71a4 | ||
|
|
fbfde6968a | ||
|
|
9857e0a4b7 | ||
|
|
6e65998ca7 | ||
|
|
b5ec1a5fd0 | ||
|
|
91fe749d03 | ||
|
|
5d2ab192cf | ||
|
|
5ed6f66f77 | ||
|
|
4b4762697c | ||
|
|
382cb4d538 | ||
|
|
520541cd2d | ||
|
|
3f70f1cbf1 | ||
|
|
e7865d2f94 | ||
|
|
074a011b08 | ||
|
|
796fb651d6 | ||
|
|
52f3ad7c75 | ||
|
|
e6fb32b792 | ||
|
|
8be85c2997 | ||
|
|
3ef98f42bd | ||
|
|
ac7f69063d | ||
|
|
ce2986cfa5 | ||
|
|
d465b71362 | ||
|
|
7ea3aba5e5 | ||
|
|
5a3a695586 | ||
|
|
c9e203e620 | ||
|
|
b9f02ffb27 | ||
|
|
f20e5a4cf0 | ||
|
|
f224ce8a37 | ||
|
|
9420c411bd | ||
|
|
597507e519 | ||
|
|
0cb8130d0e | ||
|
|
cc04a7aaa0 | ||
|
|
1afe2992e2 | ||
|
|
344add6a28 | ||
|
|
151f9f857c | ||
|
|
62904d39ee | ||
|
|
fa7f0e2b85 | ||
|
|
b16c82f2f1 | ||
|
|
d7a60ade77 | ||
|
|
01b2971d04 | ||
|
|
7123f7236b | ||
|
|
c012563984 | ||
|
|
3c8f3221df | ||
|
|
40e26f0bc2 | ||
|
|
41cb174f3a | ||
|
|
cefc5dc5b8 | ||
|
|
2b50e68c7e | ||
|
|
7455e2e97d | ||
|
|
49ccfb1a00 | ||
|
|
0e96d4576a | ||
|
|
5635b3c864 | ||
|
|
22ec81e1de | ||
|
|
a139b387c8 | ||
|
|
79f15b0e30 | ||
|
|
ca345ffb62 | ||
|
|
44cd07d39c | ||
|
|
b390c69642 | ||
|
|
1f4f19cbd4 | ||
|
|
3ddb858881 | ||
|
|
e232ea07c2 | ||
|
|
f1314b285c | ||
|
|
f90a2d5474 | ||
|
|
ee07be5f59 | ||
|
|
c9c52ef370 | ||
|
|
71d34fc0c6 | ||
|
|
981cb95d80 | ||
|
|
7565a45b6f | ||
|
|
d585123d64 | ||
|
|
eda20d0585 | ||
|
|
1d65e5692f | ||
|
|
cf538c3a58 | ||
|
|
08f4f8f0fc | ||
|
|
b14377915b | ||
|
|
e721f851b4 | ||
|
|
290ed4885b | ||
|
|
e12e5c912c | ||
|
|
38bc489604 | ||
|
|
8f80708da6 | ||
|
|
ff5c6b0509 | ||
|
|
37f2f70439 | ||
|
|
a36129eab0 | ||
|
|
48be035da8 | ||
|
|
d48506f9c1 | ||
|
|
6b2c61a5cc | ||
|
|
2e9cd978a2 | ||
|
|
48eb362fca | ||
|
|
20a01404f3 | ||
|
|
425482116e | ||
|
|
16e7dc2371 | ||
|
|
d8f9aef84a | ||
|
|
037aaae593 | ||
|
|
fea708cff3 | ||
|
|
8a3a2da87e | ||
|
|
764a33b1c9 | ||
|
|
6c112dd1cc | ||
|
|
a5f7f51c9a | ||
|
|
ad7ea36307 | ||
|
|
ea7f68226e | ||
|
|
e9e29e003c | ||
|
|
584e0bc7f2 | ||
|
|
70623ca8a7 | ||
|
|
7d056b0839 | ||
|
|
e7b9befaa6 | ||
|
|
3c34848e02 | ||
|
|
5b3094558b | ||
|
|
7edcb2210b | ||
|
|
cd5da50531 | ||
|
|
3aff1df961 | ||
|
|
d20e3bc71c | ||
|
|
b98387d0fa | ||
|
|
099df0af52 | ||
|
|
365d023d0e | ||
|
|
5df6ce6bb8 | ||
|
|
39107a48b9 | ||
|
|
8e0d1f57c6 | ||
|
|
555743a2ba | ||
|
|
8cd1ccff84 | ||
|
|
6c60ca24c1 | ||
|
|
52b6024997 | ||
|
|
4952e2f143 | ||
|
|
8bc44ed585 | ||
|
|
a8c5e0f4dc | ||
|
|
911b6d8f71 | ||
|
|
0741612db7 | ||
|
|
cb3a25f276 | ||
|
|
27e2f53ac9 | ||
|
|
ae08f80ead | ||
|
|
3111c6c1ca | ||
|
|
f6ac8a9eb9 | ||
|
|
4d44996af6 | ||
|
|
b789b9eaad | ||
|
|
fb00acf734 | ||
|
|
f8fec369e5 | ||
|
|
9e7c493e7e | ||
|
|
bac02c9d81 | ||
|
|
8c1d6eda81 | ||
|
|
6c014a25e8 | ||
|
|
1ddc3eec6d | ||
|
|
bb271859ef | ||
|
|
27780cbb23 | ||
|
|
d425b8a18a | ||
|
|
1ad7d5e6ca | ||
|
|
4bc31fcd18 | ||
|
|
7ed82ab712 | ||
|
|
decf8188bc | ||
|
|
c1fa88e78c | ||
|
|
bcc215c4e0 | ||
|
|
732d8e3ed6 | ||
|
|
8ef8a35462 | ||
|
|
8a4cf923a8 | ||
|
|
86e8074017 | ||
|
|
da8012971a | ||
|
|
105251c1de | ||
|
|
248a5eb2f6 | ||
|
|
1bf894f48c | ||
|
|
d97924b698 | ||
|
|
e4cd371621 | ||
|
|
3a57e4d151 | ||
|
|
b5254e9760 | ||
|
|
8e71f82f8f | ||
|
|
3cbf716d72 | ||
|
|
89832884c9 | ||
|
|
fa7d041c26 | ||
|
|
3c8e6ed51c | ||
|
|
716b22d524 | ||
|
|
7086586b17 | ||
|
|
7b5108d934 | ||
|
|
caed406e16 | ||
|
|
34674e088d | ||
|
|
d851f399c0 | ||
|
|
9c0a5635df | ||
|
|
9010458581 | ||
|
|
c26e5e277e | ||
|
|
54f44c2d0f | ||
|
|
1752ad9ad1 | ||
|
|
a09db595f1 | ||
|
|
a786e01127 | ||
|
|
3115d2025a | ||
|
|
9cd0d75c4f | ||
|
|
0ed639a116 | ||
|
|
50f7ad3552 | ||
|
|
1575b3d7dd | ||
|
|
634eb1920c | ||
|
|
daecbad543 | ||
|
|
1aa737cdc9 | ||
|
|
5fc2b98b73 | ||
|
|
ea3a8e3c62 | ||
|
|
6e681d9066 | ||
|
|
0e848b608c | ||
|
|
36898436b5 | ||
|
|
73b8181ce6 | ||
|
|
d4d939bea9 | ||
|
|
6490d3a5e6 | ||
|
|
33c2c20e66 | ||
|
|
3ac92ea529 | ||
|
|
3ab069c9bd | ||
|
|
22e8050639 | ||
|
|
e4456a4e0e | ||
|
|
6ed456f99c | ||
|
|
40f5e54198 | ||
|
|
aca66a54a5 | ||
|
|
f15c8f4127 | ||
|
|
0702cb59b7 | ||
|
|
5917de565d | ||
|
|
2f5b94e07d | ||
|
|
da365134b5 | ||
|
|
7eb16836d0 | ||
|
|
f38ced1e4c | ||
|
|
4af7219078 | ||
|
|
25d2af0b25 | ||
|
|
b0b91ba897 | ||
|
|
45ed37a5d9 | ||
|
|
960ae62aaa | ||
|
|
680672117f | ||
|
|
5029078df3 | ||
|
|
94bdabb8c3 | ||
|
|
eec529ad9d | ||
|
|
7ac07a30b8 | ||
|
|
780844ad73 | ||
|
|
db769fb060 | ||
|
|
1a5ef969a5 | ||
|
|
d644dc797f | ||
|
|
b401772d23 | ||
|
|
1c56bebd7c | ||
|
|
fe729dab58 | ||
|
|
07dad64acb | ||
|
|
b172cd8b17 | ||
|
|
c248885e57 | ||
|
|
0e4dd95e5d | ||
|
|
5a91f7e19f | ||
|
|
c96e7402ba | ||
|
|
f0a0aef33d | ||
|
|
4884e33f8b | ||
|
|
be5c7a09ce | ||
|
|
b952dda386 | ||
|
|
231398dddc | ||
|
|
be1377f6d7 | ||
|
|
3212278c91 | ||
|
|
43653ef548 | ||
|
|
c4579e1809 | ||
|
|
5b986ce5d3 | ||
|
|
0b0cbfa80a | ||
|
|
ed93cd1494 | ||
|
|
35031a0b8a | ||
|
|
841acf725c | ||
|
|
3878be9977 | ||
|
|
b43ed6baf5 | ||
|
|
e023e7a2fe | ||
|
|
346c91fb6b | ||
|
|
a97afd3380 | ||
|
|
658ec4b10e | ||
|
|
4339af2bb6 | ||
|
|
5292d2f349 | ||
|
|
81d993086e | ||
|
|
5946a128c3 | ||
|
|
8a8879a28f | ||
|
|
07ebfbeef0 | ||
|
|
a790077136 | ||
|
|
090f8a8f38 | ||
|
|
90d4fb139c | ||
|
|
515dcdef29 | ||
|
|
d090dec8b4 | ||
|
|
ef495ba32d | ||
|
|
010ebc2459 | ||
|
|
b2e6d0dff8 | ||
|
|
69d6ff6020 | ||
|
|
40e69794eb | ||
|
|
d8ea83e344 | ||
|
|
8eb41dc94c | ||
|
|
6fd10f80de | ||
|
|
5204f2dbc2 | ||
|
|
618074a053 | ||
|
|
663fe75d0f | ||
|
|
e71c4a8bea | ||
|
|
dded246aba | ||
|
|
221cb0f8cf | ||
|
|
3ddbe48d84 | ||
|
|
d8a638f38a | ||
|
|
844354cfed | ||
|
|
02c8793c53 | ||
|
|
be547a0111 | ||
|
|
620ec32da1 | ||
|
|
3859ac0c9b | ||
|
|
70177480ba | ||
|
|
a809c4fa3a | ||
|
|
65aa88a7d5 | ||
|
|
f21f52343d | ||
|
|
47577564a2 | ||
|
|
25045641fb | ||
|
|
a300014396 | ||
|
|
e376f0ae44 | ||
|
|
3ab414de1a | ||
|
|
7392f808c0 | ||
|
|
753592ca66 | ||
|
|
e0bd490ed9 | ||
|
|
54a08c5f8c | ||
|
|
5091e2de45 | ||
|
|
638ca42082 | ||
|
|
4634b1be93 | ||
|
|
5731616cd2 | ||
|
|
c76f721b59 | ||
|
|
a640d3b022 | ||
|
|
1d1b5155e6 | ||
|
|
c989ef0fc6 | ||
|
|
9fc01bd246 | ||
|
|
8f6044b8b6 | ||
|
|
49b6805b09 | ||
|
|
0be77c60c5 | ||
|
|
cde50f1091 | ||
|
|
cb56cbb714 | ||
|
|
2bd352370f | ||
|
|
3910b025b2 | ||
|
|
70fdeb7c22 | ||
|
|
5a1ebdb633 | ||
|
|
8bc66cff39 | ||
|
|
6ebd8f355c | ||
|
|
a59d1ddbf3 | ||
|
|
71c2e65d64 | ||
|
|
52c933cd72 | ||
|
|
3d2bddf4af | ||
|
|
677263f115 | ||
|
|
7302bedc5e | ||
|
|
91df9ba2c0 | ||
|
|
4e9420d1f5 | ||
|
|
e2271b769c | ||
|
|
7f42aedaec | ||
|
|
661ed6e40b | ||
|
|
a7614d9502 | ||
|
|
8eb99c3cec | ||
|
|
b6a487ccf9 | ||
|
|
cb8a140141 | ||
|
|
e19a81cb09 | ||
|
|
65e6e50bf8 | ||
|
|
9d24cc4047 | ||
|
|
c4ad92e458 | ||
|
|
18a7d32c4c | ||
|
|
c11d2ae375 | ||
|
|
1a52a2b880 | ||
|
|
18f4d5a6da | ||
|
|
f3da8f45c1 | ||
|
|
b3a9a0e3e8 | ||
|
|
8055a03067 | ||
|
|
f238e15f10 | ||
|
|
574cb11594 | ||
|
|
d9bdbd5a58 | ||
|
|
a33b3f189d | ||
|
|
26195efa0b | ||
|
|
1c5253b928 | ||
|
|
89cc8ca314 | ||
|
|
ff28836616 | ||
|
|
73d031d7ea | ||
|
|
555d23c035 | ||
|
|
8198c2b63c | ||
|
|
b8963f21bf | ||
|
|
9474a9d319 | ||
|
|
963e16870b | ||
|
|
02aad45aa6 | ||
|
|
59fd98b8b2 | ||
|
|
fbc846b4ba | ||
|
|
dd77b6eac5 | ||
|
|
e951056e7b | ||
|
|
2be39d3e1c | ||
|
|
2b34cf098a | ||
|
|
9821b2c414 | ||
|
|
6661ff9794 | ||
|
|
a9823cbfd5 | ||
|
|
03f1c1e81b | ||
|
|
c277cdef8c | ||
|
|
ad1bd424fa | ||
|
|
a170cc806a | ||
|
|
22a0cd6e05 | ||
|
|
a21a75c19e | ||
|
|
8595fcdeb9 | ||
|
|
5239ef9c83 | ||
|
|
edfe65a22c | ||
|
|
e53debe000 | ||
|
|
c2f547b6e3 | ||
|
|
984c4f0658 | ||
|
|
1ea5400e8d | ||
|
|
b60a7224ab | ||
|
|
29ffd5134f | ||
|
|
6833e01f23 | ||
|
|
0aa8640d07 | ||
|
|
e235e5a6a5 | ||
|
|
63e8946fc8 | ||
|
|
c7fbcb3c02 | ||
|
|
d482b8e3b7 | ||
|
|
f9b43a566c | ||
|
|
52eff3bd83 | ||
|
|
7c2a5052a8 | ||
|
|
1d86a724f2 | ||
|
|
f36f38c960 | ||
|
|
301d30229b | ||
|
|
05ce86ea33 | ||
|
|
6e423a94cd | ||
|
|
c09f8f5764 | ||
|
|
33278f0fce | ||
|
|
9958a8d32e | ||
|
|
ed9cdca127 | ||
|
|
fca77266bd | ||
|
|
688212130d | ||
|
|
3bde390c58 | ||
|
|
0cdb653c9c | ||
|
|
40dca63891 | ||
|
|
b8f5a4923c | ||
|
|
f4c5d29c64 | ||
|
|
c7536fb4fd | ||
|
|
3152e5c207 | ||
|
|
d08d2dac79 | ||
|
|
8264e265a8 | ||
|
|
ec178b0b3b | ||
|
|
b36882e72e | ||
|
|
87fb72346a | ||
|
|
2a238fda9e | ||
|
|
54900d5216 | ||
|
|
22db934db9 | ||
|
|
4a0735a195 | ||
|
|
0827cb5483 | ||
|
|
8e3c1dbd11 | ||
|
|
b031531e79 | ||
|
|
73ec83d055 | ||
|
|
908e94622e | ||
|
|
b9cf450684 | ||
|
|
e13651c16d | ||
|
|
cdd1ddffdb | ||
|
|
8f8d015dae | ||
|
|
4bea50b82f | ||
|
|
623fdf212c | ||
|
|
0507503aa7 | ||
|
|
80c7fbcefe | ||
|
|
2f19cf874b | ||
|
|
1a524ca63e | ||
|
|
47a8ebc8b9 | ||
|
|
9d3bda4441 | ||
|
|
b356d56448 | ||
|
|
a3299bf03a | ||
|
|
cc02eb8a5a | ||
|
|
456378cb53 | ||
|
|
47e681529b | ||
|
|
4c6b58f70c | ||
|
|
d646ebda72 | ||
|
|
c7193e775e | ||
|
|
753cf5da95 | ||
|
|
5a9a365aed | ||
|
|
e5d0a17694 | ||
|
|
7112776d1b | ||
|
|
fb0adc602e | ||
|
|
9d6883561c | ||
|
|
b2d3764a18 | ||
|
|
20e64fbae0 | ||
|
|
f8de08faf0 | ||
|
|
18cb9a725d | ||
|
|
e9e1bec772 | ||
|
|
fb0c931b2d | ||
|
|
5c839c4825 | ||
|
|
9c6e25d8d8 | ||
|
|
be4347084e | ||
|
|
8cc7cd3aa1 | ||
|
|
41c4f3431c | ||
|
|
2560cdd56e | ||
|
|
2365fd2948 | ||
|
|
0a282eb76a | ||
|
|
342e83db60 | ||
|
|
17a76a7403 | ||
|
|
797b03b35e | ||
|
|
5af82312fb | ||
|
|
1680f7af63 | ||
|
|
79701f6f20 | ||
|
|
2d02de33d4 | ||
|
|
ea124c49d0 | ||
|
|
a5d7bb449b | ||
|
|
626568d66d | ||
|
|
ae6cecabb6 | ||
|
|
f67fc43d9b | ||
|
|
c6d11f4281 | ||
|
|
b6f0b17eaf | ||
|
|
bc548b2ef9 | ||
|
|
e6b6146731 | ||
|
|
b300b0646d | ||
|
|
c14886e479 | ||
|
|
c52a4910bf | ||
|
|
7614560a6e | ||
|
|
8e9130d66e | ||
|
|
78b9ae0f1c | ||
|
|
d5ae3201a4 | ||
|
|
b1462ac66c | ||
|
|
322910dc0b | ||
|
|
dcf7cbe366 | ||
|
|
34aa3437e0 | ||
|
|
0c26e8945c | ||
|
|
9ae2df1958 | ||
|
|
7dee9da0f2 | ||
|
|
2dcd2ee4da | ||
|
|
b9f31621e4 | ||
|
|
abcf2909e6 | ||
|
|
4709e67627 | ||
|
|
2b546a50dc | ||
|
|
fe95fcd357 | ||
|
|
670858f774 | ||
|
|
ac8cc6d991 | ||
|
|
16772298ab | ||
|
|
a535d07f28 | ||
|
|
5010ddc28f | ||
|
|
16cfedf04a | ||
|
|
2edea15358 | ||
|
|
c18451fba9 | ||
|
|
2c4700ab7f | ||
|
|
39ebb431b6 | ||
|
|
f7d7abe5b2 | ||
|
|
2d608b9329 | ||
|
|
e4a6da936d | ||
|
|
70cd1d5a57 | ||
|
|
593cafa18b | ||
|
|
747d4fe80b | ||
|
|
a767578d44 | ||
|
|
666cfc6ee2 | ||
|
|
9ac74c44fe | ||
|
|
d1023e9c2c | ||
|
|
09d50ebe31 | ||
|
|
a3d2fb5688 | ||
|
|
617582c5d3 | ||
|
|
6e07cf5b12 | ||
|
|
1356cf8e01 | ||
|
|
db531171ac | ||
|
|
d6557b2c5c | ||
|
|
ad4c7f92cf | ||
|
|
bc1cf285c2 | ||
|
|
7eb84242ee | ||
|
|
35913d9ce7 | ||
|
|
a4ffd2f37c | ||
|
|
ec82530247 | ||
|
|
7c32ef104b | ||
|
|
eaeb71993f | ||
|
|
79d4935ccf | ||
|
|
2c252c0f12 | ||
|
|
6000d956f0 | ||
|
|
5810d7faa0 | ||
|
|
84af543907 | ||
|
|
63b9d9e9df | ||
|
|
fa33faad9e | ||
|
|
db4d68eae7 | ||
|
|
ded1bc14df | ||
|
|
810e884dbe | ||
|
|
fbf59fd4ce | ||
|
|
cfdb41f4d2 | ||
|
|
e6f527f954 | ||
|
|
cd860e3e8d | ||
|
|
86297a7c65 | ||
|
|
e45c16d9bb | ||
|
|
e0c014ab8c | ||
|
|
b4d23d700b | ||
|
|
d1424de1f9 | ||
|
|
8ab632e6f2 | ||
|
|
a0059cfe03 | ||
|
|
12217480f9 | ||
|
|
c1998b170c | ||
|
|
78e37dabb7 | ||
|
|
6d732b9fb4 | ||
|
|
710c3ee3d2 | ||
|
|
3bb75a6fde | ||
|
|
8ea9044667 | ||
|
|
cddb26558f | ||
|
|
f3fec6685e | ||
|
|
ee6dabcc4e | ||
|
|
af6830a722 | ||
|
|
ce845e51f2 | ||
|
|
87616c5e91 | ||
|
|
7d1fde292d | ||
|
|
a5f754a5e0 | ||
|
|
ca83f11bee | ||
|
|
f133ce96f8 | ||
|
|
cbdf10a129 | ||
|
|
0b50ebb0f0 | ||
|
|
235fc90e22 | ||
|
|
aa94d0902a | ||
|
|
5a6ffc2804 | ||
|
|
0931e99ea4 | ||
|
|
a8a4df05e6 | ||
|
|
da410caff8 | ||
|
|
a6cc492a99 | ||
|
|
27feab7e3a | ||
|
|
eab77b7072 | ||
|
|
3b1bc2bd13 | ||
|
|
92918fd841 | ||
|
|
23ea62d40a | ||
|
|
3352a6c9df | ||
|
|
fe70742bb9 | ||
|
|
9e83878900 | ||
|
|
58717e05a3 | ||
|
|
54ff573174 | ||
|
|
bd5ff5b1e5 | ||
|
|
7d174b0056 | ||
|
|
1aea6a34ff | ||
|
|
4fa66ab627 | ||
|
|
15c48650e7 | ||
|
|
cad9fc19c6 | ||
|
|
507e32e91c | ||
|
|
5afbc9b701 | ||
|
|
4c50aec79c | ||
|
|
4c6c5bf84f | ||
|
|
b50ae96413 | ||
|
|
f7f6f6541d | ||
|
|
bc97735b6d | ||
|
|
dcbb0ffee5 | ||
|
|
5885954197 | ||
|
|
bc32e24203 | ||
|
|
400580e4e8 | ||
|
|
9e0d7a9d8c | ||
|
|
ff80b23ee1 | ||
|
|
b2be833744 | ||
|
|
340c0bbac5 | ||
|
|
d12e990f73 | ||
|
|
bbabdd0043 | ||
|
|
a96cc92edf | ||
|
|
7b73204f25 | ||
|
|
505d114a68 | ||
|
|
5c7b55edec | ||
|
|
768f761017 | ||
|
|
05d3bb12dd | ||
|
|
78e0029488 | ||
|
|
eb79b52a9a | ||
|
|
d787050fa8 | ||
|
|
29d0a20dc3 | ||
|
|
751d965265 | ||
|
|
b44f6053d1 | ||
|
|
82dd80c692 | ||
|
|
6a84605c57 | ||
|
|
b50a7318fb | ||
|
|
47ff514878 | ||
|
|
025f3407d6 | ||
|
|
ab0e76dbd5 | ||
|
|
836a2cfe3b | ||
|
|
c67d3b7e60 | ||
|
|
a70591fa76 | ||
|
|
ab47011ef2 | ||
|
|
1b55e5edab | ||
|
|
4fd5bf81be | ||
|
|
7def00d5a9 | ||
|
|
dd5806662a | ||
|
|
996732d5a6 | ||
|
|
fdc7166c3c | ||
|
|
f9aa7d3b9a | ||
|
|
8eb4f95766 | ||
|
|
46225f3bb1 | ||
|
|
d9a7364dae | ||
|
|
7ce960ae51 | ||
|
|
130928590b | ||
|
|
8315c0e337 | ||
|
|
854066e849 | ||
|
|
b43413916d | ||
|
|
5859050d29 | ||
|
|
af02fb5183 | ||
|
|
871ce1c8f5 | ||
|
|
1bd9b0fbe2 | ||
|
|
a04e73ddbc | ||
|
|
1b8450e7a0 | ||
|
|
35093e8f0d | ||
|
|
6ab92af181 | ||
|
|
e134eca694 | ||
|
|
18fef18ab1 | ||
|
|
7b7a275902 | ||
|
|
bb293b297c | ||
|
|
a1cf7f67a1 | ||
|
|
638eb1f000 | ||
|
|
84b280b881 | ||
|
|
def4466671 | ||
|
|
160b9548ee | ||
|
|
fd6f05c9ea | ||
|
|
5a3cfbbdf5 | ||
|
|
51f256e897 | ||
|
|
857ca941d2 | ||
|
|
b731bd77ab | ||
|
|
5b731f761f | ||
|
|
9f21e45156 | ||
|
|
0d8be55c51 | ||
|
|
2330837747 | ||
|
|
b2e730fb5e | ||
|
|
29746d492e | ||
|
|
64c6cbee48 | ||
|
|
3f1cab3e7e | ||
|
|
411c6b5e9f | ||
|
|
518f99b480 | ||
|
|
79e8e063af | ||
|
|
01ecf2a75f | ||
|
|
7eec1f2efc | ||
|
|
8846a8860f | ||
|
|
f883d4d4fd | ||
|
|
f984c5fb83 | ||
|
|
72161b82ef | ||
|
|
0302d2a328 | ||
|
|
e51272e277 | ||
|
|
14cca6d115 | ||
|
|
16ba9bd680 | ||
|
|
499bf63dc3 | ||
|
|
b9d91f0e9b | ||
|
|
d5c9a4eb87 | ||
|
|
d2ec53f817 | ||
|
|
539a76c5ae | ||
|
|
1917e9157c | ||
|
|
3828ea5b26 | ||
|
|
8b557f346c | ||
|
|
7f6e5dc65b | ||
|
|
7d73a1602b | ||
|
|
a9b29fef28 | ||
|
|
c2f69b7750 | ||
|
|
93473a4101 | ||
|
|
229a1c092a | ||
|
|
492260c967 | ||
|
|
c2138a2656 | ||
|
|
ec3ddce4ac | ||
|
|
2c6b571e66 | ||
|
|
4eaa990fe8 | ||
|
|
8da5641355 | ||
|
|
d1e23f7295 | ||
|
|
dc647fcc7f | ||
|
|
e98560a349 | ||
|
|
026c4f304e | ||
|
|
1ea61162a0 | ||
|
|
fbf8ccb882 | ||
|
|
47401a6eda | ||
|
|
ce2bfa88eb | ||
|
|
40f6ee4c39 | ||
|
|
93539e10de | ||
|
|
dab6f39eb0 | ||
|
|
ab534c2995 | ||
|
|
d2806fad60 | ||
|
|
50d952b07d | ||
|
|
a105aa90a5 | ||
|
|
b96f5845ed | ||
|
|
b44bd4e24f | ||
|
|
66b9d025bb | ||
|
|
11e17669d3 | ||
|
|
af1ab0b5a9 | ||
|
|
8ab103504f | ||
|
|
7e79018b8c | ||
|
|
629ff513ec | ||
|
|
fb682be199 | ||
|
|
f814be45b1 | ||
|
|
c2258e3684 | ||
|
|
e455d8219e | ||
|
|
25e4d1a353 | ||
|
|
07af1799b1 | ||
|
|
f6b0a28cba | ||
|
|
3442e58c8b | ||
|
|
f472e04b09 | ||
|
|
6f858590c2 | ||
|
|
e8cc40b139 | ||
|
|
ba83c476cd | ||
|
|
ebbfb64221 | ||
|
|
aef58f598c | ||
|
|
86c17e1834 | ||
|
|
99263bdda4 | ||
|
|
5146332206 | ||
|
|
64ad51048d | ||
|
|
62862c3347 | ||
|
|
8ce6d47ef6 | ||
|
|
14d86f8763 | ||
|
|
04190cbcfe | ||
|
|
d8d96fb0eb | ||
|
|
e93dba351c | ||
|
|
817b6bbd2d | ||
|
|
1eec446620 | ||
|
|
f61c6d4c0e | ||
|
|
71257979aa | ||
|
|
2ac670f293 | ||
|
|
25e1aa43b8 | ||
|
|
9ee7a6d57c | ||
|
|
7517fd8226 | ||
|
|
edddb1910b | ||
|
|
8f9828e5bf | ||
|
|
11e38efa83 | ||
|
|
f30652a98f | ||
|
|
e4d886d4a7 | ||
|
|
eeea72e167 | ||
|
|
e4708c356b | ||
|
|
7db805b0cd | ||
|
|
ef86a8a389 | ||
|
|
9dadde190e | ||
|
|
e88eb6c415 | ||
|
|
3c5156d4a4 | ||
|
|
a0e0408ecc | ||
|
|
d41f15bcbc | ||
|
|
fcc17dffbe | ||
|
|
02ac28dbe6 | ||
|
|
f6109d2e4e | ||
|
|
3be60bf034 | ||
|
|
1a62e95733 | ||
|
|
dcbab18a35 | ||
|
|
33b0852c84 | ||
|
|
fcb5718712 | ||
|
|
2c89a4c98a | ||
|
|
7c68889bbc | ||
|
|
955452816a | ||
|
|
8c5a7fb2ca | ||
|
|
2b9e320370 | ||
|
|
e4649b50d6 | ||
|
|
fbd76fb63d | ||
|
|
0d3d5657ff | ||
|
|
d5ae9b50ea | ||
|
|
81f27a99c8 | ||
|
|
735a6a2a88 | ||
|
|
5e4c302b5b | ||
|
|
88948e0ee3 | ||
|
|
42efd51723 | ||
|
|
5eb80f03a2 | ||
|
|
ab50b3a88a | ||
|
|
676a4049b3 | ||
|
|
fd49f7df90 | ||
|
|
e72dc1acd5 | ||
|
|
a90cf62995 | ||
|
|
5d32366616 | ||
|
|
6fe8105a0e | ||
|
|
b9f4b0373a | ||
|
|
6ec965c8e4 | ||
|
|
fa02b1d259 | ||
|
|
bc317a7be5 | ||
|
|
bfad5c9dc4 | ||
|
|
7a89d0c97e | ||
|
|
50fc4b5521 | ||
|
|
7ed343965c | ||
|
|
945ed7d4e7 | ||
|
|
505b591b22 | ||
|
|
dc775f236c | ||
|
|
c17346d402 | ||
|
|
aca5a00fb7 | ||
|
|
8e997ac231 | ||
|
|
5825a65627 | ||
|
|
62dae1cc6b | ||
|
|
8e8113ff6f | ||
|
|
c4f22186bd | ||
|
|
f71c60ede3 | ||
|
|
b934dc52b6 | ||
|
|
00d3141962 | ||
|
|
28a62aab28 | ||
|
|
9460e58c3b | ||
|
|
c77cf0e518 | ||
|
|
7fe1119cf1 | ||
|
|
c89587785b | ||
|
|
fb07971290 | ||
|
|
3840cebbc4 | ||
|
|
c31cd12bdd | ||
|
|
6f76a840f0 | ||
|
|
6b1f0c5d1f | ||
|
|
aabddea6dd | ||
|
|
5ee2ada8e9 | ||
|
|
da8fd647bf | ||
|
|
43098171ac | ||
|
|
ed8f79987d | ||
|
|
92ade713f2 | ||
|
|
58880f33be | ||
|
|
1e72a7a130 | ||
|
|
4526018344 | ||
|
|
2e442a2cab | ||
|
|
71bf2bfb94 | ||
|
|
c8ce15d9f1 | ||
|
|
b67c103d06 | ||
|
|
3a289dab6b | ||
|
|
23ee0d0992 | ||
|
|
57ad32f986 | ||
|
|
d511b02ebe | ||
|
|
ab44d05508 | ||
|
|
3532257a1a | ||
|
|
f92bbab8cf | ||
|
|
bf8bf06681 | ||
|
|
74d879952c | ||
|
|
3530180a73 | ||
|
|
59d9f5d458 | ||
|
|
ad52b9630d | ||
|
|
ed097cfcbd | ||
|
|
e80389f8d4 | ||
|
|
74691269ce | ||
|
|
18467a55b5 | ||
|
|
e6b132c915 | ||
|
|
4214832ae2 | ||
|
|
1f4d1800e0 | ||
|
|
ea1627f5ce | ||
|
|
0b743389e5 | ||
|
|
05bab00c3c | ||
|
|
8ebd15a54d | ||
|
|
7d8390d43e | ||
|
|
0d797c203f | ||
|
|
04e0dda17a | ||
|
|
65fbf1cdff | ||
|
|
d012fd1f09 | ||
|
|
0646b2861f | ||
|
|
0f0d1709c5 | ||
|
|
455793dfd9 | ||
|
|
af6470c8d0 | ||
|
|
bb1f045d59 | ||
|
|
cdf0fb39e5 | ||
|
|
3ca70cb841 | ||
|
|
c41afa2b0d | ||
|
|
2fd4db91ce | ||
|
|
05970e1b28 | ||
|
|
6299da7bd3 | ||
|
|
3f926de76b | ||
|
|
f7fc54262d | ||
|
|
164c4efb32 | ||
|
|
5790df1272 | ||
|
|
372a4dfd7e | ||
|
|
3443994a52 | ||
|
|
e2860f8a26 | ||
|
|
1b53fa841b | ||
|
|
9ca51ed035 | ||
|
|
a65358cfce | ||
|
|
9185a0d2e5 | ||
|
|
8712aee5dc | ||
|
|
4c5e97dd1c | ||
|
|
78a7df52c0 | ||
|
|
42155049a5 | ||
|
|
11a50b2580 | ||
|
|
9baae52d1a | ||
|
|
fa3a4b3ba2 | ||
|
|
113f53a5d2 | ||
|
|
3f33dc7d98 | ||
|
|
d4466d4be7 | ||
|
|
204e3ca36b | ||
|
|
5a947933d7 | ||
|
|
2bafdb7e5a | ||
|
|
07b2542c0d | ||
|
|
fa54f7af97 | ||
|
|
2f96f26038 | ||
|
|
ac707be619 | ||
|
|
4e5a848d95 | ||
|
|
6ea00af689 | ||
|
|
28c6ec9cad | ||
|
|
d7bdaeeab0 | ||
|
|
cd79ced839 |
40
.appveyor.yml
Normal file
40
.appveyor.yml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
# Disabling building for AppVeyor. We are just testing things.
|
||||||
|
build: false
|
||||||
|
clone_depth: 10
|
||||||
|
# Use the directory C:\testplugin so test directories will mostly work.
|
||||||
|
clone_folder: C:\testplugin
|
||||||
|
|
||||||
|
# Cache the vim and vader directories between builds.
|
||||||
|
cache:
|
||||||
|
- C:\vim -> .appveyor.yml
|
||||||
|
- C:\vader -> .appveyor.yml
|
||||||
|
|
||||||
|
init:
|
||||||
|
# Stop git from changing newlines
|
||||||
|
- git config --global core.autocrlf input
|
||||||
|
|
||||||
|
install:
|
||||||
|
# Download and unpack Vim
|
||||||
|
- ps: >-
|
||||||
|
if (!(Test-Path -Path C:\vim)){
|
||||||
|
Add-Type -A System.IO.Compression.FileSystem
|
||||||
|
Invoke-WebRequest ftp://ftp.vim.org/pub/vim/pc/vim80-586w32.zip `
|
||||||
|
-OutFile C:\vim.zip
|
||||||
|
[IO.Compression.ZipFile]::ExtractToDirectory('C:\vim.zip', 'C:\vim')
|
||||||
|
Invoke-WebRequest ftp://ftp.vim.org/pub/vim/pc/vim80-586rt.zip `
|
||||||
|
-OutFile C:\rt.zip
|
||||||
|
[IO.Compression.ZipFile]::ExtractToDirectory('C:\rt.zip', 'C:\vim')
|
||||||
|
}
|
||||||
|
# Clone Vader and check out the commit we want
|
||||||
|
- ps: >-
|
||||||
|
if (!(Test-Path -Path C:\vader)){
|
||||||
|
git clone https://github.com/junegunn/vader.vim C:\vader 2> $null
|
||||||
|
cd C:\vader
|
||||||
|
git checkout -qf c6243dd81c98350df4dec608fa972df98fa2a3af 2> $null
|
||||||
|
}
|
||||||
|
|
||||||
|
test_script:
|
||||||
|
- cd C:\testplugin
|
||||||
|
- 'C:\vim\vim\vim80\vim.exe -u test\vimrc "+Vader!
|
||||||
|
test/*.vader test/*/*.vader test/*/*/*.vader test/*/*/*.vader"'
|
||||||
14
.editorconfig
Normal file
14
.editorconfig
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# EditorConfig is awesome: http://EditorConfig.org
|
||||||
|
|
||||||
|
# Top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# Match and apply these rules for all file
|
||||||
|
# types you open in your code editor
|
||||||
|
[*]
|
||||||
|
# Unix-style newlines
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
trim_trailing_whitespace = true
|
||||||
11
.eslintrc.js
11
.eslintrc.js
@@ -1,11 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
parserOptions: {
|
|
||||||
ecmaVersion: 6,
|
|
||||||
sourceType: "module",
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
semi: 'error',
|
|
||||||
'space-infix-ops': 'warn',
|
|
||||||
radix: 'error',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
4
.gitattributes
vendored
4
.gitattributes
vendored
@@ -1,10 +1,12 @@
|
|||||||
.* export-ignore
|
.* export-ignore
|
||||||
|
/CODE_OF_CONDUCT.md export-ignore
|
||||||
/CONTRIBUTING.md export-ignore
|
/CONTRIBUTING.md export-ignore
|
||||||
/Dockerfile export-ignore
|
/Dockerfile export-ignore
|
||||||
/ISSUE_TEMPLATE.md export-ignore
|
/ISSUE_TEMPLATE.md export-ignore
|
||||||
/Makefile export-ignore
|
/Makefile export-ignore
|
||||||
/PULL_REQUEST_TEMPLATE.md export-ignore
|
/PULL_REQUEST_TEMPLATE.md export-ignore
|
||||||
/README.md export-ignore
|
/README.md export-ignore
|
||||||
/custom-checks export-ignore
|
|
||||||
/img export-ignore
|
/img export-ignore
|
||||||
|
/run-tests export-ignore
|
||||||
|
/run-tests.bat export-ignore
|
||||||
/test export-ignore
|
/test export-ignore
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
|||||||
/init.vim
|
/init.vim
|
||||||
/doc/tags
|
/doc/tags
|
||||||
.*
|
.*
|
||||||
|
!.editorconfig
|
||||||
*.obj
|
*.obj
|
||||||
tags
|
tags
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
sudo: required
|
sudo: required
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
language: python
|
language: python
|
||||||
script: |
|
script: |
|
||||||
make test
|
./run-tests
|
||||||
|
|||||||
3
CODE_OF_CONDUCT.md
Normal file
3
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Codes of conduct are totally unnecessary and dumb.
|
||||||
|
|
||||||
|
Just don't be a jerk and have fun.
|
||||||
@@ -74,10 +74,10 @@ If you want to credit multiple authors, you can comma separate them.
|
|||||||
### 3.i. Adding a New Linter
|
### 3.i. Adding a New Linter
|
||||||
|
|
||||||
If you add a new linter, look for existing handlers first in the
|
If you add a new linter, look for existing handlers first in the
|
||||||
[handlers.vim](autoload/ale/handlers.vim) file. One of the handlers there may
|
[handlers](autoload/ale/handlers) directory. One of the handlers there may
|
||||||
already be able to handle your lines of output. If you find that your new
|
already be able to handle your lines of output. If you find that your new
|
||||||
linter replicates an existing error handler, consider pulling it up into the
|
linter replicates an existing error handler, consider pulling it up into the
|
||||||
[handlers.vim](autoload/ale/handlers.vim) file, and use the generic handler in
|
[handlers](autoload/ale/handlers) directory, and use the generic handler in
|
||||||
both places.
|
both places.
|
||||||
|
|
||||||
When you add a linter, make sure the language for the linter and the linter
|
When you add a linter, make sure the language for the linter and the linter
|
||||||
@@ -129,7 +129,7 @@ giving some unfair preference to any particular tool or language.
|
|||||||
|
|
||||||
The "online documentation" file used for this project lives in `doc/ale.txt`.
|
The "online documentation" file used for this project lives in `doc/ale.txt`.
|
||||||
This is the file used for generating `:help` text inside Vim itself. There are
|
This is the file used for generating `:help` text inside Vim itself. There are
|
||||||
some guidlines to follow for this file.
|
some guidelines to follow for this file.
|
||||||
|
|
||||||
1. Keep all text within a column size of 79 characters, inclusive.
|
1. Keep all text within a column size of 79 characters, inclusive.
|
||||||
2. Open a section with 79 `=` or `-` characters, for headings and subheadings.
|
2. Open a section with 79 `=` or `-` characters, for headings and subheadings.
|
||||||
@@ -160,7 +160,7 @@ to look up the default value easily by typing `:echo g:ale_...`.
|
|||||||
Should the principal author of the ALE project and all collaborators with the
|
Should the principal author of the ALE project and all collaborators with the
|
||||||
required access needed to properly administrate the project on GitHub or any
|
required access needed to properly administrate the project on GitHub or any
|
||||||
other website either perish or disappear, whether by tragic traffic accident
|
other website either perish or disappear, whether by tragic traffic accident
|
||||||
or government adduction, etc., action should be taken to ensure that the
|
or government abduction, etc., action should be taken to ensure that the
|
||||||
project continues. If no one is left to administer the project where it is
|
project continues. If no one is left to administer the project where it is
|
||||||
hosted, please fork the project and nominate someone capable to administer it.
|
hosted, please fork the project and nominate someone capable to administer it.
|
||||||
Preferably, in such an event, a single fork of the project will replace the
|
Preferably, in such an event, a single fork of the project will replace the
|
||||||
|
|||||||
11
Dockerfile
11
Dockerfile
@@ -1,25 +1,18 @@
|
|||||||
FROM tweekmonster/vim-testbed:latest
|
FROM tweekmonster/vim-testbed:latest
|
||||||
|
|
||||||
RUN install_vim -tag v8.0.0000 -build \
|
RUN install_vim -tag v8.0.0027 -build \
|
||||||
-tag v8.0.0027 -build
|
-tag neovim:v0.1.7 -build
|
||||||
|
|
||||||
# the clang package includes clang-tidy
|
|
||||||
ENV PACKAGES="\
|
ENV PACKAGES="\
|
||||||
bash \
|
bash \
|
||||||
git \
|
git \
|
||||||
python \
|
python \
|
||||||
py-pip \
|
py-pip \
|
||||||
nodejs \
|
|
||||||
gcc \
|
|
||||||
g++ \
|
|
||||||
clang \
|
|
||||||
"
|
"
|
||||||
RUN apk --update add $PACKAGES && \
|
RUN apk --update add $PACKAGES && \
|
||||||
rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
|
rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
RUN pip install vim-vint==0.3.9
|
RUN pip install vim-vint==0.3.9
|
||||||
|
|
||||||
RUN npm install -g eslint@3.7.1
|
|
||||||
|
|
||||||
RUN git clone https://github.com/junegunn/vader.vim vader && \
|
RUN git clone https://github.com/junegunn/vader.vim vader && \
|
||||||
cd vader && git checkout c6243dd81c98350df4dec608fa972df98fa2a3af
|
cd vader && git checkout c6243dd81c98350df4dec608fa972df98fa2a3af
|
||||||
|
|||||||
@@ -1,12 +1,28 @@
|
|||||||
<!--
|
<!--
|
||||||
For bugs, paste output from your clipboard after running :ALEInfoToClipboard
|
This is a template for bug reports. If you want to request a new feature,
|
||||||
here. If that doesn't work for some reason, try running :ALEInfo and copying
|
you can clear this entire form field and write a short description of what
|
||||||
the output from that here instead. If everything is broken, run around in
|
you want.
|
||||||
circles and scream.
|
|
||||||
|
|
||||||
If you are experiencing a bug where ALE is not correctly parsing the output of
|
|
||||||
commands, set g:ale_history_log_output to 1, and run ALE again, and then
|
|
||||||
:ALEInfo should include the full output of each command which ran.
|
|
||||||
|
|
||||||
Whatever the case, describe the your issue here.
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
## Information
|
||||||
|
|
||||||
|
**VIM version**
|
||||||
|
|
||||||
|
PASTE JUST THE FIRST TWO LINES OF `:version` HERE.
|
||||||
|
|
||||||
|
Operating System: WHAT OS WERE YOU USING?
|
||||||
|
|
||||||
|
### :ALEInfo
|
||||||
|
|
||||||
|
PASTE OUTPUT OF `:ALEInfo` HERE. YOU CAN TRY `:ALEInfoToClipboard`.
|
||||||
|
|
||||||
|
## What went wrong
|
||||||
|
|
||||||
|
WRITE WHAT WENT WRONG HERE.
|
||||||
|
|
||||||
|
## Reproducing the bug
|
||||||
|
|
||||||
|
Steps for repeating the bug:
|
||||||
|
|
||||||
|
1. Write a list of steps.
|
||||||
|
2. Otherwise nobody will fix the bug.
|
||||||
|
|||||||
2
LICENSE
2
LICENSE
@@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2016, w0rp <devw0rp@gmail.com>
|
Copyright (c) 2016-2018, 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
|
||||||
|
|||||||
53
Makefile
53
Makefile
@@ -1,53 +0,0 @@
|
|||||||
SHELL := /usr/bin/env bash
|
|
||||||
IMAGE ?= w0rp/ale
|
|
||||||
CURRENT_IMAGE_ID = 30a9967dbdb1
|
|
||||||
DOCKER_FLAGS = --rm -v $(PWD):/testplugin -v $(PWD)/test:/home "$(IMAGE)"
|
|
||||||
tests = test/*.vader test/*/*.vader test/*/*/*.vader test/*/*/*/*.vader
|
|
||||||
|
|
||||||
test-setup:
|
|
||||||
docker images -q w0rp/ale | grep ^$(CURRENT_IMAGE_ID) > /dev/null || \
|
|
||||||
docker pull $(IMAGE)
|
|
||||||
|
|
||||||
vader: test-setup
|
|
||||||
@:; \
|
|
||||||
vims=$$(docker run --rm $(IMAGE) ls /vim-build/bin | grep -E '^n?vim'); \
|
|
||||||
if [ -z "$$vims" ]; then echo "No Vims found!"; exit 1; fi; \
|
|
||||||
for vim in $$vims; do \
|
|
||||||
docker run -a stderr $(DOCKER_FLAGS) $$vim '+Vader! $(tests)'; \
|
|
||||||
done
|
|
||||||
|
|
||||||
test: test-setup
|
|
||||||
@:; \
|
|
||||||
vims=$$(docker run --rm $(IMAGE) ls /vim-build/bin | grep -E '^n?vim'); \
|
|
||||||
if [ -z "$$vims" ]; then echo "No Vims found!"; exit 1; fi; \
|
|
||||||
EXIT=0; \
|
|
||||||
for vim in $$vims; do \
|
|
||||||
echo; \
|
|
||||||
echo '========================================'; \
|
|
||||||
echo "Running tests for $$vim"; \
|
|
||||||
echo '========================================'; \
|
|
||||||
echo; \
|
|
||||||
docker run -a stderr $(DOCKER_FLAGS) $$vim '+Vader! $(tests)' || EXIT=$$?; \
|
|
||||||
done; \
|
|
||||||
echo; \
|
|
||||||
echo '========================================'; \
|
|
||||||
echo 'Running Vint to lint our code'; \
|
|
||||||
echo '========================================'; \
|
|
||||||
echo 'Vint warnings/errors follow:'; \
|
|
||||||
echo; \
|
|
||||||
set -o pipefail; \
|
|
||||||
docker run -a stdout $(DOCKER_FLAGS) vint -s /testplugin | sed s:^/testplugin/:: || EXIT=$$?; \
|
|
||||||
set +o pipefail; \
|
|
||||||
echo; \
|
|
||||||
echo '========================================'; \
|
|
||||||
echo 'Running custom checks'; \
|
|
||||||
echo '========================================'; \
|
|
||||||
echo 'Custom warnings/errors follow:'; \
|
|
||||||
echo; \
|
|
||||||
set -o pipefail; \
|
|
||||||
docker run -v $(PWD):/testplugin "$(IMAGE)" /testplugin/custom-checks /testplugin | sed s:^/testplugin/:: || EXIT=$$?; \
|
|
||||||
set +o pipefail; \
|
|
||||||
echo; \
|
|
||||||
exit $$EXIT;
|
|
||||||
|
|
||||||
.DEFAULT_GOAL := test
|
|
||||||
@@ -1,6 +1,10 @@
|
|||||||
<!--
|
<!--
|
||||||
When creating new pull requests, please consider the following.
|
READ THIS: Before creating a pull request, please consider the following first.
|
||||||
|
|
||||||
|
* The most important thing you can do is write tests. Code without tests
|
||||||
|
probably doesn't work, and will almost certainly stop working later on. Pull
|
||||||
|
requests without tests probably won't be accepted, although there are some
|
||||||
|
exceptions.
|
||||||
* Read the Contributing guide linked above first.
|
* Read the Contributing guide linked above first.
|
||||||
* If you are adding a new linter, remember to update the README.md file and
|
* If you are adding a new linter, remember to update the README.md file and
|
||||||
doc/ale.txt first.
|
doc/ale.txt first.
|
||||||
|
|||||||
487
README.md
487
README.md
@@ -1,4 +1,5 @@
|
|||||||
# Asynchronous Lint Engine [](https://travis-ci.org/w0rp/ale)
|
# Asynchronous Lint Engine [](https://travis-ci.org/w0rp/ale) [](https://ci.appveyor.com/project/w0rp/ale)
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -15,27 +16,39 @@ back to a filesystem.
|
|||||||
|
|
||||||
In other words, this plugin allows you to lint while you type.
|
In other words, this plugin allows you to lint while you type.
|
||||||
|
|
||||||
|
In addition to linting support, ALE offers some support for fixing code with
|
||||||
|
formatting tools, and some Language Server Protocol and `tsserver` features.
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
1. [Supported Languages and Tools](#supported-languages)
|
1. [Supported Languages and Tools](#supported-languages)
|
||||||
2. [Usage](#usage)
|
2. [Usage](#usage)
|
||||||
|
1. [Linting](#usage-linting)
|
||||||
|
2. [Fixing](#usage-fixing)
|
||||||
|
3. [Completion](#usage-completion)
|
||||||
|
4. [Go To Definition](#usage-go-to-definition)
|
||||||
3. [Installation](#installation)
|
3. [Installation](#installation)
|
||||||
1. [Installation with Pathogen](#installation-with-pathogen)
|
1. [Installation with Vim package management](#standard-installation)
|
||||||
2. [Installation with Vundle](#installation-with-vundle)
|
2. [Installation with Pathogen](#installation-with-pathogen)
|
||||||
3. [Manual Installation](#manual-installation)
|
3. [Installation with Vundle](#installation-with-vundle)
|
||||||
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)
|
||||||
2. [How can I keep the sign gutter open?](#faq-keep-signs)
|
2. [How can I keep the sign gutter open?](#faq-keep-signs)
|
||||||
3. [How can I change the signs ALE uses?](#faq-change-signs)
|
3. [How can I change the signs ALE uses?](#faq-change-signs)
|
||||||
4. [How can I show errors or warnings in my statusline?](#faq-statusline)
|
4. [How can I change or disable the highlights ALE uses?](#faq-change-highlights)
|
||||||
5. [How can I change the format for echo messages?](#faq-echo-format)
|
5. [How can I show errors or warnings in my statusline?](#faq-statusline)
|
||||||
6. [How can I execute some code when ALE stops linting?](#faq-autocmd)
|
6. [How can I show errors or warnings in my lightline?](#faq-lightline)
|
||||||
7. [How can I navigate between errors quickly?](#faq-navigation)
|
7. [How can I change the format for echo messages?](#faq-echo-format)
|
||||||
8. [How can I run linters only when I save files?](#faq-lint-on-save)
|
8. [How can I execute some code when ALE starts or stops linting?](#faq-autocmd)
|
||||||
9. [How can I use the quickfix list instead of the loclist?](#faq-quickfix)
|
9. [How can I navigate between errors quickly?](#faq-navigation)
|
||||||
10. [How can I check JSX files with both stylelint and eslint?](#faq-jsx-stylelint-eslint)
|
10. [How can I run linters only when I save files?](#faq-lint-on-save)
|
||||||
11. [Will this plugin eat all of my laptop battery power?](#faq-my-battery-is-sad)
|
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)
|
||||||
|
13. [Will this plugin eat all of my laptop battery power?](#faq-my-battery-is-sad)
|
||||||
|
14. [How can I configure my C or C++ project?](#faq-c-configuration)
|
||||||
|
15. [How can I configure ALE differently for different buffers?](#faq-buffer-configuration)
|
||||||
|
16. [How can I configure the height of the list in which ALE displays errors?](#faq-list-window-height)
|
||||||
|
|
||||||
<a name="supported-languages"></a>
|
<a name="supported-languages"></a>
|
||||||
|
|
||||||
@@ -48,81 +61,123 @@ tools will be run in combination, so they can be complementary.
|
|||||||
Keep the table rows sorted alphabetically by the language name,
|
Keep the table rows sorted alphabetically by the language name,
|
||||||
and the tools in the tools column sorted alphabetically by the tool
|
and the tools in the tools column sorted alphabetically by the tool
|
||||||
name. That seems to be the fairest way to arrange this table.
|
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 |
|
| Language | Tools |
|
||||||
| -------- | ----- |
|
| -------- | ----- |
|
||||||
| ASM | [gcc](https://gcc.gnu.org) |
|
| ASM | [gcc](https://gcc.gnu.org) |
|
||||||
| Ansible | [ansible-lint](https://github.com/willthames/ansible-lint) |
|
| Ansible | [ansible-lint](https://github.com/willthames/ansible-lint) |
|
||||||
| AsciiDoc | [proselint](http://proselint.com/)|
|
| API Blueprint | [drafter](https://github.com/apiaryio/drafter) |
|
||||||
| Bash | [-n flag](https://www.gnu.org/software/bash/manual/bash.html#index-set), [shellcheck](https://www.shellcheck.net/) |
|
| AsciiDoc | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [write-good](https://github.com/btford/write-good) |
|
||||||
| Bourne Shell | [-n flag](http://linux.die.net/man/1/sh), [shellcheck](https://www.shellcheck.net/) |
|
| Awk | [gawk](https://www.gnu.org/software/gawk/)|
|
||||||
| C | [cppcheck](http://cppcheck.sourceforge.net), [gcc](https://gcc.gnu.org/), [clang](http://clang.llvm.org/)|
|
| Bash | 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) |
|
||||||
| C++ (filetype cpp) | [clang](http://clang.llvm.org/), [clangtidy](http://clang.llvm.org/extra/clang-tidy/), [cppcheck](http://cppcheck.sourceforge.net), [gcc](https://gcc.gnu.org/)|
|
| Bourne Shell | shell [-n flag](http://linux.die.net/man/1/sh), [shellcheck](https://www.shellcheck.net/), [shfmt](https://github.com/mvdan/sh) |
|
||||||
| C# | [mcs](http://www.mono-project.com/docs/about-mono/languages/csharp/) |
|
| 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) !!, [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/) |
|
| Chef | [foodcritic](http://www.foodcritic.io/) |
|
||||||
|
| Clojure | [joker](https://github.com/candid82/joker) |
|
||||||
| CMake | [cmakelint](https://github.com/richq/cmake-lint) |
|
| CMake | [cmakelint](https://github.com/richq/cmake-lint) |
|
||||||
| CoffeeScript | [coffee](http://coffeescript.org/), [coffeelint](https://www.npmjs.com/package/coffeelint) |
|
| CoffeeScript | [coffee](http://coffeescript.org/), [coffeelint](https://www.npmjs.com/package/coffeelint) |
|
||||||
| Crystal | [crystal](https://crystal-lang.org/) |
|
| Crystal | [crystal](https://crystal-lang.org/) !! |
|
||||||
| CSS | [csslint](http://csslint.net/), [stylelint](https://github.com/stylelint/stylelint) |
|
| CSS | [csslint](http://csslint.net/), [prettier](https://github.com/prettier/prettier), [stylelint](https://github.com/stylelint/stylelint) |
|
||||||
| Cython (pyrex filetype) | [cython](http://cython.org/) |
|
| Cython (pyrex filetype) | [cython](http://cython.org/) |
|
||||||
| D | [dmd](https://dlang.org/dmd-linux.html) |
|
| D | [dmd](https://dlang.org/dmd-linux.html) |
|
||||||
| Dockerfile | [hadolint](https://github.com/lukasmartinelli/hadolint) |
|
| Dafny | [dafny](https://rise4fun.com/Dafny) !! |
|
||||||
| Elixir | [credo](https://github.com/rrrene/credo), [dogma](https://github.com/lpil/dogma) |
|
| Dart | [dartanalyzer](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer_cli) !!, [language_server](https://github.com/natebosch/dart_language_server) |
|
||||||
| Elm | [elm-make](https://github.com/elm-lang/elm-make) |
|
| Dockerfile | [hadolint](https://github.com/hadolint/hadolint) |
|
||||||
| Erb | [erb](https://github.com/jeremyevans/erubi) |
|
| Elixir | [credo](https://github.com/rrrene/credo), [dialyxir](https://github.com/jeremyjh/dialyxir), [dogma](https://github.com/lpil/dogma) !!|
|
||||||
| Erlang | [erlc](http://erlang.org/doc/man/erlc.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/) |
|
| Fortran | [gcc](https://gcc.gnu.org/) |
|
||||||
| Go | [gofmt -e](https://golang.org/cmd/gofmt/), [go vet](https://golang.org/cmd/vet/), [golint](https://godoc.org/github.com/golang/lint), [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) |
|
| Fountain | [proselint](http://proselint.com/) |
|
||||||
| Haml | [haml-lint](https://github.com/brigade/haml-lint)
|
| 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) |
|
| Handlebars | [ember-template-lint](https://github.com/rwjblue/ember-template-lint) |
|
||||||
| Haskell | [ghc](https://www.haskell.org/ghc/), [hlint](https://hackage.haskell.org/package/hlint), [hdevtools](https://hackage.haskell.org/package/hdevtools) |
|
| 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 | [HTMLHint](http://htmlhint.com/), [proselint](http://proselint.com/), [tidy](http://www.html-tidy.org/) |
|
| 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) |
|
||||||
| Java | [javac](http://www.oracle.com/technetwork/java/javase/downloads/index.html) |
|
| Idris | [idris](http://www.idris-lang.org/) |
|
||||||
| JavaScript | [eslint](http://eslint.org/), [jscs](http://jscs.info/), [jshint](http://jshint.com/), [flow](https://flowtype.org/), [standard](http://standardjs.com/), [xo](https://github.com/sindresorhus/xo)
|
| 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) |
|
||||||
| JSON | [jsonlint](http://zaa.ch/jsonlint/) |
|
| 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), [prettier-standard](https://github.com/sheerun/prettier-standard), [standard](http://standardjs.com/), [xo](https://github.com/sindresorhus/xo)
|
||||||
| Kotlin | [kotlinc](https://kotlinlang.org) see `:help ale-integration-kotlin` for configuration instructions
|
| JSON | [fixjson](https://github.com/rhysd/fixjson), [jsonlint](http://zaa.ch/jsonlint/), [jq](https://stedolan.github.io/jq/), [prettier](https://github.com/prettier/prettier) |
|
||||||
| LaTeX | [chktex](http://www.nongnu.org/chktex/), [lacheck](https://www.ctan.org/pkg/lacheck), [proselint](http://proselint.com/) |
|
| Kotlin | [kotlinc](https://kotlinlang.org) !!, [ktlint](https://ktlint.github.io) !! see `:help ale-integration-kotlin` for configuration instructions |
|
||||||
| Lua | [luacheck](https://github.com/mpeterv/luacheck) |
|
| 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) |
|
||||||
| Markdown | [mdl](https://github.com/mivok/markdownlint), [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale) |
|
| 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) |
|
| MATLAB | [mlint](https://www.mathworks.com/help/matlab/ref/mlint.html) |
|
||||||
| Nim | [nim](https://nim-lang.org/docs/nimc.html) |
|
| Nim | [nim check](https://nim-lang.org/docs/nimc.html) !! |
|
||||||
| nix | [nix-instantiate](http://nixos.org/nix/manual/#sec-nix-instantiate) |
|
| nix | [nix-instantiate](http://nixos.org/nix/manual/#sec-nix-instantiate) |
|
||||||
| nroff | [proselint](http://proselint.com/)|
|
| nroff | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good)|
|
||||||
| OCaml | [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-integration-ocaml-merlin` for configuration instructions
|
| 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) |
|
| Perl | [perl -c](https://perl.org/), [perl-critic](https://metacpan.org/pod/Perl::Critic) |
|
||||||
| PHP | [hack](http://hacklang.org/), [php -l](https://secure.php.net/), [phpcs](https://github.com/squizlabs/PHP_CodeSniffer), [phpmd](https://phpmd.org) |
|
| 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/) |
|
||||||
| Pod | [proselint](http://proselint.com/)|
|
| 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) |
|
| Pug | [pug-lint](https://github.com/pugjs/pug-lint) |
|
||||||
| Puppet | [puppet](https://puppet.com), [puppet-lint](https://puppet-lint.com) |
|
| Puppet | [puppet](https://puppet.com), [puppet-lint](https://puppet-lint.com) |
|
||||||
| Python | [flake8](http://flake8.pycqa.org/en/latest/), [mypy](http://mypy-lang.org/), [pylint](https://www.pylint.org/) |
|
| Python | [autopep8](https://github.com/hhatto/autopep8), [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), [pylint](https://www.pylint.org/) !!, [yapf](https://github.com/google/yapf) |
|
||||||
| ReasonML | [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-integration-reason-merlin` for configuration instructions
|
| QML | [qmllint](https://github.com/qt/qtdeclarative/tree/5.11/tools/qmllint) |
|
||||||
| reStructuredText | [proselint](http://proselint.com/)|
|
| 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`) |
|
| RPM spec | [rpmlint](https://github.com/rpm-software-management/rpmlint) (disabled by default; see `:help ale-integration-spec`) |
|
||||||
| Ruby | [brakeman](http://brakemanscanner.org/), [reek](https://github.com/troessner/reek), [rubocop](https://github.com/bbatsov/rubocop), [ruby](https://www.ruby-lang.org) |
|
| 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 | [rustc](https://www.rust-lang.org/), cargo (see `:help ale-integration-rust` for configuration instructions) |
|
| 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) |
|
| SASS | [sass-lint](https://www.npmjs.com/package/sass-lint), [stylelint](https://github.com/stylelint/stylelint) |
|
||||||
| SCSS | [sass-lint](https://www.npmjs.com/package/sass-lint), [scss-lint](https://github.com/brigade/scss-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 | [scalac](http://scala-lang.org) |
|
| Scala | [scalac](http://scala-lang.org), [scalastyle](http://www.scalastyle.org) |
|
||||||
| Slim | [slim-lint](https://github.com/sds/slim-lint)
|
| Slim | [slim-lint](https://github.com/sds/slim-lint) |
|
||||||
| SML | [smlnj](http://www.smlnj.org/) |
|
| 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) |
|
| SQL | [sqlint](https://github.com/purcell/sqlint) |
|
||||||
| Swift | [swiftlint](https://swift.org/) |
|
| Swift | [swiftlint](https://github.com/realm/SwiftLint), [swiftformat](https://github.com/nicklockwood/SwiftFormat) |
|
||||||
| Texinfo | [proselint](http://proselint.com/)|
|
| Tcl | [nagelfar](http://nagelfar.sourceforge.net) !! |
|
||||||
| Text^ | [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale) |
|
| Terraform | [tflint](https://github.com/wata727/tflint) |
|
||||||
| TypeScript | [tslint](https://github.com/palantir/tslint), typecheck |
|
| 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) |
|
| Verilog | [iverilog](https://github.com/steveicarus/iverilog), [verilator](http://www.veripool.org/projects/verilator/wiki/Intro) |
|
||||||
| Vim | [vint](https://github.com/Kuniwak/vint) |
|
| Vim | [vint](https://github.com/Kuniwak/vint) |
|
||||||
| Vim help^ | [proselint](http://proselint.com/)|
|
| Vim help^ | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good) |
|
||||||
| XHTML | [proselint](http://proselint.com/)|
|
| Vue | [prettier](https://github.com/prettier/prettier) |
|
||||||
| YAML | [yamllint](https://yamllint.readthedocs.io/) |
|
| 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) |
|
||||||
* *^ No linters for text or Vim help filetypes are enabled by default.*
|
| YAML | [swaglint](https://github.com/byCedric/swaglint), [yamllint](https://yamllint.readthedocs.io/) |
|
||||||
|
|
||||||
<a name="usage"></a>
|
<a name="usage"></a>
|
||||||
|
|
||||||
## 2. Usage
|
## 2. Usage
|
||||||
|
|
||||||
|
<a name="usage-linting"></a>
|
||||||
|
|
||||||
|
### 2.i Linting
|
||||||
|
|
||||||
Once this plugin is installed, while editing your files in supported
|
Once this plugin is installed, while editing your files in supported
|
||||||
languages and tools which have been correctly installed,
|
languages and tools which have been correctly installed,
|
||||||
this plugin will send the contents of your text buffers to a variety of
|
this plugin will send the contents of your text buffers to a variety of
|
||||||
@@ -135,19 +190,115 @@ 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-linter-options` for options specified to particular linters.
|
||||||
|
|
||||||
|
<a name="usage-fixing"></a>
|
||||||
|
|
||||||
|
### 2.ii Fixing
|
||||||
|
|
||||||
|
ALE can fix files with the `ALEFix` command. Functions need to be configured
|
||||||
|
for different filetypes with the `g:ale_fixers` variable. For example, the
|
||||||
|
following code can be used to fix JavaScript code with ESLint:
|
||||||
|
|
||||||
|
```vim
|
||||||
|
" Put this in vimrc or a plugin file of your own.
|
||||||
|
" After this is configured, :ALEFix will try and fix your JS code with ESLint.
|
||||||
|
let g:ale_fixers = {
|
||||||
|
\ 'javascript': ['eslint'],
|
||||||
|
\}
|
||||||
|
|
||||||
|
" Set this setting in vimrc if you want to fix files automatically on save.
|
||||||
|
" This is off by default.
|
||||||
|
let g:ale_fix_on_save = 1
|
||||||
|
```
|
||||||
|
|
||||||
|
The `:ALEFixSuggest` command will suggest some supported tools for fixing code,
|
||||||
|
but fixers can be also implemented with functions, including lambda functions
|
||||||
|
too. See `:help ale-fix` for detailed information.
|
||||||
|
|
||||||
|
<a name="usage-completion"></a>
|
||||||
|
|
||||||
|
### 2.iii Completion
|
||||||
|
|
||||||
|
ALE offers some support for completion via hijacking of omnicompletion while you
|
||||||
|
type. All of ALE's completion information must come from Language Server
|
||||||
|
Protocol linters, or similar protocols. At the moment, completion is only
|
||||||
|
supported for TypeScript code with `tsserver`, when `tsserver` is enabled. You
|
||||||
|
can enable completion like so:
|
||||||
|
|
||||||
|
```vim
|
||||||
|
" Enable completion where available.
|
||||||
|
let g:ale_completion_enabled = 1
|
||||||
|
```
|
||||||
|
|
||||||
|
See `:help ale-completion` for more information.
|
||||||
|
|
||||||
|
<a name="usage-go-to-definition"></a>
|
||||||
|
|
||||||
|
### 2.iv Go To Definition
|
||||||
|
|
||||||
|
ALE supports jumping to the definition of words under your cursor with the
|
||||||
|
`:ALEGoToDefinition` command using any enabled LSP linters and `tsserver`.
|
||||||
|
|
||||||
|
See `:help ale-go-to-definition` for more information.
|
||||||
|
|
||||||
<a name="installation"></a>
|
<a name="installation"></a>
|
||||||
|
|
||||||
## 3. Installation
|
## 3. Installation
|
||||||
|
|
||||||
To install this plugin, you should use one of the following methods.
|
To install this plugin, you should use one of the following methods.
|
||||||
For Windows users, replace usage of the Unix `~/.vim` directory with
|
For Windows users, replace usage of the Unix `~/.vim` directory with
|
||||||
`%USERPROFILE%\_vim`, or another directory if you have configured
|
`%USERPROFILE%\vimfiles`, or another directory if you have configured
|
||||||
Vim differently. On Windows, your `~/.vimrc` file will be similarly
|
Vim differently. On Windows, your `~/.vimrc` file will be similarly
|
||||||
stored in `%USERPROFILE%\_vimrc`.
|
stored in `%USERPROFILE%\_vimrc`.
|
||||||
|
|
||||||
|
<a name="standard-installation"></a>
|
||||||
|
|
||||||
|
### 3.i. Installation with Vim package management
|
||||||
|
|
||||||
|
In Vim 8 and NeoVim, you can install plugins easily without needing to use
|
||||||
|
any other tools. Simply clone the plugin into your `pack` directory.
|
||||||
|
|
||||||
|
#### Vim 8 on Unix
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir -p ~/.vim/pack/git-plugins/start
|
||||||
|
git clone https://github.com/w0rp/ale.git ~/.vim/pack/git-plugins/start/ale
|
||||||
|
```
|
||||||
|
|
||||||
|
#### NeoVim on Unix
|
||||||
|
|
||||||
|
```bash
|
||||||
|
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
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Vim 8 on Windows
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Run these commands in the "Git for Windows" Bash terminal
|
||||||
|
mkdir -p ~/vimfiles/pack/git-plugins/start
|
||||||
|
git clone https://github.com/w0rp/ale.git ~/vimfiles/pack/git-plugins/start/ale
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Generating Vim help files
|
||||||
|
|
||||||
|
You can add the following line to your vimrc files to generate documentation
|
||||||
|
tags automatically, if you don't have something similar already, so you can use
|
||||||
|
the `:help` command to consult ALE's online documentation:
|
||||||
|
|
||||||
|
```vim
|
||||||
|
" Put these lines at the very end of your vimrc file.
|
||||||
|
|
||||||
|
" Load all plugins now.
|
||||||
|
" Plugins need to be added to runtimepath before helptags can be generated.
|
||||||
|
packloadall
|
||||||
|
" Load all of the helptags now, after plugins have been loaded.
|
||||||
|
" All messages and errors will be ignored.
|
||||||
|
silent! helptags ALL
|
||||||
|
```
|
||||||
|
|
||||||
<a name="installation-with-pathogen"></a>
|
<a name="installation-with-pathogen"></a>
|
||||||
|
|
||||||
### 3.i. Installation with Pathogen
|
### 3.ii. Installation with Pathogen
|
||||||
|
|
||||||
To install this module with [Pathogen](https://github.com/tpope/vim-pathogen),
|
To install this module with [Pathogen](https://github.com/tpope/vim-pathogen),
|
||||||
you should clone this repository to your bundle directory, and ensure
|
you should clone this repository to your bundle directory, and ensure
|
||||||
@@ -161,7 +312,7 @@ git clone https://github.com/w0rp/ale.git
|
|||||||
|
|
||||||
<a name="installation-with-vundle"></a>
|
<a name="installation-with-vundle"></a>
|
||||||
|
|
||||||
### 3.ii. Installation with Vundle
|
### 3.iii. Installation with Vundle
|
||||||
|
|
||||||
You can install this plugin using [Vundle](https://github.com/VundleVim/Vundle.vim)
|
You can install this plugin using [Vundle](https://github.com/VundleVim/Vundle.vim)
|
||||||
by using the path on GitHub for this repository.
|
by using the path on GitHub for this repository.
|
||||||
@@ -172,41 +323,6 @@ Plugin 'w0rp/ale'
|
|||||||
|
|
||||||
See the Vundle documentation for more information.
|
See the Vundle documentation for more information.
|
||||||
|
|
||||||
<a name="manual-installation"></a>
|
|
||||||
|
|
||||||
### 3.iii. Manual Installation
|
|
||||||
|
|
||||||
For installation without a package manager, you can clone this git repository
|
|
||||||
into a bundle directory as with pathogen, and add the repository to your
|
|
||||||
runtime path yourself. First clone the repository.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd ~/.vim/bundle
|
|
||||||
git clone https://github.com/w0rp/ale.git
|
|
||||||
```
|
|
||||||
|
|
||||||
Then, modify your `~/.vimrc` file to add this plugin to your runtime path.
|
|
||||||
|
|
||||||
```vim
|
|
||||||
set nocompatible
|
|
||||||
filetype off
|
|
||||||
|
|
||||||
let &runtimepath.=',~/.vim/bundle/ale'
|
|
||||||
|
|
||||||
filetype plugin on
|
|
||||||
```
|
|
||||||
|
|
||||||
You can add the following line to generate documentation tags automatically,
|
|
||||||
if you don't have something similar already, so you can use the `:help` command
|
|
||||||
to consult ALE's online documentation:
|
|
||||||
|
|
||||||
```vim
|
|
||||||
silent! helptags ALL
|
|
||||||
```
|
|
||||||
|
|
||||||
Because the author of this plugin is a weird nerd, this is his preferred
|
|
||||||
installation method.
|
|
||||||
|
|
||||||
<a name="contributing"></a>
|
<a name="contributing"></a>
|
||||||
|
|
||||||
## 4. Contributing
|
## 4. Contributing
|
||||||
@@ -283,36 +399,84 @@ highlight clear ALEErrorSign
|
|||||||
highlight clear ALEWarningSign
|
highlight clear ALEWarningSign
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<a name="faq-change-highlights"></a>
|
||||||
|
|
||||||
|
### 5.iv. How can I change or disable the highlights ALE uses?
|
||||||
|
|
||||||
|
ALE's highlights problems with highlight groups which link to `SpellBad`,
|
||||||
|
`SpellCap`, `error`, and `todo` groups by default. The characters that are
|
||||||
|
highlighted depend on the linters being used, and the information provided to
|
||||||
|
ALE.
|
||||||
|
|
||||||
|
Highlighting can be disabled completely by setting `g:ale_set_highlights` to
|
||||||
|
`0`.
|
||||||
|
|
||||||
|
```vim
|
||||||
|
" Set this in your vimrc file to disabling highlighting
|
||||||
|
let g:ale_set_highlights = 0
|
||||||
|
```
|
||||||
|
|
||||||
|
You can control all of the highlights ALE uses, say if you are using a different
|
||||||
|
color scheme which produces ugly highlights. For example:
|
||||||
|
|
||||||
|
```vim
|
||||||
|
highlight ALEWarning ctermbg=DarkMagenta
|
||||||
|
```
|
||||||
|
|
||||||
|
See `:help ale-highlights` for more information.
|
||||||
|
|
||||||
<a name="faq-statusline"></a>
|
<a name="faq-statusline"></a>
|
||||||
|
|
||||||
### 5.iv. How can I show errors or warnings in my statusline?
|
### 5.v. How can I show errors or warnings in my statusline?
|
||||||
|
|
||||||
You can use `ALEGetStatusLine()` to integrate ALE into vim statusline.
|
[vim-airline](https://github.com/vim-airline/vim-airline) integrates with ALE
|
||||||
To enable it, you should have in your `statusline` settings
|
for displaying error information in the status bar. If you want to see the
|
||||||
|
status for ALE in a nice format, it is recommended to use vim-airline with ALE.
|
||||||
|
The airline extension can be enabled by adding the following to your vimrc:
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
%{ALEGetStatusLine()}
|
" Set this. Airline will handle the rest.
|
||||||
|
let g:airline#extensions#ale#enabled = 1
|
||||||
```
|
```
|
||||||
|
|
||||||
When errors are detected a string showing the number of errors will be shown.
|
If you don't want to use vim-airline, you can implement your own statusline
|
||||||
You can customize the output format using the global list `g:ale_statusline_format` where:
|
function without adding any other plugins. ALE provides a function for counting
|
||||||
|
the number of problems for this purpose, named `ale#statusline#Count`.
|
||||||
|
|
||||||
- The 1st element is for errors
|
Say you want to display all errors as one figure, and all non-errors as another
|
||||||
- The 2nd element is for warnings
|
figure. You can do the following:
|
||||||
- The 3rd element is for when no errors are detected
|
|
||||||
|
|
||||||
e.g
|
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
let g:ale_statusline_format = ['⨉ %d', '⚠ %d', '⬥ ok']
|
function! LinterStatus() abort
|
||||||
|
let l:counts = ale#statusline#Count(bufnr(''))
|
||||||
|
|
||||||
|
let l:all_errors = l:counts.error + l:counts.style_error
|
||||||
|
let l:all_non_errors = l:counts.total - l:all_errors
|
||||||
|
|
||||||
|
return l:counts.total == 0 ? 'OK' : printf(
|
||||||
|
\ '%dW %dE',
|
||||||
|
\ all_non_errors,
|
||||||
|
\ all_errors
|
||||||
|
\)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
set statusline=%{LinterStatus()}
|
||||||
```
|
```
|
||||||
|
|
||||||

|
See `:help ale#statusline#Count()` for more information.
|
||||||

|
|
||||||
|
<a name="faq-lightline"></a>
|
||||||
|
|
||||||
|
### 5.vi. How can I show errors or warnings in my lightline?
|
||||||
|
|
||||||
|
[lightline](https://github.com/itchyny/lightline.vim) does not have built-in
|
||||||
|
support for ALE, nevertheless there is a plugin that adds this functionality: [maximbaz/lightline-ale](https://github.com/maximbaz/lightline-ale).
|
||||||
|
|
||||||
|
For more information, check out the sources of that plugin, `:help ale#statusline#Count()` and [lightline documentation](https://github.com/itchyny/lightline.vim#advanced-configuration).
|
||||||
|
|
||||||
<a name="faq-echo-format"></a>
|
<a name="faq-echo-format"></a>
|
||||||
|
|
||||||
### 5.v. How can I change the format for echo messages?
|
### 5.vii. How can I change the format for echo messages?
|
||||||
|
|
||||||
There are 3 global options that allow customizing the echoed message.
|
There are 3 global options that allow customizing the echoed message.
|
||||||
|
|
||||||
@@ -337,22 +501,26 @@ Will give you:
|
|||||||
|
|
||||||
<a name="faq-autocmd"></a>
|
<a name="faq-autocmd"></a>
|
||||||
|
|
||||||
### 5.vi. How can I execute some code when ALE stops linting?
|
### 5.viii. How can I execute some code when ALE starts or stops linting?
|
||||||
|
|
||||||
ALE runs its own [autocmd](http://vimdoc.sourceforge.net/htmldoc/autocmd.html)
|
ALE runs its own [autocmd](http://vimdoc.sourceforge.net/htmldoc/autocmd.html)
|
||||||
event whenever has a linter has been successfully executed and processed. This
|
events when a lint or fix cycle are started and stopped. These events can be
|
||||||
autocmd event can be used to call arbitrary functions after ALE stops linting.
|
used to call arbitrary functions before and after ALE stops linting.
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
augroup YourGroup
|
augroup YourGroup
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd User ALELint call YourFunction()
|
autocmd User ALELintPre call YourFunction()
|
||||||
|
autocmd User ALELintPost call YourFunction()
|
||||||
|
|
||||||
|
autocmd User ALEFixPre call YourFunction()
|
||||||
|
autocmd User ALEFixPost call YourFunction()
|
||||||
augroup END
|
augroup END
|
||||||
```
|
```
|
||||||
|
|
||||||
<a name="faq-navigation"></a>
|
<a name="faq-navigation"></a>
|
||||||
|
|
||||||
### 5.vii. How can I navigate between errors quickly?
|
### 5.ix. How can I navigate between errors quickly?
|
||||||
|
|
||||||
ALE offers some commands with `<Plug>` keybinds for moving between warnings and
|
ALE offers some commands with `<Plug>` keybinds for moving between warnings and
|
||||||
errors quickly. You can map the keys Ctrl+j and Ctrl+k to moving between errors
|
errors quickly. You can map the keys Ctrl+j and Ctrl+k to moving between errors
|
||||||
@@ -368,7 +536,7 @@ For more information, consult the online documentation with
|
|||||||
|
|
||||||
<a name="faq-lint-on-save"></a>
|
<a name="faq-lint-on-save"></a>
|
||||||
|
|
||||||
### 5.viii. How can I run linters only when I save files?
|
### 5.x. How can I run linters only when I save files?
|
||||||
|
|
||||||
ALE offers an option `g:ale_lint_on_save` for enabling running the linters
|
ALE offers an option `g:ale_lint_on_save` for enabling running the linters
|
||||||
when files are saved. This option is enabled by default. If you only
|
when files are saved. This option is enabled by default. If you only
|
||||||
@@ -388,7 +556,7 @@ files, you can set `g:ale_lint_on_save` to `0`.
|
|||||||
|
|
||||||
<a name="faq-quickfix"></a>
|
<a name="faq-quickfix"></a>
|
||||||
|
|
||||||
### 5.ix. How can I use the quickfix list instead of the loclist?
|
### 5.xi. How can I use the quickfix list instead of the loclist?
|
||||||
|
|
||||||
The quickfix list can be enabled by turning the `g:ale_set_quickfix`
|
The quickfix list can be enabled by turning the `g:ale_set_quickfix`
|
||||||
option on. If you wish to also disable the loclist, you can disable
|
option on. If you wish to also disable the loclist, you can disable
|
||||||
@@ -413,15 +581,18 @@ let g:ale_open_list = 1
|
|||||||
let g:ale_keep_list_window_open = 1
|
let g:ale_keep_list_window_open = 1
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can also set `let g:ale_list_vertical = 1` to open the windows vertically
|
||||||
|
instead of the default horizontally.
|
||||||
|
|
||||||
<a name="faq-jsx-stylelint-eslint"></a>
|
<a name="faq-jsx-stylelint-eslint"></a>
|
||||||
|
|
||||||
### 5.x. How can I check JSX files with both stylelint and eslint?
|
### 5.xii. How can I check JSX files with both stylelint and eslint?
|
||||||
|
|
||||||
If you configure ALE options correctly in your vimrc file, and install
|
If you configure ALE options correctly in your vimrc file, and install
|
||||||
the right tools, you can check JSX files with stylelint and eslint.
|
the right tools, you can check JSX files with stylelint and eslint.
|
||||||
|
|
||||||
First, install eslint and install stylelint with
|
First, install eslint and install stylelint with
|
||||||
[https://github.com/styled-components/stylelint-processor-styled-components](stylelint-processor-styled-components).
|
[stylelint-processor-styled-components](https://github.com/styled-components/stylelint-processor-styled-components).
|
||||||
|
|
||||||
Supposing you have installed both tools correctly, configure your .jsx files so
|
Supposing you have installed both tools correctly, configure your .jsx files so
|
||||||
`jsx` is included in the filetype. You can use an `autocmd` for this.
|
`jsx` is included in the filetype. You can use an `autocmd` for this.
|
||||||
@@ -448,7 +619,7 @@ no linter will be run twice for the same file.
|
|||||||
|
|
||||||
<a name="faq-my-battery-is-sad"></a>
|
<a name="faq-my-battery-is-sad"></a>
|
||||||
|
|
||||||
### 5.xi. Will this plugin eat all of my laptop battery power?
|
### 5.xiii. 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
|
||||||
@@ -469,4 +640,76 @@ 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
|
||||||
`:call ale#Lint()`.
|
`:ALELint`.
|
||||||
|
|
||||||
|
<a name="faq-c-configuration"></a>
|
||||||
|
|
||||||
|
### 5.xiv. How can I configure my C or C++ project?
|
||||||
|
|
||||||
|
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
|
||||||
|
formats for project configuration files. ALE can run compilers easily, but
|
||||||
|
ALE cannot easily detect which compiler flags to use.
|
||||||
|
|
||||||
|
Some tools and build configurations can generate
|
||||||
|
[compile_commands.json](https://clang.llvm.org/docs/JSONCompilationDatabase.html)
|
||||||
|
files. The `cppcheck`, `clangcheck` and `clangtidy` linters can read these
|
||||||
|
files for automatically determining the appropriate compiler flags to use.
|
||||||
|
|
||||||
|
For linting with compilers like `gcc` and `clang`, and with other tools, you
|
||||||
|
will need to tell ALE which compiler flags to use yourself. You can use
|
||||||
|
different options for different projects with the `g:ale_pattern_options`
|
||||||
|
setting. Consult the documentation for that setting for more information.
|
||||||
|
`b:ale_linters` can be used to select which tools you want to run, say if you
|
||||||
|
want to use only `gcc` for one project, and only `clang` for another.
|
||||||
|
|
||||||
|
You may also configure buffer-local settings for linters with project-specific
|
||||||
|
vimrc files. [local_vimrc](https://github.com/LucHermitte/local_vimrc) can be
|
||||||
|
used for executing local vimrc files which can be shared in your project.
|
||||||
|
|
||||||
|
<a name="faq-buffer-configuration"></a>
|
||||||
|
|
||||||
|
### 5.xv. How can I configure ALE differently for different buffers?
|
||||||
|
|
||||||
|
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
|
||||||
|
configured globally with a `g:` variable prefix, or for a specific buffer
|
||||||
|
with a `b:` variable prefix. For example, you can configure a Python ftplugin
|
||||||
|
file like so.
|
||||||
|
|
||||||
|
```vim
|
||||||
|
" In ~/.vim/ftplugin/python.vim
|
||||||
|
|
||||||
|
" Check Python files with flake8 and pylint.
|
||||||
|
let b:ale_linters = ['flake8', 'pylint']
|
||||||
|
" Fix Python files with autopep8 and yapf.
|
||||||
|
let b:ale_fixers = ['autopep8', 'yapf']
|
||||||
|
" Disable warnings about trailing whitespace for Python files.
|
||||||
|
let b:ale_warn_about_trailing_whitespace = 0
|
||||||
|
```
|
||||||
|
|
||||||
|
For configuring files based on regular expression patterns matched against the
|
||||||
|
absolute path to a file, you can use `g:ale_pattern_options`.
|
||||||
|
|
||||||
|
```vim
|
||||||
|
" Do not lint or fix minified files.
|
||||||
|
let g:ale_pattern_options = {
|
||||||
|
\ '\.min\.js$': {'ale_linters': [], 'ale_fixers': []},
|
||||||
|
\ '\.min\.css$': {'ale_linters': [], 'ale_fixers': []},
|
||||||
|
\}
|
||||||
|
" If you configure g:ale_pattern_options outside of vimrc, you need this.
|
||||||
|
let g:ale_pattern_options_enabled = 1
|
||||||
|
```
|
||||||
|
|
||||||
|
Buffer-local variables for settings always override the global settings.
|
||||||
|
|
||||||
|
<a name="faq-list-window-height"></a>
|
||||||
|
|
||||||
|
### 5.xvi. 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.
|
||||||
|
|
||||||
|
```vim
|
||||||
|
" Show 5 lines of errors (default: 10)
|
||||||
|
let g:ale_list_window_size = 5
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
" Author: Bjorn Neergaard <bjorn@neersighted.com>
|
|
||||||
" Description: ansible-lint for ansible-yaml files
|
|
||||||
|
|
||||||
call ale#linter#Define('ansible', {
|
|
||||||
\ 'name': 'ansible',
|
|
||||||
\ 'executable': 'ansible',
|
|
||||||
\ 'command': 'ansible-lint -p %t',
|
|
||||||
\ 'callback': 'ale#handlers#python#HandlePEP8Format',
|
|
||||||
\})
|
|
||||||
49
ale_linters/ansible/ansible_lint.vim
Normal file
49
ale_linters/ansible/ansible_lint.vim
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
" Author: Bjorn Neergaard <bjorn@neersighted.com>
|
||||||
|
" Description: ansible-lint for ansible-yaml files
|
||||||
|
|
||||||
|
function! ale_linters#ansible#ansible_lint#Handle(buffer, lines) abort
|
||||||
|
for l:line in a:lines[:10]
|
||||||
|
if match(l:line, '^Traceback') >= 0
|
||||||
|
return [{
|
||||||
|
\ 'lnum': 1,
|
||||||
|
\ 'text': 'An exception was thrown. See :ALEDetail',
|
||||||
|
\ 'detail': join(a:lines, "\n"),
|
||||||
|
\}]
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
" Matches patterns line the following:
|
||||||
|
"
|
||||||
|
" test.yml:35: [EANSIBLE0002] Trailing whitespace
|
||||||
|
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?: \[?([[:alnum:]]+)\]? (.*)$'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
let l:code = l:match[4]
|
||||||
|
|
||||||
|
if l:code is# 'EANSIBLE0002'
|
||||||
|
\&& !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
|
||||||
|
" Skip warnings for trailing whitespace if the option is off.
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
|
||||||
|
if ale#path#IsBufferPath(a:buffer, l:match[1])
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': l:match[2] + 0,
|
||||||
|
\ 'col': l:match[3] + 0,
|
||||||
|
\ 'text': l:match[5],
|
||||||
|
\ 'code': l:code,
|
||||||
|
\ 'type': l:code[:0] is# 'E' ? 'E' : 'W',
|
||||||
|
\})
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('ansible', {
|
||||||
|
\ 'name': 'ansible',
|
||||||
|
\ 'executable': 'ansible',
|
||||||
|
\ 'command': 'ansible-lint -p %t',
|
||||||
|
\ 'callback': 'ale_linters#ansible#ansible_lint#Handle',
|
||||||
|
\})
|
||||||
36
ale_linters/apiblueprint/drafter.vim
Normal file
36
ale_linters/apiblueprint/drafter.vim
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
" Author: nametake https://nametake.github.io
|
||||||
|
" Description: apiblueprint parser
|
||||||
|
|
||||||
|
function! ale_linters#apiblueprint#drafter#HandleErrors(buffer, lines) abort
|
||||||
|
" Matches patterns line the following:
|
||||||
|
"
|
||||||
|
" warning: (3) unable to parse response signature, expected 'response [<HTTP status code>] [(<media type>)]'; line 4, column 3k - line 4, column 22
|
||||||
|
" warning: (10) message-body asset is expected to be a pre-formatted code block, separate it by a newline and indent every of its line by 12 spaces or 3 tabs; line 30, column 5 - line 30, column 9; line 31, column 9 - line 31, column 14; line 32, column 9 - line 32, column 14
|
||||||
|
let l:pattern = '\(^.*\): (\d\+) \(.\{-\}\); line \(\d\+\), column \(\d\+\) - line \d\+, column \d\+\(.*; line \d\+, column \d\+ - line \(\d\+\), column \(\d\+\)\)\{-\}$'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines[2:], l:pattern)
|
||||||
|
let l:item = {
|
||||||
|
\ 'type': l:match[1] is# 'warning' ? 'W' : 'E',
|
||||||
|
\ 'text': l:match[2],
|
||||||
|
\ 'lnum': l:match[3] + 0,
|
||||||
|
\ 'col': l:match[4] + 0,
|
||||||
|
\}
|
||||||
|
if l:match[5] isnot# ''
|
||||||
|
let l:item.end_lnum = l:match[6] + 0
|
||||||
|
let l:item.end_col = l:match[7] + 0
|
||||||
|
endif
|
||||||
|
call add(l:output, l:item)
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
call ale#linter#Define('apiblueprint', {
|
||||||
|
\ 'name': 'drafter',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'executable': 'drafter',
|
||||||
|
\ 'command': 'drafter --use-line-num --validate %t',
|
||||||
|
\ 'callback': 'ale_linters#apiblueprint#drafter#HandleErrors',
|
||||||
|
\})
|
||||||
11
ale_linters/asciidoc/alex.vim
Normal file
11
ale_linters/asciidoc/alex.vim
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
" Author: Johannes Wienke <languitar@semipol.de>
|
||||||
|
" Description: alex for asciidoc files
|
||||||
|
|
||||||
|
call ale#linter#Define('help', {
|
||||||
|
\ 'name': 'alex',
|
||||||
|
\ 'executable': 'alex',
|
||||||
|
\ 'command': 'alex %s -t',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'callback': 'ale#handlers#alex#Handle',
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\})
|
||||||
9
ale_linters/asciidoc/redpen.vim
Normal file
9
ale_linters/asciidoc/redpen.vim
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
" Author: rhysd https://rhysd.github.io
|
||||||
|
" Description: Redpen, a proofreading tool (http://redpen.cc)
|
||||||
|
|
||||||
|
call ale#linter#Define('asciidoc', {
|
||||||
|
\ 'name': 'redpen',
|
||||||
|
\ 'executable': 'redpen',
|
||||||
|
\ 'command': 'redpen -f asciidoc -r json %t',
|
||||||
|
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
|
||||||
|
\})
|
||||||
9
ale_linters/asciidoc/write-good.vim
Normal file
9
ale_linters/asciidoc/write-good.vim
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
" 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',
|
||||||
|
\})
|
||||||
@@ -1,11 +1,17 @@
|
|||||||
" Author: Lucas Kolstad <lkolstad@uw.edu>
|
" Author: Lucas Kolstad <lkolstad@uw.edu>
|
||||||
" Description: gcc linter for asm files
|
" Description: gcc linter for asm files
|
||||||
|
|
||||||
let g:ale_asm_gcc_options = get(g:, 'ale_asm_gcc_options', '-Wall')
|
call ale#Set('asm_gcc_executable', 'gcc')
|
||||||
|
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 'gcc -x assembler -fsyntax-only '
|
return ale#Escape(ale_linters#asm#gcc#GetExecutable(a:buffer))
|
||||||
\ . '-iquote ' . fnameescape(fnamemodify(bufname(a:buffer), ':p:h'))
|
\ . ' -x assembler -fsyntax-only '
|
||||||
|
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||||
\ . ' ' . ale#Var(a:buffer, 'asm_gcc_options') . ' -'
|
\ . ' ' . ale#Var(a:buffer, 'asm_gcc_options') . ' -'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -27,7 +33,7 @@ endfunction
|
|||||||
call ale#linter#Define('asm', {
|
call ale#linter#Define('asm', {
|
||||||
\ 'name': 'gcc',
|
\ 'name': 'gcc',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable': 'gcc',
|
\ 'executable_callback': 'ale_linters#asm#gcc#GetExecutable',
|
||||||
\ 'command_callback': 'ale_linters#asm#gcc#GetCommand',
|
\ 'command_callback': 'ale_linters#asm#gcc#GetCommand',
|
||||||
\ 'callback': 'ale_linters#asm#gcc#Handle',
|
\ 'callback': 'ale_linters#asm#gcc#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
30
ale_linters/awk/gawk.vim
Normal file
30
ale_linters/awk/gawk.vim
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
" Author: kmarc <korondi.mark@gmail.com>
|
||||||
|
" Description: This file adds support for using GNU awk with sripts.
|
||||||
|
|
||||||
|
let g:ale_awk_gawk_executable =
|
||||||
|
\ get(g:, 'ale_awk_gawk_executable', 'gawk')
|
||||||
|
|
||||||
|
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
|
||||||
|
" note the --source 'BEGIN ...' is to prevent
|
||||||
|
" gawk from attempting to execute the body of the script
|
||||||
|
" it is linting.
|
||||||
|
return ale_linters#awk#gawk#GetExecutable(a:buffer)
|
||||||
|
\ . " --source 'BEGIN { exit } END { exit 1 }'"
|
||||||
|
\ . ' ' . ale#Var(a:buffer, 'awk_gawk_options')
|
||||||
|
\ . ' ' . '-f %t --lint /dev/null'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('awk', {
|
||||||
|
\ 'name': 'gawk',
|
||||||
|
\ 'executable_callback': 'ale_linters#awk#gawk#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale_linters#awk#gawk#GetCommand',
|
||||||
|
\ 'callback': 'ale#handlers#gawk#HandleGawkFormat',
|
||||||
|
\ 'output_stream': 'both'
|
||||||
|
\})
|
||||||
@@ -1,26 +1,29 @@
|
|||||||
" Author: Masahiro H https://github.com/mshr-h
|
" Author: Masahiro H https://github.com/mshr-h
|
||||||
" Description: clang linter for c files
|
" Description: clang linter for c files
|
||||||
|
|
||||||
" Set this option to change the Clang options for warnings for C.
|
call ale#Set('c_clang_executable', 'clang')
|
||||||
if !exists('g:ale_c_clang_options')
|
call ale#Set('c_clang_options', '-std=c11 -Wall')
|
||||||
" let g:ale_c_clang_options = '-Wall'
|
|
||||||
" let g:ale_c_clang_options = '-std=c99 -Wall'
|
function! ale_linters#c#clang#GetExecutable(buffer) abort
|
||||||
" c11 compatible
|
return ale#Var(a:buffer, 'c_clang_executable')
|
||||||
let g:ale_c_clang_options = '-std=c11 -Wall'
|
endfunction
|
||||||
endif
|
|
||||||
|
|
||||||
function! ale_linters#c#clang#GetCommand(buffer) abort
|
function! ale_linters#c#clang#GetCommand(buffer) abort
|
||||||
|
let l:paths = ale#c#FindLocalHeaderPaths(a:buffer)
|
||||||
|
|
||||||
" -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 'clang -S -x c -fsyntax-only '
|
return ale#Escape(ale_linters#c#clang#GetExecutable(a:buffer))
|
||||||
\ . '-iquote ' . fnameescape(fnamemodify(bufname(a:buffer), ':p:h'))
|
\ . ' -S -x c -fsyntax-only '
|
||||||
\ . ' ' . ale#Var(a:buffer, 'c_clang_options') . ' -'
|
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) . ' '
|
||||||
|
\ . ale#c#IncludeOptions(l:paths)
|
||||||
|
\ . 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': 'clang',
|
\ 'executable_callback': 'ale_linters#c#clang#GetExecutable',
|
||||||
\ 'command_callback': 'ale_linters#c#clang#GetCommand',
|
\ 'command_callback': 'ale_linters#c#clang#GetCommand',
|
||||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||||
\})
|
\})
|
||||||
|
|||||||
64
ale_linters/c/clangtidy.vim
Normal file
64
ale_linters/c/clangtidy.vim
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
" Author: vdeurzen <tim@kompiler.org>, w0rp <devw0rp@gmail.com>,
|
||||||
|
" gagbo <gagbobada@gmail.com>, Andrej Radovic <r.andrej@gmail.com>
|
||||||
|
" Description: clang-tidy linter for c files
|
||||||
|
|
||||||
|
call ale#Set('c_clangtidy_executable', 'clang-tidy')
|
||||||
|
" Set this option to check the checks clang-tidy will apply.
|
||||||
|
" The number of checks that can be applied to C files is limited in contrast to
|
||||||
|
" C++
|
||||||
|
"
|
||||||
|
" Consult the check list in clang-tidy's documentation:
|
||||||
|
" http://clang.llvm.org/extra/clang-tidy/checks/list.html
|
||||||
|
|
||||||
|
call ale#Set('c_clangtidy_checks', ['*'])
|
||||||
|
" Set this option to manually set some options for clang-tidy.
|
||||||
|
" This will disable compile_commands.json detection.
|
||||||
|
call ale#Set('c_clangtidy_options', '')
|
||||||
|
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
|
||||||
|
let l:checks = join(ale#Var(a:buffer, 'c_clangtidy_checks'), ',')
|
||||||
|
let l:build_dir = s:GetBuildDirectory(a:buffer)
|
||||||
|
|
||||||
|
" Get the extra options if we couldn't find a build directory.
|
||||||
|
let l:options = empty(l:build_dir)
|
||||||
|
\ ? ale#Var(a:buffer, 'c_clangtidy_options')
|
||||||
|
\ : ''
|
||||||
|
|
||||||
|
return ale#Escape(ale_linters#c#clangtidy#GetExecutable(a:buffer))
|
||||||
|
\ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
|
||||||
|
\ . ' %s'
|
||||||
|
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
||||||
|
\ . (!empty(l:options) ? ' -- ' . l:options : '')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('c', {
|
||||||
|
\ 'name': 'clangtidy',
|
||||||
|
\ 'output_stream': 'stdout',
|
||||||
|
\ 'executable_callback': 'ale_linters#c#clangtidy#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale_linters#c#clangtidy#GetCommand',
|
||||||
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\})
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
" Author: Bart Libert <bart.libert@gmail.com>
|
" Author: Bart Libert <bart.libert@gmail.com>
|
||||||
" Description: cppcheck linter for c files
|
" Description: cppcheck linter for c files
|
||||||
|
|
||||||
" Set this option to change the cppcheck options
|
call ale#Set('c_cppcheck_executable', 'cppcheck')
|
||||||
let g:ale_c_cppcheck_options = get(g:, 'ale_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.
|
" Search upwards from the file for compile_commands.json.
|
||||||
@@ -19,7 +23,8 @@ function! ale_linters#c#cppcheck#GetCommand(buffer) abort
|
|||||||
\ : ''
|
\ : ''
|
||||||
|
|
||||||
return l:cd_command
|
return l:cd_command
|
||||||
\ . 'cppcheck -q --language=c '
|
\ . ale#Escape(ale_linters#c#cppcheck#GetExecutable(a:buffer))
|
||||||
|
\ . ' -q --language=c '
|
||||||
\ . l:compile_commands_option
|
\ . l:compile_commands_option
|
||||||
\ . ale#Var(a:buffer, 'c_cppcheck_options')
|
\ . ale#Var(a:buffer, 'c_cppcheck_options')
|
||||||
\ . ' %t'
|
\ . ' %t'
|
||||||
@@ -28,7 +33,7 @@ endfunction
|
|||||||
call ale#linter#Define('c', {
|
call ale#linter#Define('c', {
|
||||||
\ 'name': 'cppcheck',
|
\ 'name': 'cppcheck',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\ 'executable': 'cppcheck',
|
\ 'executable_callback': 'ale_linters#c#cppcheck#GetExecutable',
|
||||||
\ 'command_callback': 'ale_linters#c#cppcheck#GetCommand',
|
\ 'command_callback': 'ale_linters#c#cppcheck#GetCommand',
|
||||||
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
|
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
|
||||||
\})
|
\})
|
||||||
|
|||||||
31
ale_linters/c/flawfinder.vim
Normal file
31
ale_linters/c/flawfinder.vim
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
" Author: Christian Gibbons <cgibbons@gmu.edu>
|
||||||
|
" Description: flawfinder linter for c files
|
||||||
|
|
||||||
|
call ale#Set('c_flawfinder_executable', 'flawfinder')
|
||||||
|
call ale#Set('c_flawfinder_options', '')
|
||||||
|
call ale#Set('c_flawfinder_minlevel', 1)
|
||||||
|
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
|
||||||
|
|
||||||
|
" Set the minimum vulnerability level for flawfinder to bother with
|
||||||
|
let l:minlevel = ' --minlevel=' . ale#Var(a:buffer, 'c_flawfinder_minlevel')
|
||||||
|
|
||||||
|
return ale#Escape(ale_linters#c#flawfinder#GetExecutable(a:buffer))
|
||||||
|
\ . ' -CDQS'
|
||||||
|
\ . ale#Var(a:buffer, 'c_flawfinder_options')
|
||||||
|
\ . l:minlevel
|
||||||
|
\ . ' %t'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('c', {
|
||||||
|
\ 'name': 'flawfinder',
|
||||||
|
\ 'output_stream': 'stdout',
|
||||||
|
\ 'executable_callback': 'ale_linters#c#flawfinder#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale_linters#c#flawfinder#GetCommand',
|
||||||
|
\ 'callback': 'ale#handlers#flawfinder#HandleFlawfinderFormat',
|
||||||
|
\})
|
||||||
@@ -1,26 +1,29 @@
|
|||||||
" Author: w0rp <devw0rp@gmail.com>
|
" Author: w0rp <devw0rp@gmail.com>
|
||||||
" Description: gcc linter for c files
|
" Description: gcc linter for c files
|
||||||
|
|
||||||
" Set this option to change the GCC options for warnings for C.
|
call ale#Set('c_gcc_executable', 'gcc')
|
||||||
if !exists('g:ale_c_gcc_options')
|
call ale#Set('c_gcc_options', '-std=c11 -Wall')
|
||||||
" let g:ale_c_gcc_options = '-Wall'
|
|
||||||
" let g:ale_c_gcc_options = '-std=c99 -Wall'
|
function! ale_linters#c#gcc#GetExecutable(buffer) abort
|
||||||
" c11 compatible
|
return ale#Var(a:buffer, 'c_gcc_executable')
|
||||||
let g:ale_c_gcc_options = '-std=c11 -Wall'
|
endfunction
|
||||||
endif
|
|
||||||
|
|
||||||
function! ale_linters#c#gcc#GetCommand(buffer) abort
|
function! ale_linters#c#gcc#GetCommand(buffer) abort
|
||||||
|
let l:paths = ale#c#FindLocalHeaderPaths(a:buffer)
|
||||||
|
|
||||||
" -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 'gcc -S -x c -fsyntax-only '
|
return ale#Escape(ale_linters#c#gcc#GetExecutable(a:buffer))
|
||||||
\ . '-iquote ' . fnameescape(fnamemodify(bufname(a:buffer), ':p:h'))
|
\ . ' -S -x c -fsyntax-only '
|
||||||
\ . ' ' . ale#Var(a:buffer, 'c_gcc_options') . ' -'
|
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) . ' '
|
||||||
|
\ . ale#c#IncludeOptions(l:paths)
|
||||||
|
\ . 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': 'gcc',
|
\ 'executable_callback': 'ale_linters#c#gcc#GetExecutable',
|
||||||
\ 'command_callback': 'ale_linters#c#gcc#GetCommand',
|
\ 'command_callback': 'ale_linters#c#gcc#GetCommand',
|
||||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -1,24 +1,37 @@
|
|||||||
" Author: Edward Larkey <edwlarkey@mac.com>
|
" Author: Edward Larkey <edwlarkey@mac.com>
|
||||||
" Author: Jose Junior <jose.junior@gmail.com>
|
" Author: Jose Junior <jose.junior@gmail.com>
|
||||||
|
" Author: w0rp <devw0rp@gmail.com>
|
||||||
" Description: This file adds the foodcritic linter for Chef files.
|
" Description: This file adds the foodcritic linter for Chef files.
|
||||||
|
|
||||||
" Support options!
|
call ale#Set('chef_foodcritic_executable', 'foodcritic')
|
||||||
let g:ale_chef_foodcritic_options = get(g:, 'ale_chef_foodcritic_options', '')
|
call ale#Set('chef_foodcritic_options', '')
|
||||||
let g:ale_chef_foodcritic_executable = get(g:, 'ale_chef_foodcritic_executable', 'foodcritic')
|
|
||||||
|
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
|
||||||
|
let l:executable = ale_linters#chef#foodcritic#GetExecutable(a:buffer)
|
||||||
|
let l:options = ale#Var(a:buffer, 'chef_foodcritic_options')
|
||||||
|
|
||||||
|
return ale#Escape(l:executable)
|
||||||
|
\ . (!empty(l:options) ? ' ' . escape(l:options, '~') : '')
|
||||||
|
\ . ' %s'
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#chef#foodcritic#Handle(buffer, lines) abort
|
function! ale_linters#chef#foodcritic#Handle(buffer, lines) abort
|
||||||
" Matches patterns line the following:
|
" Matches patterns line the following:
|
||||||
"
|
"
|
||||||
" FC002: Avoid string interpolation where not required: httpd.rb:13
|
" FC002: Avoid string interpolation where not required: httpd.rb:13
|
||||||
let l:pattern = '^\(.\+:\s.\+\):\s\(.\+\):\(\d\+\)$'
|
let l:pattern = '\v([^:]+): (.+): ([a-zA-Z]?:?[^:]+):(\d+)$'
|
||||||
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:text = l:match[1]
|
|
||||||
|
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'lnum': l:match[3] + 0,
|
\ 'code': l:match[1],
|
||||||
\ 'text': l:text,
|
\ 'text': l:match[2],
|
||||||
|
\ 'filename': l:match[3],
|
||||||
|
\ 'lnum': l:match[4] + 0,
|
||||||
\ 'type': 'W',
|
\ 'type': 'W',
|
||||||
\})
|
\})
|
||||||
endfor
|
endfor
|
||||||
@@ -26,17 +39,10 @@ function! ale_linters#chef#foodcritic#Handle(buffer, lines) abort
|
|||||||
return l:output
|
return l:output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#chef#foodcritic#GetCommand(buffer) abort
|
|
||||||
return printf('%s %s %%t',
|
|
||||||
\ ale#Var(a:buffer, 'chef_foodcritic_executable'),
|
|
||||||
\ escape(ale#Var(a:buffer, 'chef_foodcritic_options'), '~')
|
|
||||||
\)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
|
||||||
call ale#linter#Define('chef', {
|
call ale#linter#Define('chef', {
|
||||||
\ 'name': 'foodcritic',
|
\ 'name': 'foodcritic',
|
||||||
\ 'executable': 'foodcritic',
|
\ 'executable_callback': 'ale_linters#chef#foodcritic#GetExecutable',
|
||||||
\ 'command_callback': 'ale_linters#chef#foodcritic#GetCommand',
|
\ 'command_callback': 'ale_linters#chef#foodcritic#GetCommand',
|
||||||
\ 'callback': 'ale_linters#chef#foodcritic#Handle',
|
\ 'callback': 'ale_linters#chef#foodcritic#Handle',
|
||||||
|
\ 'lint_file': 1,
|
||||||
\})
|
\})
|
||||||
|
|||||||
32
ale_linters/clojure/joker.vim
Normal file
32
ale_linters/clojure/joker.vim
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
" Author: Nic West <nicwest@mailbox.org>
|
||||||
|
" Description: linter for clojure using joker https://github.com/candid82/joker
|
||||||
|
|
||||||
|
function! ale_linters#clojure#joker#HandleJokerFormat(buffer, lines) abort
|
||||||
|
" output format
|
||||||
|
" <filename>:<line>:<column>: <issue type>: <message>
|
||||||
|
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):(\d+):? ((Read error|Parse error|Parse warning|Exception): ?(.+))$'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
let l:type = 'E'
|
||||||
|
if l:match[4] is? 'Parse 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': 'joker',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'executable': 'joker',
|
||||||
|
\ 'command': 'joker --lint %t',
|
||||||
|
\ 'callback': 'ale_linters#clojure#joker#HandleJokerFormat',
|
||||||
|
\})
|
||||||
@@ -27,7 +27,7 @@ function! ale_linters#coffee#coffeelint#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)
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'lnum': str2nr(l:match[1]),
|
\ 'lnum': str2nr(l:match[1]),
|
||||||
\ 'type': l:match[3] ==# 'error' ? 'E' : 'W',
|
\ 'type': l:match[3] is# 'error' ? 'E' : 'W',
|
||||||
\ 'text': l:match[4],
|
\ 'text': l:match[4],
|
||||||
\})
|
\})
|
||||||
endfor
|
endfor
|
||||||
|
|||||||
@@ -1,23 +1,29 @@
|
|||||||
" Author: Tomota Nakamura <https://github.com/tomotanakamura>
|
" Author: Tomota Nakamura <https://github.com/tomotanakamura>
|
||||||
" Description: clang linter for cpp files
|
" Description: clang linter for cpp files
|
||||||
|
|
||||||
" Set this option to change the Clang options for warnings for CPP.
|
call ale#Set('cpp_clang_executable', 'clang++')
|
||||||
if !exists('g:ale_cpp_clang_options')
|
call ale#Set('cpp_clang_options', '-std=c++14 -Wall')
|
||||||
let g:ale_cpp_clang_options = '-std=c++14 -Wall'
|
|
||||||
endif
|
function! ale_linters#cpp#clang#GetExecutable(buffer) abort
|
||||||
|
return ale#Var(a:buffer, 'cpp_clang_executable')
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#cpp#clang#GetCommand(buffer) abort
|
function! ale_linters#cpp#clang#GetCommand(buffer) abort
|
||||||
|
let l:paths = ale#c#FindLocalHeaderPaths(a:buffer)
|
||||||
|
|
||||||
" -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 'clang++ -S -x c++ -fsyntax-only '
|
return ale#Escape(ale_linters#cpp#clang#GetExecutable(a:buffer))
|
||||||
\ . '-iquote ' . fnameescape(fnamemodify(bufname(a:buffer), ':p:h'))
|
\ . ' -S -x c++ -fsyntax-only '
|
||||||
\ . ' ' . ale#Var(a:buffer, 'cpp_clang_options') . ' -'
|
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) . ' '
|
||||||
|
\ . ale#c#IncludeOptions(l:paths)
|
||||||
|
\ . 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': 'clang++',
|
\ 'executable_callback': 'ale_linters#cpp#clang#GetExecutable',
|
||||||
\ 'command_callback': 'ale_linters#cpp#clang#GetCommand',
|
\ 'command_callback': 'ale_linters#cpp#clang#GetCommand',
|
||||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||||
\})
|
\})
|
||||||
|
|||||||
39
ale_linters/cpp/clangcheck.vim
Normal file
39
ale_linters/cpp/clangcheck.vim
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
" Author: gagbo <gagbobada@gmail.com>
|
||||||
|
" Description: clang-check linter for cpp files
|
||||||
|
|
||||||
|
call ale#Set('cpp_clangcheck_executable', 'clang-check')
|
||||||
|
call ale#Set('cpp_clangcheck_options', '')
|
||||||
|
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
|
||||||
|
let l:user_options = ale#Var(a:buffer, 'cpp_clangcheck_options')
|
||||||
|
|
||||||
|
" Try to find compilation database to link automatically
|
||||||
|
let l:build_dir = ale#Var(a:buffer, 'c_build_dir')
|
||||||
|
|
||||||
|
if empty(l:build_dir)
|
||||||
|
let l:build_dir = ale#c#FindCompileCommands(a:buffer)
|
||||||
|
endif
|
||||||
|
|
||||||
|
" 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
|
||||||
|
" detected.
|
||||||
|
return ale#Escape(ale_linters#cpp#clangcheck#GetExecutable(a:buffer))
|
||||||
|
\ . ' -analyze %s'
|
||||||
|
\ . (empty(l:build_dir) ? ' -extra-arg -Xclang -extra-arg -analyzer-output=text' : '')
|
||||||
|
\ . (!empty(l:user_options) ? ' ' . l:user_options : '')
|
||||||
|
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('cpp', {
|
||||||
|
\ 'name': 'clangcheck',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'executable_callback': 'ale_linters#cpp#clangcheck#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale_linters#cpp#clangcheck#GetCommand',
|
||||||
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\})
|
||||||
@@ -1,30 +1,57 @@
|
|||||||
" Author: vdeurzen <tim@kompiler.org>, w0rp <devw0rp@gmail.com>
|
" Author: vdeurzen <tim@kompiler.org>, w0rp <devw0rp@gmail.com>,
|
||||||
|
" gagbo <gagbobada@gmail.com>
|
||||||
" Description: clang-tidy linter for cpp files
|
" Description: clang-tidy linter for cpp files
|
||||||
|
|
||||||
|
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.
|
||||||
let g:ale_cpp_clangtidy_checks = get(g:, 'ale_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.
|
||||||
" This will disable compile_commands.json detection.
|
" This will disable compile_commands.json detection.
|
||||||
let g:ale_cpp_clangtidy_options = get(g:, 'ale_cpp_clangtidy_options', '')
|
call ale#Set('cpp_clangtidy_options', '')
|
||||||
|
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:check_list = ale#Var(a:buffer, 'cpp_clangtidy_checks')
|
let l:checks = join(ale#Var(a:buffer, 'cpp_clangtidy_checks'), ',')
|
||||||
let l:check_option = !empty(l:check_list)
|
let l:build_dir = s:GetBuildDirectory(a:buffer)
|
||||||
\ ? '-checks=' . shellescape(join(l:check_list, ',')) . ' '
|
|
||||||
\ : ''
|
" Get the extra options if we couldn't find a build directory.
|
||||||
let l:user_options = ale#Var(a:buffer, 'cpp_clangtidy_options')
|
let l:options = empty(l:build_dir)
|
||||||
let l:extra_options = !empty(l:user_options)
|
\ ? ale#Var(a:buffer, 'cpp_clangtidy_options')
|
||||||
\ ? ' -- ' . l:user_options
|
|
||||||
\ : ''
|
\ : ''
|
||||||
|
|
||||||
return 'clang-tidy ' . l:check_option . '%s' . l:extra_options
|
return ale#Escape(ale_linters#cpp#clangtidy#GetExecutable(a:buffer))
|
||||||
|
\ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
|
||||||
|
\ . ' %s'
|
||||||
|
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
||||||
|
\ . (!empty(l:options) ? ' -- ' . l:options : '')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('cpp', {
|
call ale#linter#Define('cpp', {
|
||||||
\ 'name': 'clangtidy',
|
\ 'name': 'clangtidy',
|
||||||
\ 'output_stream': 'stdout',
|
\ 'output_stream': 'stdout',
|
||||||
\ 'executable': 'clang-tidy',
|
\ 'executable_callback': 'ale_linters#cpp#clangtidy#GetExecutable',
|
||||||
\ 'command_callback': 'ale_linters#cpp#clangtidy#GetCommand',
|
\ 'command_callback': 'ale_linters#cpp#clangtidy#GetCommand',
|
||||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
" Author: Bart Libert <bart.libert@gmail.com>
|
" Author: Bart Libert <bart.libert@gmail.com>
|
||||||
" Description: cppcheck linter for cpp files
|
" Description: cppcheck linter for cpp files
|
||||||
|
|
||||||
" Set this option to change the cppcheck options
|
call ale#Set('cpp_cppcheck_executable', 'cppcheck')
|
||||||
let g:ale_cpp_cppcheck_options = get(g:, 'ale_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.
|
" Search upwards from the file for compile_commands.json.
|
||||||
@@ -19,7 +23,8 @@ function! ale_linters#cpp#cppcheck#GetCommand(buffer) abort
|
|||||||
\ : ''
|
\ : ''
|
||||||
|
|
||||||
return l:cd_command
|
return l:cd_command
|
||||||
\ . 'cppcheck -q --language=c++ '
|
\ . ale#Escape(ale_linters#cpp#cppcheck#GetExecutable(a:buffer))
|
||||||
|
\ . ' -q --language=c++ '
|
||||||
\ . l:compile_commands_option
|
\ . l:compile_commands_option
|
||||||
\ . ale#Var(a:buffer, 'cpp_cppcheck_options')
|
\ . ale#Var(a:buffer, 'cpp_cppcheck_options')
|
||||||
\ . ' %t'
|
\ . ' %t'
|
||||||
@@ -28,7 +33,7 @@ endfunction
|
|||||||
call ale#linter#Define('cpp', {
|
call ale#linter#Define('cpp', {
|
||||||
\ 'name': 'cppcheck',
|
\ 'name': 'cppcheck',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\ 'executable': 'cppcheck',
|
\ 'executable_callback': 'ale_linters#cpp#cppcheck#GetExecutable',
|
||||||
\ 'command_callback': 'ale_linters#cpp#cppcheck#GetCommand',
|
\ 'command_callback': 'ale_linters#cpp#cppcheck#GetCommand',
|
||||||
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
|
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
|
||||||
\})
|
\})
|
||||||
|
|||||||
26
ale_linters/cpp/cpplint.vim
Normal file
26
ale_linters/cpp/cpplint.vim
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
" Author: Dawid Kurek https://github.com/dawikur
|
||||||
|
" Description: cpplint for cpp files
|
||||||
|
|
||||||
|
call ale#Set('cpp_cpplint_executable', 'cpplint')
|
||||||
|
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
|
||||||
|
let l:options = ale#Var(a:buffer, 'cpp_cpplint_options')
|
||||||
|
|
||||||
|
return ale#Escape(ale_linters#cpp#cpplint#GetExecutable(a:buffer))
|
||||||
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
|
\ . ' %s'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('cpp', {
|
||||||
|
\ 'name': 'cpplint',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'executable_callback': 'ale_linters#cpp#cpplint#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale_linters#cpp#cpplint#GetCommand',
|
||||||
|
\ 'callback': 'ale#handlers#cpplint#HandleCppLintFormat',
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\})
|
||||||
31
ale_linters/cpp/flawfinder.vim
Normal file
31
ale_linters/cpp/flawfinder.vim
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
" Author: Christian Gibbons <cgibbons@gmu.edu>
|
||||||
|
" Description: flawfinder linter for c++ files
|
||||||
|
|
||||||
|
call ale#Set('cpp_flawfinder_executable', 'flawfinder')
|
||||||
|
call ale#Set('cpp_flawfinder_options', '')
|
||||||
|
call ale#Set('cpp_flawfinder_minlevel', 1)
|
||||||
|
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
|
||||||
|
|
||||||
|
" Set the minimum vulnerability level for flawfinder to bother with
|
||||||
|
let l:minlevel = ' --minlevel=' . ale#Var(a:buffer, 'cpp_flawfinder_minlevel')
|
||||||
|
|
||||||
|
return ale#Escape(ale_linters#cpp#flawfinder#GetExecutable(a:buffer))
|
||||||
|
\ . ' -CDQS'
|
||||||
|
\ . ale#Var(a:buffer, 'cpp_flawfinder_options')
|
||||||
|
\ . l:minlevel
|
||||||
|
\ . ' %t'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('cpp', {
|
||||||
|
\ 'name': 'flawfinder',
|
||||||
|
\ 'output_stream': 'stdout',
|
||||||
|
\ 'executable_callback': 'ale_linters#cpp#flawfinder#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale_linters#cpp#flawfinder#GetCommand',
|
||||||
|
\ 'callback': 'ale#handlers#flawfinder#HandleFlawfinderFormat',
|
||||||
|
\})
|
||||||
@@ -1,33 +1,29 @@
|
|||||||
" Author: geam <mdelage@student.42.fr>
|
" Author: geam <mdelage@student.42.fr>
|
||||||
" Description: gcc linter for cpp files
|
" Description: gcc linter for cpp files
|
||||||
|
"
|
||||||
|
call ale#Set('cpp_gcc_executable', 'gcc')
|
||||||
|
call ale#Set('cpp_gcc_options', '-std=c++14 -Wall')
|
||||||
|
|
||||||
" Set this option to change the GCC options for warnings for C.
|
function! ale_linters#cpp#gcc#GetExecutable(buffer) abort
|
||||||
if !exists('g:ale_cpp_gcc_options')
|
return ale#Var(a:buffer, 'cpp_gcc_executable')
|
||||||
let s:version = ale#handlers#gcc#ParseGCCVersion(systemlist('gcc --version'))
|
endfunction
|
||||||
|
|
||||||
if !empty(s:version) && ale#semver#GreaterOrEqual(s:version, [4, 9, 0])
|
|
||||||
" Use c++14 support in 4.9 and above.
|
|
||||||
let g:ale_cpp_gcc_options = '-std=c++14 -Wall'
|
|
||||||
else
|
|
||||||
" Use c++1y in older versions.
|
|
||||||
let g:ale_cpp_gcc_options = '-std=c++1y -Wall'
|
|
||||||
endif
|
|
||||||
|
|
||||||
unlet! s:version
|
|
||||||
endif
|
|
||||||
|
|
||||||
function! ale_linters#cpp#gcc#GetCommand(buffer) abort
|
function! ale_linters#cpp#gcc#GetCommand(buffer) abort
|
||||||
|
let l:paths = ale#c#FindLocalHeaderPaths(a:buffer)
|
||||||
|
|
||||||
" -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 'gcc -S -x c++ -fsyntax-only '
|
return ale#Escape(ale_linters#cpp#gcc#GetExecutable(a:buffer))
|
||||||
\ . '-iquote ' . fnameescape(fnamemodify(bufname(a:buffer), ':p:h'))
|
\ . ' -S -x c++ -fsyntax-only '
|
||||||
\ . ' ' . ale#Var(a:buffer, 'cpp_gcc_options') . ' -'
|
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h')) . ' '
|
||||||
|
\ . ale#c#IncludeOptions(l:paths)
|
||||||
|
\ . ale#Var(a:buffer, 'cpp_gcc_options') . ' -'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('cpp', {
|
call ale#linter#Define('cpp', {
|
||||||
\ 'name': 'g++',
|
\ 'name': 'g++',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable': 'g++',
|
\ 'executable_callback': 'ale_linters#cpp#gcc#GetExecutable',
|
||||||
\ 'command_callback': 'ale_linters#cpp#gcc#GetCommand',
|
\ 'command_callback': 'ale_linters#cpp#gcc#GetCommand',
|
||||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -1,34 +1,24 @@
|
|||||||
" Author: Jordan Andree <https://github.com/jordanandree>
|
" Author: Jordan Andree <https://github.com/jordanandree>, David Alexander <opensource@thelonelyghost.com>
|
||||||
" Description: This file adds support for checking Crystal with crystal build
|
" Description: This file adds support for checking Crystal with crystal build
|
||||||
|
|
||||||
function! ale_linters#crystal#crystal#Handle(buffer, lines) abort
|
function! ale_linters#crystal#crystal#Handle(buffer, lines) abort
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
let l:lines = join(a:lines, '')
|
for l:error in ale#util#FuzzyJSONDecode(a:lines, [])
|
||||||
|
call add(l:output, {
|
||||||
if !empty(l:lines)
|
\ 'lnum': l:error.line + 0,
|
||||||
let l:errors = json_decode(l:lines)
|
\ 'col': l:error.column + 0,
|
||||||
|
\ 'text': l:error.message,
|
||||||
for l:error in l:errors
|
\})
|
||||||
call add(l:output, {
|
endfor
|
||||||
\ 'bufnr': a:buffer,
|
|
||||||
\ 'lnum': l:error.line + 0,
|
|
||||||
\ 'col': l:error.column + 0,
|
|
||||||
\ 'text': l:error.message,
|
|
||||||
\ 'type': 'E',
|
|
||||||
\})
|
|
||||||
endfor
|
|
||||||
endif
|
|
||||||
|
|
||||||
return l:output
|
return l:output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#crystal#crystal#GetCommand(buffer) abort
|
function! ale_linters#crystal#crystal#GetCommand(buffer) abort
|
||||||
let l:crystal_cmd = 'crystal build -f json --no-codegen -o '
|
return 'crystal build -f json --no-codegen --no-color -o '
|
||||||
let l:crystal_cmd .= shellescape(g:ale#util#nul_file)
|
\ . ale#Escape(g:ale#util#nul_file)
|
||||||
let l:crystal_cmd .= ' %s'
|
\ . ' %s'
|
||||||
|
|
||||||
return l:crystal_cmd
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('crystal', {
|
call ale#linter#Define('crystal', {
|
||||||
|
|||||||
@@ -8,15 +8,16 @@ function! ale_linters#cs#mcs#Handle(buffer, lines) abort
|
|||||||
" Look for lines like the following.
|
" Look for lines like the following.
|
||||||
"
|
"
|
||||||
" Tests.cs(12,29): error CSXXXX: ; expected
|
" Tests.cs(12,29): error CSXXXX: ; expected
|
||||||
let l:pattern = '^.\+.cs(\(\d\+\),\(\d\+\)): \(.\+\): \(.\+\)'
|
let l:pattern = '^\v(.+\.cs)\((\d+),(\d+)\)\: ([^ ]+) ([^ ]+): (.+)$'
|
||||||
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)
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'lnum': l:match[1] + 0,
|
\ 'lnum': l:match[2] + 0,
|
||||||
\ 'col': l:match[2] + 0,
|
\ 'col': l:match[3] + 0,
|
||||||
\ 'text': l:match[3] . ': ' . l:match[4],
|
\ 'type': l:match[4] is# 'error' ? 'E' : 'W',
|
||||||
\ 'type': l:match[3] =~# '^error' ? 'E' : 'W',
|
\ 'code': l:match[5],
|
||||||
|
\ 'text': l:match[6],
|
||||||
\})
|
\})
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
|
|||||||
81
ale_linters/cs/mcsc.vim
Normal file
81
ale_linters/cs/mcsc.vim
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
call ale#Set('cs_mcsc_options', '')
|
||||||
|
call ale#Set('cs_mcsc_source', '')
|
||||||
|
call ale#Set('cs_mcsc_assembly_path', [])
|
||||||
|
call ale#Set('cs_mcsc_assemblies', [])
|
||||||
|
|
||||||
|
function! s:GetWorkingDirectory(buffer) abort
|
||||||
|
let l:working_directory = ale#Var(a:buffer, 'cs_mcsc_source')
|
||||||
|
|
||||||
|
if !empty(l:working_directory)
|
||||||
|
return l:working_directory
|
||||||
|
endif
|
||||||
|
|
||||||
|
return expand('#' . a:buffer . ':p:h')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#cs#mcsc#GetCommand(buffer) abort
|
||||||
|
" Pass assembly paths via the -lib: parameter.
|
||||||
|
let l:path_list = ale#Var(a:buffer, 'cs_mcsc_assembly_path')
|
||||||
|
|
||||||
|
let l:lib_option = !empty(l:path_list)
|
||||||
|
\ ? '-lib:' . join(map(copy(l:path_list), 'ale#Escape(v:val)'), ',')
|
||||||
|
\ : ''
|
||||||
|
|
||||||
|
" Pass paths to DLL files via the -r: parameter.
|
||||||
|
let l:assembly_list = ale#Var(a:buffer, 'cs_mcsc_assemblies')
|
||||||
|
|
||||||
|
let l:r_option = !empty(l:assembly_list)
|
||||||
|
\ ? '-r:' . join(map(copy(l:assembly_list), 'ale#Escape(v:val)'), ',')
|
||||||
|
\ : ''
|
||||||
|
|
||||||
|
" register temporary module target file with ale
|
||||||
|
let l:out = tempname()
|
||||||
|
call ale#engine#ManageFile(a:buffer, l:out)
|
||||||
|
|
||||||
|
" The code is compiled as a module and the output is redirected to a
|
||||||
|
" temporary file.
|
||||||
|
return ale#path#CdString(s:GetWorkingDirectory(a:buffer))
|
||||||
|
\ . 'mcs -unsafe'
|
||||||
|
\ . ' ' . ale#Var(a:buffer, 'cs_mcsc_options')
|
||||||
|
\ . ' ' . l:lib_option
|
||||||
|
\ . ' ' . l:r_option
|
||||||
|
\ . ' -out:' . l:out
|
||||||
|
\ . ' -t:module'
|
||||||
|
\ . ' -recurse:' . ale#Escape('*.cs')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#cs#mcsc#Handle(buffer, lines) abort
|
||||||
|
" Look for lines like the following.
|
||||||
|
"
|
||||||
|
" Tests.cs(12,29): error CSXXXX: ; expected
|
||||||
|
"
|
||||||
|
" NOTE: pattern also captures file name as linter compiles all
|
||||||
|
" files within the source tree rooted at the specified source
|
||||||
|
" path and not just the file loaded in the buffer
|
||||||
|
let l:pattern = '^\v(.+\.cs)\((\d+),(\d+)\)\: ([^ ]+) ([^ ]+): (.+)$'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
let l:dir = s:GetWorkingDirectory(a:buffer)
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
|
||||||
|
\ 'lnum': l:match[2] + 0,
|
||||||
|
\ 'col': l:match[3] + 0,
|
||||||
|
\ 'type': l:match[4] is# 'error' ? 'E' : 'W',
|
||||||
|
\ 'code': l:match[5],
|
||||||
|
\ 'text': l:match[6],
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('cs',{
|
||||||
|
\ 'name': 'mcsc',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'executable': 'mcs',
|
||||||
|
\ 'command_callback': 'ale_linters#cs#mcsc#GetCommand',
|
||||||
|
\ 'callback': 'ale_linters#cs#mcsc#Handle',
|
||||||
|
\ 'lint_file': 1
|
||||||
|
\})
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
function! ale_linters#css#csslint#GetCommand(buffer) abort
|
function! ale_linters#css#csslint#GetCommand(buffer) abort
|
||||||
let l:csslintrc = ale#path#FindNearestFile(a:buffer, '.csslintrc')
|
let l:csslintrc = ale#path#FindNearestFile(a:buffer, '.csslintrc')
|
||||||
let l:config_option = !empty(l:csslintrc)
|
let l:config_option = !empty(l:csslintrc)
|
||||||
\ ? '--config=' . fnameescape(l:csslintrc)
|
\ ? '--config=' . ale#Escape(l:csslintrc)
|
||||||
\ : ''
|
\ : ''
|
||||||
|
|
||||||
return 'csslint --format=compact ' . l:config_option . ' %t'
|
return 'csslint --format=compact ' . l:config_option . ' %t'
|
||||||
|
|||||||
@@ -1,24 +1,13 @@
|
|||||||
" Author: diartyz <diartyz@gmail.com>
|
" Author: diartyz <diartyz@gmail.com>
|
||||||
|
|
||||||
let g:ale_css_stylelint_executable =
|
call ale#Set('css_stylelint_executable', 'stylelint')
|
||||||
\ get(g:, 'ale_css_stylelint_executable', 'stylelint')
|
call ale#Set('css_stylelint_options', '')
|
||||||
|
call ale#Set('css_stylelint_use_global', 0)
|
||||||
let g:ale_css_stylelint_options =
|
|
||||||
\ get(g:, 'ale_css_stylelint_options', '')
|
|
||||||
|
|
||||||
let g:ale_css_stylelint_use_global =
|
|
||||||
\ get(g:, 'ale_css_stylelint_use_global', 0)
|
|
||||||
|
|
||||||
function! ale_linters#css#stylelint#GetExecutable(buffer) abort
|
function! ale_linters#css#stylelint#GetExecutable(buffer) abort
|
||||||
if ale#Var(a:buffer, 'css_stylelint_use_global')
|
return ale#node#FindExecutable(a:buffer, 'css_stylelint', [
|
||||||
return ale#Var(a:buffer, 'css_stylelint_executable')
|
|
||||||
endif
|
|
||||||
|
|
||||||
return ale#path#ResolveLocalPath(
|
|
||||||
\ a:buffer,
|
|
||||||
\ 'node_modules/.bin/stylelint',
|
\ 'node_modules/.bin/stylelint',
|
||||||
\ ale#Var(a:buffer, 'css_stylelint_executable')
|
\])
|
||||||
\)
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#css#stylelint#GetCommand(buffer) abort
|
function! ale_linters#css#stylelint#GetCommand(buffer) abort
|
||||||
|
|||||||
56
ale_linters/cuda/nvcc.vim
Normal file
56
ale_linters/cuda/nvcc.vim
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
" Author: blahgeek <i@blahgeek.com>
|
||||||
|
" Description: NVCC linter for cuda files
|
||||||
|
|
||||||
|
call ale#Set('cuda_nvcc_executable', 'nvcc')
|
||||||
|
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
|
||||||
|
" Unused: use ale#util#nul_file
|
||||||
|
" let l:output_file = tempname() . '.ii'
|
||||||
|
" call ale#engine#ManageFile(a:buffer, l:output_file)
|
||||||
|
|
||||||
|
return ale#Escape(ale_linters#cuda#nvcc#GetExecutable(a:buffer))
|
||||||
|
\ . ' -cuda '
|
||||||
|
\ . ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer))
|
||||||
|
\ . ale#Var(a:buffer, 'cuda_nvcc_options') . ' %s'
|
||||||
|
\ . ' -o ' . g:ale#util#nul_file
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#cuda#nvcc#HandleNVCCFormat(buffer, lines) abort
|
||||||
|
" Look for lines like the following.
|
||||||
|
"
|
||||||
|
" test.cu(8): error: argument of type "void *" is incompatible with parameter of type "int *"
|
||||||
|
let l:pattern = '\v^([^:\(\)]+):?\(?(\d+)\)?:(\d+)?:?\s*\w*\s*(error|warning): (.+)$'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
|
||||||
|
let l:item = {
|
||||||
|
\ 'lnum': str2nr(l:match[2]),
|
||||||
|
\ 'type': l:match[4] =~# 'error' ? 'E' : 'W',
|
||||||
|
\ 'text': l:match[5],
|
||||||
|
\ 'filename': fnamemodify(l:match[1], ':p'),
|
||||||
|
\}
|
||||||
|
|
||||||
|
if !empty(l:match[3])
|
||||||
|
let l:item.col = str2nr(l:match[3])
|
||||||
|
endif
|
||||||
|
|
||||||
|
call add(l:output, l:item)
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('cuda', {
|
||||||
|
\ 'name': 'nvcc',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'executable_callback': 'ale_linters#cuda#nvcc#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale_linters#cuda#nvcc#GetCommand',
|
||||||
|
\ 'callback': 'ale_linters#cuda#nvcc#HandleNVCCFormat',
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\})
|
||||||
@@ -31,7 +31,7 @@ function! ale_linters#d#dmd#DUBCommand(buffer) abort
|
|||||||
" To support older dub versions, we just change the directory to
|
" To support older dub versions, we just change the directory to
|
||||||
" the directory where we found the dub config, and then run `dub describe`
|
" the directory where we found the dub config, and then run `dub describe`
|
||||||
" from that directory.
|
" from that directory.
|
||||||
return 'cd ' . fnameescape(fnamemodify(l:dub_file, ':h'))
|
return 'cd ' . ale#Escape(fnamemodify(l:dub_file, ':h'))
|
||||||
\ . ' && dub describe --import-paths'
|
\ . ' && dub describe --import-paths'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ function! ale_linters#d#dmd#DMDCommand(buffer, dub_output) abort
|
|||||||
for l:line in a:dub_output
|
for l:line in a:dub_output
|
||||||
if !empty(l:line)
|
if !empty(l:line)
|
||||||
" The arguments must be '-Ifilename', not '-I filename'
|
" The arguments must be '-Ifilename', not '-I filename'
|
||||||
call add(l:import_list, '-I' . fnameescape(l:line))
|
call add(l:import_list, '-I' . ale#Escape(l:line))
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ function! ale_linters#d#dmd#Handle(buffer, lines) abort
|
|||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'lnum': l:match[1],
|
\ 'lnum': l:match[1],
|
||||||
\ 'col': l:match[2],
|
\ 'col': l:match[2],
|
||||||
\ 'type': l:match[3] ==# 'Warning' ? 'W' : 'E',
|
\ 'type': l:match[3] is# 'Warning' ? 'W' : 'E',
|
||||||
\ 'text': l:match[4],
|
\ 'text': l:match[4],
|
||||||
\})
|
\})
|
||||||
endfor
|
endfor
|
||||||
|
|||||||
25
ale_linters/dafny/dafny.vim
Normal file
25
ale_linters/dafny/dafny.vim
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
" Author: Taylor Blau <me@ttaylorr.com>
|
||||||
|
|
||||||
|
function! ale_linters#dafny#dafny#Handle(buffer, lines) abort
|
||||||
|
let l:pattern = '\v(.*)\((\d+),(\d+)\): (.*): (.*)'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'bufnr': a:buffer,
|
||||||
|
\ 'col': l:match[3] + 0,
|
||||||
|
\ 'lnum': l:match[2] + 0,
|
||||||
|
\ 'text': l:match[5],
|
||||||
|
\ 'type': l:match[4] =~# '^Error' ? 'E' : 'W'
|
||||||
|
\ })
|
||||||
|
endfor
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('dafny', {
|
||||||
|
\ 'name': 'dafny',
|
||||||
|
\ 'executable': 'dafny',
|
||||||
|
\ 'command': 'dafny %s /compile:0',
|
||||||
|
\ 'callback': 'ale_linters#dafny#dafny#Handle',
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\ })
|
||||||
41
ale_linters/dart/dartanalyzer.vim
Normal file
41
ale_linters/dart/dartanalyzer.vim
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
" Author: w0rp <devw0rp@gmail.com>
|
||||||
|
" Description: Check Dart files with 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
|
||||||
|
let l:executable = ale_linters#dart#dartanalyzer#GetExecutable(a:buffer)
|
||||||
|
let l:path = ale#path#FindNearestFile(a:buffer, '.packages')
|
||||||
|
|
||||||
|
return ale#Escape(l:executable)
|
||||||
|
\ . (!empty(l:path) ? ' --packages ' . ale#Escape(l:path) : '')
|
||||||
|
\ . ' %s'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#dart#dartanalyzer#Handle(buffer, lines) abort
|
||||||
|
let l:pattern = '\v^ ([a-z]+) . (.+) at (.+):(\d+):(\d+) . (.+)$'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'type': l:match[1] is# 'error' ? 'E' : 'W',
|
||||||
|
\ 'text': l:match[6] . ': ' . l:match[2],
|
||||||
|
\ 'lnum': str2nr(l:match[4]),
|
||||||
|
\ 'col': str2nr(l:match[5]),
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('dart', {
|
||||||
|
\ 'name': 'dartanalyzer',
|
||||||
|
\ 'executable_callback': 'ale_linters#dart#dartanalyzer#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale_linters#dart#dartanalyzer#GetCommand',
|
||||||
|
\ 'callback': 'ale_linters#dart#dartanalyzer#Handle',
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\})
|
||||||
30
ale_linters/dart/language_server.vim
Normal file
30
ale_linters/dart/language_server.vim
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
" Author: aurieh <me@aurieh.me>
|
||||||
|
" Description: A language server for dart
|
||||||
|
|
||||||
|
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#GetLanguage(buffer) abort
|
||||||
|
return 'dart'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#dart#language_server#GetProjectRoot(buffer) abort
|
||||||
|
" Note: pub only looks for pubspec.yaml, there's no point in adding
|
||||||
|
" support for pubspec.yml
|
||||||
|
let l:pubspec = ale#path#FindNearestFile(a:buffer, 'pubspec.yaml')
|
||||||
|
|
||||||
|
return !empty(l:pubspec) ? fnamemodify(l:pubspec, ':h:h') : ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('dart', {
|
||||||
|
\ 'name': 'language_server',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable_callback': 'ale_linters#dart#language_server#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale_linters#dart#language_server#GetExecutable',
|
||||||
|
\ 'language_callback': 'ale_linters#dart#language_server#GetLanguage',
|
||||||
|
\ 'project_root_callback': 'ale_linters#dart#language_server#GetProjectRoot',
|
||||||
|
\})
|
||||||
|
|
||||||
@@ -1,37 +1,97 @@
|
|||||||
" Author: hauleth - https://github.com/hauleth
|
" Author: hauleth - https://github.com/hauleth
|
||||||
|
|
||||||
|
" always, yes, never
|
||||||
|
call ale#Set('dockerfile_hadolint_use_docker', 'never')
|
||||||
|
call ale#Set('dockerfile_hadolint_docker_image', 'hadolint/hadolint')
|
||||||
|
|
||||||
function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
|
function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
|
||||||
" Matches patterns line the following:
|
" Matches patterns line the following:
|
||||||
"
|
"
|
||||||
" stdin:19: F: Pipe chain should start with a raw value.
|
" /dev/stdin:19 DL3001 Pipe chain should start with a raw value.
|
||||||
let l:pattern = '\v^/dev/stdin:?(\d+)? (\S+) (.+)$'
|
" /dev/stdin:19:3 unexpected thing
|
||||||
|
let l:pattern = '\v^/dev/stdin:(\d+):?(\d+)? ((DL|SC)(\d+) )?(.+)$'
|
||||||
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:lnum = 0
|
let l:lnum = 0
|
||||||
|
let l:colnum = 0
|
||||||
|
|
||||||
if l:match[1] !=# ''
|
if l:match[1] isnot# ''
|
||||||
let l:lnum = l:match[1] + 0
|
let l:lnum = l:match[1] + 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if l:match[2] isnot# ''
|
||||||
|
let l:colnum = l:match[2] + 0
|
||||||
|
endif
|
||||||
|
|
||||||
let l:type = 'W'
|
let l:type = 'W'
|
||||||
let l:text = l:match[3]
|
let l:text = l:match[6]
|
||||||
|
let l:detail = l:match[6]
|
||||||
|
let l:domain = 'https://github.com/hadolint/hadolint/wiki/'
|
||||||
|
|
||||||
|
if l:match[4] is# 'SC'
|
||||||
|
let l:domain = 'https://github.com/koalaman/shellcheck/wiki/'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if l:match[5] isnot# ''
|
||||||
|
let l:code = l:match[4] . l:match[5]
|
||||||
|
let l:link = ' ( ' . l:domain . l:code . ' )'
|
||||||
|
let l:detail = l:code . l:link . "\n\n" . l:detail
|
||||||
|
else
|
||||||
|
let l:type = 'E'
|
||||||
|
endif
|
||||||
|
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'lnum': l:lnum,
|
\ 'lnum': l:lnum,
|
||||||
\ 'col': 0,
|
\ 'col': l:colnum,
|
||||||
\ 'type': l:type,
|
\ 'type': l:type,
|
||||||
\ 'text': l:text,
|
\ 'text': l:text,
|
||||||
\ 'nr': l:match[2],
|
\ 'detail': l:detail
|
||||||
\})
|
\})
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
return l:output
|
return l:output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" This is a little different than the typical 'executable' callback. We want
|
||||||
|
" to afford the user the chance to say always use docker, never use docker,
|
||||||
|
" and use docker if the hadolint executable is not present on the system.
|
||||||
|
"
|
||||||
|
" In the case of neither docker nor hadolint executables being present, it
|
||||||
|
" really doesn't matter which we return -- either will have the effect of
|
||||||
|
" 'nope, can't use this linter!'.
|
||||||
|
|
||||||
|
function! ale_linters#dockerfile#hadolint#GetExecutable(buffer) abort
|
||||||
|
let l:use_docker = ale#Var(a:buffer, 'dockerfile_hadolint_use_docker')
|
||||||
|
|
||||||
|
" check for mandatory directives
|
||||||
|
if l:use_docker is# 'never'
|
||||||
|
return 'hadolint'
|
||||||
|
elseif l:use_docker is# 'always'
|
||||||
|
return 'docker'
|
||||||
|
endif
|
||||||
|
|
||||||
|
" if we reach here, we want to use 'hadolint' if present...
|
||||||
|
if executable('hadolint')
|
||||||
|
return 'hadolint'
|
||||||
|
endif
|
||||||
|
|
||||||
|
"... and 'docker' as a fallback.
|
||||||
|
return 'docker'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#dockerfile#hadolint#GetCommand(buffer) abort
|
||||||
|
let l:command = ale_linters#dockerfile#hadolint#GetExecutable(a:buffer)
|
||||||
|
if l:command is# 'docker'
|
||||||
|
return 'docker run --rm -i ' . ale#Var(a:buffer, 'dockerfile_hadolint_docker_image')
|
||||||
|
endif
|
||||||
|
return 'hadolint -'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
call ale#linter#Define('dockerfile', {
|
call ale#linter#Define('dockerfile', {
|
||||||
\ 'name': 'hadolint',
|
\ 'name': 'hadolint',
|
||||||
\ 'executable': 'hadolint',
|
\ 'executable_callback': 'ale_linters#dockerfile#hadolint#GetExecutable',
|
||||||
\ 'command': 'hadolint -',
|
\ 'command_callback': 'ale_linters#dockerfile#hadolint#GetCommand',
|
||||||
\ 'callback': 'ale_linters#dockerfile#hadolint#Handle',
|
\ 'callback': 'ale_linters#dockerfile#hadolint#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ 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 ==# 'C'
|
if l:type is# 'C'
|
||||||
let l:type = 'E'
|
let l:type = 'E'
|
||||||
elseif l:type ==# 'R'
|
elseif l:type is# 'R'
|
||||||
let l:type = 'W'
|
let l:type = 'W'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -32,6 +32,6 @@ endfunction
|
|||||||
call ale#linter#Define('elixir', {
|
call ale#linter#Define('elixir', {
|
||||||
\ 'name': 'credo',
|
\ 'name': 'credo',
|
||||||
\ 'executable': 'mix',
|
\ 'executable': 'mix',
|
||||||
\ 'command': 'mix credo suggest --format=flycheck --read-from-stdin %s',
|
\ 'command': 'mix help credo && mix credo suggest --format=flycheck --read-from-stdin %s',
|
||||||
\ 'callback': 'ale_linters#elixir#credo#Handle',
|
\ 'callback': 'ale_linters#elixir#credo#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
34
ale_linters/elixir/dialyxir.vim
Normal file
34
ale_linters/elixir/dialyxir.vim
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
" Author: Fran C. - https://github.com/franciscoj
|
||||||
|
" Description: Add dialyzer support for elixir through dialyxir
|
||||||
|
" https://github.com/jeremyjh/dialyxir
|
||||||
|
|
||||||
|
function! ale_linters#elixir#dialyxir#Handle(buffer, lines) abort
|
||||||
|
" Matches patterns line the following:
|
||||||
|
"
|
||||||
|
" lib/filename.ex:19: Function fname/1 has no local return
|
||||||
|
let l:pattern = '\v(.+):(\d+): (.+)$'
|
||||||
|
let l:output = []
|
||||||
|
let l:type = 'W'
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
if bufname(a:buffer) == l:match[1]
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'bufnr': a:buffer,
|
||||||
|
\ 'lnum': l:match[2] + 0,
|
||||||
|
\ 'col': 0,
|
||||||
|
\ 'type': l:type,
|
||||||
|
\ 'text': l:match[3],
|
||||||
|
\})
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('elixir', {
|
||||||
|
\ 'name': 'dialyxir',
|
||||||
|
\ 'executable': 'mix',
|
||||||
|
\ 'command': 'mix dialyzer',
|
||||||
|
\ 'callback': 'ale_linters#elixir#dialyxir#Handle',
|
||||||
|
\})
|
||||||
|
|
||||||
@@ -11,9 +11,9 @@ function! ale_linters#elixir#dogma#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 ==# 'C'
|
if l:type is# 'C'
|
||||||
let l:type = 'E'
|
let l:type = 'E'
|
||||||
elseif l:type ==# 'R'
|
elseif l:type is# 'R'
|
||||||
let l:type = 'W'
|
let l:type = 'W'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ endfunction
|
|||||||
call ale#linter#Define('elixir', {
|
call ale#linter#Define('elixir', {
|
||||||
\ 'name': 'dogma',
|
\ 'name': 'dogma',
|
||||||
\ 'executable': 'mix',
|
\ 'executable': 'mix',
|
||||||
\ 'command': 'mix dogma %s --format=flycheck',
|
\ 'command': 'mix help dogma && mix dogma %s --format=flycheck',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
\ 'callback': 'ale_linters#elixir#dogma#Handle',
|
\ 'callback': 'ale_linters#elixir#dogma#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -1,37 +1,59 @@
|
|||||||
" Author: buffalocoder - https://github.com/buffalocoder
|
" Author: buffalocoder - https://github.com/buffalocoder, soywod - https://github.com/soywod
|
||||||
" Description: Elm linting in Ale. Closely follows the Syntastic checker in https://github.com/ElmCast/elm-vim.
|
" Description: Elm linting in Ale. Closely follows the Syntastic checker in https://github.com/ElmCast/elm-vim.
|
||||||
|
|
||||||
|
call ale#Set('elm_make_executable', 'elm-make')
|
||||||
|
call ale#Set('elm_make_use_global', 0)
|
||||||
|
|
||||||
|
function! ale_linters#elm#make#GetExecutable(buffer) abort
|
||||||
|
return ale#node#FindExecutable(a:buffer, 'elm_make', [
|
||||||
|
\ 'node_modules/.bin/elm-make',
|
||||||
|
\])
|
||||||
|
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:is_windows = has('win32')
|
let l:is_windows = has('win32')
|
||||||
let l:temp_dir = l:is_windows ? $TMP : $TMPDIR
|
let l:temp_dir = l:is_windows ? $TMP : $TMPDIR
|
||||||
|
let l:unparsed_lines = []
|
||||||
for l:line in a:lines
|
for l:line in a:lines
|
||||||
if l:line[0] ==# '['
|
if l:line[0] is# '['
|
||||||
let l:errors = json_decode(l:line)
|
let l:errors = json_decode(l:line)
|
||||||
|
|
||||||
for l:error in l:errors
|
for l:error in l:errors
|
||||||
" Check if file is from the temp directory.
|
" Check if file is from the temp directory.
|
||||||
" Filters out any errors not related to the buffer.
|
" Filters out any errors not related to the buffer.
|
||||||
if l:is_windows
|
if l:is_windows
|
||||||
let l:file_is_buffer = l:error.file[0:len(l:temp_dir) - 1] ==? l:temp_dir
|
let l:file_is_buffer = l:error.file[0:len(l:temp_dir) - 1] is? l:temp_dir
|
||||||
else
|
else
|
||||||
let l:file_is_buffer = l:error.file[0:len(l:temp_dir) - 1] ==# l:temp_dir
|
let l:file_is_buffer = l:error.file[0:len(l:temp_dir) - 1] is# l:temp_dir
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if l:file_is_buffer
|
if l:file_is_buffer
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'bufnr': a:buffer,
|
|
||||||
\ 'lnum': l:error.region.start.line,
|
\ 'lnum': l:error.region.start.line,
|
||||||
\ 'col': l:error.region.start.column,
|
\ 'col': l:error.region.start.column,
|
||||||
\ 'type': (l:error.type ==? 'error') ? 'E' : 'W',
|
\ 'end_lnum': l:error.region.end.line,
|
||||||
|
\ 'end_col': l:error.region.end.column,
|
||||||
|
\ 'type': (l:error.type is? 'error') ? 'E' : 'W',
|
||||||
\ 'text': l:error.overview,
|
\ 'text': l:error.overview,
|
||||||
\ 'detail': l:error.overview . "\n\n" . l:error.details
|
\ 'detail': l:error.overview . "\n\n" . l:error.details
|
||||||
\})
|
\})
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
elseif l:line isnot# 'Successfully generated /dev/null'
|
||||||
|
call add(l:unparsed_lines, l:line)
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
|
if len(l:unparsed_lines) > 0
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': 1,
|
||||||
|
\ 'type': 'E',
|
||||||
|
\ 'text': l:unparsed_lines[0],
|
||||||
|
\ 'detail': join(l:unparsed_lines, "\n")
|
||||||
|
\})
|
||||||
|
endif
|
||||||
|
|
||||||
return l:output
|
return l:output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -39,25 +61,28 @@ endfunction
|
|||||||
" If it doesn't, then this will fail when imports are needed.
|
" If it doesn't, then this will fail when imports are needed.
|
||||||
function! ale_linters#elm#make#GetCommand(buffer) abort
|
function! ale_linters#elm#make#GetCommand(buffer) abort
|
||||||
let l:elm_package = ale#path#FindNearestFile(a:buffer, 'elm-package.json')
|
let l:elm_package = ale#path#FindNearestFile(a:buffer, 'elm-package.json')
|
||||||
|
let l:elm_exe = ale_linters#elm#make#GetExecutable(a:buffer)
|
||||||
if empty(l:elm_package)
|
if empty(l:elm_package)
|
||||||
let l:dir_set_cmd = ''
|
let l:dir_set_cmd = ''
|
||||||
else
|
else
|
||||||
let l:root_dir = fnamemodify(l:elm_package, ':p:h')
|
let l:root_dir = fnamemodify(l:elm_package, ':p:h')
|
||||||
let l:dir_set_cmd = 'cd ' . fnameescape(l:root_dir) . ' && '
|
let l:dir_set_cmd = 'cd ' . ale#Escape(l:root_dir) . ' && '
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" The elm-make compiler, at the time of this writing, uses '/dev/null' as
|
" The elm-make 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. It does not use NUL on Windows.
|
||||||
" Source: https://github.com/elm-lang/elm-make/blob/master/src/Flags.hs
|
" Source: https://github.com/elm-lang/elm-make/blob/master/src/Flags.hs
|
||||||
let l:elm_cmd = 'elm-make --report=json --output='.shellescape('/dev/null')
|
let l:elm_cmd = ale#Escape(l:elm_exe)
|
||||||
|
\ . ' --report=json'
|
||||||
|
\ . ' --output=/dev/null'
|
||||||
|
|
||||||
return l:dir_set_cmd . ' ' . l:elm_cmd . ' %t'
|
return l:dir_set_cmd . ' ' . l:elm_cmd . ' %t'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('elm', {
|
call ale#linter#Define('elm', {
|
||||||
\ 'name': 'make',
|
\ 'name': 'make',
|
||||||
\ 'executable': 'elm-make',
|
\ 'executable_callback': 'ale_linters#elm#make#GetExecutable',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\ 'command_callback': 'ale_linters#elm#make#GetCommand',
|
\ 'command_callback': 'ale_linters#elm#make#GetCommand',
|
||||||
\ 'callback': 'ale_linters#elm#make#Handle'
|
\ 'callback': 'ale_linters#elm#make#Handle'
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ function! ale_linters#erlang#erlc#GetCommand(buffer) abort
|
|||||||
let l:output_file = tempname()
|
let l:output_file = tempname()
|
||||||
call ale#engine#ManageFile(a:buffer, l:output_file)
|
call ale#engine#ManageFile(a:buffer, l:output_file)
|
||||||
|
|
||||||
return 'erlc -o ' . fnameescape(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')
|
||||||
\ . ' %t'
|
\ . ' %t'
|
||||||
endfunction
|
endfunction
|
||||||
@@ -17,7 +17,7 @@ function! ale_linters#erlang#erlc#Handle(buffer, lines) abort
|
|||||||
" error.erl:4: variable 'B' is unbound
|
" error.erl:4: variable 'B' is unbound
|
||||||
" error.erl:3: Warning: function main/0 is unused
|
" error.erl:3: Warning: function main/0 is unused
|
||||||
" error.erl:4: Warning: variable 'A' is unused
|
" error.erl:4: Warning: variable 'A' is unused
|
||||||
let l:pattern = '\v^([^:]+):(\d+): (Warning: )?(.+)$'
|
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+): (Warning: )?(.+)$'
|
||||||
|
|
||||||
" parse_transforms are a special case. The error message does not indicate a location:
|
" parse_transforms are a special case. The error message does not indicate a location:
|
||||||
" error.erl: undefined parse transform 'some_parse_transform'
|
" error.erl: undefined parse transform 'some_parse_transform'
|
||||||
@@ -27,7 +27,7 @@ function! ale_linters#erlang#erlc#Handle(buffer, lines) abort
|
|||||||
let l:pattern_no_module_definition = '\v(no module definition)$'
|
let l:pattern_no_module_definition = '\v(no module definition)$'
|
||||||
let l:pattern_unused = '\v(.* is unused)$'
|
let l:pattern_unused = '\v(.* is unused)$'
|
||||||
|
|
||||||
let l:is_hrl = fnamemodify(bufname(a:buffer), ':e') ==# 'hrl'
|
let l:is_hrl = fnamemodify(bufname(a:buffer), ':e') is# 'hrl'
|
||||||
|
|
||||||
for l:line in a:lines
|
for l:line in a:lines
|
||||||
let l:match = matchlist(l:line, l:pattern)
|
let l:match = matchlist(l:line, l:pattern)
|
||||||
|
|||||||
53
ale_linters/erlang/syntaxerl.vim
Normal file
53
ale_linters/erlang/syntaxerl.vim
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
" Author: Dmitri Vereshchagin <dmitri.vereshchagin@gmail.com>
|
||||||
|
" Description: SyntaxErl linter for Erlang files
|
||||||
|
|
||||||
|
call ale#Set('erlang_syntaxerl_executable', 'syntaxerl')
|
||||||
|
|
||||||
|
|
||||||
|
function! ale_linters#erlang#syntaxerl#GetExecutable(buffer) abort
|
||||||
|
return ale#Var(a:buffer, 'erlang_syntaxerl_executable')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
return s:GetEscapedExecutable(a:buffer) . (l:use_b_option ? ' -b %s %t' : ' %t')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! ale_linters#erlang#syntaxerl#Handle(buffer, lines) abort
|
||||||
|
let l:pattern = '\v\C:(\d+):( warning:)? (.+)'
|
||||||
|
let l:loclist = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
call add(l:loclist, {
|
||||||
|
\ 'lnum': l:match[1] + 0,
|
||||||
|
\ 'text': l:match[3],
|
||||||
|
\ 'type': empty(l:match[2]) ? 'E' : 'W',
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:loclist
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! s:GetEscapedExecutable(buffer) abort
|
||||||
|
return ale#Escape(ale_linters#erlang#syntaxerl#GetExecutable(a:buffer))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
call ale#linter#Define('erlang', {
|
||||||
|
\ 'name': 'syntaxerl',
|
||||||
|
\ 'executable_callback': 'ale_linters#erlang#syntaxerl#GetExecutable',
|
||||||
|
\ 'command_chain': [
|
||||||
|
\ {'callback': 'ale_linters#erlang#syntaxerl#FeatureCheck'},
|
||||||
|
\ {'callback': 'ale_linters#erlang#syntaxerl#GetCommand'},
|
||||||
|
\ ],
|
||||||
|
\ 'callback': 'ale_linters#erlang#syntaxerl#Handle',
|
||||||
|
\})
|
||||||
25
ale_linters/eruby/erb.vim
Normal file
25
ale_linters/eruby/erb.vim
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
" Author: Matthias Guenther - https://wikimatze.de, Eddie Lebow https://github.com/elebow
|
||||||
|
" Description: ERB from the Ruby standard library, for eruby/erb files
|
||||||
|
|
||||||
|
function! ale_linters#eruby#erb#GetCommand(buffer) abort
|
||||||
|
let l:rails_root = ale#ruby#FindRailsRoot(a:buffer)
|
||||||
|
|
||||||
|
if empty(l:rails_root)
|
||||||
|
return 'erb -P -T - -x %t | ruby -c'
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Rails-flavored eRuby does not comply with the standard as understood by
|
||||||
|
" ERB, so we'll have to do some substitution. This does not reduce the
|
||||||
|
" effectiveness of the linter—the translated code is still evaluated.
|
||||||
|
return 'ruby -r erb -e ' . ale#Escape('puts ERB.new($stdin.read.gsub(%{<%=},%{<%}), nil, %{-}).src') . '< %t | ruby -c'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('eruby', {
|
||||||
|
\ 'name': 'erb',
|
||||||
|
\ 'aliases': ['erubylint'],
|
||||||
|
\ 'executable': 'erb',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'command_callback': 'ale_linters#eruby#erb#GetCommand',
|
||||||
|
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
|
||||||
|
\})
|
||||||
|
|
||||||
35
ale_linters/eruby/erubi.vim
Normal file
35
ale_linters/eruby/erubi.vim
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
" Author: Eddie Lebow https://github.com/elebow
|
||||||
|
" Description: eruby checker using `erubi`
|
||||||
|
|
||||||
|
function! ale_linters#eruby#erubi#CheckErubi(buffer) 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)
|
||||||
|
|
||||||
|
if (!empty(a:check_erubi_output))
|
||||||
|
" The empty command in CheckErubi returns nothing if erubi runs and
|
||||||
|
" emits an error if erubi is not present
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
|
||||||
|
if empty(l:rails_root)
|
||||||
|
return 'ruby -r erubi/capture_end -e ' . ale#Escape('puts Erubi::CaptureEndEngine.new($stdin.read).src') . '< %t | ruby -c'
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Rails-flavored eRuby does not comply with the standard as understood by
|
||||||
|
" Erubi, so we'll have to do some substitution. This does not reduce the
|
||||||
|
" effectiveness of the linter---the translated code is still evaluated.
|
||||||
|
return 'ruby -r erubi/capture_end -e ' . ale#Escape('puts Erubi::CaptureEndEngine.new($stdin.read.gsub(%{<%=},%{<%}), nil, %{-}).src') . '< %t | ruby -c'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('eruby', {
|
||||||
|
\ 'name': 'erubi',
|
||||||
|
\ 'executable': 'ruby',
|
||||||
|
\ 'command_chain': [
|
||||||
|
\ {'callback': 'ale_linters#eruby#erubi#CheckErubi'},
|
||||||
|
\ {'callback': 'ale_linters#eruby#erubi#GetCommand', 'output_stream': 'stderr'},
|
||||||
|
\ ],
|
||||||
|
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
|
||||||
|
\})
|
||||||
23
ale_linters/eruby/erubis.vim
Normal file
23
ale_linters/eruby/erubis.vim
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
" Author: Jake Zimmerman <jake@zimmerman.io>, Eddie Lebow https://github.com/elebow
|
||||||
|
" Description: eruby checker using `erubis`, instead of `erb`
|
||||||
|
|
||||||
|
function! ale_linters#eruby#erubis#GetCommand(buffer) abort
|
||||||
|
let l:rails_root = ale#ruby#FindRailsRoot(a:buffer)
|
||||||
|
|
||||||
|
if empty(l:rails_root)
|
||||||
|
return 'erubis -x %t | ruby -c'
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Rails-flavored eRuby does not comply with the standard as understood by
|
||||||
|
" Erubis, so we'll have to do some substitution. This does not reduce the
|
||||||
|
" effectiveness of the linter - the translated code is still evaluated.
|
||||||
|
return 'ruby -r erubis -e ' . ale#Escape('puts Erubis::Eruby.new($stdin.read.gsub(%{<%=},%{<%})).src') . '< %t | ruby -c'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('eruby', {
|
||||||
|
\ 'name': 'erubis',
|
||||||
|
\ 'executable': 'erubis',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'command_callback': 'ale_linters#eruby#erubis#GetCommand',
|
||||||
|
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
|
||||||
|
\})
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
" Author: Matthias Guenther - https://wikimatze.de
|
|
||||||
" Description: erb-lint for eruby/erb files
|
|
||||||
|
|
||||||
call ale#linter#Define('eruby', {
|
|
||||||
\ 'name': 'erubylint',
|
|
||||||
\ 'executable': 'erb',
|
|
||||||
\ 'output_stream': 'stderr',
|
|
||||||
\ 'command': 'erb -P -x %t | ruby -c',
|
|
||||||
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
|
|
||||||
\})
|
|
||||||
|
|
||||||
67
ale_linters/fish/fish.vim
Normal file
67
ale_linters/fish/fish.vim
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
" Author: Niraj Thapaliya - https://github.com/nthapaliya
|
||||||
|
" Description: Lints fish files using fish -n
|
||||||
|
|
||||||
|
function! ale_linters#fish#fish#Handle(buffer, lines) abort
|
||||||
|
" Matches patterns such as:
|
||||||
|
"
|
||||||
|
" home/.config/fish/functions/foo.fish (line 1): Missing end to balance this function definition
|
||||||
|
" function foo
|
||||||
|
" ^
|
||||||
|
"
|
||||||
|
" OR, patterns such as:
|
||||||
|
"
|
||||||
|
" Unsupported use of '||'. In fish, please use 'COMMAND; or COMMAND'.
|
||||||
|
" /tmp/vLz620o/258/test.fish (line 2): if set -q SSH_CLIENT || set -q SSH_TTY
|
||||||
|
" ^
|
||||||
|
"
|
||||||
|
" fish -n can return errors in either format.
|
||||||
|
let l:pattern = '^\(.* (line \(\d\+\)): \)\(.*\)$'
|
||||||
|
let l:column_pattern = '^ *\^'
|
||||||
|
let l:output = []
|
||||||
|
let l:column_offset = 0
|
||||||
|
let l:last_line_with_message = ''
|
||||||
|
|
||||||
|
for l:line in a:lines
|
||||||
|
" Look for error lines first.
|
||||||
|
let l:match = matchlist(l:line, l:pattern)
|
||||||
|
|
||||||
|
if !empty(l:match)
|
||||||
|
if !empty(l:last_line_with_message)
|
||||||
|
let l:text = l:last_line_with_message
|
||||||
|
else
|
||||||
|
let l:text = l:match[3]
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:column_offset = len(l:match[1])
|
||||||
|
|
||||||
|
let l:last_line_with_message = ''
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'col': 0,
|
||||||
|
\ 'lnum': str2nr(l:match[2]),
|
||||||
|
\ 'text': l:text,
|
||||||
|
\})
|
||||||
|
else
|
||||||
|
" Look for column markers like ' ^' second.
|
||||||
|
" The column index will be set according to how long the line is.
|
||||||
|
let l:column_match = matchstr(l:line, l:column_pattern)
|
||||||
|
|
||||||
|
if !empty(l:column_match) && !empty(l:output)
|
||||||
|
let l:output[-1].col = len(l:column_match) - l:column_offset
|
||||||
|
let l:last_line_with_message = ''
|
||||||
|
else
|
||||||
|
let l:last_line_with_message = l:line
|
||||||
|
let l:column_offset = 0
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('fish', {
|
||||||
|
\ 'name': 'fish',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'executable': 'fish',
|
||||||
|
\ 'command': 'fish -n %t',
|
||||||
|
\ 'callback': 'ale_linters#fish#fish#Handle',
|
||||||
|
\})
|
||||||
@@ -44,7 +44,7 @@ function! ale_linters#fortran#gcc#Handle(buffer, lines) abort
|
|||||||
|
|
||||||
" Now we have the text, we can set it and add the error.
|
" Now we have the text, we can set it and add the error.
|
||||||
let l:last_loclist_obj.text = l:match[2]
|
let l:last_loclist_obj.text = l:match[2]
|
||||||
let l:last_loclist_obj.type = l:match[1] ==# 'Warning' ? 'W' : 'E'
|
let l:last_loclist_obj.type = l:match[1] is# 'Warning' ? 'W' : 'E'
|
||||||
call add(l:output, l:last_loclist_obj)
|
call add(l:output, l:last_loclist_obj)
|
||||||
else
|
else
|
||||||
let l:last_loclist_obj = {
|
let l:last_loclist_obj = {
|
||||||
|
|||||||
9
ale_linters/fountain/proselint.vim
Normal file
9
ale_linters/fountain/proselint.vim
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
" Author: Jansen Mitchell https://github.com/JansenMitchell
|
||||||
|
" Description: proselint for Fountain files
|
||||||
|
|
||||||
|
call ale#linter#Define('fountain', {
|
||||||
|
\ 'name': 'proselint',
|
||||||
|
\ 'executable': 'proselint',
|
||||||
|
\ 'command': 'proselint %t',
|
||||||
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
|
\})
|
||||||
41
ale_linters/fuse/fusionlint.vim
Normal file
41
ale_linters/fuse/fusionlint.vim
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
" Author: RyanSquared <vandor2012@gmail.com>
|
||||||
|
" Description: `fusion-lint` linter for FusionScript files
|
||||||
|
|
||||||
|
let g:ale_fuse_fusionlint_executable =
|
||||||
|
\ get(g:, 'ale_fuse_fusionlint_executable', 'fusion-lint')
|
||||||
|
|
||||||
|
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
|
||||||
|
return ale#Escape(ale_linters#fuse#fusionlint#GetExecutable(a:buffer))
|
||||||
|
\ . ' ' . ale#Var(a:buffer, 'fuse_fusionlint_options')
|
||||||
|
\ . ' --filename %s -i'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#fuse#fusionlint#Handle(buffer, lines) abort
|
||||||
|
let l:pattern = '^.*:\(\d\+\):\(\d\+\): (\([WE]\)\d\+) \(.\+\)$'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': l:match[1] + 0,
|
||||||
|
\ 'col': l:match[2] + 0,
|
||||||
|
\ 'text': l:match[4],
|
||||||
|
\ 'type': l:match[3],
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('fuse', {
|
||||||
|
\ 'name': 'fusionlint',
|
||||||
|
\ 'executable_callback': 'ale_linters#fuse#fusionlint#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale_linters#fuse#fusionlint#GetCommand',
|
||||||
|
\ 'callback': 'ale_linters#fuse#fusionlint#Handle',
|
||||||
|
\})
|
||||||
52
ale_linters/gitcommit/gitlint.vim
Normal file
52
ale_linters/gitcommit/gitlint.vim
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
" Author: Nick Yamane <nick.diego@gmail.com>
|
||||||
|
" Description: gitlint for git commit message files
|
||||||
|
|
||||||
|
let g:ale_gitcommit_gitlint_executable =
|
||||||
|
\ get(g:, 'ale_gitcommit_gitlint_executable', 'gitlint')
|
||||||
|
let g:ale_gitcommit_gitlint_options = get(g:, 'ale_gitcommit_gitlint_options', '')
|
||||||
|
let g:ale_gitcommit_gitlint_use_global = get(g:, 'ale_gitcommit_gitlint_use_global', 0)
|
||||||
|
|
||||||
|
|
||||||
|
function! ale_linters#gitcommit#gitlint#GetExecutable(buffer) abort
|
||||||
|
return ale#python#FindExecutable(a:buffer, 'gitcommit_gitlint', ['gitlint'])
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#gitcommit#gitlint#GetCommand(buffer) abort
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
function! ale_linters#gitcommit#gitlint#Handle(buffer, lines) abort
|
||||||
|
" Matches patterns line the following:
|
||||||
|
let l:pattern = '\v^(\d+): (\w+) (.*)$'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
let l:code = l:match[2]
|
||||||
|
|
||||||
|
let l:item = {
|
||||||
|
\ 'lnum': l:match[1] + 0,
|
||||||
|
\ 'text': l:match[3],
|
||||||
|
\ 'code': l:code,
|
||||||
|
\ 'type': 'E',
|
||||||
|
\}
|
||||||
|
|
||||||
|
call add(l:output, l:item)
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
call ale#linter#Define('gitcommit', {
|
||||||
|
\ 'name': 'gitlint',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'executable_callback': 'ale_linters#gitcommit#gitlint#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale_linters#gitcommit#gitlint#GetCommand',
|
||||||
|
\ 'callback': 'ale_linters#gitcommit#gitlint#Handle',
|
||||||
|
\})
|
||||||
|
|
||||||
46
ale_linters/glsl/glslang.vim
Normal file
46
ale_linters/glsl/glslang.vim
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
" Author: Sven-Hendrik Haase <svenstaro@gmail.com>
|
||||||
|
" Description: glslang-based linter for glsl files
|
||||||
|
"
|
||||||
|
" TODO: Once https://github.com/KhronosGroup/glslang/pull/1047 is accepted,
|
||||||
|
" we can use stdin.
|
||||||
|
|
||||||
|
let g:ale_glsl_glslang_executable =
|
||||||
|
\ get(g:, 'ale_glsl_glslang_executable', 'glslangValidator')
|
||||||
|
|
||||||
|
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
|
||||||
|
return ale_linters#glsl#glslang#GetExecutable(a:buffer)
|
||||||
|
\ . ' ' . ale#Var(a:buffer, 'glsl_glslang_options')
|
||||||
|
\ . ' ' . '-C %t'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#glsl#glslang#Handle(buffer, lines) abort
|
||||||
|
" Matches patterns like the following:
|
||||||
|
"
|
||||||
|
" ERROR: 0:5: 'foo' : undeclared identifier
|
||||||
|
let l:pattern = '^\(.\+\): \(\d\+\):\(\d\+\): \(.\+\)'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': str2nr(l:match[3]),
|
||||||
|
\ 'col': str2nr(l:match[2]),
|
||||||
|
\ 'text': l:match[4],
|
||||||
|
\ 'type': l:match[1] is# 'ERROR' ? 'E' : 'W',
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('glsl', {
|
||||||
|
\ 'name': 'glslang',
|
||||||
|
\ 'executable_callback': 'ale_linters#glsl#glslang#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale_linters#glsl#glslang#GetCommand',
|
||||||
|
\ 'callback': 'ale_linters#glsl#glslang#Handle',
|
||||||
|
\})
|
||||||
38
ale_linters/glsl/glslls.vim
Normal file
38
ale_linters/glsl/glslls.vim
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
" Author: Sven-Hendrik Haase <svenstaro@gmail.com>
|
||||||
|
" Description: A language server for glsl
|
||||||
|
|
||||||
|
call ale#Set('glsl_glslls_executable', 'glslls')
|
||||||
|
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
|
||||||
|
let l:executable = ale_linters#glsl#glslls#GetExecutable(a:buffer)
|
||||||
|
let l:logfile = ale#Var(a:buffer, 'glsl_glslls_logfile')
|
||||||
|
let l:logfile_args = ''
|
||||||
|
if l:logfile isnot# ''
|
||||||
|
let l:logfile_args = ' --verbose -l ' . l:logfile
|
||||||
|
endif
|
||||||
|
return ale#Escape(l:executable) . l:logfile_args . ' --stdin'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#glsl#glslls#GetLanguage(buffer) abort
|
||||||
|
return 'glsl'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#glsl#glslls#GetProjectRoot(buffer) abort
|
||||||
|
let l:project_root = ale#c#FindProjectRoot(a:buffer)
|
||||||
|
|
||||||
|
return !empty(l:project_root) ? fnamemodify(l:project_root, ':h:h') : ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('glsl', {
|
||||||
|
\ 'name': 'glslls',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable_callback': 'ale_linters#glsl#glslls#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale_linters#glsl#glslls#GetCommand',
|
||||||
|
\ 'language_callback': 'ale_linters#glsl#glslls#GetLanguage',
|
||||||
|
\ 'project_root_callback': 'ale_linters#glsl#glslls#GetProjectRoot',
|
||||||
|
\})
|
||||||
@@ -1,8 +1,14 @@
|
|||||||
" Author: Joshua Rubin <joshua@rubixconsulting.com>, Ben Reedy <https://github.com/breed808>
|
" Author: Joshua Rubin <joshua@rubixconsulting.com>, Ben Reedy <https://github.com/breed808>,
|
||||||
|
" Jeff Willette <jrwillette88@gmail.com>
|
||||||
" 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_gobuild_options', '')
|
||||||
|
|
||||||
|
function! ale_linters#go#gobuild#ResetEnv() abort
|
||||||
|
unlet! s:go_env
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#go#gobuild#GoEnv(buffer) abort
|
function! ale_linters#go#gobuild#GoEnv(buffer) abort
|
||||||
if exists('s:go_env')
|
if exists('s:go_env')
|
||||||
return ''
|
return ''
|
||||||
@@ -12,6 +18,8 @@ function! ale_linters#go#gobuild#GoEnv(buffer) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#go#gobuild#GetCommand(buffer, goenv_output) abort
|
function! ale_linters#go#gobuild#GetCommand(buffer, goenv_output) abort
|
||||||
|
let l:options = ale#Var(a:buffer, 'go_gobuild_options')
|
||||||
|
|
||||||
if !exists('s:go_env')
|
if !exists('s:go_env')
|
||||||
let s:go_env = {
|
let s:go_env = {
|
||||||
\ 'GOPATH': a:goenv_output[0],
|
\ 'GOPATH': a:goenv_output[0],
|
||||||
@@ -19,10 +27,16 @@ function! ale_linters#go#gobuild#GetCommand(buffer, goenv_output) abort
|
|||||||
\}
|
\}
|
||||||
endif
|
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 'GOPATH=' . s:go_env.GOPATH
|
return l:gopath_env_command
|
||||||
\ . ' cd ' . fnamemodify(bufname(a:buffer), ':.:h')
|
\ . ale#path#BufferCdString(a:buffer)
|
||||||
\ . ' && go test -c -o /dev/null ./'
|
\ . 'go test'
|
||||||
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
|
\ . ' -c -o /dev/null ./'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#go#gobuild#GetMatches(lines) abort
|
function! ale_linters#go#gobuild#GetMatches(lines) abort
|
||||||
@@ -39,15 +53,12 @@ function! ale_linters#go#gobuild#GetMatches(lines) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#go#gobuild#Handler(buffer, lines) abort
|
function! ale_linters#go#gobuild#Handler(buffer, lines) abort
|
||||||
|
let l:dir = expand('#' . a:buffer . ':p:h')
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
for l:match in ale_linters#go#gobuild#GetMatches(a:lines)
|
for l:match in ale_linters#go#gobuild#GetMatches(a:lines)
|
||||||
" Omit errors from imported go packages
|
|
||||||
if !ale#path#IsBufferPath(a:buffer, l:match[1])
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
|
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
|
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
|
||||||
\ 'lnum': l:match[2] + 0,
|
\ 'lnum': l:match[2] + 0,
|
||||||
\ 'col': l:match[3] + 0,
|
\ 'col': l:match[3] + 0,
|
||||||
\ 'text': l:match[4],
|
\ 'text': l:match[4],
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
call ale#linter#Define('go', {
|
call ale#linter#Define('go', {
|
||||||
\ 'name': 'golint',
|
\ 'name': 'golint',
|
||||||
|
\ 'output_stream': 'both',
|
||||||
\ 'executable': 'golint',
|
\ 'executable': 'golint',
|
||||||
\ 'command': 'golint %t',
|
\ 'command': 'golint %t',
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
|
|||||||
@@ -1,14 +1,32 @@
|
|||||||
" Author: Ben Reedy <https://github.com/breed808>
|
" Author: Ben Reedy <https://github.com/breed808>, Jeff Willette <jrwillette88@gmail.com>
|
||||||
" Description: Adds support for the gometalinter suite for Go files
|
" Description: Adds support for the gometalinter suite for Go files
|
||||||
|
|
||||||
if !exists('g:ale_go_gometalinter_options')
|
call ale#Set('go_gometalinter_options', '')
|
||||||
let g:ale_go_gometalinter_options = ''
|
call ale#Set('go_gometalinter_executable', 'gometalinter')
|
||||||
endif
|
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
|
||||||
return 'gometalinter '
|
let l:executable = ale_linters#go#gometalinter#GetExecutable(a:buffer)
|
||||||
\ . ale#Var(a:buffer, 'go_gometalinter_options')
|
let l:filename = expand('#' . a:buffer . ':t')
|
||||||
\ . ' ' . fnameescape(fnamemodify(bufname(a:buffer), ':p:h'))
|
let l:options = ale#Var(a:buffer, 'go_gometalinter_options')
|
||||||
|
let l:lint_package = ale#Var(a:buffer, 'go_gometalinter_lint_package')
|
||||||
|
|
||||||
|
" BufferCdString is used so that we can be sure the paths output from gometalinter can
|
||||||
|
" be calculated to absolute paths in the Handler
|
||||||
|
if l:lint_package
|
||||||
|
return ale#path#BufferCdString(a:buffer)
|
||||||
|
\ . ale#Escape(l:executable)
|
||||||
|
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ale#path#BufferCdString(a:buffer)
|
||||||
|
\ . ale#Escape(l:executable)
|
||||||
|
\ . ' --include=' . ale#Escape(ale#util#EscapePCRE(l:filename))
|
||||||
|
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#go#gometalinter#GetMatches(lines) abort
|
function! ale_linters#go#gometalinter#GetMatches(lines) abort
|
||||||
@@ -18,18 +36,16 @@ function! ale_linters#go#gometalinter#GetMatches(lines) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#go#gometalinter#Handler(buffer, lines) abort
|
function! ale_linters#go#gometalinter#Handler(buffer, lines) abort
|
||||||
|
let l:dir = expand('#' . a:buffer . ':p:h')
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
for l:match in ale_linters#go#gometalinter#GetMatches(a:lines)
|
for l:match in ale_linters#go#gometalinter#GetMatches(a:lines)
|
||||||
" Omit errors from files other than the one currently open
|
" l:match[1] will already be an absolute path, output from gometalinter
|
||||||
if ale#path#IsBufferPath(a:buffer, l:match[0])
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
|
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
|
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
|
||||||
\ 'lnum': l:match[2] + 0,
|
\ 'lnum': l:match[2] + 0,
|
||||||
\ 'col': l:match[3] + 0,
|
\ 'col': l:match[3] + 0,
|
||||||
\ 'type': tolower(l:match[4]) ==# 'warning' ? 'W' : 'E',
|
\ 'type': tolower(l:match[4]) is# 'warning' ? 'W' : 'E',
|
||||||
\ 'text': l:match[5],
|
\ 'text': l:match[5],
|
||||||
\})
|
\})
|
||||||
endfor
|
endfor
|
||||||
@@ -39,7 +55,7 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('go', {
|
call ale#linter#Define('go', {
|
||||||
\ 'name': 'gometalinter',
|
\ 'name': 'gometalinter',
|
||||||
\ 'executable': 'gometalinter',
|
\ 'executable_callback': 'ale_linters#go#gometalinter#GetExecutable',
|
||||||
\ 'command_callback': 'ale_linters#go#gometalinter#GetCommand',
|
\ 'command_callback': 'ale_linters#go#gometalinter#GetCommand',
|
||||||
\ 'callback': 'ale_linters#go#gometalinter#Handler',
|
\ 'callback': 'ale_linters#go#gometalinter#Handler',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
" Author: Ben Reedy <https://github.com/breed808>
|
" Author: Ben Reedy <https://github.com/breed808>
|
||||||
" Description: gosimple for Go files
|
" Description: gosimple for Go files
|
||||||
|
|
||||||
|
function! ale_linters#go#gosimple#GetCommand(buffer) abort
|
||||||
|
return ale#path#BufferCdString(a:buffer) . ' gosimple .'
|
||||||
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('go', {
|
call ale#linter#Define('go', {
|
||||||
\ 'name': 'gosimple',
|
\ 'name': 'gosimple',
|
||||||
\ 'executable': 'gosimple',
|
\ 'executable': 'gosimple',
|
||||||
\ 'command': 'gosimple %t',
|
\ 'command_callback': 'ale_linters#go#gosimple#GetCommand',
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
\ 'callback': 'ale#handlers#go#Handler',
|
||||||
|
\ 'output_stream': 'both',
|
||||||
|
\ 'lint_file': 1,
|
||||||
\})
|
\})
|
||||||
|
|||||||
20
ale_linters/go/gotype.vim
Normal file
20
ale_linters/go/gotype.vim
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
" Author: Jelte Fennema <github-public@jeltef.nl>
|
||||||
|
" Description: gotype for Go files
|
||||||
|
|
||||||
|
function! ale_linters#go#gotype#GetCommand(buffer) abort
|
||||||
|
if expand('#' . a:buffer . ':p') =~# '_test\.go$'
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
return ale#path#BufferCdString(a:buffer) . ' gotype .'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('go', {
|
||||||
|
\ 'name': 'gotype',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'executable': 'gotype',
|
||||||
|
\ 'command_callback': 'ale_linters#go#gotype#GetCommand',
|
||||||
|
\ 'callback': 'ale#handlers#go#Handler',
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\})
|
||||||
@@ -1,10 +1,18 @@
|
|||||||
" Author: neersighted <bjorn@neersighted.com>
|
" Author: neersighted <bjorn@neersighted.com>
|
||||||
" Description: go vet for Go files
|
" Description: go vet for Go files
|
||||||
|
"
|
||||||
|
" Author: John Eikenberry <jae@zhar.net>
|
||||||
|
" Description: updated to work with go1.10
|
||||||
|
|
||||||
|
function! ale_linters#go#govet#GetCommand(buffer) abort
|
||||||
|
return ale#path#BufferCdString(a:buffer) . ' go vet .'
|
||||||
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('go', {
|
call ale#linter#Define('go', {
|
||||||
\ 'name': 'go vet',
|
\ 'name': 'go vet',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable': 'go',
|
\ 'executable': 'go',
|
||||||
\ 'command': 'go vet %t',
|
\ 'command_callback': 'ale_linters#go#govet#GetCommand',
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsError',
|
\ 'callback': 'ale#handlers#go#Handler',
|
||||||
|
\ 'lint_file': 1,
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -1,9 +1,33 @@
|
|||||||
" Author: Ben Reedy <https://github.com/breed808>
|
" Author: Ben Reedy <https://github.com/breed808>
|
||||||
" Description: staticcheck for Go files
|
" Description: staticcheck for Go files
|
||||||
|
|
||||||
|
call ale#Set('go_staticcheck_options', '')
|
||||||
|
call ale#Set('go_staticcheck_lint_package', 0)
|
||||||
|
|
||||||
|
function! ale_linters#go#staticcheck#GetCommand(buffer) abort
|
||||||
|
let l:filename = expand('#' . a:buffer . ':t')
|
||||||
|
let l:options = ale#Var(a:buffer, 'go_staticcheck_options')
|
||||||
|
let l:lint_package = ale#Var(a:buffer, 'go_staticcheck_lint_package')
|
||||||
|
|
||||||
|
" BufferCdString is used so that we can be sure the paths output from
|
||||||
|
" staticcheck can be calculated to absolute paths in the Handler
|
||||||
|
if l:lint_package
|
||||||
|
return ale#path#BufferCdString(a:buffer)
|
||||||
|
\ . 'staticcheck'
|
||||||
|
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ale#path#BufferCdString(a:buffer)
|
||||||
|
\ . 'staticcheck'
|
||||||
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
|
\ . ' ' . ale#Escape(l:filename)
|
||||||
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('go', {
|
call ale#linter#Define('go', {
|
||||||
\ 'name': 'staticcheck',
|
\ 'name': 'staticcheck',
|
||||||
\ 'executable': 'staticcheck',
|
\ 'executable': 'staticcheck',
|
||||||
\ 'command': 'staticcheck %t',
|
\ 'command_callback': 'ale_linters#go#staticcheck#GetCommand',
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
\ 'callback': 'ale#handlers#go#Handler',
|
||||||
|
\ 'output_stream': 'both',
|
||||||
|
\ 'lint_file': 1,
|
||||||
\})
|
\})
|
||||||
|
|||||||
9
ale_linters/graphql/eslint.vim
Normal file
9
ale_linters/graphql/eslint.vim
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
" Author: Benjie Gillam <code@benjiegillam.com>
|
||||||
|
" Description: eslint for GraphQL files
|
||||||
|
|
||||||
|
call ale#linter#Define('graphql', {
|
||||||
|
\ 'name': 'eslint',
|
||||||
|
\ 'executable_callback': 'ale#handlers#eslint#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale#handlers#eslint#GetCommand',
|
||||||
|
\ 'callback': 'ale#handlers#eslint#Handle',
|
||||||
|
\})
|
||||||
9
ale_linters/graphql/gqlint.vim
Normal file
9
ale_linters/graphql/gqlint.vim
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
" Author: Michiel Westerbeek <happylinks@gmail.com>
|
||||||
|
" Description: Linter for GraphQL Schemas
|
||||||
|
|
||||||
|
call ale#linter#Define('graphql', {
|
||||||
|
\ 'name': 'gqlint',
|
||||||
|
\ 'executable': 'gqlint',
|
||||||
|
\ 'command': 'gqlint --reporter=simple %t',
|
||||||
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
|
\})
|
||||||
@@ -1,6 +1,31 @@
|
|||||||
" Author: Patrick Lewis - https://github.com/patricklewis
|
" Author: Patrick Lewis - https://github.com/patricklewis, thenoseman - https://github.com/thenoseman
|
||||||
" Description: haml-lint for Haml files
|
" Description: haml-lint for Haml files
|
||||||
|
|
||||||
|
function! ale_linters#haml#hamllint#GetCommand(buffer) abort
|
||||||
|
let l:prefix = ''
|
||||||
|
|
||||||
|
let l:rubocop_config_file_path = ale#path#FindNearestFile(a:buffer, '.rubocop.yml')
|
||||||
|
let l:hamllint_config_file_path = ale#path#FindNearestFile(a:buffer, '.haml-lint.yml')
|
||||||
|
|
||||||
|
" Set HAML_LINT_RUBOCOP_CONF variable as it is needed for haml-lint to
|
||||||
|
" pick up the rubocop config.
|
||||||
|
"
|
||||||
|
" See https://github.com/brigade/haml-lint/blob/master/lib/haml_lint/linter/rubocop.rb#L89
|
||||||
|
" HamlLint::Linter::RuboCop#rubocop_flags
|
||||||
|
if !empty(l:rubocop_config_file_path)
|
||||||
|
if ale#Has('win32')
|
||||||
|
let l:prefix = 'set HAML_LINT_RUBOCOP_CONF=' . ale#Escape(l:rubocop_config_file_path) . ' &&'
|
||||||
|
else
|
||||||
|
let l:prefix = 'HAML_LINT_RUBOCOP_CONF=' . ale#Escape(l:rubocop_config_file_path)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
return (!empty(l:prefix) ? l:prefix . ' ' : '')
|
||||||
|
\ . 'haml-lint'
|
||||||
|
\ . (!empty(l:hamllint_config_file_path) ? ' --config ' . ale#Escape(l:hamllint_config_file_path) : '')
|
||||||
|
\ . ' %t'
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#haml#hamllint#Handle(buffer, lines) abort
|
function! ale_linters#haml#hamllint#Handle(buffer, lines) abort
|
||||||
" Matches patterns like the following:
|
" Matches patterns like the following:
|
||||||
" <path>:51 [W] RuboCop: Use the new Ruby 1.9 hash syntax.
|
" <path>:51 [W] RuboCop: Use the new Ruby 1.9 hash syntax.
|
||||||
@@ -21,6 +46,6 @@ endfunction
|
|||||||
call ale#linter#Define('haml', {
|
call ale#linter#Define('haml', {
|
||||||
\ 'name': 'hamllint',
|
\ 'name': 'hamllint',
|
||||||
\ 'executable': 'haml-lint',
|
\ 'executable': 'haml-lint',
|
||||||
\ 'command': 'haml-lint %t',
|
\ 'command_callback': 'ale_linters#haml#hamllint#GetCommand',
|
||||||
\ 'callback': 'ale_linters#haml#hamllint#Handle'
|
\ 'callback': 'ale_linters#haml#hamllint#Handle'
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -1,22 +1,13 @@
|
|||||||
" Author: Adrian Zalewski <aazalewski@hotmail.com>
|
" Author: Adrian Zalewski <aazalewski@hotmail.com>
|
||||||
" Description: Ember-template-lint for checking Handlebars files
|
" Description: Ember-template-lint for checking Handlebars files
|
||||||
|
|
||||||
let g:ale_handlebars_embertemplatelint_executable =
|
call ale#Set('handlebars_embertemplatelint_executable', 'ember-template-lint')
|
||||||
\ get(g:, 'ale_handlebars_embertemplatelint_executable', 'ember-template-lint')
|
call ale#Set('handlebars_embertemplatelint_use_global', 0)
|
||||||
|
|
||||||
let g:ale_handlebars_embertemplatelint_use_global =
|
|
||||||
\ get(g:, 'ale_handlebars_embertemplatelint_use_global', 0)
|
|
||||||
|
|
||||||
function! ale_linters#handlebars#embertemplatelint#GetExecutable(buffer) abort
|
function! ale_linters#handlebars#embertemplatelint#GetExecutable(buffer) abort
|
||||||
if ale#Var(a:buffer, 'handlebars_embertemplatelint_use_global')
|
return ale#node#FindExecutable(a:buffer, 'handlebars_embertemplatelint', [
|
||||||
return ale#Var(a:buffer, 'handlebars_embertemplatelint_executable')
|
|
||||||
endif
|
|
||||||
|
|
||||||
return ale#path#ResolveLocalPath(
|
|
||||||
\ a:buffer,
|
|
||||||
\ 'node_modules/.bin/ember-template-lint',
|
\ 'node_modules/.bin/ember-template-lint',
|
||||||
\ ale#Var(a:buffer, 'handlebars_embertemplatelint_executable')
|
\])
|
||||||
\)
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#handlebars#embertemplatelint#GetCommand(buffer) abort
|
function! ale_linters#handlebars#embertemplatelint#GetCommand(buffer) abort
|
||||||
@@ -25,23 +16,25 @@ function! ale_linters#handlebars#embertemplatelint#GetCommand(buffer) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#handlebars#embertemplatelint#Handle(buffer, lines) abort
|
function! ale_linters#handlebars#embertemplatelint#Handle(buffer, lines) abort
|
||||||
if len(a:lines) == 0
|
|
||||||
return []
|
|
||||||
endif
|
|
||||||
|
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
let l:json = ale#util#FuzzyJSONDecode(a:lines, {})
|
||||||
|
|
||||||
let l:input_json = json_decode(join(a:lines, ''))
|
for l:error in get(values(l:json), 0, [])
|
||||||
let l:file_errors = values(l:input_json)[0]
|
if has_key(l:error, 'fatal')
|
||||||
|
call add(l:output, {
|
||||||
for l:error in l:file_errors
|
\ 'lnum': get(l:error, 'line', 1),
|
||||||
call add(l:output, {
|
\ 'col': get(l:error, 'column', 1),
|
||||||
\ 'bufnr': a:buffer,
|
\ 'text': l:error.message,
|
||||||
\ 'lnum': l:error.line,
|
\ 'type': l:error.severity == 1 ? 'W' : 'E',
|
||||||
\ 'col': l:error.column,
|
\})
|
||||||
\ 'text': l:error.rule . ': ' . l:error.message,
|
else
|
||||||
\ 'type': l:error.severity == 1 ? 'W' : 'E',
|
call add(l:output, {
|
||||||
\})
|
\ 'lnum': l:error.line,
|
||||||
|
\ 'col': l:error.column,
|
||||||
|
\ 'text': l:error.rule . ': ' . l:error.message,
|
||||||
|
\ 'type': l:error.severity == 1 ? 'W' : 'E',
|
||||||
|
\})
|
||||||
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
return l:output
|
return l:output
|
||||||
|
|||||||
16
ale_linters/haskell/ghc-mod.vim
Normal file
16
ale_linters/haskell/ghc-mod.vim
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
" Author: wizzup <wizzup@gmail.com>
|
||||||
|
" Description: ghc-mod for Haskell files
|
||||||
|
|
||||||
|
call ale#linter#Define('haskell', {
|
||||||
|
\ 'name': 'ghc-mod',
|
||||||
|
\ 'executable': 'ghc-mod',
|
||||||
|
\ 'command': 'ghc-mod --map-file %s=%t check %s',
|
||||||
|
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||||
|
\})
|
||||||
|
|
||||||
|
call ale#linter#Define('haskell', {
|
||||||
|
\ 'name': 'stack-ghc-mod',
|
||||||
|
\ 'executable': 'stack',
|
||||||
|
\ 'command': 'stack exec ghc-mod -- --map-file %s=%t check %s',
|
||||||
|
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||||
|
\})
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
" Author: w0rp <devw0rp@gmail.com>
|
" Author: w0rp <devw0rp@gmail.com>
|
||||||
" Description: ghc for Haskell files
|
" Description: ghc for Haskell files
|
||||||
|
|
||||||
|
call ale#Set('haskell_ghc_options', '-fno-code -v0')
|
||||||
|
|
||||||
|
function! ale_linters#haskell#ghc#GetCommand(buffer) abort
|
||||||
|
return 'ghc '
|
||||||
|
\ . ale#Var(a:buffer, 'haskell_ghc_options')
|
||||||
|
\ . ' %t'
|
||||||
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('haskell', {
|
call ale#linter#Define('haskell', {
|
||||||
\ 'name': 'ghc',
|
\ 'name': 'ghc',
|
||||||
\ 'output_stream': 'stderr',
|
\ 'output_stream': 'stderr',
|
||||||
\ 'executable': 'ghc',
|
\ 'executable': 'ghc',
|
||||||
\ 'command': 'ghc -fno-code -v0 %t',
|
\ 'command_callback': 'ale_linters#haskell#ghc#GetCommand',
|
||||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
|
||||||
\})
|
|
||||||
|
|
||||||
call ale#linter#Define('haskell', {
|
|
||||||
\ 'name': 'stack-ghc',
|
|
||||||
\ 'output_stream': 'stderr',
|
|
||||||
\ 'executable': 'stack',
|
|
||||||
\ 'command': 'stack ghc -- -fno-code -v0 %t',
|
|
||||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -1,9 +1,22 @@
|
|||||||
" Author: rob-b
|
" Author: rob-b, Takano Akio <tak@anoak.io>
|
||||||
" Description: hdevtools for Haskell files
|
" Description: hdevtools for Haskell files
|
||||||
|
|
||||||
|
call ale#Set('haskell_hdevtools_executable', 'hdevtools')
|
||||||
|
call ale#Set('haskell_hdevtools_options', '-g -Wall')
|
||||||
|
|
||||||
|
function! ale_linters#haskell#hdevtools#GetExecutable(buffer) abort
|
||||||
|
return ale#Var(a:buffer, 'haskell_hdevtools_executable')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#haskell#hdevtools#GetCommand(buffer) abort
|
||||||
|
return ale#Escape(ale_linters#haskell#hdevtools#GetExecutable(a:buffer))
|
||||||
|
\ . ' check ' . ale#Var(a:buffer, 'haskell_hdevtools_options')
|
||||||
|
\ . ' -p %s %t'
|
||||||
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('haskell', {
|
call ale#linter#Define('haskell', {
|
||||||
\ 'name': 'hdevtools',
|
\ 'name': 'hdevtools',
|
||||||
\ 'executable': 'hdevtools',
|
\ 'executable_callback': 'ale_linters#haskell#hdevtools#GetExecutable',
|
||||||
\ 'command': 'hdevtools check -g -Wall -p %s %t',
|
\ 'command_callback': 'ale_linters#haskell#hdevtools#GetCommand',
|
||||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -2,17 +2,24 @@
|
|||||||
" Description: hlint for Haskell files
|
" Description: hlint for Haskell files
|
||||||
|
|
||||||
function! ale_linters#haskell#hlint#Handle(buffer, lines) abort
|
function! ale_linters#haskell#hlint#Handle(buffer, lines) abort
|
||||||
let l:errors = json_decode(join(a:lines, ''))
|
|
||||||
|
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
for l:error in l:errors
|
for l:error in ale#util#FuzzyJSONDecode(a:lines, [])
|
||||||
|
if l:error.severity is# 'Error'
|
||||||
|
let l:type = 'E'
|
||||||
|
elseif l:error.severity is# 'Suggestion'
|
||||||
|
let l:type = 'I'
|
||||||
|
else
|
||||||
|
let l:type = 'W'
|
||||||
|
endif
|
||||||
|
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'bufnr': a:buffer,
|
\ 'lnum': str2nr(l:error.startLine),
|
||||||
\ 'lnum': l:error.startLine + 0,
|
\ 'col': str2nr(l:error.startColumn),
|
||||||
\ 'col': l:error.startColumn + 0,
|
\ 'end_lnum': str2nr(l:error.endLine),
|
||||||
|
\ 'end_col': str2nr(l:error.endColumn),
|
||||||
\ 'text': l:error.severity . ': ' . l:error.hint . '. Found: ' . l:error.from . ' Why not: ' . l:error.to,
|
\ 'text': l:error.severity . ': ' . l:error.hint . '. Found: ' . l:error.from . ' Why not: ' . l:error.to,
|
||||||
\ 'type': l:error.severity ==# 'Error' ? 'E' : 'W',
|
\ 'type': l:type,
|
||||||
\})
|
\})
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
|
|||||||
22
ale_linters/haskell/stack_build.vim
Normal file
22
ale_linters/haskell/stack_build.vim
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
" Author: Jake Zimmerman <jake@zimmerman.io>
|
||||||
|
" Description: Like stack-ghc, but for entire projects
|
||||||
|
"
|
||||||
|
" Note: Ideally, this would *only* typecheck. Right now, it also does codegen.
|
||||||
|
" See <https://github.com/commercialhaskell/stack/issues/977>.
|
||||||
|
|
||||||
|
call ale#Set('haskell_stack_build_options', '--fast')
|
||||||
|
|
||||||
|
function! ale_linters#haskell#stack_build#GetCommand(buffer) abort
|
||||||
|
let l:flags = ale#Var(a:buffer, 'haskell_stack_build_options')
|
||||||
|
|
||||||
|
return 'stack build ' . l:flags
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('haskell', {
|
||||||
|
\ 'name': 'stack-build',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'executable': 'stack',
|
||||||
|
\ 'command_callback': 'ale_linters#haskell#stack_build#GetCommand',
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||||
|
\})
|
||||||
10
ale_linters/haskell/stack_ghc.vim
Normal file
10
ale_linters/haskell/stack_ghc.vim
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
" Author: w0rp <devw0rp@gmail.com>
|
||||||
|
" Description: ghc for Haskell files, using Stack
|
||||||
|
|
||||||
|
call ale#linter#Define('haskell', {
|
||||||
|
\ 'name': 'stack-ghc',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'executable': 'stack',
|
||||||
|
\ 'command': 'stack ghc -- -fno-code -v0 %t',
|
||||||
|
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||||
|
\})
|
||||||
11
ale_linters/help/alex.vim
Normal file
11
ale_linters/help/alex.vim
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
" Author: Johannes Wienke <languitar@semipol.de>
|
||||||
|
" Description: alex for help files
|
||||||
|
|
||||||
|
call ale#linter#Define('help', {
|
||||||
|
\ 'name': 'alex',
|
||||||
|
\ 'executable': 'alex',
|
||||||
|
\ 'command': 'alex %s -t',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'callback': 'ale#handlers#alex#Handle',
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\})
|
||||||
9
ale_linters/help/write-good.vim
Normal file
9
ale_linters/help/write-good.vim
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
||||||
|
" Description: write-good for vim Help files
|
||||||
|
|
||||||
|
call ale#linter#Define('help', {
|
||||||
|
\ 'name': 'write-good',
|
||||||
|
\ 'executable_callback': 'ale#handlers#writegood#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale#handlers#writegood#GetCommand',
|
||||||
|
\ 'callback': 'ale#handlers#writegood#Handle',
|
||||||
|
\})
|
||||||
11
ale_linters/html/alex.vim
Normal file
11
ale_linters/html/alex.vim
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
" Author: Johannes Wienke <languitar@semipol.de>
|
||||||
|
" Description: alex for HTML files
|
||||||
|
|
||||||
|
call ale#linter#Define('html', {
|
||||||
|
\ 'name': 'alex',
|
||||||
|
\ 'executable': 'alex',
|
||||||
|
\ 'command': 'alex %s -t',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'callback': 'ale#handlers#alex#Handle',
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\})
|
||||||
@@ -1,27 +1,33 @@
|
|||||||
" Author: KabbAmine <amine.kabb@gmail.com>, deathmaz <00maz1987@gmail.com>, diartyz <diartyz@gmail.com>
|
" Author: KabbAmine <amine.kabb@gmail.com>, deathmaz <00maz1987@gmail.com>, diartyz <diartyz@gmail.com>
|
||||||
" Description: HTMLHint for checking html files
|
" Description: HTMLHint for checking html files
|
||||||
|
|
||||||
" CLI options
|
call ale#Set('html_htmlhint_options', '')
|
||||||
let g:ale_html_htmlhint_options = get(g:, 'ale_html_htmlhint_options', '--format=unix')
|
call ale#Set('html_htmlhint_executable', 'htmlhint')
|
||||||
let g:ale_html_htmlhint_executable = get(g:, 'ale_html_htmlhint_executable', 'htmlhint')
|
call ale#Set('html_htmlhint_use_global', 0)
|
||||||
let g:ale_html_htmlhint_use_global = get(g:, 'ale_html_htmlhint_use_global', 0)
|
|
||||||
|
|
||||||
function! ale_linters#html#htmlhint#GetExecutable(buffer) abort
|
function! ale_linters#html#htmlhint#GetExecutable(buffer) abort
|
||||||
if ale#Var(a:buffer, 'html_htmlhint_use_global')
|
return ale#node#FindExecutable(a:buffer, 'html_htmlhint', [
|
||||||
return ale#Var(a:buffer, 'html_htmlhint_executable')
|
|
||||||
endif
|
|
||||||
|
|
||||||
return ale#path#ResolveLocalPath(
|
|
||||||
\ a:buffer,
|
|
||||||
\ 'node_modules/.bin/htmlhint',
|
\ 'node_modules/.bin/htmlhint',
|
||||||
\ ale#Var(a:buffer, 'html_htmlhint_executable')
|
\])
|
||||||
\)
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#html#htmlhint#GetCommand(buffer) abort
|
function! ale_linters#html#htmlhint#GetCommand(buffer) abort
|
||||||
return ale_linters#html#htmlhint#GetExecutable(a:buffer)
|
let l:options = ale#Var(a:buffer, 'html_htmlhint_options')
|
||||||
\ . ' ' . ale#Var(a:buffer, 'html_htmlhint_options')
|
let l:config = l:options !~# '--config'
|
||||||
\ . ' %t'
|
\ ? ale#path#FindNearestFile(a:buffer, '.htmlhintrc')
|
||||||
|
\ : ''
|
||||||
|
|
||||||
|
if !empty(l:config)
|
||||||
|
let l:options .= ' --config ' . ale#Escape(l:config)
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !empty(l:options)
|
||||||
|
let l:options = substitute(l:options, '--format=unix', '', '')
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ale#Escape(ale_linters#html#htmlhint#GetExecutable(a:buffer))
|
||||||
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
|
\ . ' --format=unix %t'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('html', {
|
call ale#linter#Define('html', {
|
||||||
|
|||||||
@@ -25,8 +25,16 @@ function! ale_linters#html#tidy#GetCommand(buffer) abort
|
|||||||
\ 'utf-8': '-utf8',
|
\ 'utf-8': '-utf8',
|
||||||
\ }, &fileencoding, '-utf8')
|
\ }, &fileencoding, '-utf8')
|
||||||
|
|
||||||
|
" On macOS, old tidy (released on 31 Oct 2006) is installed. It does not
|
||||||
|
" consider HTML5 so we should avoid it.
|
||||||
|
let l:executable = ale#Var(a:buffer, 'html_tidy_executable')
|
||||||
|
if has('mac') && l:executable is# 'tidy' && exists('*exepath')
|
||||||
|
\ && exepath(l:executable) is# '/usr/bin/tidy'
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
|
||||||
return printf('%s %s %s -',
|
return printf('%s %s %s -',
|
||||||
\ ale#Var(a:buffer, 'html_tidy_executable'),
|
\ l:executable,
|
||||||
\ ale#Var(a:buffer, 'html_tidy_options'),
|
\ ale#Var(a:buffer, 'html_tidy_options'),
|
||||||
\ l:file_encoding
|
\ l:file_encoding
|
||||||
\)
|
\)
|
||||||
@@ -46,7 +54,7 @@ function! ale_linters#html#tidy#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:line = l:match[1] + 0
|
let l:line = l:match[1] + 0
|
||||||
let l:col = l:match[2] + 0
|
let l:col = l:match[2] + 0
|
||||||
let l:type = l:match[3] ==# 'Error' ? 'E' : 'W'
|
let l:type = l:match[3] is# 'Error' ? 'E' : 'W'
|
||||||
let l:text = l:match[4]
|
let l:text = l:match[4]
|
||||||
|
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
|
|||||||
9
ale_linters/html/write-good.vim
Normal file
9
ale_linters/html/write-good.vim
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
||||||
|
" Description: write-good for nroff files
|
||||||
|
|
||||||
|
call ale#linter#Define('html', {
|
||||||
|
\ 'name': 'write-good',
|
||||||
|
\ 'executable_callback': 'ale#handlers#writegood#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale#handlers#writegood#GetCommand',
|
||||||
|
\ 'callback': 'ale#handlers#writegood#Handle',
|
||||||
|
\})
|
||||||
87
ale_linters/idris/idris.vim
Normal file
87
ale_linters/idris/idris.vim
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
" Author: Scott Bonds <scott@ggr.com>
|
||||||
|
" Description: default Idris compiler
|
||||||
|
|
||||||
|
call ale#Set('idris_idris_executable', 'idris')
|
||||||
|
call ale#Set('idris_idris_options', '--total --warnpartial --warnreach --warnipkg')
|
||||||
|
|
||||||
|
function! ale_linters#idris#idris#GetExecutable(buffer) abort
|
||||||
|
return ale#Var(a:buffer, 'idris_idris_executable')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#idris#idris#GetCommand(buffer) abort
|
||||||
|
let l:options = ale#Var(a:buffer, 'idris_idris_options')
|
||||||
|
|
||||||
|
return ale#Escape(ale_linters#idris#idris#GetExecutable(a:buffer))
|
||||||
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
|
\ . ' --check %s'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#idris#idris#Handle(buffer, lines) abort
|
||||||
|
" This was copied almost verbatim from ale#handlers#haskell#HandleGHCFormat
|
||||||
|
|
||||||
|
" Look for lines like the following:
|
||||||
|
" foo.idr:2:6:When checking right hand side of main with expected type
|
||||||
|
" bar.idr:11:11-13:
|
||||||
|
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+)(-\d+)?:(.*)?$'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
let l:corrected_lines = []
|
||||||
|
|
||||||
|
for l:line in a:lines
|
||||||
|
if len(matchlist(l:line, l:pattern)) > 0
|
||||||
|
call add(l:corrected_lines, l:line)
|
||||||
|
elseif len(l:corrected_lines) > 0
|
||||||
|
if l:line is# ''
|
||||||
|
let l:corrected_lines[-1] .= ' ' " turn a blank line into a space
|
||||||
|
else
|
||||||
|
let l:corrected_lines[-1] .= l:line
|
||||||
|
endif
|
||||||
|
let l:corrected_lines[-1] = substitute(l:corrected_lines[-1], '\s\+', ' ', 'g')
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
for l:line in l:corrected_lines
|
||||||
|
let l:match = matchlist(l:line, l:pattern)
|
||||||
|
|
||||||
|
if len(l:match) == 0
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !ale#path#IsBufferPath(a:buffer, l:match[1])
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:errors = matchlist(l:match[5], '\v([wW]arning|[eE]rror) - ?(.*)')
|
||||||
|
|
||||||
|
if len(l:errors) > 0
|
||||||
|
let l:ghc_type = l:errors[1]
|
||||||
|
let l:text = l:errors[2]
|
||||||
|
else
|
||||||
|
let l:ghc_type = ''
|
||||||
|
let l:text = l:match[5][:0] is# ' ' ? l:match[5][1:] : l:match[5]
|
||||||
|
endif
|
||||||
|
|
||||||
|
if l:ghc_type is? 'Warning'
|
||||||
|
let l:type = 'W'
|
||||||
|
else
|
||||||
|
let l:type = 'E'
|
||||||
|
endif
|
||||||
|
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': l:match[2] + 0,
|
||||||
|
\ 'col': l:match[3] + 0,
|
||||||
|
\ 'text': l:text,
|
||||||
|
\ 'type': l:type,
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('idris', {
|
||||||
|
\ 'name': 'idris',
|
||||||
|
\ 'executable_callback': 'ale_linters#idris#idris#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale_linters#idris#idris#GetCommand',
|
||||||
|
\ 'callback': 'ale_linters#idris#idris#Handle',
|
||||||
|
\})
|
||||||
|
|
||||||
36
ale_linters/java/checkstyle.vim
Normal file
36
ale_linters/java/checkstyle.vim
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
" Author: Devon Meunier <devon.meunier@gmail.com>
|
||||||
|
" Description: checkstyle for Java files
|
||||||
|
|
||||||
|
function! ale_linters#java#checkstyle#Handle(buffer, lines) abort
|
||||||
|
let l:pattern = '\v\[(WARN|ERROR)\] [a-zA-Z]?:?[^:]+:(\d+):(\d+)?:? (.*) \[(.+)\]$'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'type': l:match[1] is? 'WARN' ? 'W' : 'E',
|
||||||
|
\ 'lnum': l:match[2] + 0,
|
||||||
|
\ 'col': l:match[3] + 0,
|
||||||
|
\ 'text': l:match[4],
|
||||||
|
\ 'code': l:match[5],
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#java#checkstyle#GetCommand(buffer) abort
|
||||||
|
return 'checkstyle '
|
||||||
|
\ . ale#Var(a:buffer, 'java_checkstyle_options')
|
||||||
|
\ . ' %t'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
if !exists('g:ale_java_checkstyle_options')
|
||||||
|
let g:ale_java_checkstyle_options = '-c /google_checks.xml'
|
||||||
|
endif
|
||||||
|
|
||||||
|
call ale#linter#Define('java', {
|
||||||
|
\ 'name': 'checkstyle',
|
||||||
|
\ 'executable': 'checkstyle',
|
||||||
|
\ 'command_callback': 'ale_linters#java#checkstyle#GetCommand',
|
||||||
|
\ 'callback': 'ale_linters#java#checkstyle#Handle',
|
||||||
|
\})
|
||||||
@@ -6,27 +6,6 @@ let s:classpath_sep = has('unix') ? ':' : ';'
|
|||||||
let g:ale_java_javac_options = get(g:, 'ale_java_javac_options', '')
|
let g:ale_java_javac_options = get(g:, 'ale_java_javac_options', '')
|
||||||
let g:ale_java_javac_classpath = get(g:, 'ale_java_javac_classpath', '')
|
let g:ale_java_javac_classpath = get(g:, 'ale_java_javac_classpath', '')
|
||||||
|
|
||||||
" Detect if the javac command just shows an annoying popup for Mac OSX.
|
|
||||||
if has('macunix')
|
|
||||||
function s:GetIsJavacAnAppStoreStub() abort
|
|
||||||
let l:path = resolve(systemlist('which javac')[0])
|
|
||||||
|
|
||||||
for l:line in readfile(l:path)
|
|
||||||
" This string is present inside the executable for the popup.
|
|
||||||
if l:line =~? 'No Java runtime present'
|
|
||||||
return 1
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
|
|
||||||
return 0
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let s:is_javac_an_app_store_stub = s:GetIsJavacAnAppStoreStub()
|
|
||||||
delfunction s:GetIsJavacAnAppStoreStub
|
|
||||||
else
|
|
||||||
let s:is_javac_an_app_store_stub = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
function! ale_linters#java#javac#GetImportPaths(buffer) abort
|
function! ale_linters#java#javac#GetImportPaths(buffer) abort
|
||||||
let l:pom_path = ale#path#FindNearestFile(a:buffer, 'pom.xml')
|
let l:pom_path = ale#path#FindNearestFile(a:buffer, 'pom.xml')
|
||||||
|
|
||||||
@@ -35,46 +14,72 @@ function! ale_linters#java#javac#GetImportPaths(buffer) abort
|
|||||||
\ . 'mvn dependency:build-classpath'
|
\ . 'mvn dependency:build-classpath'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let l:classpath_command = ale#gradle#BuildClasspathCommand(a:buffer)
|
||||||
|
if !empty(l:classpath_command)
|
||||||
|
return l:classpath_command
|
||||||
|
endif
|
||||||
|
|
||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:BuildClassPathOption(buffer, import_paths) abort
|
function! s:BuildClassPathOption(buffer, import_paths) abort
|
||||||
" Filter out lines like [INFO], etc.
|
" Filter out lines like [INFO], etc.
|
||||||
let l:class_paths = filter(a:import_paths[:], 'v:val !~# ''[''')
|
let l:class_paths = filter(a:import_paths[:], 'v:val !~# ''[''')
|
||||||
call map(l:class_paths, 'fnameescape(v:val)')
|
|
||||||
call extend(
|
call extend(
|
||||||
\ l:class_paths,
|
\ l:class_paths,
|
||||||
\ split(ale#Var(a:buffer, 'java_javac_classpath'), s:classpath_sep),
|
\ split(ale#Var(a:buffer, 'java_javac_classpath'), s:classpath_sep),
|
||||||
\)
|
\)
|
||||||
|
|
||||||
return !empty(l:class_paths)
|
return !empty(l:class_paths)
|
||||||
\ ? '-cp ' . join(l:class_paths, s:classpath_sep)
|
\ ? '-cp ' . ale#Escape(join(l:class_paths, s:classpath_sep))
|
||||||
\ : ''
|
\ : ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#java#javac#GetCommand(buffer, import_paths) abort
|
function! ale_linters#java#javac#GetCommand(buffer, import_paths) abort
|
||||||
" If running the command will just show a popup, then don't run it.
|
|
||||||
if s:is_javac_an_app_store_stub
|
|
||||||
return ''
|
|
||||||
endif
|
|
||||||
|
|
||||||
let l:cp_option = s:BuildClassPathOption(a:buffer, a:import_paths)
|
let l:cp_option = s:BuildClassPathOption(a:buffer, a:import_paths)
|
||||||
let l:sp_option = ''
|
let l:sp_option = ''
|
||||||
|
|
||||||
" Find the src directory, for files in this project.
|
" Find the src directory, for files in this project.
|
||||||
let l:src_dir = ale#path#FindNearestDirectory(a:buffer, 'src/main/java')
|
let l:src_dir = ale#path#FindNearestDirectory(a:buffer, 'src/main/java')
|
||||||
|
let l:sp_dirs = []
|
||||||
|
|
||||||
if !empty(l:src_dir)
|
if !empty(l:src_dir)
|
||||||
let l:sp_option = '-sourcepath ' . fnameescape(l:src_dir)
|
call add(l:sp_dirs, l:src_dir)
|
||||||
|
|
||||||
|
" Automatically include the jaxb directory too, if it's there.
|
||||||
|
let l:jaxb_dir = fnamemodify(l:src_dir, ':h:h')
|
||||||
|
\ . (has('win32') ? '\jaxb\' : '/jaxb/')
|
||||||
|
|
||||||
|
if isdirectory(l:jaxb_dir)
|
||||||
|
call add(l:sp_dirs, l:jaxb_dir)
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Automatically include the test directory, but only for test code.
|
||||||
|
if expand('#' . a:buffer . ':p') =~? '\vsrc[/\\]test[/\\]java'
|
||||||
|
let l:test_dir = fnamemodify(l:src_dir, ':h:h:h')
|
||||||
|
\ . (has('win32') ? '\test\java\' : '/test/java/')
|
||||||
|
|
||||||
|
if isdirectory(l:test_dir)
|
||||||
|
call add(l:sp_dirs, l:test_dir)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !empty(l:sp_dirs)
|
||||||
|
let l:sp_option = '-sourcepath '
|
||||||
|
\ . ale#Escape(join(l:sp_dirs, s:classpath_sep))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Create .class files in a temporary directory, which we will delete later.
|
" Create .class files in a temporary directory, which we will delete later.
|
||||||
let l:class_file_directory = ale#engine#CreateDirectory(a:buffer)
|
let l:class_file_directory = ale#engine#CreateDirectory(a:buffer)
|
||||||
|
|
||||||
return 'javac -Xlint'
|
" Always run javac from the directory the file is in, so we can resolve
|
||||||
|
" relative paths correctly.
|
||||||
|
return ale#path#BufferCdString(a:buffer)
|
||||||
|
\ . 'javac -Xlint'
|
||||||
\ . ' ' . l:cp_option
|
\ . ' ' . l:cp_option
|
||||||
\ . ' ' . l:sp_option
|
\ . ' ' . l:sp_option
|
||||||
\ . ' -d ' . fnameescape(l:class_file_directory)
|
\ . ' -d ' . ale#Escape(l:class_file_directory)
|
||||||
\ . ' ' . ale#Var(a:buffer, 'java_javac_options')
|
\ . ' ' . ale#Var(a:buffer, 'java_javac_options')
|
||||||
\ . ' %t'
|
\ . ' %t'
|
||||||
endfunction
|
endfunction
|
||||||
@@ -85,21 +90,26 @@ function! ale_linters#java#javac#Handle(buffer, lines) abort
|
|||||||
" Main.java:13: warning: [deprecation] donaught() in Testclass has been deprecated
|
" Main.java:13: warning: [deprecation] donaught() in Testclass has been deprecated
|
||||||
" Main.java:16: error: ';' expected
|
" Main.java:16: error: ';' expected
|
||||||
|
|
||||||
let l:pattern = '\v^.*:(\d+): (.+):(.+)$'
|
let l:directory = expand('#' . a:buffer . ':p:h')
|
||||||
|
let l:pattern = '\v^(.*):(\d+): (.+):(.+)$'
|
||||||
|
let l:col_pattern = '\v^(\s*\^)$'
|
||||||
let l:symbol_pattern = '\v^ +symbol: *(class|method) +([^ ]+)'
|
let l:symbol_pattern = '\v^ +symbol: *(class|method) +([^ ]+)'
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
for l:match in ale#util#GetMatches(a:lines, [l:pattern, l:symbol_pattern])
|
for l:match in ale#util#GetMatches(a:lines, [l:pattern, l:col_pattern, l:symbol_pattern])
|
||||||
if empty(l:match[3])
|
if empty(l:match[2]) && empty(l:match[3])
|
||||||
|
let l:output[-1].col = len(l:match[1])
|
||||||
|
elseif empty(l:match[3])
|
||||||
" Add symbols to 'cannot find symbol' errors.
|
" Add symbols to 'cannot find symbol' errors.
|
||||||
if l:output[-1].text ==# 'error: cannot find symbol'
|
if l:output[-1].text is# 'error: cannot find symbol'
|
||||||
let l:output[-1].text .= ': ' . l:match[2]
|
let l:output[-1].text .= ': ' . l:match[2]
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'lnum': l:match[1] + 0,
|
\ 'filename': ale#path#GetAbsPath(l:directory, l:match[1]),
|
||||||
\ 'text': l:match[2] . ':' . l:match[3],
|
\ 'lnum': l:match[2] + 0,
|
||||||
\ 'type': l:match[2] ==# 'error' ? 'E' : 'W',
|
\ 'text': l:match[3] . ':' . l:match[4],
|
||||||
|
\ 'type': l:match[3] is# 'error' ? 'E' : 'W',
|
||||||
\})
|
\})
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|||||||
@@ -1,97 +1,10 @@
|
|||||||
" Author: w0rp <devw0rp@gmail.com>
|
" Author: w0rp <devw0rp@gmail.com>
|
||||||
" Description: eslint for JavaScript files
|
" Description: eslint for JavaScript files
|
||||||
|
|
||||||
let g:ale_javascript_eslint_executable =
|
|
||||||
\ get(g:, 'ale_javascript_eslint_executable', 'eslint')
|
|
||||||
|
|
||||||
let g:ale_javascript_eslint_options =
|
|
||||||
\ get(g:, 'ale_javascript_eslint_options', '')
|
|
||||||
|
|
||||||
let g:ale_javascript_eslint_use_global =
|
|
||||||
\ get(g:, 'ale_javascript_eslint_use_global', 0)
|
|
||||||
|
|
||||||
function! ale_linters#javascript#eslint#GetExecutable(buffer) abort
|
|
||||||
if ale#Var(a:buffer, 'javascript_eslint_use_global')
|
|
||||||
return ale#Var(a:buffer, 'javascript_eslint_executable')
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Look for the kinds of paths that create-react-app generates first.
|
|
||||||
let l:executable = ale#path#ResolveLocalPath(
|
|
||||||
\ a:buffer,
|
|
||||||
\ 'node_modules/eslint/bin/eslint.js',
|
|
||||||
\ ''
|
|
||||||
\)
|
|
||||||
|
|
||||||
if !empty(l:executable)
|
|
||||||
return l:executable
|
|
||||||
endif
|
|
||||||
|
|
||||||
return ale#path#ResolveLocalPath(
|
|
||||||
\ a:buffer,
|
|
||||||
\ 'node_modules/.bin/eslint',
|
|
||||||
\ ale#Var(a:buffer, 'javascript_eslint_executable')
|
|
||||||
\)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#javascript#eslint#GetCommand(buffer) abort
|
|
||||||
return fnameescape(ale_linters#javascript#eslint#GetExecutable(a:buffer))
|
|
||||||
\ . ' ' . ale#Var(a:buffer, 'javascript_eslint_options')
|
|
||||||
\ . ' -f unix --stdin --stdin-filename %s'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#javascript#eslint#Handle(buffer, lines) abort
|
|
||||||
let l:config_error_pattern = '\v^ESLint couldn''t find a configuration file'
|
|
||||||
\ . '|^Cannot read config file'
|
|
||||||
\ . '|^.*Configuration for rule .* is invalid'
|
|
||||||
|
|
||||||
" Look for a message in the first few lines which indicates that
|
|
||||||
" a configuration file couldn't be found.
|
|
||||||
for l:line in a:lines[:10]
|
|
||||||
if len(matchlist(l:line, l:config_error_pattern)) > 0
|
|
||||||
return [{
|
|
||||||
\ 'lnum': 1,
|
|
||||||
\ 'text': 'eslint configuration error (type :ALEDetail for more information)',
|
|
||||||
\ 'detail': join(a:lines, "\n"),
|
|
||||||
\}]
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
|
|
||||||
" Matches patterns line the following:
|
|
||||||
"
|
|
||||||
" /path/to/some-filename.js:47:14: Missing trailing comma. [Warning/comma-dangle]
|
|
||||||
" /path/to/some-filename.js:56:41: Missing semicolon. [Error/semi]
|
|
||||||
let l:pattern = '^.*:\(\d\+\):\(\d\+\): \(.\+\) \[\(.\+\)\]$'
|
|
||||||
" This second pattern matches lines like the following:
|
|
||||||
"
|
|
||||||
" /path/to/some-filename.js:13:3: Parsing error: Unexpected token
|
|
||||||
let l:parsing_pattern = '^.*:\(\d\+\):\(\d\+\): \(.\+\)$'
|
|
||||||
let l:output = []
|
|
||||||
|
|
||||||
for l:match in ale#util#GetMatches(a:lines, [l:pattern, l:parsing_pattern])
|
|
||||||
let l:type = 'Error'
|
|
||||||
let l:text = l:match[3]
|
|
||||||
|
|
||||||
" Take the error type from the output if available.
|
|
||||||
if !empty(l:match[4])
|
|
||||||
let l:type = split(l:match[4], '/')[0]
|
|
||||||
let l:text .= ' [' . l:match[4] . ']'
|
|
||||||
endif
|
|
||||||
|
|
||||||
call add(l:output, {
|
|
||||||
\ 'bufnr': a:buffer,
|
|
||||||
\ 'lnum': l:match[1] + 0,
|
|
||||||
\ 'col': l:match[2] + 0,
|
|
||||||
\ 'text': l:text,
|
|
||||||
\ 'type': l:type ==# 'Warning' ? 'W' : 'E',
|
|
||||||
\})
|
|
||||||
endfor
|
|
||||||
|
|
||||||
return l:output
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
call ale#linter#Define('javascript', {
|
call ale#linter#Define('javascript', {
|
||||||
\ 'name': 'eslint',
|
\ 'name': 'eslint',
|
||||||
\ 'executable_callback': 'ale_linters#javascript#eslint#GetExecutable',
|
\ 'output_stream': 'both',
|
||||||
\ 'command_callback': 'ale_linters#javascript#eslint#GetCommand',
|
\ 'executable_callback': 'ale#handlers#eslint#GetExecutable',
|
||||||
\ 'callback': 'ale_linters#javascript#eslint#Handle',
|
\ 'command_callback': 'ale#handlers#eslint#GetCommand',
|
||||||
|
\ 'callback': 'ale#handlers#eslint#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
146
ale_linters/javascript/flow.vim
Normal file → Executable file
146
ale_linters/javascript/flow.vim
Normal file → Executable file
@@ -1,25 +1,12 @@
|
|||||||
" Author: Zach Perrault -- @zperrault
|
" Author: Zach Perrault -- @zperrault
|
||||||
|
" Author: Florian Beeres <yuuki@protonmail.com>
|
||||||
" Description: FlowType checking for JavaScript files
|
" Description: FlowType checking for JavaScript files
|
||||||
|
|
||||||
let g:ale_javascript_flow_executable =
|
call ale#Set('javascript_flow_executable', 'flow')
|
||||||
\ get(g:, 'ale_javascript_flow_executable', 'flow')
|
call ale#Set('javascript_flow_use_home_config', 0)
|
||||||
|
call ale#Set('javascript_flow_use_global', 0)
|
||||||
let g:ale_javascript_flow_use_global =
|
|
||||||
\ get(g:, 'ale_javascript_flow_use_global', 0)
|
|
||||||
|
|
||||||
function! ale_linters#javascript#flow#GetExecutable(buffer) abort
|
function! ale_linters#javascript#flow#GetExecutable(buffer) abort
|
||||||
if ale#Var(a:buffer, 'javascript_flow_use_global')
|
|
||||||
return ale#Var(a:buffer, 'javascript_flow_executable')
|
|
||||||
endif
|
|
||||||
|
|
||||||
return ale#path#ResolveLocalPath(
|
|
||||||
\ a:buffer,
|
|
||||||
\ 'node_modules/.bin/flow',
|
|
||||||
\ ale#Var(a:buffer, 'javascript_flow_executable')
|
|
||||||
\)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ale_linters#javascript#flow#GetCommand(buffer) abort
|
|
||||||
let l:flow_config = ale#path#FindNearestFile(a:buffer, '.flowconfig')
|
let l:flow_config = ale#path#FindNearestFile(a:buffer, '.flowconfig')
|
||||||
|
|
||||||
if empty(l:flow_config)
|
if empty(l:flow_config)
|
||||||
@@ -27,14 +14,106 @@ function! ale_linters#javascript#flow#GetCommand(buffer) abort
|
|||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return fnameescape(ale_linters#javascript#flow#GetExecutable(a:buffer))
|
" Don't run Flow with a configuration file from the home directory by
|
||||||
\ . ' check-contents --respect-pragma --json --from ale %s'
|
" default, which can eat all of your RAM.
|
||||||
|
if fnamemodify(l:flow_config, ':h') is? $HOME
|
||||||
|
\&& !ale#Var(a:buffer, 'javascript_flow_use_home_config')
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ale#node#FindExecutable(a:buffer, 'javascript_flow', [
|
||||||
|
\ 'node_modules/.bin/flow',
|
||||||
|
\])
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#javascript#flow#VersionCheck(buffer) abort
|
||||||
|
let l:executable = ale_linters#javascript#flow#GetExecutable(a:buffer)
|
||||||
|
|
||||||
|
if empty(l:executable)
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ale#Escape(l:executable) . ' --version'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#javascript#flow#GetCommand(buffer, version_lines) abort
|
||||||
|
let l:executable = ale_linters#javascript#flow#GetExecutable(a:buffer)
|
||||||
|
|
||||||
|
if empty(l:executable)
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:version = ale#semver#GetVersion(l:executable, a:version_lines)
|
||||||
|
|
||||||
|
" If we can parse the version number, then only use --respect-pragma
|
||||||
|
" if the version is >= 0.36.0, which added the argument.
|
||||||
|
let l:use_respect_pragma = empty(l:version)
|
||||||
|
\ || ale#semver#GTE(l:version, [0, 36])
|
||||||
|
|
||||||
|
return ale#Escape(l:executable)
|
||||||
|
\ . ' check-contents'
|
||||||
|
\ . (l:use_respect_pragma ? ' --respect-pragma': '')
|
||||||
|
\ . ' --json --from ale %s'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Filter lines of flow output until we find the first line where the JSON
|
||||||
|
" output starts.
|
||||||
|
function! s:GetJSONLines(lines) abort
|
||||||
|
let l:start_index = 0
|
||||||
|
|
||||||
|
for l:line in a:lines
|
||||||
|
if l:line[:0] is# '{'
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:start_index += 1
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return a:lines[l:start_index :]
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:ExtraErrorMsg(current, new) abort
|
||||||
|
let l:newMsg = ''
|
||||||
|
|
||||||
|
if a:current is# ''
|
||||||
|
" extra messages appear to already have a :
|
||||||
|
let l:newMsg = a:new
|
||||||
|
else
|
||||||
|
let l:newMsg = a:current . ' ' . a:new
|
||||||
|
endif
|
||||||
|
|
||||||
|
return l:newMsg
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! s:GetDetails(error) abort
|
||||||
|
let l:detail = ''
|
||||||
|
|
||||||
|
for l:extra_error in a:error.extra
|
||||||
|
|
||||||
|
if has_key(l:extra_error, 'message')
|
||||||
|
for l:extra_message in l:extra_error.message
|
||||||
|
let l:detail = s:ExtraErrorMsg(l:detail, l:extra_message.descr)
|
||||||
|
endfor
|
||||||
|
endif
|
||||||
|
|
||||||
|
if has_key(l:extra_error, 'children')
|
||||||
|
for l:child in l:extra_error.children
|
||||||
|
for l:child_message in l:child.message
|
||||||
|
let l:detail = l:detail . ' ' . l:child_message.descr
|
||||||
|
endfor
|
||||||
|
endfor
|
||||||
|
endif
|
||||||
|
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:detail
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#javascript#flow#Handle(buffer, lines) abort
|
function! ale_linters#javascript#flow#Handle(buffer, lines) abort
|
||||||
let l:str = join(a:lines, '')
|
let l:str = join(s:GetJSONLines(a:lines), '')
|
||||||
|
|
||||||
if l:str ==# ''
|
if empty(l:str)
|
||||||
return []
|
return []
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -51,12 +130,14 @@ function! ale_linters#javascript#flow#Handle(buffer, lines) abort
|
|||||||
" Comments have no line of column information, so we skip them.
|
" Comments have no line of column information, so we skip them.
|
||||||
" In certain cases, `l:message.loc.source` points to a different path
|
" In certain cases, `l:message.loc.source` points to a different path
|
||||||
" than the buffer one, thus we skip this loc information too.
|
" than the buffer one, thus we skip this loc information too.
|
||||||
if has_key(l:message, 'loc') && l:line ==# 0 && l:message.loc.source ==# expand('#' . a:buffer . ':p')
|
if has_key(l:message, 'loc')
|
||||||
|
\&& l:line is# 0
|
||||||
|
\&& ale#path#IsBufferPath(a:buffer, l:message.loc.source)
|
||||||
let l:line = l:message.loc.start.line + 0
|
let l:line = l:message.loc.start.line + 0
|
||||||
let l:col = l:message.loc.start.column + 0
|
let l:col = l:message.loc.start.column + 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if l:text ==# ''
|
if l:text is# ''
|
||||||
let l:text = l:message.descr . ':'
|
let l:text = l:message.descr . ':'
|
||||||
else
|
else
|
||||||
let l:text = l:text . ' ' . l:message.descr
|
let l:text = l:text . ' ' . l:message.descr
|
||||||
@@ -67,12 +148,19 @@ function! ale_linters#javascript#flow#Handle(buffer, lines) abort
|
|||||||
let l:text = l:text . ' See also: ' . l:error.operation.descr
|
let l:text = l:text . ' See also: ' . l:error.operation.descr
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call add(l:output, {
|
let l:errorToAdd = {
|
||||||
\ 'lnum': l:line,
|
\ 'lnum': l:line,
|
||||||
\ 'col': l:col,
|
\ 'col': l:col,
|
||||||
\ 'text': l:text,
|
\ 'text': l:text,
|
||||||
\ 'type': l:error.level ==# 'error' ? 'E' : 'W',
|
\ 'type': has_key(l:error, 'level') && l:error.level is# 'error' ? 'E' : 'W',
|
||||||
\})
|
\}
|
||||||
|
|
||||||
|
if has_key(l:error, 'extra')
|
||||||
|
let l:errorToAdd.detail = s:GetDetails(l:error)
|
||||||
|
endif
|
||||||
|
|
||||||
|
call add(l:output, l:errorToAdd)
|
||||||
|
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
return l:output
|
return l:output
|
||||||
@@ -81,6 +169,10 @@ endfunction
|
|||||||
call ale#linter#Define('javascript', {
|
call ale#linter#Define('javascript', {
|
||||||
\ 'name': 'flow',
|
\ 'name': 'flow',
|
||||||
\ 'executable_callback': 'ale_linters#javascript#flow#GetExecutable',
|
\ 'executable_callback': 'ale_linters#javascript#flow#GetExecutable',
|
||||||
\ 'command_callback': 'ale_linters#javascript#flow#GetCommand',
|
\ 'command_chain': [
|
||||||
|
\ {'callback': 'ale_linters#javascript#flow#VersionCheck'},
|
||||||
|
\ {'callback': 'ale_linters#javascript#flow#GetCommand'},
|
||||||
|
\ ],
|
||||||
\ 'callback': 'ale_linters#javascript#flow#Handle',
|
\ 'callback': 'ale_linters#javascript#flow#Handle',
|
||||||
|
\ 'add_newline': !has('win32'),
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -1,9 +1,67 @@
|
|||||||
" Author: Chris Kyrouac - https://github.com/fijshion
|
" Author: Chris Kyrouac - https://github.com/fijshion
|
||||||
" Description: jscs for JavaScript files
|
" Description: jscs for JavaScript files
|
||||||
|
|
||||||
|
call ale#Set('javascript_jscs_executable', 'jscs')
|
||||||
|
call ale#Set('javascript_jscs_use_global', 0)
|
||||||
|
|
||||||
|
function! ale_linters#javascript#jscs#GetExecutable(buffer) abort
|
||||||
|
return ale#node#FindExecutable(a:buffer, 'javascript_jscs', [
|
||||||
|
\ 'node_modules/.bin/jscs',
|
||||||
|
\])
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#javascript#jscs#GetCommand(buffer) abort
|
||||||
|
" Search for a local JShint config locaation, and default to a global one.
|
||||||
|
let l:jscs_config = ale#path#ResolveLocalPath(
|
||||||
|
\ a:buffer,
|
||||||
|
\ '.jscsrc',
|
||||||
|
\ get(g:, 'ale_jscs_config_loc', '')
|
||||||
|
\)
|
||||||
|
|
||||||
|
let l:command = ale#Escape(ale_linters#javascript#jscs#GetExecutable(a:buffer))
|
||||||
|
let l:command .= ' --reporter inline --no-colors'
|
||||||
|
|
||||||
|
if !empty(l:jscs_config)
|
||||||
|
let l:command .= ' --config ' . ale#Escape(l:jscs_config)
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:command .= ' -'
|
||||||
|
|
||||||
|
return l:command
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#javascript#jscs#Handle(buffer, lines) abort
|
||||||
|
" Matches patterns looking like the following
|
||||||
|
"
|
||||||
|
" foobar.js: line 2, col 1, Expected indentation of 1 characters
|
||||||
|
"
|
||||||
|
let l:pattern = '\v^.*:\s+line (\d+),\s+col\s+(\d+),\s+(.*)$'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
let l:obj = {
|
||||||
|
\ 'lnum': l:match[1] + 0,
|
||||||
|
\ 'col': l:match[2] + 0,
|
||||||
|
\ 'text': l:match[3]
|
||||||
|
\}
|
||||||
|
|
||||||
|
let l:code_match = matchlist(l:match[3], '\v([^ :]+): (.+)$')
|
||||||
|
|
||||||
|
if !empty(l:code_match)
|
||||||
|
let l:obj.code = l:code_match[1]
|
||||||
|
let l:obj.text = l:code_match[2]
|
||||||
|
endif
|
||||||
|
|
||||||
|
call add(l:output, l:obj)
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('javascript', {
|
call ale#linter#Define('javascript', {
|
||||||
\ 'name': 'jscs',
|
\ 'name': 'jscs',
|
||||||
\ 'executable': 'jscs',
|
\ 'executable_callback': 'ale_linters#javascript#jscs#GetExecutable',
|
||||||
\ 'command': 'jscs -r unix -n -',
|
\ 'command_callback': 'ale_linters#javascript#jscs#GetCommand',
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsError',
|
\ 'callback': 'ale_linters#javascript#jscs#Handle',
|
||||||
\})
|
\})
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,13 @@
|
|||||||
" Author: Chris Kyrouac - https://github.com/fijshion
|
" Author: Chris Kyrouac - https://github.com/fijshion
|
||||||
" Description: JSHint for Javascript files
|
" Description: JSHint for Javascript files
|
||||||
|
|
||||||
let g:ale_javascript_jshint_executable =
|
call ale#Set('javascript_jshint_executable', 'jshint')
|
||||||
\ get(g:, 'ale_javascript_jshint_executable', 'jshint')
|
call ale#Set('javascript_jshint_use_global', 0)
|
||||||
|
|
||||||
let g:ale_javascript_jshint_use_global =
|
|
||||||
\ get(g:, 'ale_javascript_jshint_use_global', 0)
|
|
||||||
|
|
||||||
function! ale_linters#javascript#jshint#GetExecutable(buffer) abort
|
function! ale_linters#javascript#jshint#GetExecutable(buffer) abort
|
||||||
if ale#Var(a:buffer, 'javascript_jshint_use_global')
|
return ale#node#FindExecutable(a:buffer, 'javascript_jshint', [
|
||||||
return ale#Var(a:buffer, 'javascript_jshint_executable')
|
|
||||||
endif
|
|
||||||
|
|
||||||
return ale#path#ResolveLocalPath(
|
|
||||||
\ a:buffer,
|
|
||||||
\ 'node_modules/.bin/jshint',
|
\ 'node_modules/.bin/jshint',
|
||||||
\ ale#Var(a:buffer, 'javascript_jshint_executable')
|
\])
|
||||||
\)
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#javascript#jshint#GetCommand(buffer) abort
|
function! ale_linters#javascript#jshint#GetCommand(buffer) abort
|
||||||
@@ -27,11 +18,11 @@ function! ale_linters#javascript#jshint#GetCommand(buffer) abort
|
|||||||
\ get(g:, 'ale_jshint_config_loc', '')
|
\ get(g:, 'ale_jshint_config_loc', '')
|
||||||
\)
|
\)
|
||||||
|
|
||||||
let l:command = fnameescape(ale_linters#javascript#jshint#GetExecutable(a:buffer))
|
let l:command = ale#Escape(ale_linters#javascript#jshint#GetExecutable(a:buffer))
|
||||||
let l:command .= ' --reporter unix --extract auto'
|
let l:command .= ' --reporter unix --extract auto'
|
||||||
|
|
||||||
if !empty(l:jshint_config)
|
if !empty(l:jshint_config)
|
||||||
let l:command .= ' --config ' . fnameescape(l:jshint_config)
|
let l:command .= ' --config ' . ale#Escape(l:jshint_config)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:command .= ' -'
|
let l:command .= ' -'
|
||||||
|
|||||||
@@ -1,62 +1,30 @@
|
|||||||
" Author: Ahmed El Gabri <@ahmedelgabri>
|
" Author: Ahmed El Gabri <@ahmedelgabri>
|
||||||
" Description: standardjs for JavaScript files
|
" Description: standardjs for JavaScript files
|
||||||
|
|
||||||
let g:ale_javascript_standard_executable =
|
call ale#Set('javascript_standard_executable', 'standard')
|
||||||
\ get(g:, 'ale_javascript_standard_executable', 'standard')
|
call ale#Set('javascript_standard_use_global', 0)
|
||||||
|
call ale#Set('javascript_standard_options', '')
|
||||||
let g:ale_javascript_standard_options =
|
|
||||||
\ get(g:, 'ale_javascript_standard_options', '')
|
|
||||||
|
|
||||||
let g:ale_javascript_standard_use_global =
|
|
||||||
\ get(g:, 'ale_javascript_standard_use_global', 0)
|
|
||||||
|
|
||||||
function! ale_linters#javascript#standard#GetExecutable(buffer) abort
|
function! ale_linters#javascript#standard#GetExecutable(buffer) abort
|
||||||
if ale#Var(a:buffer, 'javascript_standard_use_global')
|
return ale#node#FindExecutable(a:buffer, 'javascript_standard', [
|
||||||
return ale#Var(a:buffer, 'javascript_standard_executable')
|
\ 'node_modules/standard/bin/cmd.js',
|
||||||
endif
|
|
||||||
|
|
||||||
return ale#path#ResolveLocalPath(
|
|
||||||
\ a:buffer,
|
|
||||||
\ 'node_modules/.bin/standard',
|
\ 'node_modules/.bin/standard',
|
||||||
\ ale#Var(a:buffer, 'javascript_standard_executable')
|
\])
|
||||||
\)
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#javascript#standard#GetCommand(buffer) abort
|
function! ale_linters#javascript#standard#GetCommand(buffer) abort
|
||||||
return fnameescape(ale_linters#javascript#standard#GetExecutable(a:buffer))
|
let l:executable = ale_linters#javascript#standard#GetExecutable(a:buffer)
|
||||||
\ . ' ' . ale#Var(a:buffer, 'javascript_standard_options')
|
let l:options = ale#Var(a:buffer, 'javascript_standard_options')
|
||||||
|
|
||||||
|
return ale#node#Executable(a:buffer, l:executable)
|
||||||
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
\ . ' --stdin %s'
|
\ . ' --stdin %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#javascript#standard#Handle(buffer, lines) abort
|
" standard uses eslint and the output format is the same
|
||||||
" Matches patterns line the following:
|
|
||||||
"
|
|
||||||
" /path/to/some-filename.js:47:14: Strings must use singlequote.
|
|
||||||
" /path/to/some-filename.js:56:41: Expected indentation of 2 spaces but found 4.
|
|
||||||
" /path/to/some-filename.js:13:3: Parsing error: Unexpected token
|
|
||||||
let l:pattern = '^.*:\(\d\+\):\(\d\+\): \(.\+\)$'
|
|
||||||
let l:output = []
|
|
||||||
|
|
||||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
|
||||||
let l:type = 'Error'
|
|
||||||
let l:text = l:match[3]
|
|
||||||
|
|
||||||
call add(l:output, {
|
|
||||||
\ 'bufnr': a:buffer,
|
|
||||||
\ 'lnum': l:match[1] + 0,
|
|
||||||
\ 'col': l:match[2] + 0,
|
|
||||||
\ 'text': l:text,
|
|
||||||
\ 'type': 'E',
|
|
||||||
\})
|
|
||||||
endfor
|
|
||||||
|
|
||||||
return l:output
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
call ale#linter#Define('javascript', {
|
call ale#linter#Define('javascript', {
|
||||||
\ 'name': 'standard',
|
\ 'name': 'standard',
|
||||||
\ 'executable_callback': 'ale_linters#javascript#standard#GetExecutable',
|
\ 'executable_callback': 'ale_linters#javascript#standard#GetExecutable',
|
||||||
\ 'command_callback': 'ale_linters#javascript#standard#GetCommand',
|
\ 'command_callback': 'ale_linters#javascript#standard#GetCommand',
|
||||||
\ 'callback': 'ale_linters#javascript#standard#Handle',
|
\ 'callback': 'ale#handlers#eslint#Handle',
|
||||||
\})
|
\})
|
||||||
|
|
||||||
|
|||||||
@@ -1,41 +1,26 @@
|
|||||||
" Author: Daniel Lupu <lupu.daniel.f@gmail.com>
|
" Author: Daniel Lupu <lupu.daniel.f@gmail.com>
|
||||||
" Description: xo for JavaScript files
|
" Description: xo for JavaScript files
|
||||||
|
|
||||||
let g:ale_javascript_xo_executable =
|
call ale#Set('javascript_xo_executable', 'xo')
|
||||||
\ get(g:, 'ale_javascript_xo_executable', 'xo')
|
call ale#Set('javascript_xo_use_global', 0)
|
||||||
|
call ale#Set('javascript_xo_options', '')
|
||||||
let g:ale_javascript_xo_options =
|
|
||||||
\ get(g:, 'ale_javascript_xo_options', '')
|
|
||||||
|
|
||||||
let g:ale_javascript_xo_use_global =
|
|
||||||
\ get(g:, 'ale_javascript_xo_use_global', 0)
|
|
||||||
|
|
||||||
function! ale_linters#javascript#xo#GetExecutable(buffer) abort
|
function! ale_linters#javascript#xo#GetExecutable(buffer) abort
|
||||||
if ale#Var(a:buffer, 'javascript_xo_use_global')
|
return ale#node#FindExecutable(a:buffer, 'javascript_xo', [
|
||||||
return ale#Var(a:buffer, 'javascript_xo_executable')
|
|
||||||
endif
|
|
||||||
|
|
||||||
return ale#path#ResolveLocalPath(
|
|
||||||
\ a:buffer,
|
|
||||||
\ 'node_modules/.bin/xo',
|
\ 'node_modules/.bin/xo',
|
||||||
\ ale#Var(a:buffer, 'javascript_xo_executable')
|
\])
|
||||||
\)
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#javascript#xo#GetCommand(buffer) abort
|
function! ale_linters#javascript#xo#GetCommand(buffer) abort
|
||||||
return fnameescape(ale_linters#javascript#xo#GetExecutable(a:buffer))
|
return ale#Escape(ale_linters#javascript#xo#GetExecutable(a:buffer))
|
||||||
\ . ' ' . ale#Var(a:buffer, 'javascript_xo_options')
|
\ . ' ' . ale#Var(a:buffer, 'javascript_xo_options')
|
||||||
\ . ' --reporter unix --stdin --stdin-filename %s'
|
\ . ' --reporter unix --stdin --stdin-filename %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#javascript#xo#Handle(buffer, lines) abort
|
" xo uses eslint and the output format is the same
|
||||||
" xo uses eslint and the output format is the same
|
|
||||||
return ale_linters#javascript#eslint#Handle(a:buffer, a:lines)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
call ale#linter#Define('javascript', {
|
call ale#linter#Define('javascript', {
|
||||||
\ 'name': 'xo',
|
\ 'name': 'xo',
|
||||||
\ 'executable_callback': 'ale_linters#javascript#xo#GetExecutable',
|
\ 'executable_callback': 'ale_linters#javascript#xo#GetExecutable',
|
||||||
\ 'command_callback': 'ale_linters#javascript#xo#GetCommand',
|
\ 'command_callback': 'ale_linters#javascript#xo#GetCommand',
|
||||||
\ 'callback': 'ale_linters#javascript#xo#Handle',
|
\ 'callback': 'ale#handlers#eslint#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -9,20 +9,57 @@ let g:ale_kotlin_kotlinc_sourcepath = get(g:, 'ale_kotlin_kotlinc_sourcepath', '
|
|||||||
let g:ale_kotlin_kotlinc_use_module_file = get(g:, 'ale_kotlin_kotlinc_use_module_file', 0)
|
let g:ale_kotlin_kotlinc_use_module_file = get(g:, 'ale_kotlin_kotlinc_use_module_file', 0)
|
||||||
let g:ale_kotlin_kotlinc_module_filename = get(g:, 'ale_kotlin_kotlinc_module_filename', 'module.xml')
|
let g:ale_kotlin_kotlinc_module_filename = get(g:, 'ale_kotlin_kotlinc_module_filename', 'module.xml')
|
||||||
|
|
||||||
function! ale_linters#kotlin#kotlinc#GetCommand(buffer) abort
|
let s:classpath_sep = has('unix') ? ':' : ';'
|
||||||
|
|
||||||
|
function! ale_linters#kotlin#kotlinc#GetImportPaths(buffer) abort
|
||||||
|
" exec maven/gradle only if classpath is not set
|
||||||
|
if ale#Var(a:buffer, 'kotlin_kotlinc_classpath') isnot# ''
|
||||||
|
return ''
|
||||||
|
else
|
||||||
|
let l:pom_path = ale#path#FindNearestFile(a:buffer, 'pom.xml')
|
||||||
|
if !empty(l:pom_path) && executable('mvn')
|
||||||
|
return ale#path#CdString(fnamemodify(l:pom_path, ':h'))
|
||||||
|
\ . 'mvn dependency:build-classpath'
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:classpath_command = ale#gradle#BuildClasspathCommand(a:buffer)
|
||||||
|
if !empty(l:classpath_command)
|
||||||
|
return l:classpath_command
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:BuildClassPathOption(buffer, import_paths) abort
|
||||||
|
" Filter out lines like [INFO], etc.
|
||||||
|
let l:class_paths = filter(a:import_paths[:], 'v:val !~# ''[''')
|
||||||
|
call extend(
|
||||||
|
\ l:class_paths,
|
||||||
|
\ split(ale#Var(a:buffer, 'kotlin_kotlinc_classpath'), s:classpath_sep),
|
||||||
|
\)
|
||||||
|
|
||||||
|
return !empty(l:class_paths)
|
||||||
|
\ ? ' -cp ' . ale#Escape(join(l:class_paths, s:classpath_sep))
|
||||||
|
\ : ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#kotlin#kotlinc#GetCommand(buffer, import_paths) abort
|
||||||
let l:kotlinc_opts = ale#Var(a:buffer, 'kotlin_kotlinc_options')
|
let l:kotlinc_opts = ale#Var(a:buffer, 'kotlin_kotlinc_options')
|
||||||
let l:command = 'kotlinc '
|
let l:command = 'kotlinc '
|
||||||
|
|
||||||
" If the config file is enabled and readable, source it
|
" If the config file is enabled and readable, source it
|
||||||
if ale#Var(a:buffer, 'kotlin_kotlinc_enable_config')
|
if ale#Var(a:buffer, 'kotlin_kotlinc_enable_config')
|
||||||
if filereadable(expand(ale#Var(a:buffer, 'kotlin_kotlinc_config_file'), 1))
|
let l:conf = expand(ale#Var(a:buffer, 'kotlin_kotlinc_config_file'), 1)
|
||||||
execute 'source ' . fnameescape(expand(ale#Var(a:buffer, 'kotlin_kotlinc_config_file'), 1))
|
|
||||||
|
if filereadable(l:conf)
|
||||||
|
execute 'source ' . fnameescape(l:conf)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" If use module and module file is readable use that and return
|
" If use module and module file is readable use that and return
|
||||||
if ale#Var(a:buffer, 'kotlin_kotlinc_use_module_file')
|
if ale#Var(a:buffer, 'kotlin_kotlinc_use_module_file')
|
||||||
let l:module_filename = fnameescape(expand(ale#Var(a:buffer, 'kotlin_kotlinc_module_filename'), 1))
|
let l:module_filename = ale#Escape(expand(ale#Var(a:buffer, 'kotlin_kotlinc_module_filename'), 1))
|
||||||
|
|
||||||
if filereadable(l:module_filename)
|
if filereadable(l:module_filename)
|
||||||
let l:kotlinc_opts .= ' -module ' . l:module_filename
|
let l:kotlinc_opts .= ' -module ' . l:module_filename
|
||||||
@@ -33,16 +70,30 @@ function! ale_linters#kotlin#kotlinc#GetCommand(buffer) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" We only get here if not using module or the module file not readable
|
" We only get here if not using module or the module file not readable
|
||||||
if ale#Var(a:buffer, 'kotlin_kotlinc_classpath') !=# ''
|
if ale#Var(a:buffer, 'kotlin_kotlinc_classpath') isnot# ''
|
||||||
let l:kotlinc_opts .= ' -cp ' . ale#Var(a:buffer, 'kotlin_kotlinc_classpath')
|
let l:kotlinc_opts .= ' -cp ' . ale#Var(a:buffer, 'kotlin_kotlinc_classpath')
|
||||||
|
else
|
||||||
|
" get classpath from maven/gradle
|
||||||
|
let l:kotlinc_opts .= s:BuildClassPathOption(a:buffer, a:import_paths)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:fname = ''
|
let l:fname = ''
|
||||||
|
if ale#Var(a:buffer, 'kotlin_kotlinc_sourcepath') isnot# ''
|
||||||
if ale#Var(a:buffer, 'kotlin_kotlinc_sourcepath') !=# ''
|
|
||||||
let l:fname .= expand(ale#Var(a:buffer, 'kotlin_kotlinc_sourcepath'), 1) . ' '
|
let l:fname .= expand(ale#Var(a:buffer, 'kotlin_kotlinc_sourcepath'), 1) . ' '
|
||||||
|
else
|
||||||
|
" Find the src directory for files in this project.
|
||||||
|
|
||||||
|
let l:project_root = ale#gradle#FindProjectRoot(a:buffer)
|
||||||
|
if !empty(l:project_root)
|
||||||
|
let l:src_dir = l:project_root
|
||||||
|
else
|
||||||
|
let l:src_dir = ale#path#FindNearestDirectory(a:buffer, 'src/main/java')
|
||||||
|
\ . ' ' . ale#path#FindNearestDirectory(a:buffer, 'src/main/kotlin')
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:fname .= expand(l:src_dir, 1) . ' '
|
||||||
endif
|
endif
|
||||||
let l:fname .= shellescape(expand('#' . a:buffer . ':p'))
|
let l:fname .= ale#Escape(expand('#' . a:buffer . ':p'))
|
||||||
let l:command .= l:kotlinc_opts . ' ' . l:fname
|
let l:command .= l:kotlinc_opts . ' ' . l:fname
|
||||||
|
|
||||||
return l:command
|
return l:command
|
||||||
@@ -70,10 +121,10 @@ function! ale_linters#kotlin#kotlinc#Handle(buffer, lines) abort
|
|||||||
let l:curbuf_abspath = expand('#' . a:buffer . ':p')
|
let l:curbuf_abspath = expand('#' . a:buffer . ':p')
|
||||||
|
|
||||||
" Skip if file is not loaded
|
" Skip if file is not loaded
|
||||||
if l:buf_abspath !=# l:curbuf_abspath
|
if l:buf_abspath isnot# l:curbuf_abspath
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
let l:type_marker_str = l:type ==# 'warning' ? 'W' : 'E'
|
let l:type_marker_str = l:type is# 'warning' ? 'W' : 'E'
|
||||||
|
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'lnum': l:line,
|
\ 'lnum': l:line,
|
||||||
@@ -94,10 +145,10 @@ function! ale_linters#kotlin#kotlinc#Handle(buffer, lines) abort
|
|||||||
let l:type = l:match[1]
|
let l:type = l:match[1]
|
||||||
let l:text = l:match[2]
|
let l:text = l:match[2]
|
||||||
|
|
||||||
let l:type_marker_str = l:type ==# 'warning' || l:type ==# 'info' ? 'W' : 'E'
|
let l:type_marker_str = l:type is# 'warning' || l:type is# 'info' ? 'W' : 'E'
|
||||||
|
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
\ 'lnum': -1,
|
\ 'lnum': 1,
|
||||||
\ 'text': l:text,
|
\ 'text': l:text,
|
||||||
\ 'type': l:type_marker_str,
|
\ 'type': l:type_marker_str,
|
||||||
\})
|
\})
|
||||||
@@ -108,9 +159,12 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('kotlin', {
|
call ale#linter#Define('kotlin', {
|
||||||
\ 'name': 'kotlinc',
|
\ 'name': 'kotlinc',
|
||||||
\ 'output_stream': 'stderr',
|
|
||||||
\ 'executable': 'kotlinc',
|
\ 'executable': 'kotlinc',
|
||||||
\ 'command_callback': 'ale_linters#kotlin#kotlinc#GetCommand',
|
\ 'command_chain': [
|
||||||
|
\ {'callback': 'ale_linters#kotlin#kotlinc#GetImportPaths', 'output_stream': 'stdout'},
|
||||||
|
\ {'callback': 'ale_linters#kotlin#kotlinc#GetCommand', 'output_stream': 'stderr'},
|
||||||
|
\ ],
|
||||||
\ 'callback': 'ale_linters#kotlin#kotlinc#Handle',
|
\ 'callback': 'ale_linters#kotlin#kotlinc#Handle',
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
\})
|
\})
|
||||||
|
|
||||||
|
|||||||
54
ale_linters/kotlin/ktlint.vim
Normal file
54
ale_linters/kotlin/ktlint.vim
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
" Author: Francis Agyapong <francisagyapong2@gmail.com>
|
||||||
|
" Description: Lint kotlin files using ktlint
|
||||||
|
|
||||||
|
call ale#Set('kotlin_ktlint_executable', 'ktlint')
|
||||||
|
call ale#Set('kotlin_ktlint_rulesets', [])
|
||||||
|
call ale#Set('kotlin_ktlint_format', 0)
|
||||||
|
|
||||||
|
|
||||||
|
function! ale_linters#kotlin#ktlint#GetCommand(buffer) abort
|
||||||
|
let l:executable = ale#Var(a:buffer, 'kotlin_ktlint_executable')
|
||||||
|
let l:file_path = expand('#' . a:buffer . ':p')
|
||||||
|
let l:options = ''
|
||||||
|
|
||||||
|
" Formmatted content written to original file, not sure how to handle
|
||||||
|
" if ale#Var(a:buffer, 'kotlin_ktlint_format')
|
||||||
|
" let l:options = l:options . ' --format'
|
||||||
|
" endif
|
||||||
|
|
||||||
|
for l:ruleset in ale#Var(a:buffer, 'kotlin_ktlint_rulesets')
|
||||||
|
let l:options = l:options . ' --ruleset ' . l:ruleset
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:executable . ' ' . l:options . ' ' . l:file_path
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#kotlin#ktlint#Handle(buffer, lines) abort
|
||||||
|
let l:message_pattern = '^\(.*\):\([0-9]\+\):\([0-9]\+\):\s\+\(.*\)'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:message_pattern)
|
||||||
|
let l:line = l:match[2] + 0
|
||||||
|
let l:column = l:match[3] + 0
|
||||||
|
let l:text = l:match[4]
|
||||||
|
|
||||||
|
let l:type = l:text =~? 'not a valid kotlin file' ? 'E' : 'W'
|
||||||
|
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': l:line,
|
||||||
|
\ 'col': l:column,
|
||||||
|
\ 'text': l:text,
|
||||||
|
\ 'type': l:type
|
||||||
|
\})
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('kotlin', {
|
||||||
|
\ 'name': 'ktlint',
|
||||||
|
\ 'executable': 'ktlint',
|
||||||
|
\ 'command_callback': 'ale_linters#kotlin#ktlint#GetCommand',
|
||||||
|
\ 'callback': 'ale_linters#kotlin#ktlint#Handle',
|
||||||
|
\ 'lint_file': 1
|
||||||
|
\})
|
||||||
56
ale_linters/less/lessc.vim
Executable file
56
ale_linters/less/lessc.vim
Executable file
@@ -0,0 +1,56 @@
|
|||||||
|
" Author: zanona <https://github.com/zanona>, w0rp <devw0rp@gmail.com>
|
||||||
|
" Description: This file adds support for checking Less code with lessc.
|
||||||
|
|
||||||
|
call ale#Set('less_lessc_executable', 'lessc')
|
||||||
|
call ale#Set('less_lessc_options', '')
|
||||||
|
call ale#Set('less_lessc_use_global', 0)
|
||||||
|
|
||||||
|
function! ale_linters#less#lessc#GetExecutable(buffer) abort
|
||||||
|
return ale#node#FindExecutable(a:buffer, 'less_lessc', [
|
||||||
|
\ 'node_modules/.bin/lessc',
|
||||||
|
\])
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#less#lessc#GetCommand(buffer) abort
|
||||||
|
let l:executable = ale_linters#less#lessc#GetExecutable(a:buffer)
|
||||||
|
let l:dir = expand('#' . a:buffer . ':p:h')
|
||||||
|
let l:options = ale#Var(a:buffer, 'less_lessc_options')
|
||||||
|
|
||||||
|
return ale#Escape(l:executable)
|
||||||
|
\ . ' --no-color --lint'
|
||||||
|
\ . ' --include-path=' . ale#Escape(l:dir)
|
||||||
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
|
\ . ' -'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#less#lessc#Handle(buffer, lines) abort
|
||||||
|
let l:dir = expand('#' . a:buffer . ':p:h')
|
||||||
|
" Matches patterns like the following:
|
||||||
|
let l:pattern = '^\(\w\+\): \(.\{-}\) in \(.\{-}\) on line \(\d\+\), column \(\d\+\):$'
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||||
|
let l:item = {
|
||||||
|
\ 'lnum': l:match[4] + 0,
|
||||||
|
\ 'col': l:match[5] + 0,
|
||||||
|
\ 'text': l:match[2],
|
||||||
|
\ 'type': 'E',
|
||||||
|
\}
|
||||||
|
|
||||||
|
if l:match[3] isnot# '-'
|
||||||
|
let l:item.filename = ale#path#GetAbsPath(l:dir, l:match[3])
|
||||||
|
endif
|
||||||
|
|
||||||
|
call add(l:output, l:item)
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('less', {
|
||||||
|
\ 'name': 'lessc',
|
||||||
|
\ 'executable_callback': 'ale_linters#less#lessc#GetExecutable',
|
||||||
|
\ 'command_callback': 'ale_linters#less#lessc#GetCommand',
|
||||||
|
\ 'callback': 'ale_linters#less#lessc#Handle',
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\})
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user