Compare commits
663 commits
Author | SHA1 | Date | |
---|---|---|---|
80ef6ef6a7 | |||
|
0a0535546f | ||
|
b7363bef7d | ||
|
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 | ||
|
e4a6da936d | ||
|
70cd1d5a57 | ||
|
a767578d44 | ||
|
6d732b9fb4 | ||
|
710c3ee3d2 | ||
|
3bb75a6fde | ||
|
8ea9044667 | ||
|
cddb26558f |
633 changed files with 19060 additions and 3619 deletions
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
|
2
.gitattributes
vendored
2
.gitattributes
vendored
|
@ -6,7 +6,7 @@
|
|||
/Makefile export-ignore
|
||||
/PULL_REQUEST_TEMPLATE.md export-ignore
|
||||
/README.md export-ignore
|
||||
/custom-checks export-ignore
|
||||
/img export-ignore
|
||||
/run-tests export-ignore
|
||||
/run-tests.bat export-ignore
|
||||
/test export-ignore
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
|||
/init.vim
|
||||
/doc/tags
|
||||
.*
|
||||
!.editorconfig
|
||||
*.obj
|
||||
tags
|
||||
|
|
|
@ -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`.
|
||||
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.
|
||||
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
|
||||
required access needed to properly administrate the project on GitHub or any
|
||||
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
|
||||
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
|
||||
|
|
|
@ -1,8 +1,28 @@
|
|||
<!--
|
||||
For bugs, paste output from your clipboard after running :ALEInfoToClipboard
|
||||
here. If that doesn't work for some reason, try running :ALEInfo and copying
|
||||
the output from that here instead. If everything is broken, run around in
|
||||
circles and scream.
|
||||
|
||||
Whatever the case, describe the your issue here.
|
||||
This is a template for bug reports. If you want to request a new feature,
|
||||
you can clear this entire form field and write a short description of what
|
||||
you want.
|
||||
-->
|
||||
|
||||
## 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-2017, w0rp <devw0rp@gmail.com>
|
||||
Copyright (c) 2016-2018, w0rp <devw0rp@gmail.com>
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
|
277
README.md
277
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)
|
||||
|
||||
|
||||

|
||||
|
||||
|
@ -16,8 +17,7 @@ back to a filesystem.
|
|||
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 completion via Language Server Protocol servers, or
|
||||
servers with similar enough protocols, like `tsserver`.
|
||||
formatting tools, and some Language Server Protocol and `tsserver` features.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
|
@ -26,6 +26,7 @@ servers with similar enough protocols, like `tsserver`.
|
|||
1. [Linting](#usage-linting)
|
||||
2. [Fixing](#usage-fixing)
|
||||
3. [Completion](#usage-completion)
|
||||
4. [Go To Definition](#usage-go-to-definition)
|
||||
3. [Installation](#installation)
|
||||
1. [Installation with Vim package management](#standard-installation)
|
||||
2. [Installation with Pathogen](#installation-with-pathogen)
|
||||
|
@ -35,14 +36,18 @@ servers with similar enough protocols, like `tsserver`.
|
|||
1. [How do I disable particular linters?](#faq-disable-linters)
|
||||
2. [How can I keep the sign gutter open?](#faq-keep-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)
|
||||
5. [How can I change the format for echo messages?](#faq-echo-format)
|
||||
6. [How can I execute some code when ALE stops linting?](#faq-autocmd)
|
||||
7. [How can I navigate between errors quickly?](#faq-navigation)
|
||||
8. [How can I run linters only when I save files?](#faq-lint-on-save)
|
||||
9. [How can I use the quickfix list instead of the loclist?](#faq-quickfix)
|
||||
10. [How can I check JSX files with both stylelint and eslint?](#faq-jsx-stylelint-eslint)
|
||||
11. [Will this plugin eat all of my laptop battery power?](#faq-my-battery-is-sad)
|
||||
4. [How can I change or disable the highlights ALE uses?](#faq-change-highlights)
|
||||
5. [How can I show errors or warnings in my statusline?](#faq-statusline)
|
||||
6. [How can I show errors or warnings in my lightline?](#faq-lightline)
|
||||
7. [How can I change the format for echo messages?](#faq-echo-format)
|
||||
8. [How can I execute some code when ALE starts or stops linting?](#faq-autocmd)
|
||||
9. [How can I navigate between errors quickly?](#faq-navigation)
|
||||
10. [How can I run linters only when I save files?](#faq-lint-on-save)
|
||||
11. [How can I use the quickfix list instead of the loclist?](#faq-quickfix)
|
||||
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)
|
||||
|
||||
<a name="supported-languages"></a>
|
||||
|
||||
|
@ -55,88 +60,114 @@ tools will be run in combination, so they can be complementary.
|
|||
Keep the table rows sorted alphabetically by the language name,
|
||||
and the tools in the tools column sorted alphabetically by the tool
|
||||
name. That seems to be the fairest way to arrange this table.
|
||||
|
||||
Remember to also update doc/ale.txt, which has a similar list with different
|
||||
formatting.
|
||||
-->
|
||||
|
||||
**Notes:**
|
||||
|
||||
* *^ No linters for text or Vim help filetypes are enabled by default.*
|
||||
* *!! These linters check only files on disk. See `:help ale-lint-file-linters`*
|
||||
|
||||
| Language | Tools |
|
||||
| -------- | ----- |
|
||||
| ASM | [gcc](https://gcc.gnu.org) |
|
||||
| Ansible | [ansible-lint](https://github.com/willthames/ansible-lint) |
|
||||
| AsciiDoc | [proselint](http://proselint.com/)|
|
||||
| API Blueprint | [drafter](https://github.com/apiaryio/drafter) |
|
||||
| AsciiDoc | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [write-good](https://github.com/btford/write-good) |
|
||||
| Awk | [gawk](https://www.gnu.org/software/gawk/)|
|
||||
| Bash | [-n flag](https://www.gnu.org/software/bash/manual/bash.html#index-set), [shellcheck](https://www.shellcheck.net/) |
|
||||
| Bourne Shell | [-n flag](http://linux.die.net/man/1/sh), [shellcheck](https://www.shellcheck.net/) |
|
||||
| C | [cppcheck](http://cppcheck.sourceforge.net), [gcc](https://gcc.gnu.org/), [clang](http://clang.llvm.org/), [clang-format](https://clang.llvm.org/docs/ClangFormat.html)|
|
||||
| C++ (filetype cpp) | [clang](http://clang.llvm.org/), [clangcheck](http://clang.llvm.org/docs/ClangCheck.html), [clangtidy](http://clang.llvm.org/extra/clang-tidy/), [cppcheck](http://cppcheck.sourceforge.net), [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint), [gcc](https://gcc.gnu.org/), [clang-format](https://clang.llvm.org/docs/ClangFormat.html)|
|
||||
| C# | [mcs](http://www.mono-project.com/docs/about-mono/languages/csharp/) |
|
||||
| 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) |
|
||||
| Bourne Shell | shell [-n flag](http://linux.die.net/man/1/sh), [shellcheck](https://www.shellcheck.net/), [shfmt](https://github.com/mvdan/sh) |
|
||||
| C | [cppcheck](http://cppcheck.sourceforge.net), [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint), [clang](http://clang.llvm.org/), [clangtidy](http://clang.llvm.org/extra/clang-tidy/) !!, [clang-format](https://clang.llvm.org/docs/ClangFormat.html), [flawfinder](https://www.dwheeler.com/flawfinder/), [gcc](https://gcc.gnu.org/) |
|
||||
| C++ (filetype cpp) | [clang](http://clang.llvm.org/), [clangcheck](http://clang.llvm.org/docs/ClangCheck.html) !!, [clangtidy](http://clang.llvm.org/extra/clang-tidy/) !!, [clang-format](https://clang.llvm.org/docs/ClangFormat.html), [cppcheck](http://cppcheck.sourceforge.net), [cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint) !!, [flawfinder](https://www.dwheeler.com/flawfinder/), [gcc](https://gcc.gnu.org/) |
|
||||
| CUDA | [nvcc](http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html) |
|
||||
| C# | [mcs](http://www.mono-project.com/docs/about-mono/languages/csharp/) see:`help ale-cs-mcs` for details, [mcsc](http://www.mono-project.com/docs/about-mono/languages/csharp/) !! see:`help ale-cs-mcsc` for details and configuration|
|
||||
| Chef | [foodcritic](http://www.foodcritic.io/) |
|
||||
| Clojure | [joker](https://github.com/candid82/joker) |
|
||||
| CMake | [cmakelint](https://github.com/richq/cmake-lint) |
|
||||
| CoffeeScript | [coffee](http://coffeescript.org/), [coffeelint](https://www.npmjs.com/package/coffeelint) |
|
||||
| Crystal | [crystal](https://crystal-lang.org/) |
|
||||
| CSS | [csslint](http://csslint.net/), [stylelint](https://github.com/stylelint/stylelint) |
|
||||
| Crystal | [crystal](https://crystal-lang.org/) !! |
|
||||
| CSS | [csslint](http://csslint.net/), [prettier](https://github.com/prettier/prettier), [stylelint](https://github.com/stylelint/stylelint) |
|
||||
| Cython (pyrex filetype) | [cython](http://cython.org/) |
|
||||
| D | [dmd](https://dlang.org/dmd-linux.html) |
|
||||
| Dart | [dartanalyzer](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer_cli) |
|
||||
| Dockerfile | [hadolint](https://github.com/lukasmartinelli/hadolint) |
|
||||
| Elixir | [credo](https://github.com/rrrene/credo), [dogma](https://github.com/lpil/dogma) |
|
||||
| Elm | [elm-make](https://github.com/elm-lang/elm-make) |
|
||||
| Erb | [erb](https://github.com/jeremyevans/erubi), [erubis](https://github.com/kwatch/erubis) |
|
||||
| Dafny | [dafny](https://rise4fun.com/Dafny) !! |
|
||||
| Dart | [dartanalyzer](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer_cli) !!, [language_server](https://github.com/natebosch/dart_language_server) |
|
||||
| Dockerfile | [hadolint](https://github.com/hadolint/hadolint) |
|
||||
| Elixir | [credo](https://github.com/rrrene/credo), [dialyxir](https://github.com/jeremyjh/dialyxir), [dogma](https://github.com/lpil/dogma) !!|
|
||||
| Elm | [elm-format](https://github.com/avh4/elm-format), [elm-make](https://github.com/elm-lang/elm-make) |
|
||||
| Erb | [erb](https://apidock.com/ruby/ERB), [erubi](https://github.com/jeremyevans/erubi), [erubis](https://github.com/kwatch/erubis) |
|
||||
| Erlang | [erlc](http://erlang.org/doc/man/erlc.html), [SyntaxErl](https://github.com/ten0s/syntaxerl) |
|
||||
| Fish | fish [-n flag](https://linux.die.net/man/1/fish)
|
||||
| Fortran | [gcc](https://gcc.gnu.org/) |
|
||||
| Fountain | [proselint](http://proselint.com/) |
|
||||
| FusionScript | [fusion-lint](https://github.com/RyanSquared/fusionscript) |
|
||||
| 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) |
|
||||
| GraphQL | [gqlint](https://github.com/happylinks/gqlint) |
|
||||
| Haml | [haml-lint](https://github.com/brigade/haml-lint)
|
||||
| Git Commit Messages | [gitlint](https://github.com/jorisroovers/gitlint) |
|
||||
| GLSL | [glslang](https://github.com/KhronosGroup/glslang), [glslls](https://github.com/svenstaro/glsl-language-server) |
|
||||
| Go | [gofmt](https://golang.org/cmd/gofmt/), [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports), [go vet](https://golang.org/cmd/vet/) !!, [golint](https://godoc.org/github.com/golang/lint), [gotype](https://godoc.org/golang.org/x/tools/cmd/gotype), [gometalinter](https://github.com/alecthomas/gometalinter) !!, [go build](https://golang.org/cmd/go/) !!, [gosimple](https://github.com/dominikh/go-tools/tree/master/cmd/gosimple) !!, [staticcheck](https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck) !! |
|
||||
| GraphQL | [eslint](http://eslint.org/), [gqlint](https://github.com/happylinks/gqlint), [prettier](https://github.com/prettier/prettier) |
|
||||
| Haml | [haml-lint](https://github.com/brigade/haml-lint) |
|
||||
| Handlebars | [ember-template-lint](https://github.com/rwjblue/ember-template-lint) |
|
||||
| Haskell | [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) |
|
||||
| HTML | [HTMLHint](http://htmlhint.com/), [proselint](http://proselint.com/), [tidy](http://www.html-tidy.org/) |
|
||||
| Haskell | [brittany](https://github.com/lspitzner/brittany), [ghc](https://www.haskell.org/ghc/), [stack-ghc](https://haskellstack.org/), [stack-build](https://haskellstack.org/) !!, [ghc-mod](https://github.com/DanielG/ghc-mod), [stack-ghc-mod](https://github.com/DanielG/ghc-mod), [hlint](https://hackage.haskell.org/package/hlint), [hdevtools](https://hackage.haskell.org/package/hdevtools), [hfmt](https://github.com/danstiner/hfmt) |
|
||||
| HTML | [alex](https://github.com/wooorm/alex) !!, [HTMLHint](http://htmlhint.com/), [proselint](http://proselint.com/), [tidy](http://www.html-tidy.org/), [write-good](https://github.com/btford/write-good) |
|
||||
| Idris | [idris](http://www.idris-lang.org/) |
|
||||
| Java | [checkstyle](http://checkstyle.sourceforge.net), [javac](http://www.oracle.com/technetwork/java/javase/downloads/index.html) |
|
||||
| JavaScript | [eslint](http://eslint.org/), [jscs](http://jscs.info/), [jshint](http://jshint.com/), [flow](https://flowtype.org/), [standard](http://standardjs.com/), [prettier](https://github.com/prettier/prettier) (and `prettier-eslint`, `prettier-standard`), [xo](https://github.com/sindresorhus/xo)
|
||||
| JSON | [jsonlint](http://zaa.ch/jsonlint/) |
|
||||
| Kotlin | [kotlinc](https://kotlinlang.org), [ktlint](https://ktlint.github.io) see `:help ale-integration-kotlin` for configuration instructions
|
||||
| LaTeX | [chktex](http://www.nongnu.org/chktex/), [lacheck](https://www.ctan.org/pkg/lacheck), [proselint](http://proselint.com/) |
|
||||
| Lua | [luacheck](https://github.com/mpeterv/luacheck) |
|
||||
| Markdown | [mdl](https://github.com/mivok/markdownlint), [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale) |
|
||||
| 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) |
|
||||
| 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)
|
||||
| JSON | [fixjson](https://github.com/rhysd/fixjson), [jsonlint](http://zaa.ch/jsonlint/), [jq](https://stedolan.github.io/jq/), [prettier](https://github.com/prettier/prettier) |
|
||||
| Kotlin | [kotlinc](https://kotlinlang.org) !!, [ktlint](https://ktlint.github.io) !! see `:help ale-integration-kotlin` for configuration instructions |
|
||||
| LaTeX | [alex](https://github.com/wooorm/alex) !!, [chktex](http://www.nongnu.org/chktex/), [lacheck](https://www.ctan.org/pkg/lacheck), [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good) |
|
||||
| Less | [lessc](https://www.npmjs.com/package/less), [prettier](https://github.com/prettier/prettier), [stylelint](https://github.com/stylelint/stylelint) |
|
||||
| LLVM | [llc](https://llvm.org/docs/CommandGuide/llc.html) |
|
||||
| Lua | [luac](https://www.lua.org/manual/5.1/luac.html), [luacheck](https://github.com/mpeterv/luacheck) |
|
||||
| Mail | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale) |
|
||||
| Make | [checkmake](https://github.com/mrtazz/checkmake) |
|
||||
| Markdown | [alex](https://github.com/wooorm/alex) !!, [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) !!, [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) |
|
||||
| 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) |
|
||||
| nroff | [proselint](http://proselint.com/)|
|
||||
| nroff | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good)|
|
||||
| Objective-C | [clang](http://clang.llvm.org/) |
|
||||
| Objective-C++ | [clang](http://clang.llvm.org/) |
|
||||
| OCaml | [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-integration-ocaml-merlin` for configuration instructions
|
||||
| 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) |
|
||||
| PHP | [hack](http://hacklang.org/), [langserver](https://github.com/felixfbecker/php-language-server), [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) |
|
||||
| Pod | [proselint](http://proselint.com/)|
|
||||
| PHP | [hack](http://hacklang.org/), [hackfmt](https://github.com/facebook/flow/tree/master/hack/hackfmt), [langserver](https://github.com/felixfbecker/php-language-server), [phan](https://github.com/phan/phan) see `:help ale-php-phan` to instructions, [php -l](https://secure.php.net/), [phpcs](https://github.com/squizlabs/PHP_CodeSniffer), [phpmd](https://phpmd.org), [phpstan](https://github.com/phpstan/phpstan), [phpcbf](https://github.com/squizlabs/PHP_CodeSniffer), [php-cs-fixer](http://cs.sensiolabs.org/) |
|
||||
| PO | [alex](https://github.com/wooorm/alex) !!, [msgfmt](https://www.gnu.org/software/gettext/manual/html_node/msgfmt-Invocation.html), [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good) |
|
||||
| Pod | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good) |
|
||||
| Pony | [ponyc](https://github.com/ponylang/ponyc) |
|
||||
| proto | [protoc-gen-lint](https://github.com/ckaznocha/protoc-gen-lint) |
|
||||
| Pug | [pug-lint](https://github.com/pugjs/pug-lint) |
|
||||
| Puppet | [puppet](https://puppet.com), [puppet-lint](https://puppet-lint.com) |
|
||||
| Python | [autopep8](https://github.com/hhatto/autopep8), [flake8](http://flake8.pycqa.org/en/latest/), [isort](https://github.com/timothycrosley/isort), [mypy](http://mypy-lang.org/), [pycodestyle](https://github.com/PyCQA/pycodestyle), [pylint](https://www.pylint.org/), [yapf](https://github.com/google/yapf) |
|
||||
| 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) |
|
||||
| R | [lintr](https://github.com/jimhester/lintr) |
|
||||
| ReasonML | [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-integration-reason-merlin` for configuration instructions
|
||||
| reStructuredText | [proselint](http://proselint.com/)|
|
||||
| ReasonML | [merlin](https://github.com/the-lambda-church/merlin) see `:help ale-reasonml-ols` for configuration instructions, [ols](https://github.com/freebroccolo/ocaml-language-server), [refmt](https://github.com/reasonml/reason-cli) |
|
||||
| reStructuredText | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [redpen](http://redpen.cc/), [rstcheck](https://github.com/myint/rstcheck), [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good) |
|
||||
| Re:VIEW | [redpen](http://redpen.cc/) |
|
||||
| RPM spec | [rpmlint](https://github.com/rpm-software-management/rpmlint) (disabled by default; see `:help ale-integration-spec`) |
|
||||
| Ruby | [brakeman](http://brakemanscanner.org/), [rails_best_practices](https://github.com/flyerhzm/rails_best_practices), [reek](https://github.com/troessner/reek), [rubocop](https://github.com/bbatsov/rubocop), [ruby](https://www.ruby-lang.org) |
|
||||
| Rust | cargo (see `:help ale-integration-rust` for configuration instructions), [rls](https://github.com/rust-lang-nursery/rls), [rustc](https://www.rust-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) |
|
||||
| Rust | cargo !! (see `:help ale-integration-rust` for configuration instructions), [rls](https://github.com/rust-lang-nursery/rls), [rustc](https://www.rust-lang.org/), [rustfmt](https://github.com/rust-lang-nursery/rustfmt) |
|
||||
| SASS | [sass-lint](https://www.npmjs.com/package/sass-lint), [stylelint](https://github.com/stylelint/stylelint) |
|
||||
| SCSS | [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), [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/) |
|
||||
| Solidity | [solhint](https://github.com/protofire/solhint), [solium](https://github.com/duaraghav8/Solium) |
|
||||
| Stylus | [stylelint](https://github.com/stylelint/stylelint) |
|
||||
| SQL | [sqlint](https://github.com/purcell/sqlint) |
|
||||
| Swift | [swiftlint](https://github.com/realm/SwiftLint), [swiftformat](https://github.com/nicklockwood/SwiftFormat) |
|
||||
| Tcl | [nagelfar](http://nagelfar.sourceforge.net)|
|
||||
| Texinfo | [proselint](http://proselint.com/)|
|
||||
| Text^ | [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale) |
|
||||
| TypeScript | [eslint](http://eslint.org/), [tslint](https://github.com/palantir/tslint), tsserver, typecheck |
|
||||
| Tcl | [nagelfar](http://nagelfar.sourceforge.net) !! |
|
||||
| Terraform | [tflint](https://github.com/wata727/tflint) |
|
||||
| Texinfo | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good)|
|
||||
| Text^ | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [vale](https://github.com/ValeLint/vale), [write-good](https://github.com/btford/write-good), [redpen](http://redpen.cc/) |
|
||||
| Thrift | [thrift](http://thrift.apache.org/) |
|
||||
| TypeScript | [eslint](http://eslint.org/), [prettier](https://github.com/prettier/prettier), [tslint](https://github.com/palantir/tslint), tsserver, typecheck |
|
||||
| Verilog | [iverilog](https://github.com/steveicarus/iverilog), [verilator](http://www.veripool.org/projects/verilator/wiki/Intro) |
|
||||
| Vim | [vint](https://github.com/Kuniwak/vint) |
|
||||
| Vim help^ | [proselint](http://proselint.com/)|
|
||||
| XHTML | [proselint](http://proselint.com/)|
|
||||
| XML | [xmllint](http://xmlsoft.org/xmllint.html/)|
|
||||
| Vim help^ | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good) |
|
||||
| Vue | [prettier](https://github.com/prettier/prettier) |
|
||||
| XHTML | [alex](https://github.com/wooorm/alex) !!, [proselint](http://proselint.com/), [write-good](https://github.com/btford/write-good) |
|
||||
| XML | [xmllint](http://xmlsoft.org/xmllint.html) |
|
||||
| YAML | [swaglint](https://github.com/byCedric/swaglint), [yamllint](https://yamllint.readthedocs.io/) |
|
||||
|
||||
* *^ No linters for text or Vim help filetypes are enabled by default.*
|
||||
|
||||
<a name="usage"></a>
|
||||
|
||||
## 2. Usage
|
||||
|
@ -198,6 +229,15 @@ 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>
|
||||
|
||||
## 3. Installation
|
||||
|
@ -357,9 +397,35 @@ highlight clear ALEErrorSign
|
|||
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>
|
||||
|
||||
### 5.iv. How can I show errors or warnings in my statusline?
|
||||
### 5.v. How can I show errors or warnings in my statusline?
|
||||
|
||||
[vim-airline](https://github.com/vim-airline/vim-airline) integrates with ALE
|
||||
for displaying error information in the status bar. If you want to see the
|
||||
|
@ -397,9 +463,18 @@ 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>
|
||||
|
||||
### 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.
|
||||
|
||||
|
@ -424,22 +499,24 @@ Will give you:
|
|||
|
||||
<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)
|
||||
event whenever has a linter has been successfully executed and processed. This
|
||||
autocmd event can be used to call arbitrary functions after ALE stops linting.
|
||||
events whenever has a linter is started and has been successfully executed and
|
||||
processed. These events can be used to call arbitrary functions before and after
|
||||
ALE stops linting.
|
||||
|
||||
```vim
|
||||
augroup YourGroup
|
||||
autocmd!
|
||||
autocmd User ALELint call YourFunction()
|
||||
autocmd User ALELintPre call YourFunction()
|
||||
autocmd User ALELintPost call YourFunction()
|
||||
augroup END
|
||||
```
|
||||
|
||||
<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
|
||||
errors quickly. You can map the keys Ctrl+j and Ctrl+k to moving between errors
|
||||
|
@ -455,7 +532,7 @@ For more information, consult the online documentation with
|
|||
|
||||
<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
|
||||
when files are saved. This option is enabled by default. If you only
|
||||
|
@ -475,7 +552,7 @@ files, you can set `g:ale_lint_on_save` to `0`.
|
|||
|
||||
<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`
|
||||
option on. If you wish to also disable the loclist, you can disable
|
||||
|
@ -500,9 +577,12 @@ let g:ale_open_list = 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>
|
||||
|
||||
### 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
|
||||
the right tools, you can check JSX files with stylelint and eslint.
|
||||
|
@ -535,7 +615,7 @@ no linter will be run twice for the same file.
|
|||
|
||||
<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
|
||||
course means that CPU time will be used to continuously check your code. If you
|
||||
|
@ -557,3 +637,64 @@ still be an advantage.
|
|||
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
|
||||
`: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.
|
||||
|
|
|
@ -21,7 +21,7 @@ function! ale_linters#ansible#ansible_lint#Handle(buffer, lines) abort
|
|||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:code = l:match[4]
|
||||
|
||||
if l:code is# 'EANSIBLE002'
|
||||
if l:code is# 'EANSIBLE0002'
|
||||
\&& !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
|
||||
" Skip warnings for trailing whitespace if the option is off.
|
||||
continue
|
||||
|
@ -31,7 +31,8 @@ function! ale_linters#ansible#ansible_lint#Handle(buffer, lines) abort
|
|||
call add(l:output, {
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'col': l:match[3] + 0,
|
||||
\ 'text': l:code . ': ' . l:match[5],
|
||||
\ 'text': l:match[5],
|
||||
\ 'code': l:code,
|
||||
\ 'type': l:code[:0] is# 'E' ? 'E' : 'W',
|
||||
\})
|
||||
endif
|
||||
|
|
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,10 +1,16 @@
|
|||
" Author: Lucas Kolstad <lkolstad@uw.edu>
|
||||
" 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
|
||||
return 'gcc -x assembler -fsyntax-only '
|
||||
return ale#Escape(ale_linters#asm#gcc#GetExecutable(a:buffer))
|
||||
\ . ' -x assembler -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||
\ . ' ' . ale#Var(a:buffer, 'asm_gcc_options') . ' -'
|
||||
endfunction
|
||||
|
@ -27,7 +33,7 @@ endfunction
|
|||
call ale#linter#Define('asm', {
|
||||
\ 'name': 'gcc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'gcc',
|
||||
\ 'executable_callback': 'ale_linters#asm#gcc#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#asm#gcc#GetCommand',
|
||||
\ 'callback': 'ale_linters#asm#gcc#Handle',
|
||||
\})
|
||||
|
|
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,
|
||||
\})
|
30
ale_linters/c/flawfinder.vim
Normal file
30
ale_linters/c/flawfinder.vim
Normal file
|
@ -0,0 +1,30 @@
|
|||
" 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)
|
||||
|
||||
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#gcc#HandleGCCFormat',
|
||||
\})
|
|
@ -1,24 +1,37 @@
|
|||
" Author: Edward Larkey <edwlarkey@mac.com>
|
||||
" Author: Jose Junior <jose.junior@gmail.com>
|
||||
" Author: w0rp <devw0rp@gmail.com>
|
||||
" Description: This file adds the foodcritic linter for Chef files.
|
||||
|
||||
" Support options!
|
||||
let g:ale_chef_foodcritic_options = get(g:, 'ale_chef_foodcritic_options', '')
|
||||
let g:ale_chef_foodcritic_executable = get(g:, 'ale_chef_foodcritic_executable', 'foodcritic')
|
||||
call ale#Set('chef_foodcritic_executable', 'foodcritic')
|
||||
call ale#Set('chef_foodcritic_options', '')
|
||||
|
||||
function! ale_linters#chef#foodcritic#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'chef_foodcritic_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#chef#foodcritic#GetCommand(buffer) abort
|
||||
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
|
||||
" Matches patterns line the following:
|
||||
"
|
||||
" 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 = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:text = l:match[1]
|
||||
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[3] + 0,
|
||||
\ 'text': l:text,
|
||||
\ 'code': l:match[1],
|
||||
\ 'text': l:match[2],
|
||||
\ 'filename': l:match[3],
|
||||
\ 'lnum': l:match[4] + 0,
|
||||
\ 'type': 'W',
|
||||
\})
|
||||
endfor
|
||||
|
@ -26,17 +39,10 @@ function! ale_linters#chef#foodcritic#Handle(buffer, lines) abort
|
|||
return l:output
|
||||
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', {
|
||||
\ 'name': 'foodcritic',
|
||||
\ 'executable': 'foodcritic',
|
||||
\ 'executable_callback': 'ale_linters#chef#foodcritic#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#chef#foodcritic#GetCommand',
|
||||
\ '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',
|
||||
\})
|
|
@ -24,9 +24,9 @@ function! ale_linters#cpp#clangcheck#GetCommand(buffer) abort
|
|||
" 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) : '')
|
||||
\ . (empty(l:build_dir) ? ' -extra-arg -Xanalyzer -extra-arg -analyzer-output=text' : '')
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('cpp', {
|
||||
|
|
30
ale_linters/cpp/flawfinder.vim
Normal file
30
ale_linters/cpp/flawfinder.vim
Normal file
|
@ -0,0 +1,30 @@
|
|||
" 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)
|
||||
|
||||
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#gcc#HandleGCCFormat',
|
||||
\})
|
|
@ -8,15 +8,16 @@ function! ale_linters#cs#mcs#Handle(buffer, lines) abort
|
|||
" Look for lines like the following.
|
||||
"
|
||||
" Tests.cs(12,29): error CSXXXX: ; expected
|
||||
let l:pattern = '^.\+.cs(\(\d\+\),\(\d\+\)): \(.\+\): \(.\+\)'
|
||||
let l:pattern = '^\v(.+\.cs)\((\d+),(\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[3] . ': ' . l:match[4],
|
||||
\ 'type': l:match[3] =~# '^error' ? 'E' : 'W',
|
||||
\ '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
|
||||
|
||||
|
|
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
|
||||
\})
|
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,
|
||||
\})
|
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,
|
||||
\ })
|
|
@ -13,7 +13,7 @@ function! ale_linters#dart#dartanalyzer#GetCommand(buffer) abort
|
|||
|
||||
return ale#Escape(l:executable)
|
||||
\ . (!empty(l:path) ? ' --packages ' . ale#Escape(l:path) : '')
|
||||
\ . ' %t'
|
||||
\ . ' %s'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#dart#dartanalyzer#Handle(buffer, lines) abort
|
||||
|
@ -37,4 +37,5 @@ call ale#linter#Define('dart', {
|
|||
\ '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',
|
||||
\})
|
||||
|
|
@ -2,31 +2,51 @@
|
|||
|
||||
" always, yes, never
|
||||
call ale#Set('dockerfile_hadolint_use_docker', 'never')
|
||||
call ale#Set('dockerfile_hadolint_docker_image', 'lukasmartinelli/hadolint')
|
||||
call ale#Set('dockerfile_hadolint_docker_image', 'hadolint/hadolint')
|
||||
|
||||
function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
|
||||
" Matches patterns line the following:
|
||||
"
|
||||
" stdin:19: F: Pipe chain should start with a raw value.
|
||||
let l:pattern = '\v^/dev/stdin:?(\d+)? (\S+) (.+)$'
|
||||
" /dev/stdin:19 DL3001 Pipe chain should start with a raw value.
|
||||
" /dev/stdin:19:3 unexpected thing
|
||||
let l:pattern = '\v^/dev/stdin:(\d+):?(\d+)? ((DL|SC)(\d+) )?(.+)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:lnum = 0
|
||||
let l:colnum = 0
|
||||
|
||||
if l:match[1] isnot# ''
|
||||
let l:lnum = l:match[1] + 0
|
||||
endif
|
||||
|
||||
if l:match[2] isnot# ''
|
||||
let l:colnum = l:match[2] + 0
|
||||
endif
|
||||
|
||||
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, {
|
||||
\ 'lnum': l:lnum,
|
||||
\ 'col': 0,
|
||||
\ 'col': l:colnum,
|
||||
\ 'type': l:type,
|
||||
\ 'text': l:text,
|
||||
\ 'nr': l:match[2],
|
||||
\ 'detail': l:detail
|
||||
\})
|
||||
endfor
|
||||
|
||||
|
|
|
@ -32,6 +32,6 @@ endfunction
|
|||
call ale#linter#Define('elixir', {
|
||||
\ 'name': 'credo',
|
||||
\ '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',
|
||||
\})
|
||||
|
|
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',
|
||||
\})
|
||||
|
|
@ -32,7 +32,7 @@ endfunction
|
|||
call ale#linter#Define('elixir', {
|
||||
\ 'name': 'dogma',
|
||||
\ 'executable': 'mix',
|
||||
\ 'command': 'mix dogma %s --format=flycheck',
|
||||
\ 'command': 'mix help dogma && mix dogma %s --format=flycheck',
|
||||
\ 'lint_file': 1,
|
||||
\ 'callback': 'ale_linters#elixir#dogma#Handle',
|
||||
\})
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
" 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.
|
||||
|
||||
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
|
||||
let l:output = []
|
||||
let l:is_windows = has('win32')
|
||||
|
@ -52,6 +61,7 @@ endfunction
|
|||
" If it doesn't, then this will fail when imports are needed.
|
||||
function! ale_linters#elm#make#GetCommand(buffer) abort
|
||||
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)
|
||||
let l:dir_set_cmd = ''
|
||||
else
|
||||
|
@ -61,16 +71,18 @@ function! ale_linters#elm#make#GetCommand(buffer) abort
|
|||
|
||||
" 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,
|
||||
" 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
|
||||
let l:elm_cmd = 'elm-make --report=json --output='.ale#Escape('/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'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('elm', {
|
||||
\ 'name': 'make',
|
||||
\ 'executable': 'elm-make',
|
||||
\ 'executable_callback': 'ale_linters#elm#make#GetExecutable',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'command_callback': 'ale_linters#elm#make#GetCommand',
|
||||
\ 'callback': 'ale_linters#elm#make#Handle'
|
||||
|
|
|
@ -17,7 +17,7 @@ function! ale_linters#erlang#erlc#Handle(buffer, lines) abort
|
|||
" error.erl:4: variable 'B' is unbound
|
||||
" error.erl:3: Warning: function main/0 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:
|
||||
" error.erl: undefined parse transform 'some_parse_transform'
|
||||
|
|
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',
|
||||
\})
|
|
@ -1,11 +1,23 @@
|
|||
" Author: Jake Zimmerman <jake@zimmerman.io>
|
||||
" 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': 'erubis -x %t | ruby -c',
|
||||
\ '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',
|
||||
\})
|
||||
|
36
ale_linters/fish/fish.vim
Normal file
36
ale_linters/fish/fish.vim
Normal file
|
@ -0,0 +1,36 @@
|
|||
" 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
|
||||
" ^
|
||||
" <W> fish: Error while reading file .config/fish/functions/foo.fish
|
||||
let l:pattern = '^.* (line \(\d\+\)): \(.*\)$'
|
||||
let l:output = []
|
||||
|
||||
let l:i = 0
|
||||
while l:i < len(a:lines)
|
||||
let l:match = matchlist(a:lines[l:i], l:pattern)
|
||||
if len(l:match) && len(l:match[2])
|
||||
call add(l:output, {
|
||||
\ 'col': len(a:lines[l:i + 2]),
|
||||
\ 'lnum': str2nr(l:match[1]),
|
||||
\ 'text': l:match[2],
|
||||
\})
|
||||
endif
|
||||
let l:i += 1
|
||||
endwhile
|
||||
|
||||
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',
|
||||
\})
|
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',
|
||||
\})
|
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
|
||||
|
||||
" 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
|
||||
if exists('s:go_env')
|
||||
return ''
|
||||
|
@ -12,6 +18,8 @@ function! ale_linters#go#gobuild#GoEnv(buffer) abort
|
|||
endfunction
|
||||
|
||||
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')
|
||||
let s:go_env = {
|
||||
\ 'GOPATH': a:goenv_output[0],
|
||||
|
@ -19,10 +27,16 @@ function! ale_linters#go#gobuild#GetCommand(buffer, goenv_output) abort
|
|||
\}
|
||||
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
|
||||
return 'GOPATH=' . s:go_env.GOPATH
|
||||
\ . ' cd ' . fnamemodify(bufname(a:buffer), ':.:h')
|
||||
\ . ' && go test -c -o /dev/null ./'
|
||||
return l:gopath_env_command
|
||||
\ . ale#path#BufferCdString(a:buffer)
|
||||
\ . 'go test'
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' -c -o /dev/null ./'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#go#gobuild#GetMatches(lines) abort
|
||||
|
@ -39,15 +53,12 @@ function! ale_linters#go#gobuild#GetMatches(lines) abort
|
|||
endfunction
|
||||
|
||||
function! ale_linters#go#gobuild#Handler(buffer, lines) abort
|
||||
let l:dir = expand('#' . a:buffer . ':p:h')
|
||||
let l:output = []
|
||||
|
||||
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, {
|
||||
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'col': l:match[3] + 0,
|
||||
\ 'text': l:match[4],
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'golint',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'executable': 'golint',
|
||||
\ 'command': 'golint %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
" 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
|
||||
|
||||
call ale#Set('go_gometalinter_options', '')
|
||||
call ale#Set('go_gometalinter_executable', 'gometalinter')
|
||||
call ale#Set('go_gometalinter_lint_package', 0)
|
||||
|
||||
function! ale_linters#go#gometalinter#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'go_gometalinter_executable')
|
||||
|
@ -10,13 +11,22 @@ endfunction
|
|||
|
||||
function! ale_linters#go#gometalinter#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#go#gometalinter#GetExecutable(a:buffer)
|
||||
let l:filename = expand('#' . a:buffer)
|
||||
let l:filename = expand('#' . a:buffer . ':t')
|
||||
let l:options = ale#Var(a:buffer, 'go_gometalinter_options')
|
||||
let l:lint_package = ale#Var(a:buffer, 'go_gometalinter_lint_package')
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . ' --include=' . ale#Escape('^' . ale#util#EscapePCRE(l:filename))
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' ' . ale#Escape(fnamemodify(l:filename, ':h'))
|
||||
" 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
|
||||
|
||||
function! ale_linters#go#gometalinter#GetMatches(lines) abort
|
||||
|
@ -26,10 +36,13 @@ function! ale_linters#go#gometalinter#GetMatches(lines) abort
|
|||
endfunction
|
||||
|
||||
function! ale_linters#go#gometalinter#Handler(buffer, lines) abort
|
||||
let l:dir = expand('#' . a:buffer . ':p:h')
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale_linters#go#gometalinter#GetMatches(a:lines)
|
||||
" l:match[1] will already be an absolute path, output from gometalinter
|
||||
call add(l:output, {
|
||||
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'col': l:match[3] + 0,
|
||||
\ 'type': tolower(l:match[4]) is# 'warning' ? 'W' : 'E',
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
call ale#linter#Define('go', {
|
||||
\ 'name': 'gosimple',
|
||||
\ 'executable': 'gosimple',
|
||||
\ 'command': 'gosimple %t',
|
||||
\ 'command': 'gosimple %s',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\ 'output_stream': 'both'
|
||||
\ 'output_stream': 'both',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
|
23
ale_linters/go/gotype.vim
Normal file
23
ale_linters/go/gotype.vim
Normal file
|
@ -0,0 +1,23 @@
|
|||
" Author: Jelte Fennema <github-public@jeltef.nl>
|
||||
" Description: gotype for Go files
|
||||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'gotype',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'gotype',
|
||||
\ 'command_callback': 'ale_linters#go#gotype#GetCommand',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsError',
|
||||
\})
|
||||
|
||||
"\ 'command':
|
||||
function! ale_linters#go#gotype#GetCommand(buffer) abort
|
||||
let l:cur_file = expand('#' . a:buffer . ':p')
|
||||
if l:cur_file =~# '_test\.go$'
|
||||
return
|
||||
endif
|
||||
|
||||
let l:module_files = globpath(expand('#' . a:buffer . ':p:h'), '*.go', 0, 1)
|
||||
let l:other_module_files = filter(l:module_files, 'v:val isnot# ' . ale#util#EscapeVim(l:cur_file) . ' && v:val !~# "_test\.go$"')
|
||||
return 'gotype %t ' . join(map(l:other_module_files, 'ale#Escape(v:val)'))
|
||||
|
||||
endfunction
|
|
@ -1,10 +1,35 @@
|
|||
" Author: neersighted <bjorn@neersighted.com>
|
||||
" 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
|
||||
|
||||
function! ale_linters#go#govet#Handler(buffer, lines) abort
|
||||
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:? ?(.+)$'
|
||||
let l:output = []
|
||||
let l:dir = expand('#' . a:buffer . ':p:h')
|
||||
|
||||
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,
|
||||
\ 'text': l:match[4],
|
||||
\ 'type': 'E',
|
||||
\})
|
||||
endfor
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'go vet',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'go',
|
||||
\ 'command': 'go vet %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsError',
|
||||
\ 'command_callback': 'ale_linters#go#govet#GetCommand',
|
||||
\ 'callback': 'ale_linters#go#govet#Handler',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
|
|
@ -1,10 +1,33 @@
|
|||
" Author: Ben Reedy <https://github.com/breed808>
|
||||
" 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', {
|
||||
\ 'name': 'staticcheck',
|
||||
\ 'executable': 'staticcheck',
|
||||
\ 'command': 'staticcheck %t',
|
||||
\ 'command_callback': 'ale_linters#go#staticcheck#GetCommand',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\ 'output_stream': 'both'
|
||||
\ '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',
|
||||
\})
|
|
@ -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
|
||||
|
||||
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
|
||||
" Matches patterns like the following:
|
||||
" <path>:51 [W] RuboCop: Use the new Ruby 1.9 hash syntax.
|
||||
|
@ -21,6 +46,6 @@ endfunction
|
|||
call ale#linter#Define('haml', {
|
||||
\ 'name': 'hamllint',
|
||||
\ 'executable': 'haml-lint',
|
||||
\ 'command': 'haml-lint %t',
|
||||
\ 'command_callback': 'ale_linters#haml#hamllint#GetCommand',
|
||||
\ 'callback': 'ale_linters#haml#hamllint#Handle'
|
||||
\})
|
||||
|
|
|
@ -22,15 +22,13 @@ function! ale_linters#handlebars#embertemplatelint#Handle(buffer, lines) abort
|
|||
for l:error in get(values(l:json), 0, [])
|
||||
if has_key(l:error, 'fatal')
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': 1,
|
||||
\ 'col': 1,
|
||||
\ 'lnum': get(l:error, 'line', 1),
|
||||
\ 'col': get(l:error, 'column', 1),
|
||||
\ 'text': l:error.message,
|
||||
\ 'type': l:error.severity == 1 ? 'W' : 'E',
|
||||
\})
|
||||
else
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:error.line,
|
||||
\ 'col': l:error.column,
|
||||
\ 'text': l:error.rule . ': ' . l:error.message,
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
" Author: w0rp <devw0rp@gmail.com>
|
||||
" 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', {
|
||||
\ 'name': 'ghc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'ghc',
|
||||
\ 'command': 'ghc -fno-code -v0 %t',
|
||||
\ 'command_callback': 'ale_linters#haskell#ghc#GetCommand',
|
||||
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
||||
\})
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
call ale#Set('haskell_stack_build_options', '--fast')
|
||||
|
||||
function ale_linters#haskell#stack_build#GetCommand(buffer) abort
|
||||
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
|
||||
|
|
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,7 +1,7 @@
|
|||
" Author: KabbAmine <amine.kabb@gmail.com>, deathmaz <00maz1987@gmail.com>, diartyz <diartyz@gmail.com>
|
||||
" Description: HTMLHint for checking html files
|
||||
|
||||
call ale#Set('html_htmlhint_options', '--format=unix')
|
||||
call ale#Set('html_htmlhint_options', '')
|
||||
call ale#Set('html_htmlhint_executable', 'htmlhint')
|
||||
call ale#Set('html_htmlhint_use_global', 0)
|
||||
|
||||
|
@ -12,9 +12,22 @@ function! ale_linters#html#htmlhint#GetExecutable(buffer) abort
|
|||
endfunction
|
||||
|
||||
function! ale_linters#html#htmlhint#GetCommand(buffer) abort
|
||||
return ale_linters#html#htmlhint#GetExecutable(a:buffer)
|
||||
\ . ' ' . ale#Var(a:buffer, 'html_htmlhint_options')
|
||||
\ . ' %t'
|
||||
let l:options = ale#Var(a:buffer, 'html_htmlhint_options')
|
||||
let l:config = l:options !~# '--config'
|
||||
\ ? 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
|
||||
|
||||
call ale#linter#Define('html', {
|
||||
|
|
|
@ -25,8 +25,16 @@ function! ale_linters#html#tidy#GetCommand(buffer) abort
|
|||
\ 'utf-8': '-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 -',
|
||||
\ ale#Var(a:buffer, 'html_tidy_executable'),
|
||||
\ l:executable,
|
||||
\ ale#Var(a:buffer, 'html_tidy_options'),
|
||||
\ l:file_encoding
|
||||
\)
|
||||
|
|
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',
|
||||
\})
|
|
@ -2,27 +2,17 @@
|
|||
" Description: checkstyle for Java files
|
||||
|
||||
function! ale_linters#java#checkstyle#Handle(buffer, lines) abort
|
||||
let l:patterns = [
|
||||
\ '\v\[(WARN|ERROR)\] .*:(\d+):(\d+): (.*)',
|
||||
\ '\v\[(WARN|ERROR)\] .*:(\d+): (.*)',
|
||||
\]
|
||||
let l:pattern = '\v\[(WARN|ERROR)\] [a-zA-Z]?:?[^:]+:(\d+):(\d+)?:? (.*) \[(.+)\]$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:patterns)
|
||||
let l:args = {
|
||||
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,
|
||||
\ 'type': l:match[1] =~? 'WARN' ? 'W' : 'E'
|
||||
\ }
|
||||
|
||||
let l:col = l:match[3] + 0
|
||||
if l:col > 0
|
||||
let l:args['col'] = l:col
|
||||
let l:args['text'] = l:match[4]
|
||||
else
|
||||
let l:args['text'] = l:match[3]
|
||||
endif
|
||||
|
||||
call add(l:output, l:args)
|
||||
\ 'col': l:match[3] + 0,
|
||||
\ 'text': l:match[4],
|
||||
\ 'code': l:match[5],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
|
|
|
@ -14,6 +14,11 @@ function! ale_linters#java#javac#GetImportPaths(buffer) abort
|
|||
\ . '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 ''
|
||||
endfunction
|
||||
|
||||
|
@ -36,15 +41,42 @@ function! ale_linters#java#javac#GetCommand(buffer, import_paths) abort
|
|||
|
||||
" Find the src directory, for files in this project.
|
||||
let l:src_dir = ale#path#FindNearestDirectory(a:buffer, 'src/main/java')
|
||||
let l:sp_dirs = []
|
||||
|
||||
if !empty(l:src_dir)
|
||||
let l:sp_option = '-sourcepath ' . ale#Escape(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
|
||||
|
||||
" Create .class files in a temporary directory, which we will delete later.
|
||||
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:sp_option
|
||||
\ . ' -d ' . ale#Escape(l:class_file_directory)
|
||||
|
@ -58,14 +90,15 @@ function! ale_linters#java#javac#Handle(buffer, lines) abort
|
|||
" Main.java:13: warning: [deprecation] donaught() in Testclass has been deprecated
|
||||
" 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:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, [l:pattern, l:col_pattern, l:symbol_pattern])
|
||||
if empty(l:match[2]) && empty(l:match[3])
|
||||
let l:output[-1].col = len(l:match[1])
|
||||
let l:output[-1].col = len(l:match[1])
|
||||
elseif empty(l:match[3])
|
||||
" Add symbols to 'cannot find symbol' errors.
|
||||
if l:output[-1].text is# 'error: cannot find symbol'
|
||||
|
@ -73,9 +106,10 @@ function! ale_linters#java#javac#Handle(buffer, lines) abort
|
|||
endif
|
||||
else
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'text': l:match[2] . ':' . l:match[3],
|
||||
\ 'type': l:match[2] is# 'error' ? 'E' : 'W',
|
||||
\ 'filename': ale#path#GetAbsPath(l:directory, l:match[1]),
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'text': l:match[3] . ':' . l:match[4],
|
||||
\ 'type': l:match[3] is# 'error' ? 'E' : 'W',
|
||||
\})
|
||||
endif
|
||||
endfor
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
call ale#linter#Define('javascript', {
|
||||
\ 'name': 'eslint',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'executable_callback': 'ale#handlers#eslint#GetExecutable',
|
||||
\ 'command_callback': 'ale#handlers#eslint#GetCommand',
|
||||
\ 'callback': 'ale#handlers#eslint#Handle',
|
||||
|
|
105
ale_linters/javascript/flow.vim
Normal file → Executable file
105
ale_linters/javascript/flow.vim
Normal file → Executable file
|
@ -1,21 +1,12 @@
|
|||
" Author: Zach Perrault -- @zperrault
|
||||
" Author: Florian Beeres <yuuki@protonmail.com>
|
||||
" Description: FlowType checking for JavaScript files
|
||||
|
||||
call ale#Set('javascript_flow_executable', 'flow')
|
||||
call ale#Set('javascript_flow_use_home_config', 0)
|
||||
call ale#Set('javascript_flow_use_global', 0)
|
||||
|
||||
function! ale_linters#javascript#flow#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'javascript_flow', [
|
||||
\ 'node_modules/.bin/flow',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#javascript#flow#VersionCheck(buffer) abort
|
||||
return ale#Escape(ale_linters#javascript#flow#GetExecutable(a:buffer))
|
||||
\ . ' --version'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#javascript#flow#GetCommand(buffer, version_lines) abort
|
||||
let l:flow_config = ale#path#FindNearestFile(a:buffer, '.flowconfig')
|
||||
|
||||
if empty(l:flow_config)
|
||||
|
@ -23,18 +14,43 @@ function! ale_linters#javascript#flow#GetCommand(buffer, version_lines) abort
|
|||
return ''
|
||||
endif
|
||||
|
||||
let l:use_respect_pragma = 1
|
||||
" Don't run Flow with a configuration file from the home directory by
|
||||
" 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.
|
||||
for l:match in ale#util#GetMatches(a:version_lines, '\v\d+\.\d+\.\d+$')
|
||||
let l:use_respect_pragma = ale#semver#GreaterOrEqual(
|
||||
\ ale#semver#Parse(l:match[0]),
|
||||
\ [0, 36, 0]
|
||||
\)
|
||||
endfor
|
||||
let l:use_respect_pragma = empty(l:version)
|
||||
\ || ale#semver#GTE(l:version, [0, 36])
|
||||
|
||||
return ale#Escape(ale_linters#javascript#flow#GetExecutable(a:buffer))
|
||||
return ale#Escape(l:executable)
|
||||
\ . ' check-contents'
|
||||
\ . (l:use_respect_pragma ? ' --respect-pragma': '')
|
||||
\ . ' --json --from ale %s'
|
||||
|
@ -56,6 +72,44 @@ function! s:GetJSONLines(lines) abort
|
|||
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
|
||||
|
||||
function! ale_linters#javascript#flow#Handle(buffer, lines) abort
|
||||
let l:str = join(s:GetJSONLines(a:lines), '')
|
||||
|
||||
|
@ -94,12 +148,19 @@ function! ale_linters#javascript#flow#Handle(buffer, lines) abort
|
|||
let l:text = l:text . ' See also: ' . l:error.operation.descr
|
||||
endif
|
||||
|
||||
call add(l:output, {
|
||||
let l:errorToAdd = {
|
||||
\ 'lnum': l:line,
|
||||
\ 'col': l:col,
|
||||
\ 'text': l:text,
|
||||
\ 'type': l:error.level is# '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
|
||||
|
||||
return l:output
|
||||
|
|
|
@ -35,19 +35,23 @@ function! ale_linters#javascript#jscs#Handle(buffer, lines) abort
|
|||
"
|
||||
" foobar.js: line 2, col 1, Expected indentation of 1 characters
|
||||
"
|
||||
let l:pattern = '^.*:\s\+line \(\d\+\),\s\+col\s\+\(\d\+\),\s\+\(.*\)$'
|
||||
let l:pattern = '\v^.*:\s+line (\d+),\s+col\s+(\d+),\s+(.*)$'
|
||||
let l:output = []
|
||||
let l:m = ale#util#GetMatches(a:lines, [l:pattern])
|
||||
|
||||
for l:match in l:m
|
||||
let l:text = l:match[3]
|
||||
|
||||
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
|
||||
|
||||
|
|
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',
|
||||
\})
|
27
ale_linters/less/stylelint.vim
Normal file
27
ale_linters/less/stylelint.vim
Normal file
|
@ -0,0 +1,27 @@
|
|||
" Author: diartyz <diartyz@gmail.com>, w0rp <devw0rp@gmail.com>
|
||||
|
||||
call ale#Set('less_stylelint_executable', 'stylelint')
|
||||
call ale#Set('less_stylelint_options', '')
|
||||
call ale#Set('less_stylelint_use_global', 0)
|
||||
|
||||
function! ale_linters#less#stylelint#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'less_stylelint', [
|
||||
\ 'node_modules/.bin/stylelint',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#less#stylelint#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#less#stylelint#GetExecutable(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'less_stylelint_options')
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --stdin-filename %s'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('less', {
|
||||
\ 'name': 'stylelint',
|
||||
\ 'executable_callback': 'ale_linters#less#stylelint#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#less#stylelint#GetCommand',
|
||||
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
|
||||
\})
|
35
ale_linters/llvm/llc.vim
Normal file
35
ale_linters/llvm/llc.vim
Normal file
|
@ -0,0 +1,35 @@
|
|||
" Author: rhysd <https://rhysd.github.io>
|
||||
" Description: Support for checking LLVM IR with llc
|
||||
|
||||
call ale#Set('llvm_llc_executable', 'llc')
|
||||
|
||||
function! ale_linters#llvm#llc#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'llvm_llc_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#llvm#llc#GetCommand(buffer) abort
|
||||
return ale#Escape(ale_linters#llvm#llc#GetExecutable(a:buffer))
|
||||
\ . ' -filetype=null -o='
|
||||
\ . ale#Escape(g:ale#util#nul_file)
|
||||
endfunction
|
||||
|
||||
function! ale_linters#llvm#llc#HandleErrors(buffer, lines) abort
|
||||
" Handle '{path}: {file}:{line}:{col}: error: {message}' format
|
||||
let l:pattern = '\v^[a-zA-Z]?:?[^:]+: [^:]+:(\d+):(\d+): (.+)$'
|
||||
let l:matches = ale#util#GetMatches(a:lines, l:pattern)
|
||||
|
||||
return map(l:matches, "{
|
||||
\ 'lnum': str2nr(v:val[1]),
|
||||
\ 'col': str2nr(v:val[2]),
|
||||
\ 'text': v:val[3],
|
||||
\ 'type': 'E',
|
||||
\}")
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('llvm', {
|
||||
\ 'name': 'llc',
|
||||
\ 'executable_callback': 'ale_linters#llvm#llc#GetExecutable',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'command_callback': 'ale_linters#llvm#llc#GetCommand',
|
||||
\ 'callback': 'ale_linters#llvm#llc#HandleErrors',
|
||||
\})
|
40
ale_linters/lua/luac.vim
Normal file
40
ale_linters/lua/luac.vim
Normal file
|
@ -0,0 +1,40 @@
|
|||
" Author: Jon Xie https://github.com/xiejiangzhi
|
||||
" Description: luac linter for lua files
|
||||
|
||||
call ale#Set('lua_luac_executable', 'luac')
|
||||
|
||||
function! ale_linters#lua#luac#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'lua_luac_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#lua#luac#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#lua#luac#GetExecutable(a:buffer)
|
||||
return ale#Escape(l:executable) . ' -p - '
|
||||
endfunction
|
||||
|
||||
function! ale_linters#lua#luac#Handle(buffer, lines) abort
|
||||
" Matches patterns line the following:
|
||||
"
|
||||
" luac: stdin:5: '=' expected near ')'
|
||||
" luac: stdin:8: ')' expected (to close '(' at line 6) near '123'
|
||||
let l:pattern = '\v^.*:(\d+): (.+)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'type': 'E',
|
||||
\ 'text': l:match[2],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('lua', {
|
||||
\ 'name': 'luac',
|
||||
\ 'executable_callback': 'ale_linters#lua#luac#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#lua#luac#GetCommand',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'callback': 'ale_linters#lua#luac#Handle',
|
||||
\})
|
|
@ -26,11 +26,18 @@ function! ale_linters#lua#luacheck#Handle(buffer, lines) abort
|
|||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
if !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
|
||||
\ && l:match[3] is# 'W'
|
||||
\ && index(range(611, 614), str2nr(l:match[4])) >= 0
|
||||
continue
|
||||
endif
|
||||
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'col': l:match[2] + 0,
|
||||
\ 'text': l:match[3] . l:match[4] . ': ' . l:match[5],
|
||||
\ 'type': l:match[3],
|
||||
\ 'code': l:match[3] . l:match[4],
|
||||
\ 'text': l:match[5],
|
||||
\})
|
||||
endfor
|
||||
|
||||
|
|
11
ale_linters/mail/alex.vim
Normal file
11
ale_linters/mail/alex.vim
Normal file
|
@ -0,0 +1,11 @@
|
|||
" Author: Johannes Wienke <languitar@semipol.de>
|
||||
" Description: alex for HTML files
|
||||
|
||||
call ale#linter#Define('mail', {
|
||||
\ 'name': 'alex',
|
||||
\ 'executable': 'alex',
|
||||
\ 'command': 'alex %s -t',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'callback': 'ale#handlers#alex#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
9
ale_linters/mail/proselint.vim
Normal file
9
ale_linters/mail/proselint.vim
Normal file
|
@ -0,0 +1,9 @@
|
|||
" Author: Daniel M. Capella https://github.com/polyzen
|
||||
" Description: proselint for mail files
|
||||
|
||||
call ale#linter#Define('mail', {
|
||||
\ 'name': 'proselint',
|
||||
\ 'executable': 'proselint',
|
||||
\ 'command': 'proselint %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
9
ale_linters/mail/vale.vim
Normal file
9
ale_linters/mail/vale.vim
Normal file
|
@ -0,0 +1,9 @@
|
|||
" Author: chew-z https://github.com/chew-z
|
||||
" Description: vale for Markdown files
|
||||
|
||||
call ale#linter#Define('mail', {
|
||||
\ 'name': 'vale',
|
||||
\ 'executable': 'vale',
|
||||
\ 'command': 'vale --output=JSON %t',
|
||||
\ 'callback': 'ale#handlers#vale#Handle',
|
||||
\})
|
24
ale_linters/make/checkmake.vim
Normal file
24
ale_linters/make/checkmake.vim
Normal file
|
@ -0,0 +1,24 @@
|
|||
" Author: aurieh - https://github.com/aurieh
|
||||
|
||||
function! ale_linters#make#checkmake#Handle(buffer, lines) abort
|
||||
let l:pattern = '\v^(\d+):(.+):(.+)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'type': 'E',
|
||||
\ 'code': l:match[2],
|
||||
\ 'text': l:match[3],
|
||||
\})
|
||||
endfor
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('make', {
|
||||
\ 'name': 'checkmake',
|
||||
\ 'executable': 'checkmake',
|
||||
\ 'command': 'checkmake %s --format="{{.LineNumber}}:{{.Rule}}:{{.Violation}}"',
|
||||
\ 'callback': 'ale_linters#make#checkmake#Handle',
|
||||
\})
|
11
ale_linters/markdown/alex.vim
Normal file
11
ale_linters/markdown/alex.vim
Normal file
|
@ -0,0 +1,11 @@
|
|||
" Author: Johannes Wienke <languitar@semipol.de>
|
||||
" Description: alex for markdown files
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'alex',
|
||||
\ 'executable': 'alex',
|
||||
\ 'command': 'alex %s -t',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'callback': 'ale#handlers#alex#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
|
@ -1,5 +1,20 @@
|
|||
" Author: Steve Dignam <steve@dignam.xyz>
|
||||
" Description: Support for mdl, a markdown linter
|
||||
" Author: Steve Dignam <steve@dignam.xyz>, Josh Leeb-du Toit <joshleeb.com>
|
||||
" Description: Support for mdl, a markdown linter.
|
||||
|
||||
call ale#Set('markdown_mdl_executable', 'mdl')
|
||||
call ale#Set('markdown_mdl_options', '')
|
||||
|
||||
function! ale_linters#markdown#mdl#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'markdown_mdl_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#markdown#mdl#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#markdown#mdl#GetExecutable(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'markdown_mdl_options')
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#markdown#mdl#Handle(buffer, lines) abort
|
||||
" matches: '(stdin):173: MD004 Unordered list style'
|
||||
|
@ -19,7 +34,7 @@ endfunction
|
|||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'mdl',
|
||||
\ 'executable': 'mdl',
|
||||
\ 'command': 'mdl',
|
||||
\ 'executable_callback': 'ale_linters#markdown#mdl#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#markdown#mdl#GetCommand',
|
||||
\ 'callback': 'ale_linters#markdown#mdl#Handle'
|
||||
\})
|
||||
|
|
9
ale_linters/markdown/redpen.vim
Normal file
9
ale_linters/markdown/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('markdown', {
|
||||
\ 'name': 'redpen',
|
||||
\ 'executable': 'redpen',
|
||||
\ 'command': 'redpen -f markdown -r json %t',
|
||||
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
|
||||
\})
|
28
ale_linters/markdown/remark_lint.vim
Normal file
28
ale_linters/markdown/remark_lint.vim
Normal file
|
@ -0,0 +1,28 @@
|
|||
" Author rhysd https://rhysd.github.io/
|
||||
" Description: remark-lint for Markdown files
|
||||
|
||||
function! ale_linters#markdown#remark_lint#Handle(buffer, lines) abort
|
||||
" matches: ' 1:4 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint'
|
||||
let l:pattern = '^ \+\(\d\+\):\(\d\+\) \(warning\|error\) \(.\+\)$'
|
||||
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,
|
||||
\ 'type': l:match[3] is# 'error' ? 'E' : 'W',
|
||||
\ 'text': l:match[4],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'remark-lint',
|
||||
\ 'executable': 'remark',
|
||||
\ 'command': 'remark --no-stdout --no-color %s',
|
||||
\ 'callback': 'ale_linters#markdown#remark_lint#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\ 'output_stream': 'stderr',
|
||||
\})
|
|
@ -4,6 +4,6 @@
|
|||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'vale',
|
||||
\ 'executable': 'vale',
|
||||
\ 'command': 'vale --output=line %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\ 'command': 'vale --output=JSON %t',
|
||||
\ 'callback': 'ale#handlers#vale#Handle',
|
||||
\})
|
||||
|
|
9
ale_linters/markdown/write-good.vim
Normal file
9
ale_linters/markdown/write-good.vim
Normal file
|
@ -0,0 +1,9 @@
|
|||
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
||||
" Description: write-good for Markdown files
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'write-good',
|
||||
\ 'executable_callback': 'ale#handlers#writegood#GetExecutable',
|
||||
\ 'command_callback': 'ale#handlers#writegood#GetCommand',
|
||||
\ 'callback': 'ale#handlers#writegood#Handle',
|
||||
\})
|
|
@ -10,33 +10,40 @@ function! ale_linters#nim#nimcheck#Handle(buffer, lines) abort
|
|||
" Only show errors of the current buffer
|
||||
" NOTE: Checking filename only is OK because nim enforces unique
|
||||
" module names.
|
||||
|
||||
let l:temp_buffer_filename = fnamemodify(l:match[1], ':p:t')
|
||||
|
||||
if l:buffer_filename isnot# '' && l:temp_buffer_filename isnot# l:buffer_filename
|
||||
continue
|
||||
endif
|
||||
|
||||
let l:line = l:match[2] + 0
|
||||
let l:column = l:match[3] + 0
|
||||
let l:text = l:match[4]
|
||||
let l:type = 'W'
|
||||
let l:item = {
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'col': l:match[3] + 0,
|
||||
\ 'text': l:match[4],
|
||||
\ 'type': 'W',
|
||||
\}
|
||||
|
||||
" Extract error type from message of type 'Error: Some error message'
|
||||
let l:textmatch = matchlist(l:match[4], '^\(.\{-}\): .\+$')
|
||||
let l:error_match = matchlist(l:item.text, '^\(.\{-}\): \(.\+\)$')
|
||||
|
||||
if len(l:textmatch) > 0
|
||||
let l:errortype = l:textmatch[1]
|
||||
if l:errortype is# 'Error'
|
||||
let l:type = 'E'
|
||||
if !empty(l:error_match)
|
||||
if l:error_match[1] is# 'Error'
|
||||
let l:item.type = 'E'
|
||||
let l:item.text = l:error_match[2]
|
||||
elseif l:error_match[1] is# 'Warning'
|
||||
\|| l:error_match[1] is# 'Hint'
|
||||
let l:item.text = l:error_match[2]
|
||||
endif
|
||||
endif
|
||||
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:line,
|
||||
\ 'col': l:column,
|
||||
\ 'text': l:text,
|
||||
\ 'type': l:type,
|
||||
\})
|
||||
let l:code_match = matchlist(l:item.text, '\v^(.+) \[([^ \[]+)\]$')
|
||||
|
||||
if !empty(l:code_match)
|
||||
let l:item.text = l:code_match[1]
|
||||
let l:item.code = l:code_match[2]
|
||||
endif
|
||||
|
||||
call add(l:output, l:item)
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
|
|
11
ale_linters/nroff/alex.vim
Normal file
11
ale_linters/nroff/alex.vim
Normal file
|
@ -0,0 +1,11 @@
|
|||
" Author: Johannes Wienke <languitar@semipol.de>
|
||||
" Description: alex for nroff files
|
||||
|
||||
call ale#linter#Define('nroff', {
|
||||
\ 'name': 'alex',
|
||||
\ 'executable': 'alex',
|
||||
\ 'command': 'alex %s -t',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'callback': 'ale#handlers#alex#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
9
ale_linters/nroff/write-good.vim
Normal file
9
ale_linters/nroff/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('nroff', {
|
||||
\ 'name': 'write-good',
|
||||
\ 'executable_callback': 'ale#handlers#writegood#GetExecutable',
|
||||
\ 'command_callback': 'ale#handlers#writegood#GetCommand',
|
||||
\ 'callback': 'ale#handlers#writegood#Handle',
|
||||
\})
|
14
ale_linters/ocaml/ols.vim
Normal file
14
ale_linters/ocaml/ols.vim
Normal file
|
@ -0,0 +1,14 @@
|
|||
" Author: Michael Jungo <michaeljungo92@gmail.com>
|
||||
" Description: A language server for OCaml
|
||||
|
||||
call ale#Set('ocaml_ols_executable', 'ocaml-language-server')
|
||||
call ale#Set('ocaml_ols_use_global', 0)
|
||||
|
||||
call ale#linter#Define('ocaml', {
|
||||
\ 'name': 'ols',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': 'ale#handlers#ols#GetExecutable',
|
||||
\ 'command_callback': 'ale#handlers#ols#GetCommand',
|
||||
\ 'language_callback': 'ale#handlers#ols#GetLanguage',
|
||||
\ 'project_root_callback': 'ale#handlers#ols#GetProjectRoot',
|
||||
\})
|
|
@ -12,7 +12,7 @@ function! ale_linters#perl#perl#GetExecutable(buffer) abort
|
|||
endfunction
|
||||
|
||||
function! ale_linters#perl#perl#GetCommand(buffer) abort
|
||||
return ale_linters#perl#perl#GetExecutable(a:buffer)
|
||||
return ale#Escape(ale_linters#perl#perl#GetExecutable(a:buffer))
|
||||
\ . ' ' . ale#Var(a:buffer, 'perl_perl_options')
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
@ -27,12 +27,20 @@ function! ale_linters#perl#perl#Handle(buffer, lines) abort
|
|||
let l:output = []
|
||||
let l:basename = expand('#' . a:buffer . ':t')
|
||||
|
||||
let l:type = 'E'
|
||||
if a:lines[-1] =~# 'syntax OK'
|
||||
let l:type = 'W'
|
||||
endif
|
||||
|
||||
let l:seen = {}
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:line = l:match[3]
|
||||
let l:file = l:match[2]
|
||||
let l:text = l:match[1]
|
||||
let l:type = 'E'
|
||||
|
||||
if ale#path#IsBufferPath(a:buffer, l:match[2])
|
||||
if ale#path#IsBufferPath(a:buffer, l:file)
|
||||
\ && !has_key(l:seen,l:line)
|
||||
\ && (
|
||||
\ l:text isnot# 'BEGIN failed--compilation aborted'
|
||||
\ || empty(l:output)
|
||||
|
@ -43,6 +51,8 @@ function! ale_linters#perl#perl#Handle(buffer, lines) abort
|
|||
\ 'text': l:text,
|
||||
\ 'type': l:type,
|
||||
\})
|
||||
|
||||
let l:seen[l:line] = 1
|
||||
endif
|
||||
endfor
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@ function! ale_linters#perl#perlcritic#Handle(buffer, lines) abort
|
|||
\ 'lnum': l:match[1],
|
||||
\ 'col': l:match[2],
|
||||
\ 'text': l:match[3],
|
||||
\ 'type': 'W'
|
||||
\})
|
||||
endfor
|
||||
|
||||
|
|
36
ale_linters/php/phan.vim
Normal file
36
ale_linters/php/phan.vim
Normal file
|
@ -0,0 +1,36 @@
|
|||
" Author: diegoholiveira <https://github.com/diegoholiveira>
|
||||
" Description: static analyzer for PHP
|
||||
|
||||
" Define the minimum severity
|
||||
let g:ale_php_phan_minimum_severity = get(g:, 'ale_php_phan_minimum_severity', 0)
|
||||
|
||||
function! ale_linters#php#phan#GetCommand(buffer) abort
|
||||
return 'phan -y '
|
||||
\ . ale#Var(a:buffer, 'php_phan_minimum_severity')
|
||||
\ . ' %s'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#php#phan#Handle(buffer, lines) abort
|
||||
" Matches against lines like the following:
|
||||
"
|
||||
" /path/to/some-filename.php:18 ERRORTYPE message
|
||||
let l:pattern = '^.*:\(\d\+\)\s\(\w\+\)\s\(.\+\)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'text': l:match[3],
|
||||
\ 'type': 'W',
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('php', {
|
||||
\ 'name': 'phan',
|
||||
\ 'executable': 'phan',
|
||||
\ 'command_callback': 'ale_linters#php#phan#GetCommand',
|
||||
\ 'callback': 'ale_linters#php#phan#Handle',
|
||||
\})
|
|
@ -4,12 +4,14 @@
|
|||
function! ale_linters#php#php#Handle(buffer, lines) abort
|
||||
" Matches patterns like the following:
|
||||
"
|
||||
" Parse error: syntax error, unexpected ';', expecting ']' in - on line 15
|
||||
let l:pattern = '\v^%(Fatal|Parse) error:\s+(.+unexpected ''(.+)%(expecting.+)@<!''.*|.+) in - on line (\d+)'
|
||||
" PHP 7.1<= - Parse error: syntax error, unexpected ';', expecting ']' in - on line 15
|
||||
" PHP 7.2>= - Parse error: syntax error, unexpected ';', expecting ']' in Standard input code on line 15
|
||||
let l:pattern = '\v^%(Fatal|Parse) error:\s+(.+unexpected ''(.+)%(expecting.+)@<!''.*|.+) in %(-|Standard input code) on line (\d+)'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:col = empty(l:match[2]) ? 0 : stridx(getline(l:match[3]), l:match[2]) + 1
|
||||
|
||||
let l:obj = {
|
||||
\ 'lnum': l:match[3] + 0,
|
||||
\ 'col': l:col,
|
||||
|
@ -30,6 +32,6 @@ call ale#linter#Define('php', {
|
|||
\ 'name': 'php',
|
||||
\ 'executable': 'php',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'command': 'php -l -d error_reporting=E_ALL -d display_errors=1 --',
|
||||
\ 'command': 'php -l -d error_reporting=E_ALL -d display_errors=1 -d log_errors=0 --',
|
||||
\ 'callback': 'ale_linters#php#php#Handle',
|
||||
\})
|
||||
|
|
|
@ -29,11 +29,12 @@ function! ale_linters#php#phpcs#Handle(buffer, lines) abort
|
|||
" Matches against lines like the following:
|
||||
"
|
||||
" /path/to/some-filename.php:18:3: error - Line indented incorrectly; expected 4 spaces, found 2 (Generic.WhiteSpace.ScopeIndent.IncorrectExact)
|
||||
let l:pattern = '^.*:\(\d\+\):\(\d\+\): \(.\+\) - \(.\+\) \(\(.\+\)\)$'
|
||||
let l:pattern = '^.*:\(\d\+\):\(\d\+\): \(.\+\) - \(.\+\) (\(.\+\))$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:text = l:match[4]
|
||||
let l:code = l:match[5]
|
||||
let l:text = l:match[4] . ' (' . l:code . ')'
|
||||
let l:type = l:match[3]
|
||||
|
||||
call add(l:output, {
|
||||
|
|
|
@ -1,11 +1,20 @@
|
|||
" Author: medains <https://github.com/medains>
|
||||
" Author: medains <https://github.com/medains>, David Sierra <https://github.com/davidsierradz>
|
||||
" Description: phpmd for PHP files
|
||||
|
||||
let g:ale_php_phpmd_executable = get(g:, 'ale_php_phpmd_executable', 'phpmd')
|
||||
|
||||
" Set to change the ruleset
|
||||
let g:ale_php_phpmd_ruleset = get(g:, 'ale_php_phpmd_ruleset', 'cleancode,codesize,controversial,design,naming,unusedcode')
|
||||
|
||||
function! ale_linters#php#phpmd#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'php_phpmd_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#php#phpmd#GetCommand(buffer) abort
|
||||
return 'phpmd %s text '
|
||||
let l:executable = ale_linters#php#phpmd#GetExecutable(a:buffer)
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . ' %s text '
|
||||
\ . ale#Var(a:buffer, 'php_phpmd_ruleset')
|
||||
\ . ' --ignore-violations-on-exit %t'
|
||||
endfunction
|
||||
|
@ -14,7 +23,7 @@ function! ale_linters#php#phpmd#Handle(buffer, lines) abort
|
|||
" Matches against lines like the following:
|
||||
"
|
||||
" /path/to/some-filename.php:18 message
|
||||
let l:pattern = '^.*:\(\d\+\)\t\(.\+\)$'
|
||||
let l:pattern = '^.*:\(\d\+\)\s\+\(.\+\)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
|
@ -30,7 +39,7 @@ endfunction
|
|||
|
||||
call ale#linter#Define('php', {
|
||||
\ 'name': 'phpmd',
|
||||
\ 'executable': 'phpmd',
|
||||
\ 'executable_callback': 'ale_linters#php#phpmd#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#php#phpmd#GetCommand',
|
||||
\ 'callback': 'ale_linters#php#phpmd#Handle',
|
||||
\})
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
" Set to change the ruleset
|
||||
let g:ale_php_phpstan_executable = get(g:, 'ale_php_phpstan_executable', 'phpstan')
|
||||
let g:ale_php_phpstan_level = get(g:, 'ale_php_phpstan_level', '4')
|
||||
let g:ale_php_phpstan_configuration = get(g:, 'ale_php_phpstan_configuration', '')
|
||||
|
||||
function! ale_linters#php#phpstan#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'php_phpstan_executable')
|
||||
|
@ -12,10 +13,16 @@ endfunction
|
|||
function! ale_linters#php#phpstan#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#php#phpstan#GetExecutable(a:buffer)
|
||||
|
||||
let l:configuration = ale#Var(a:buffer, 'php_phpstan_configuration')
|
||||
let l:configuration_option = !empty(l:configuration)
|
||||
\ ? ' -c ' . l:configuration
|
||||
\ : ''
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . ' analyze -l'
|
||||
\ . ale#Var(a:buffer, 'php_phpstan_level')
|
||||
\ . ' --errorFormat raw'
|
||||
\ . l:configuration_option
|
||||
\ . ' %s'
|
||||
endfunction
|
||||
|
||||
|
|
11
ale_linters/po/alex.vim
Normal file
11
ale_linters/po/alex.vim
Normal file
|
@ -0,0 +1,11 @@
|
|||
" Author: Cian Butler https://github.com/butlerx
|
||||
" Description: alex for PO files
|
||||
|
||||
call ale#linter#Define('po', {
|
||||
\ 'name': 'alex',
|
||||
\ 'executable': 'alex',
|
||||
\ 'command': 'alex %s -t',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'callback': 'ale#handlers#alex#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
10
ale_linters/po/msgfmt.vim
Normal file
10
ale_linters/po/msgfmt.vim
Normal file
|
@ -0,0 +1,10 @@
|
|||
" Author: Cian Butler https://github.com/butlerx
|
||||
" Description: msgfmt for PO files
|
||||
|
||||
call ale#linter#Define('po', {
|
||||
\ 'name': 'msgfmt',
|
||||
\ 'executable': 'msgfmt',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'command': 'msgfmt --statistics %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
9
ale_linters/po/proselint.vim
Normal file
9
ale_linters/po/proselint.vim
Normal file
|
@ -0,0 +1,9 @@
|
|||
" Author: Cian Butler https://github.com/butlerx
|
||||
" Description: proselint for PO files
|
||||
|
||||
call ale#linter#Define('po', {
|
||||
\ 'name': 'proselint',
|
||||
\ 'executable': 'proselint',
|
||||
\ 'command': 'proselint %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
9
ale_linters/po/write-good.vim
Normal file
9
ale_linters/po/write-good.vim
Normal file
|
@ -0,0 +1,9 @@
|
|||
" Author: Cian Butler https://github.com/butlerx
|
||||
" Description: write-good for PO files
|
||||
|
||||
call ale#linter#Define('po', {
|
||||
\ 'name': 'write-good',
|
||||
\ 'executable_callback': 'ale#handlers#writegood#GetExecutable',
|
||||
\ 'command_callback': 'ale#handlers#writegood#GetCommand',
|
||||
\ 'callback': 'ale#handlers#writegood#Handle',
|
||||
\})
|
11
ale_linters/pod/alex.vim
Normal file
11
ale_linters/pod/alex.vim
Normal file
|
@ -0,0 +1,11 @@
|
|||
" Author: Johannes Wienke <languitar@semipol.de>
|
||||
" Description: alex for pod files
|
||||
|
||||
call ale#linter#Define('pod', {
|
||||
\ 'name': 'alex',
|
||||
\ 'executable': 'alex',
|
||||
\ 'command': 'alex %s -t',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'callback': 'ale#handlers#alex#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
9
ale_linters/pod/write-good.vim
Normal file
9
ale_linters/pod/write-good.vim
Normal file
|
@ -0,0 +1,9 @@
|
|||
" Author: Sumner Evans <sumner.evans98@gmail.com>
|
||||
" Description: write-good for Pod files
|
||||
|
||||
call ale#linter#Define('pod', {
|
||||
\ 'name': 'write-good',
|
||||
\ 'executable_callback': 'ale#handlers#writegood#GetExecutable',
|
||||
\ 'command_callback': 'ale#handlers#writegood#GetCommand',
|
||||
\ 'callback': 'ale#handlers#writegood#Handle',
|
||||
\})
|
21
ale_linters/pony/ponyc.vim
Normal file
21
ale_linters/pony/ponyc.vim
Normal file
|
@ -0,0 +1,21 @@
|
|||
" Description: ponyc linter for pony files
|
||||
|
||||
call ale#Set('pony_ponyc_executable', 'ponyc')
|
||||
call ale#Set('pony_ponyc_options', '--pass paint')
|
||||
|
||||
function! ale_linters#pony#ponyc#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'pony_ponyc_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#pony#ponyc#GetCommand(buffer) abort
|
||||
return ale#Escape(ale_linters#pony#ponyc#GetExecutable(a:buffer))
|
||||
\ . ' ' . ale#Var(a:buffer, 'pony_ponyc_options')
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('pony', {
|
||||
\ 'name': 'ponyc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable_callback': 'ale_linters#pony#ponyc#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#pony#ponyc#GetCommand',
|
||||
\ 'callback': 'ale#handlers#pony#HandlePonycFormat',
|
||||
\})
|
27
ale_linters/proto/protoc_gen_lint.vim
Normal file
27
ale_linters/proto/protoc_gen_lint.vim
Normal file
|
@ -0,0 +1,27 @@
|
|||
" Author: Jeff Willette <jrwillette88@gmail.com>
|
||||
" Description: run the protoc-gen-lint plugin for the protoc binary
|
||||
|
||||
call ale#Set('proto_protoc_gen_lint_options', '')
|
||||
|
||||
function! ale_linters#proto#protoc_gen_lint#GetCommand(buffer) abort
|
||||
let l:dirname = expand('#' . a:buffer . ':p:h')
|
||||
|
||||
let l:options = ['-I ' . ale#Escape(l:dirname)]
|
||||
|
||||
if !empty(ale#Var(a:buffer, 'proto_protoc_gen_lint_options'))
|
||||
let l:options += [ale#Var(a:buffer, 'proto_protoc_gen_lint_options')]
|
||||
endif
|
||||
|
||||
let l:options += ['--lint_out=. ' . '%s']
|
||||
|
||||
return 'protoc' . ' ' . join(l:options)
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('proto', {
|
||||
\ 'name': 'protoc-gen-lint',
|
||||
\ 'lint_file': 1,
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'protoc',
|
||||
\ 'command_callback': 'ale_linters#proto#protoc_gen_lint#GetCommand',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsError',
|
||||
\})
|
|
@ -3,8 +3,9 @@
|
|||
function! ale_linters#puppet#puppet#Handle(buffer, lines) abort
|
||||
" Matches patterns like the following:
|
||||
" Error: Could not parse for environment production: Syntax error at ':' at /root/puppetcode/modules/nginx/manifests/init.pp:43:12
|
||||
" Error: Could not parse for environment production: Syntax error at '='; expected '}' at /root/puppetcode/modules/pancakes/manifests/init.pp:5"
|
||||
|
||||
let l:pattern = '^Error: .*: \(.\+\) at .\+:\(\d\+\):\(\d\+\)$'
|
||||
let l:pattern = '^Error: .*: \(.\+\) at .\+\.pp:\(\d\+\):\=\(\d*\)'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
|
|
|
@ -10,10 +10,6 @@ let g:ale_python_flake8_options =
|
|||
\ get(g:, 'ale_python_flake8_options', s:default_options)
|
||||
let g:ale_python_flake8_use_global = get(g:, 'ale_python_flake8_use_global', 0)
|
||||
|
||||
" A map from Python executable paths to semver strings parsed for those
|
||||
" executables, so we don't have to look up the version number constantly.
|
||||
let s:version_cache = {}
|
||||
|
||||
function! s:UsingModule(buffer) abort
|
||||
return ale#Var(a:buffer, 'python_flake8_options') =~# ' *-m flake8'
|
||||
endfunction
|
||||
|
@ -26,62 +22,35 @@ function! ale_linters#python#flake8#GetExecutable(buffer) abort
|
|||
return ale#Var(a:buffer, 'python_flake8_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#python#flake8#ClearVersionCache() abort
|
||||
let s:version_cache = {}
|
||||
endfunction
|
||||
|
||||
function! ale_linters#python#flake8#VersionCheck(buffer) abort
|
||||
let l:executable = ale_linters#python#flake8#GetExecutable(a:buffer)
|
||||
|
||||
" If we have previously stored the version number in a cache, then
|
||||
" don't look it up again.
|
||||
if has_key(s:version_cache, l:executable)
|
||||
if ale#semver#HasVersion(l:executable)
|
||||
" Returning an empty string skips this command.
|
||||
return ''
|
||||
endif
|
||||
|
||||
let l:executable = ale#Escape(ale_linters#python#flake8#GetExecutable(a:buffer))
|
||||
let l:executable = ale#Escape(l:executable)
|
||||
let l:module_string = s:UsingModule(a:buffer) ? ' -m flake8' : ''
|
||||
|
||||
return l:executable . l:module_string . ' --version'
|
||||
endfunction
|
||||
|
||||
" Get the flake8 version from the output, or the cache.
|
||||
function! s:GetVersion(buffer, version_output) abort
|
||||
let l:executable = ale_linters#python#flake8#GetExecutable(a:buffer)
|
||||
let l:version = []
|
||||
|
||||
" Get the version from the cache.
|
||||
if has_key(s:version_cache, l:executable)
|
||||
return s:version_cache[l:executable]
|
||||
endif
|
||||
|
||||
if !empty(a:version_output)
|
||||
" Parse the version string, and store it in the cache.
|
||||
let l:version = ale#semver#Parse(a:version_output[0])
|
||||
let s:version_cache[l:executable] = l:version
|
||||
endif
|
||||
|
||||
return l:version
|
||||
endfunction
|
||||
|
||||
" flake8 versions 3 and up support the --stdin-display-name argument.
|
||||
function! s:SupportsDisplayName(version) abort
|
||||
return !empty(a:version) && ale#semver#GreaterOrEqual(a:version, [3, 0, 0])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#python#flake8#GetCommand(buffer, version_output) abort
|
||||
let l:version = s:GetVersion(a:buffer, a:version_output)
|
||||
let l:executable = ale_linters#python#flake8#GetExecutable(a:buffer)
|
||||
let l:version = ale#semver#GetVersion(l:executable, a:version_output)
|
||||
|
||||
" Only include the --stdin-display-name argument if we can parse the
|
||||
" flake8 version, and it is recent enough to support it.
|
||||
let l:display_name_args = s:SupportsDisplayName(l:version)
|
||||
let l:display_name_args = ale#semver#GTE(l:version, [3, 0, 0])
|
||||
\ ? ' --stdin-display-name %s'
|
||||
\ : ''
|
||||
|
||||
let l:options = ale#Var(a:buffer, 'python_flake8_options')
|
||||
|
||||
return ale#Escape(ale_linters#python#flake8#GetExecutable(a:buffer))
|
||||
return ale#Escape(l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --format=default'
|
||||
\ . l:display_name_args . ' -'
|
||||
|
@ -122,18 +91,30 @@ function! ale_linters#python#flake8#Handle(buffer, lines) abort
|
|||
continue
|
||||
endif
|
||||
|
||||
if l:code is# 'W391'
|
||||
\&& !ale#Var(a:buffer, 'warn_about_trailing_blank_lines')
|
||||
" Skip warnings for trailing blank lines if the option is off
|
||||
continue
|
||||
endif
|
||||
|
||||
let l:item = {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'col': l:match[2] + 0,
|
||||
\ 'text': l:code . ': ' . l:match[4],
|
||||
\ 'text': l:match[4],
|
||||
\ 'code': l:code,
|
||||
\ 'type': 'W',
|
||||
\}
|
||||
|
||||
if l:code[:0] is# 'F' || l:code is# 'E999'
|
||||
let l:item.type = 'E'
|
||||
if l:code[:0] is# 'F'
|
||||
if l:code isnot# 'F401'
|
||||
let l:item.type = 'E'
|
||||
endif
|
||||
elseif l:code[:0] is# 'E'
|
||||
let l:item.type = 'E'
|
||||
let l:item.sub_type = 'style'
|
||||
|
||||
if l:code isnot# 'E999' && l:code isnot# 'E112'
|
||||
let l:item.sub_type = 'style'
|
||||
endif
|
||||
elseif l:code[:0] is# 'W'
|
||||
let l:item.sub_type = 'style'
|
||||
endif
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue