mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 20:54:26 +08:00
Compare commits
549 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b2702c6829 | ||
|
|
388cf33743 | ||
|
|
77c034884b | ||
|
|
8beb67b4d1 | ||
|
|
99eb68e6ca | ||
|
|
f9f2ad2765 | ||
|
|
b88d3c4e4b | ||
|
|
cf53eb3667 | ||
|
|
27130efc65 | ||
|
|
ae916d49fd | ||
|
|
787ab2a366 | ||
|
|
f612805801 | ||
|
|
4c7e843fd0 | ||
|
|
26b92f73b5 | ||
|
|
cc67bc0541 | ||
|
|
98caa19cc7 | ||
|
|
9b5c090473 | ||
|
|
c747c277c2 | ||
|
|
1457e54528 | ||
|
|
e8080be08b | ||
|
|
4894c760c2 | ||
|
|
7572ec3489 | ||
|
|
e5e851fadc | ||
|
|
2d07fa0cc2 | ||
|
|
dd1c665db2 | ||
|
|
d511d5af11 | ||
|
|
7c44f4e403 | ||
|
|
64d430438e | ||
|
|
82c8e3a3a3 | ||
|
|
bafe1c0fd6 | ||
|
|
c9f4005820 | ||
|
|
cab4280d02 | ||
|
|
3a1728297a | ||
|
|
72dbd7f648 | ||
|
|
471e20ed2b | ||
|
|
65bfb07e43 | ||
|
|
18eb6a0758 | ||
|
|
580271b510 | ||
|
|
105bc55695 | ||
|
|
0ac7595fe9 | ||
|
|
bacb8bb902 | ||
|
|
2c1c5b06d9 | ||
|
|
10d2b8797c | ||
|
|
9fd9435cd5 | ||
|
|
1101346657 | ||
|
|
c1b6628425 | ||
|
|
3e94c42ec0 | ||
|
|
a6dfc611f6 | ||
|
|
3c3dcd4041 | ||
|
|
66b3e768db | ||
|
|
997dd7f8fe | ||
|
|
5a47d878fb | ||
|
|
c374736301 | ||
|
|
5200e6c734 | ||
|
|
fe666a7a6c | ||
|
|
e16c3b09f7 | ||
|
|
9b362634f7 | ||
|
|
4f2666265a | ||
|
|
d7ed80346c | ||
|
|
56951932e0 | ||
|
|
4999ae2e85 | ||
|
|
4f8f2a4a0c | ||
|
|
542ba5a04a | ||
|
|
df91bc9046 | ||
|
|
32c0eb7c42 | ||
|
|
99a809c814 | ||
|
|
33f2f8ddcd | ||
|
|
1ca780a08a | ||
|
|
1b010bbabb | ||
|
|
985a5295a9 | ||
|
|
efe65f3477 | ||
|
|
a8acac1f4a | ||
|
|
850c41b2a9 | ||
|
|
847f729cd4 | ||
|
|
075c3e0ad0 | ||
|
|
35b8bb8a55 | ||
|
|
53ff5f2d88 | ||
|
|
9a1e91e075 | ||
|
|
64550062dc | ||
|
|
451e99341e | ||
|
|
03bd494fd4 | ||
|
|
5fd5fa5305 | ||
|
|
4edfac4db6 | ||
|
|
23ff19a162 | ||
|
|
1991313ee7 | ||
|
|
f17beadb49 | ||
|
|
8ffde14039 | ||
|
|
e75ac9f497 | ||
|
|
289f808ccd | ||
|
|
4a6136c27e | ||
|
|
6bfcb9cdff | ||
|
|
6b0b8cec79 | ||
|
|
897f6b2b23 | ||
|
|
db816b5c3f | ||
|
|
33485ffb92 | ||
|
|
8d5b3e827d | ||
|
|
e3e1ddce95 | ||
|
|
4328fe7dca | ||
|
|
04550717bf | ||
|
|
2dbf4ee271 | ||
|
|
67c3fa9001 | ||
|
|
ed2afafd62 | ||
|
|
823b094f56 | ||
|
|
89403b4a06 | ||
|
|
280d2dedae | ||
|
|
c15d9538cd | ||
|
|
b3010ad793 | ||
|
|
9eb6dace88 | ||
|
|
e94d23b1d9 | ||
|
|
7f1dd5f66a | ||
|
|
3e820207e7 | ||
|
|
4ed520a219 | ||
|
|
9bc4b468c2 | ||
|
|
65824feef3 | ||
|
|
4aa11cbc05 | ||
|
|
014b00d4d7 | ||
|
|
03eae9e085 | ||
|
|
27a22e7161 | ||
|
|
7fe61cdf0e | ||
|
|
a1e6df987c | ||
|
|
42bf5ca911 | ||
|
|
80a0108fcf | ||
|
|
6a3d215571 | ||
|
|
7e3d2930d8 | ||
|
|
7b42dd7387 | ||
|
|
16c45b8213 | ||
|
|
8de0e7b9ba | ||
|
|
783cf4ab82 | ||
|
|
bfc412a77b | ||
|
|
9387ccfbc5 | ||
|
|
bbac230008 | ||
|
|
45a28383a2 | ||
|
|
6fbdec8587 | ||
|
|
8dce126a6c | ||
|
|
f398faa8d3 | ||
|
|
39f393ef07 | ||
|
|
97ce2423b0 | ||
|
|
7b187af10a | ||
|
|
aabca5b0ac | ||
|
|
012348582c | ||
|
|
12d28ca34f | ||
|
|
49f8aa4703 | ||
|
|
7b1ed2733e | ||
|
|
54dd731cf1 | ||
|
|
4c454c96a9 | ||
|
|
7e4c125d38 | ||
|
|
8c34c738ab | ||
|
|
b4d889b682 | ||
|
|
3229d5aba4 | ||
|
|
6b97af680d | ||
|
|
3fca5e73b6 | ||
|
|
7fca451cf9 | ||
|
|
8375ee2766 | ||
|
|
02255dd967 | ||
|
|
9c7e1fe4dd | ||
|
|
8af805cefe | ||
|
|
e358afdd9b | ||
|
|
f996ede599 | ||
|
|
6043eeb25a | ||
|
|
1f0cbc7dbd | ||
|
|
fa2186d95e | ||
|
|
6d7cff9c00 | ||
|
|
b85207d524 | ||
|
|
730222bcd8 | ||
|
|
7e12be0c64 | ||
|
|
303b89a6b4 | ||
|
|
3f01cc247c | ||
|
|
d9b74caf43 | ||
|
|
03b6978a27 | ||
|
|
84c95aff9b | ||
|
|
65b09cfa9d | ||
|
|
6b0250a843 | ||
|
|
d52dce2e6f | ||
|
|
e300a48e13 | ||
|
|
469af2a734 | ||
|
|
99f1874e86 | ||
|
|
f72e60c12a | ||
|
|
09b8cc97de | ||
|
|
1365dce921 | ||
|
|
0a2ad516d4 | ||
|
|
12eb8d1523 | ||
|
|
ce3d891bed | ||
|
|
713e53e3f6 | ||
|
|
340e966055 | ||
|
|
c69d696e1b | ||
|
|
7e9d4fbfc8 | ||
|
|
491ceacb64 | ||
|
|
05d5cc4988 | ||
|
|
7d8275daf5 | ||
|
|
433b23be17 | ||
|
|
d27a3f453c | ||
|
|
6efca486e8 | ||
|
|
ae86d10e48 | ||
|
|
64471e6ea8 | ||
|
|
373ffa0f31 | ||
|
|
681a6e371d | ||
|
|
9692c0c64c | ||
|
|
5458a1b291 | ||
|
|
b4550f361b | ||
|
|
b09ccc12c3 | ||
|
|
e1184e31f6 | ||
|
|
96428425fe | ||
|
|
2873be2d6a | ||
|
|
d1246ea8d5 | ||
|
|
2e91f0e689 | ||
|
|
a139599d39 | ||
|
|
06e7f2195e | ||
|
|
b8aaff2cf7 | ||
|
|
342e5af4e3 | ||
|
|
e4bfcb44b3 | ||
|
|
edd96f4414 | ||
|
|
d23c9125c5 | ||
|
|
c10e807492 | ||
|
|
e5d16caebe | ||
|
|
8e28de142a | ||
|
|
df3163223f | ||
|
|
9f2215d69b | ||
|
|
81d16823a7 | ||
|
|
17c0c3c731 | ||
|
|
c098a07d67 | ||
|
|
2ab46d4b8e | ||
|
|
d0b5909fd8 | ||
|
|
7c04ee5c20 | ||
|
|
f156548c16 | ||
|
|
ddfc43e774 | ||
|
|
b74827de99 | ||
|
|
48fe0dd4f6 | ||
|
|
e9140c740b | ||
|
|
01800a23ad | ||
|
|
42e4b14861 | ||
|
|
01b661ea25 | ||
|
|
1ec573bf0d | ||
|
|
96d8415946 | ||
|
|
31b7a2de41 | ||
|
|
73632312c2 | ||
|
|
6c22936303 | ||
|
|
db96b00720 | ||
|
|
a49f664aea | ||
|
|
194660660d | ||
|
|
9d1a71a5cb | ||
|
|
983c7e8805 | ||
|
|
62f2c6d326 | ||
|
|
7d69cdf4ad | ||
|
|
15f44933c2 | ||
|
|
513e6ee972 | ||
|
|
b496c4b164 | ||
|
|
cafe8621e2 | ||
|
|
af5a8e1abf | ||
|
|
b84d41f9ea | ||
|
|
557a1ed5da | ||
|
|
477eb89793 | ||
|
|
f384d61c3d | ||
|
|
f125c11faa | ||
|
|
c4eb41f091 | ||
|
|
160af49450 | ||
|
|
47da7483d8 | ||
|
|
c37cc1c8a3 | ||
|
|
96ec33e6d6 | ||
|
|
d7557ef9be | ||
|
|
9a8ab764d5 | ||
|
|
b91c6c2edd | ||
|
|
4466c47990 | ||
|
|
bd1b671e82 | ||
|
|
ef145bda1c | ||
|
|
3410c1b1e2 | ||
|
|
81b92bcbfa | ||
|
|
e32d5fc03d | ||
|
|
abe1440268 | ||
|
|
2d3ed956b9 | ||
|
|
7857098cb0 | ||
|
|
ac3c0c093a | ||
|
|
7186b0437f | ||
|
|
96dcbd1f20 | ||
|
|
56242cb874 | ||
|
|
94927195ee | ||
|
|
5f2aeba8cc | ||
|
|
e089969404 | ||
|
|
48cbf1cb36 | ||
|
|
6bebdcfa30 | ||
|
|
f8351c1b22 | ||
|
|
8a855e3e64 | ||
|
|
fec6b63494 | ||
|
|
9769565f88 | ||
|
|
63a528eac2 | ||
|
|
ed47008710 | ||
|
|
b32954a46c | ||
|
|
1781b1eab0 | ||
|
|
08295ce174 | ||
|
|
4ddf742643 | ||
|
|
78fa93bd55 | ||
|
|
62fd83f1dd | ||
|
|
d1f48e5ede | ||
|
|
d3932c0242 | ||
|
|
20f6bebdf2 | ||
|
|
6a367e44aa | ||
|
|
7d90ff56d9 | ||
|
|
f07ecbc579 | ||
|
|
b4b75126f9 | ||
|
|
fc2a34e9d8 | ||
|
|
8950f6b812 | ||
|
|
417761b415 | ||
|
|
c36053d4cc | ||
|
|
49718e0ec6 | ||
|
|
5bc49d2047 | ||
|
|
152b2cb691 | ||
|
|
0b55098bd0 | ||
|
|
c78be86103 | ||
|
|
844febb9fb | ||
|
|
d4a14746cd | ||
|
|
ac2100d410 | ||
|
|
cdaeca452e | ||
|
|
31942c99b9 | ||
|
|
4a91f92f28 | ||
|
|
1462de6685 | ||
|
|
0989da4a38 | ||
|
|
33202a39f5 | ||
|
|
303bed6ec1 | ||
|
|
25b572b3bf | ||
|
|
6e2e51b154 | ||
|
|
6888ca46a7 | ||
|
|
f1ecc2e068 | ||
|
|
7e0cdb53ec | ||
|
|
bc3a843e10 | ||
|
|
6b138b965d | ||
|
|
d9a7d6bc23 | ||
|
|
06264c264f | ||
|
|
dd9ad9b5be | ||
|
|
0de847a8e1 | ||
|
|
7d4ce4e6aa | ||
|
|
3d5a2690ce | ||
|
|
34e409ea21 | ||
|
|
b8c0ac2e61 | ||
|
|
6874120405 | ||
|
|
36e959a466 | ||
|
|
47fdc02fc7 | ||
|
|
369e3876f0 | ||
|
|
80bd2e18d6 | ||
|
|
ecd7abecc0 | ||
|
|
7545b18ba1 | ||
|
|
6d843715f3 | ||
|
|
6074720dc2 | ||
|
|
af177d7825 | ||
|
|
719f3c62b0 | ||
|
|
5d3d33626c | ||
|
|
571cff932d | ||
|
|
17605777d6 | ||
|
|
66ff00c420 | ||
|
|
f5aa0e8457 | ||
|
|
686f42a2e1 | ||
|
|
c9377e9baf | ||
|
|
a955f5dfa8 | ||
|
|
396fba7cca | ||
|
|
447aea4af0 | ||
|
|
3e2abe3f25 | ||
|
|
1a7366067a | ||
|
|
33eb03ea71 | ||
|
|
d4583f1a63 | ||
|
|
c0566db1d2 | ||
|
|
ba3dd0d027 | ||
|
|
76801743cf | ||
|
|
4bece27bd4 | ||
|
|
62f07d820c | ||
|
|
2b785688ea | ||
|
|
4d42ebc160 | ||
|
|
90abb7e7ef | ||
|
|
de7b0567b1 | ||
|
|
361027eac6 | ||
|
|
794224aafa | ||
|
|
92cada9913 | ||
|
|
e27d4377b5 | ||
|
|
f8b3a43aab | ||
|
|
5eda1df0a9 | ||
|
|
4df352eee5 | ||
|
|
bc6304bdb0 | ||
|
|
ac56574b55 | ||
|
|
6d33417b15 | ||
|
|
eb864730e2 | ||
|
|
514e5a8baa | ||
|
|
cfda549056 | ||
|
|
d5c1d84230 | ||
|
|
5c778e1ae7 | ||
|
|
04bd84e914 | ||
|
|
5ceda0164c | ||
|
|
5a4fad6172 | ||
|
|
2b2403a20d | ||
|
|
8151e3e8fa | ||
|
|
94a968ef39 | ||
|
|
167e2e7750 | ||
|
|
f1080a2bbe | ||
|
|
ed69b074ba | ||
|
|
a4f70163eb | ||
|
|
506a8532d0 | ||
|
|
0b77766337 | ||
|
|
979062235a | ||
|
|
8e6c7bff9a | ||
|
|
34adb997c6 | ||
|
|
64d4c951ae | ||
|
|
80b93a3606 | ||
|
|
7c4b1d8444 | ||
|
|
d5912b53dd | ||
|
|
d3f410b6f7 | ||
|
|
2237f9b462 | ||
|
|
05210846e4 | ||
|
|
bf3c3e9438 | ||
|
|
9e1f511003 | ||
|
|
affeed7a87 | ||
|
|
681ca5fee8 | ||
|
|
2ed09f51b6 | ||
|
|
6d502233d8 | ||
|
|
8bfb5c6407 | ||
|
|
2d174db5b2 | ||
|
|
973c4ea053 | ||
|
|
f741245f11 | ||
|
|
388049dbea | ||
|
|
96d525a287 | ||
|
|
b9a1c0e6d3 | ||
|
|
97d887ae22 | ||
|
|
7cefc80f1b | ||
|
|
19229e8e27 | ||
|
|
9bdabce8df | ||
|
|
667618b399 | ||
|
|
f17b74679f | ||
|
|
4044196047 | ||
|
|
5b3da60cea | ||
|
|
711c90c523 | ||
|
|
cdd8d38e2f | ||
|
|
fa3a927ca3 | ||
|
|
1bd7b3e4ad | ||
|
|
86d5cb81bd | ||
|
|
acf892c4d1 | ||
|
|
316c7c7372 | ||
|
|
9894e92553 | ||
|
|
9a9d12cf4f | ||
|
|
e2d1e54eb5 | ||
|
|
fc7b4585e6 | ||
|
|
fbfeae0587 | ||
|
|
275b5248e5 | ||
|
|
84a413350c | ||
|
|
72f1d730fd | ||
|
|
ac2ebafadd | ||
|
|
ab6aed17ab | ||
|
|
d49b06e030 | ||
|
|
e03e24c091 | ||
|
|
7cada95683 | ||
|
|
5338dbf680 | ||
|
|
cef64424ce | ||
|
|
428c5f94da | ||
|
|
f4cff3bc06 | ||
|
|
7d40d0a16f | ||
|
|
a9b2f6362d | ||
|
|
5377272d20 | ||
|
|
0e6578cf65 | ||
|
|
75723e4522 | ||
|
|
028485b4de | ||
|
|
c38b2a6524 | ||
|
|
78295024e1 | ||
|
|
b25bb64a4d | ||
|
|
a9799fe90e | ||
|
|
b3ad7bb3d0 | ||
|
|
f26b2e7f01 | ||
|
|
4fc59ccace | ||
|
|
9316b7b3f2 | ||
|
|
ee466de733 | ||
|
|
2987ebcfae | ||
|
|
a2d172c457 | ||
|
|
488df0fa41 | ||
|
|
076f9efbd9 | ||
|
|
9fe208a01f | ||
|
|
e06060a31f | ||
|
|
68b484a49f | ||
|
|
f31182beee | ||
|
|
f4668c751f | ||
|
|
70ab831001 | ||
|
|
c1c3bd9227 | ||
|
|
54aeeec97f | ||
|
|
d38b92c957 | ||
|
|
ddf4e7e9ba | ||
|
|
26571fa050 | ||
|
|
23c58e63d4 | ||
|
|
d0b7a6e71f | ||
|
|
57423f13ec | ||
|
|
fecffeee91 | ||
|
|
56b92544c2 | ||
|
|
5dbbd2d18b | ||
|
|
8c0b9ecdfd | ||
|
|
4394084d99 | ||
|
|
6c58164094 | ||
|
|
7f881f66a8 | ||
|
|
c136061b3f | ||
|
|
106c27644b | ||
|
|
fd399c527f | ||
|
|
1fcb9d1e1a | ||
|
|
9b8ec86d7f | ||
|
|
0f45d3d01d | ||
|
|
b3c6db173a | ||
|
|
834d6f9c48 | ||
|
|
4f25498806 | ||
|
|
a5e7f2c8bb | ||
|
|
b29e9867e8 | ||
|
|
b339a8bfa0 | ||
|
|
4062b05669 | ||
|
|
53bfe41841 | ||
|
|
35c7c297b6 | ||
|
|
b209315714 | ||
|
|
6b8f08f7fc | ||
|
|
345daf683b | ||
|
|
c0d74b8094 | ||
|
|
5f4103fb35 | ||
|
|
15d590ee5e | ||
|
|
2548763d04 | ||
|
|
e641fe0c5d | ||
|
|
4fbfcc9dec | ||
|
|
5035281cb9 | ||
|
|
891852de71 | ||
|
|
b800d24212 | ||
|
|
1c6b9354a8 | ||
|
|
7b9855f1fe | ||
|
|
c2aa01199e | ||
|
|
fc6677d405 | ||
|
|
c207d6a550 | ||
|
|
8c0b0f085f | ||
|
|
07080066e4 | ||
|
|
0cea55924b | ||
|
|
1e9f870b74 | ||
|
|
efe120ce9a | ||
|
|
8fbcba0091 | ||
|
|
ece229c06f | ||
|
|
1997a8f7e2 | ||
|
|
4222f32cc4 | ||
|
|
4bdde36661 | ||
|
|
db5fe5659f | ||
|
|
b6828ac5c5 | ||
|
|
b8d69cb0d5 | ||
|
|
b454e43143 | ||
|
|
f63fd23f2e | ||
|
|
09209dc54b | ||
|
|
3c80c67633 | ||
|
|
3e4a23cb14 | ||
|
|
2f181658e6 | ||
|
|
8239b76c5a | ||
|
|
6d5d3fa4dd | ||
|
|
5cbf7007ff | ||
|
|
c30869617f | ||
|
|
321a3892a7 | ||
|
|
c74cc93140 | ||
|
|
38e0e3feef | ||
|
|
489b7d64e4 | ||
|
|
87a0227d01 | ||
|
|
e5e39a939a |
@@ -19,6 +19,9 @@ init:
|
||||
# Stop git from changing newlines
|
||||
- git config --global core.autocrlf input
|
||||
|
||||
# NOTE: If you change the Vim or Vader versions here, please also update the
|
||||
# instructions for running tests on Windows in ale-development.txt
|
||||
|
||||
install:
|
||||
# Download and unpack Vim
|
||||
- ps: >-
|
||||
|
||||
17
.github/stale.yml
vendored
Normal file
17
.github/stale.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
# This configuration closes stale PRs after 28 + 7 days.
|
||||
# That's 4 weeks until stale bot complains, and a week until it closes a PR.
|
||||
# Issues in ALE are never, ever stale. They are either resolved or not.
|
||||
only: pulls
|
||||
daysUntilStale: 28
|
||||
daysUntilClose: 7
|
||||
exemptLabels: []
|
||||
staleLabel: stale
|
||||
markComment: >
|
||||
This pull request has been automatically marked as stale because it has not
|
||||
been updated recently. Make sure to write tests and document your changes.
|
||||
See `:help ale-dev` for information on writing tests.
|
||||
|
||||
If your pull request is good to merge, bother w0rp or another maintainer
|
||||
again, and get them to merge it.
|
||||
closeComment: false
|
||||
36
.github/workflows/main.yml
vendored
Normal file
36
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
name: CI
|
||||
on: # yamllint disable-line rule:truthy
|
||||
push:
|
||||
branches: [ master ] # yamllint disable-line rule:brackets
|
||||
tags:
|
||||
- /^v\d+\.\d+\.(x|\d+)$/
|
||||
pull_request:
|
||||
branches: [ master ] # yamllint disable-line rule:brackets
|
||||
|
||||
jobs:
|
||||
build_image:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build docker run image
|
||||
shell: bash
|
||||
env:
|
||||
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
|
||||
DOCKER_HUB_PASS: ${{ secrets.DOCKER_HUB_PASS }}
|
||||
run: ./run-tests --build-image
|
||||
test_ale:
|
||||
needs: build_image
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
vim-version:
|
||||
- '--vim-80-only'
|
||||
- '--vim-82-only'
|
||||
- '--neovim-02-only'
|
||||
- '--neovim-04-only'
|
||||
- '--linters-only'
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run tests
|
||||
run: ./run-tests -v ${{ matrix.vim-version }}
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,11 +1,12 @@
|
||||
!.editorconfig
|
||||
*.obj
|
||||
*.pyc
|
||||
# Ignore all hidden files everywhere.
|
||||
# Use `git add -f` to add hidden files.
|
||||
.*
|
||||
__pycache__
|
||||
*.pyc
|
||||
/doc/tags
|
||||
/init.vim
|
||||
/test/ale-info-test-file
|
||||
/vader_output
|
||||
__pycache__
|
||||
tags
|
||||
|
||||
16
.travis.yml
16
.travis.yml
@@ -1,16 +0,0 @@
|
||||
---
|
||||
sudo: required
|
||||
services:
|
||||
- docker
|
||||
language: generic
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /^v\d+\.\d+\.(x|\d+)$/
|
||||
env:
|
||||
- OPTIONS=--vim-80-only
|
||||
- OPTIONS=--vim-81-only
|
||||
- OPTIONS=--neovim-only
|
||||
- OPTIONS=--linters-only
|
||||
script: |
|
||||
./run-tests -v $OPTIONS
|
||||
10
Dockerfile
10
Dockerfile
@@ -1,15 +1,17 @@
|
||||
FROM tweekmonster/vim-testbed:latest
|
||||
|
||||
RUN install_vim -tag v8.0.0027 -build \
|
||||
-tag v8.1.0519 -build \
|
||||
-tag v8.2.2401 -build \
|
||||
-tag neovim:v0.2.0 -build \
|
||||
-tag neovim:v0.3.5 -build
|
||||
-tag neovim:v0.4.4 -build
|
||||
|
||||
ENV PACKAGES="\
|
||||
bash \
|
||||
git \
|
||||
python \
|
||||
py-pip \
|
||||
grep \
|
||||
sed \
|
||||
"
|
||||
RUN apk --update add $PACKAGES && \
|
||||
rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
|
||||
@@ -18,3 +20,7 @@ RUN pip install vim-vint==0.3.15
|
||||
|
||||
RUN git clone https://github.com/junegunn/vader.vim vader && \
|
||||
cd vader && git checkout c6243dd81c98350df4dec608fa972df98fa2a3af
|
||||
|
||||
ARG GIT_VERSION
|
||||
LABEL Version=${GIT_VERSION}
|
||||
LABEL Name=w0rp/ale
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2016-2019, w0rp <devw0rp@gmail.com>
|
||||
Copyright (c) 2016-2020, w0rp <devw0rp@gmail.com>
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
181
README.md
181
README.md
@@ -1,4 +1,4 @@
|
||||
# Asynchronous Lint Engine [](https://travis-ci.com/dense-analysis/ale) [](https://ci.appveyor.com/project/dense-analysis/ale) [](https://gitter.im/vim-ale/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
# Asynchronous Lint Engine [](https://github.com/dense-analysis/ale/actions?query=event%3Apush+workflow%3ACI+branch%3Amaster++) [](https://ci.appveyor.com/project/dense-analysis/ale) [](https://gitter.im/vim-ale/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
|
||||

|
||||
@@ -53,6 +53,7 @@ other content at [w0rp.com](https://w0rp.com).
|
||||
5. [Find References](#usage-find-references)
|
||||
6. [Hovering](#usage-hover)
|
||||
7. [Symbol Search](#usage-symbol-search)
|
||||
8. [Refactoring: Rename, Actions](#usage-refactoring)
|
||||
3. [Installation](#installation)
|
||||
1. [Installation with Vim package management](#standard-installation)
|
||||
2. [Installation with Pathogen](#installation-with-pathogen)
|
||||
@@ -61,23 +62,25 @@ other content at [w0rp.com](https://w0rp.com).
|
||||
4. [Contributing](#contributing)
|
||||
5. [FAQ](#faq)
|
||||
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 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. [How can I check Vue files with ESLint?](#faq-vue-eslint)
|
||||
14. [Will this plugin eat all of my laptop battery power?](#faq-my-battery-is-sad)
|
||||
15. [How can I configure my C or C++ project?](#faq-c-configuration)
|
||||
16. [How can I configure ALE differently for different buffers?](#faq-buffer-configuration)
|
||||
17. [How can I configure the height of the list in which ALE displays errors?](#faq-list-window-height)
|
||||
18. [How can I see what ALE has configured for the current file?](#faq-get-info)
|
||||
2. [How can I see what ALE has configured for the current file?](#faq-get-info)
|
||||
3. [How can I use ALE and coc.nvim together?](#faq-coc-nvim)
|
||||
4. [How can I keep the sign gutter open?](#faq-keep-signs)
|
||||
5. [How can I change the signs ALE uses?](#faq-change-signs)
|
||||
6. [How can I change or disable the highlights ALE uses?](#faq-change-highlights)
|
||||
7. [How can I show errors or warnings in my statusline?](#faq-statusline)
|
||||
8. [How can I show errors or warnings in my lightline?](#faq-lightline)
|
||||
9. [How can I change the format for echo messages?](#faq-echo-format)
|
||||
10. [How can I execute some code when ALE starts or stops linting?](#faq-autocmd)
|
||||
11. [How can I navigate between errors quickly?](#faq-navigation)
|
||||
12. [How can I run linters only when I save files?](#faq-lint-on-save)
|
||||
13. [How can I use the quickfix list instead of the loclist?](#faq-quickfix)
|
||||
14. [How can I check JSX files with both stylelint and eslint?](#faq-jsx-stylelint-eslint)
|
||||
15. [How can I check Vue files with ESLint?](#faq-vue-eslint)
|
||||
16. [Will this plugin eat all of my laptop battery power?](#faq-my-battery-is-sad)
|
||||
17. [How can I configure my C or C++ project?](#faq-c-configuration)
|
||||
18. [How can I configure ALE differently for different buffers?](#faq-buffer-configuration)
|
||||
19. [How can I configure the height of the list in which ALE displays errors?](#faq-list-window-height)
|
||||
20. [How can I run linters or fixers via Docker or a VM?](#faq-vm)
|
||||
|
||||
<a name="supported-languages"></a>
|
||||
|
||||
@@ -102,7 +105,7 @@ programs for checking the syntax and semantics of your programs. By default,
|
||||
linters will be re-run in the background to check your syntax when you open
|
||||
new buffers or as you make edits to your files.
|
||||
|
||||
The behaviour of linting can be configured with a variety of options,
|
||||
The behavior of linting can be configured with a variety of options,
|
||||
documented in [the Vim help file](doc/ale.txt). For more information on the
|
||||
options ALE offers, consult `:help ale-options` for global options and `:help
|
||||
ale-integration-options` for options specified to particular linters.
|
||||
@@ -193,12 +196,11 @@ completion manually with `<C-x><C-o>`.
|
||||
set omnifunc=ale#completion#OmniFunc
|
||||
```
|
||||
|
||||
When working with TypeScript files, ALE supports automatic imports from
|
||||
external modules. This behavior is disabled by default and can be enabled by
|
||||
setting:
|
||||
ALE supports automatic imports from external modules. This behavior is disabled
|
||||
by default and can be enabled by setting:
|
||||
|
||||
```vim
|
||||
let g:ale_completion_tsserver_autoimport = 1
|
||||
let g:ale_completion_autoimport = 1
|
||||
```
|
||||
|
||||
See `:help ale-completion` for more information.
|
||||
@@ -231,6 +233,9 @@ ALE supports "hover" information for printing brief information about symbols at
|
||||
the cursor taken from Language Server Protocol linters and `tsserver` with the
|
||||
`ALEHover` command.
|
||||
|
||||
Truncated information will be displayed when the cursor rests on a symbol by
|
||||
default, as long as there are no problems on the same line.
|
||||
|
||||
The information can be displayed in a `balloon` tooltip in Vim or GVim by
|
||||
hovering your mouse over symbols. Mouse hovering is enabled by default in GVim,
|
||||
and needs to be configured for Vim 8.1+ in terminals.
|
||||
@@ -249,6 +254,18 @@ similar to a given query string.
|
||||
|
||||
See `:help ale-symbol-search` for more information.
|
||||
|
||||
<a name="usage-refactoring"></a>
|
||||
|
||||
### 2.viii Refactoring: Rename, Actions
|
||||
|
||||
ALE supports renaming symbols in symbols in code such as variables or class
|
||||
names with the `ALERename` command.
|
||||
|
||||
`ALECodeAction` will execute actions on the cursor or applied to a visual
|
||||
range selection, such as automatically fixing errors.
|
||||
|
||||
See `:help ale-refactor` for more information.
|
||||
|
||||
<a name="installation"></a>
|
||||
|
||||
## 3. Installation
|
||||
@@ -324,12 +341,14 @@ git clone https://github.com/dense-analysis/ale.git
|
||||
### 3.iii. Installation with Vundle
|
||||
|
||||
You can install this plugin using [Vundle](https://github.com/VundleVim/Vundle.vim)
|
||||
by using the path on GitHub for this repository.
|
||||
by adding the GitHub path for this repository to your `~/.vimrc`:
|
||||
|
||||
```vim
|
||||
Plugin 'dense-analysis/ale'
|
||||
```
|
||||
|
||||
Then run the command `:PluginInstall` in Vim.
|
||||
|
||||
See the Vundle documentation for more information.
|
||||
|
||||
<a name="installation-with-vim-plug"></a>
|
||||
@@ -337,13 +356,16 @@ See the Vundle documentation for more information.
|
||||
### 3.iiii. Installation with Vim-Plug
|
||||
|
||||
You can install this plugin using [Vim-Plug](https://github.com/junegunn/vim-plug)
|
||||
by adding the GitHub path for this repository to your `~/.vimrc`
|
||||
and running `:PlugInstall`.
|
||||
by adding the GitHub path for this repository to your `~/.vimrc`:
|
||||
|
||||
```vim
|
||||
Plug 'dense-analysis/ale'
|
||||
```
|
||||
|
||||
Then run the command `:PlugInstall` in Vim.
|
||||
|
||||
See the Vim-Plug documentation for more information.
|
||||
|
||||
<a name="contributing"></a>
|
||||
|
||||
## 4. Contributing
|
||||
@@ -413,9 +435,56 @@ This plugin will look for linters in the [`ale_linters`](ale_linters) directory.
|
||||
Each directory within corresponds to a particular filetype in Vim, and each file
|
||||
in each directory corresponds to the name of a particular linter.
|
||||
|
||||
<a name="faq-get-info"></a>
|
||||
|
||||
### 5.ii. How can I see what ALE has configured for the current file?
|
||||
|
||||
Run the following to see what is currently configured:
|
||||
|
||||
```vim
|
||||
:ALEInfo
|
||||
```
|
||||
|
||||
<a name="faq-coc-nvim"></a>
|
||||
|
||||
### 5.iii. How can I use ALE and coc.nvim together?
|
||||
|
||||
[coc.nvim](https://github.com/neoclide/coc.nvim) is a popular Vim plugin written
|
||||
in TypeScript and dependent on the [npm](https://www.npmjs.com/) ecosystem for
|
||||
providing full IDE features to Vim. Both ALE and coc.nvim implement
|
||||
[Language Server Protocol](https://microsoft.github.io/language-server-protocol/)
|
||||
(LSP) clients for supporting diagnostics (linting with a live server), and other
|
||||
features like auto-completion, and others listed above.
|
||||
|
||||
ALE is primarily focused on integrating with external programs through virtually
|
||||
any means, provided the plugin remains almost entirely written in Vim script.
|
||||
coc.nvim is primarily focused on bringing IDE features to Vim. If you want to
|
||||
run external programs on your files to check for errors, and also use the most
|
||||
advanced IDE features, you might want to use both plugins at the same time.
|
||||
|
||||
The easiest way to get both plugins to work together is to configure coc.nvim to
|
||||
send diagnostics to ALE, so ALE controls how all problems are presented to you,
|
||||
and to disable all LSP features in ALE, so ALE doesn't try to provide LSP
|
||||
features already provided by coc.nvim, such as auto-completion.
|
||||
|
||||
1. Open your coc.nvim configuration file with `:CocConfig` and add
|
||||
`"diagnostic.displayByAle": true` to your settings.
|
||||
2. Add `let g:ale_disable_lsp = 1` to your vimrc file, before plugins are
|
||||
loaded.
|
||||
|
||||
You can also use `b:ale_disable_lsp` in your ftplugin files to enable or disable
|
||||
LSP features in ALE for different filetypes. After you configure coc.nvim and
|
||||
ALE this way, you can further configure how problems appear to you by using all
|
||||
of the settings mentioned in ALE's help file, including how often diagnostics
|
||||
are requested. See `:help ale-lint`.
|
||||
|
||||
The integration between ALE and coc.nvim works using an API ALE offers for
|
||||
letting any other plugin integrate with ALE. If you are interested in writing a
|
||||
similar integration, see `:help ale-lint-other-sources`.
|
||||
|
||||
<a name="faq-keep-signs"></a>
|
||||
|
||||
### 5.ii. How can I keep the sign gutter open?
|
||||
### 5.iv. How can I keep the sign gutter open?
|
||||
|
||||
You can keep the sign gutter open at all times by setting the
|
||||
`g:ale_sign_column_always` to 1
|
||||
@@ -426,7 +495,7 @@ let g:ale_sign_column_always = 1
|
||||
|
||||
<a name="faq-change-signs"></a>
|
||||
|
||||
### 5.iii. How can I change the signs ALE uses?
|
||||
### 5.v. How can I change the signs ALE uses?
|
||||
|
||||
Use these options to specify what text should be used for signs:
|
||||
|
||||
@@ -446,7 +515,7 @@ highlight clear ALEWarningSign
|
||||
|
||||
<a name="faq-change-highlights"></a>
|
||||
|
||||
### 5.iv. How can I change or disable the highlights ALE uses?
|
||||
### 5.vi. 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
|
||||
@@ -472,7 +541,7 @@ See `:help ale-highlights` for more information.
|
||||
|
||||
<a name="faq-statusline"></a>
|
||||
|
||||
### 5.v. How can I show errors or warnings in my statusline?
|
||||
### 5.vii. 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
|
||||
@@ -521,7 +590,7 @@ for more information.
|
||||
|
||||
<a name="faq-lightline"></a>
|
||||
|
||||
### 5.vi. How can I show errors or warnings in my lightline?
|
||||
### 5.viii. 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).
|
||||
@@ -530,7 +599,7 @@ For more information, check out the sources of that plugin, `:help ale#statuslin
|
||||
|
||||
<a name="faq-echo-format"></a>
|
||||
|
||||
### 5.vii. How can I change the format for echo messages?
|
||||
### 5.ix. How can I change the format for echo messages?
|
||||
|
||||
There are 3 global options that allow customizing the echoed message.
|
||||
|
||||
@@ -559,7 +628,7 @@ See `:help g:ale_echo_msg_format` for more information.
|
||||
|
||||
<a name="faq-autocmd"></a>
|
||||
|
||||
### 5.viii. How can I execute some code when ALE starts or stops linting?
|
||||
### 5.x. How can I execute some code when ALE starts or stops linting?
|
||||
|
||||
ALE runs its own [autocmd](http://vimdoc.sourceforge.net/htmldoc/autocmd.html)
|
||||
events when a lint or fix cycle are started and stopped. There is also an event
|
||||
@@ -582,7 +651,7 @@ augroup END
|
||||
|
||||
<a name="faq-navigation"></a>
|
||||
|
||||
### 5.ix. How can I navigate between errors quickly?
|
||||
### 5.xi. 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
|
||||
@@ -598,7 +667,7 @@ For more information, consult the online documentation with
|
||||
|
||||
<a name="faq-lint-on-save"></a>
|
||||
|
||||
### 5.x. How can I run linters only when I save files?
|
||||
### 5.xii. 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
|
||||
@@ -619,7 +688,7 @@ files, you can set `g:ale_lint_on_save` to `0`.
|
||||
|
||||
<a name="faq-quickfix"></a>
|
||||
|
||||
### 5.xi. How can I use the quickfix list instead of the loclist?
|
||||
### 5.xiii. 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
|
||||
@@ -649,7 +718,7 @@ instead of the default horizontally.
|
||||
|
||||
<a name="faq-jsx-stylelint-eslint"></a>
|
||||
|
||||
### 5.xii. How can I check JSX files with both stylelint and eslint?
|
||||
### 5.xiv. 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.
|
||||
@@ -691,7 +760,7 @@ no linter will be run twice for the same file.
|
||||
|
||||
<a name="faq-vue-eslint"></a>
|
||||
|
||||
### 5.xiii. How can I check Vue files with ESLint?
|
||||
### 5.xv. How can I check Vue files with ESLint?
|
||||
|
||||
To check Vue files with ESLint, your ESLint project configuration file must be
|
||||
configured to use the [Vue plugin](https://github.com/vuejs/eslint-plugin-vue).
|
||||
@@ -722,7 +791,7 @@ let g:ale_linters = {'vue': ['eslint', 'vls']}
|
||||
|
||||
<a name="faq-my-battery-is-sad"></a>
|
||||
|
||||
### 5.xiv. Will this plugin eat all of my laptop battery power?
|
||||
### 5.xvi. 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
|
||||
@@ -735,7 +804,7 @@ while you type. ALE uses a timeout which is cancelled and reset every time you
|
||||
type, and this delay can be increased so linters are run less often. See
|
||||
`:help g:ale_lint_delay` for more information.
|
||||
|
||||
If you don't wish to run linters while you type, you can disable that behaviour.
|
||||
If you don't wish to run linters while you type, you can disable that behavior.
|
||||
Set `g:ale_lint_on_text_changed` to `never`. You won't get as frequent error
|
||||
checking, but ALE shouldn't block your ability to edit a document after you save
|
||||
a file, so the asynchronous nature of the plugin will still be an advantage.
|
||||
@@ -746,7 +815,7 @@ including the option `g:ale_lint_on_enter`, and you can run ALE manually with
|
||||
|
||||
<a name="faq-c-configuration"></a>
|
||||
|
||||
### 5.xv. How can I configure my C or C++ project?
|
||||
### 5.xvii. 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
|
||||
@@ -766,13 +835,24 @@ 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.
|
||||
|
||||
ALE will attempt to parse `compile_commands.json` files to discover compiler
|
||||
flags to use when linting code. See `:help g:ale_c_parse_compile_commands` for
|
||||
more information. See Clang's documentation for
|
||||
[compile_commands.json files](https://clang.llvm.org/docs/JSONCompilationDatabase.html).
|
||||
You should strongly consider generating them in your builds, which is easy to do
|
||||
with CMake.
|
||||
|
||||
You can also configure ALE to automatically run `make -n` to run dry runs on
|
||||
`Makefile`s to discover compiler flags. This can execute arbitrary code, so the
|
||||
option is disabled by default. See `:help g:ale_c_parse_makefile`.
|
||||
|
||||
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.xvi. How can I configure ALE differently for different buffers?
|
||||
### 5.xviii. 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
|
||||
@@ -808,7 +888,7 @@ Buffer-local variables for settings always override the global settings.
|
||||
|
||||
<a name="faq-list-window-height"></a>
|
||||
|
||||
### 5.xvii. How can I configure the height of the list in which ALE displays errors?
|
||||
### 5.xix. How can I configure the height of the list in which ALE displays errors?
|
||||
|
||||
To set a default height for the error list, use the `g:ale_list_window_size` variable.
|
||||
|
||||
@@ -817,12 +897,13 @@ To set a default height for the error list, use the `g:ale_list_window_size` var
|
||||
let g:ale_list_window_size = 5
|
||||
```
|
||||
|
||||
<a name="faq-get-info"></a>
|
||||
<a name="faq-vm"></a>
|
||||
|
||||
### 5.xviii. How can I see what ALE has configured for the current file?
|
||||
### 5.xx. How can I run linters or fixers via Docker or a VM?
|
||||
|
||||
Run the following to see what is currently configured:
|
||||
|
||||
```vim
|
||||
:ALEInfo
|
||||
```
|
||||
ALE supports running linters or fixers via Docker, virtual machines, or in
|
||||
combination with any remote machine with a different file system, so long as the
|
||||
tools are well-integrated with ALE, and ALE is properly configured to run the
|
||||
correct commands and map filename paths between different file systems. See
|
||||
`:help ale-lint-other-machines` for the full documentation on how to configure
|
||||
ALE to support this.
|
||||
|
||||
26
ale_linters/ada/adals.vim
Normal file
26
ale_linters/ada/adals.vim
Normal file
@@ -0,0 +1,26 @@
|
||||
" Author: Bartek Jasicki http://github.com/thindil
|
||||
" Description: Support for Ada Language Server
|
||||
|
||||
call ale#Set('ada_adals_executable', 'ada_language_server')
|
||||
call ale#Set('ada_adals_project', 'default.gpr')
|
||||
call ale#Set('ada_adals_encoding', 'utf-8')
|
||||
|
||||
function! ale_linters#ada#adals#GetAdaLSConfig(buffer) abort
|
||||
return {
|
||||
\ 'ada.projectFile': ale#Var(a:buffer, 'ada_adals_project'),
|
||||
\ 'ada.defaultCharset': ale#Var(a:buffer, 'ada_adals_encoding')
|
||||
\}
|
||||
endfunction
|
||||
|
||||
function! ale_linters#ada#adals#GetRootDirectory(buffer) abort
|
||||
return fnamemodify(bufname(a:buffer), ':p:h')
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('ada', {
|
||||
\ 'name': 'adals',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#Var(b, 'ada_adals_executable')},
|
||||
\ 'command': '%e',
|
||||
\ 'project_root': function('ale_linters#ada#adals#GetRootDirectory'),
|
||||
\ 'lsp_config': function('ale_linters#ada#adals#GetAdaLSConfig')
|
||||
\})
|
||||
@@ -18,7 +18,7 @@ function! ale_linters#ada#gcc#GetCommand(buffer) abort
|
||||
" -gnatc: Check syntax and semantics only (no code generation attempted)
|
||||
return '%e -x ada -c -gnatc'
|
||||
\ . ' -o ' . ale#Escape(l:out_file)
|
||||
\ . ' -I ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||
\ . ' -I %s:h'
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'ada_gcc_options'))
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
12
ale_linters/apkbuild/apkbuild_lint.vim
Normal file
12
ale_linters/apkbuild/apkbuild_lint.vim
Normal file
@@ -0,0 +1,12 @@
|
||||
" Author: Leo <thinkabit.ukim@gmail.com>
|
||||
" Description: apkbuild-lint from atools linter for APKBUILDs
|
||||
|
||||
call ale#Set('apkbuild_apkbuild_lint_executable', 'apkbuild-lint')
|
||||
|
||||
call ale#linter#Define('apkbuild', {
|
||||
\ 'name': 'apkbuild_lint',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable': {b -> ale#Var(b, 'apkbuild_apkbuild_lint_executable')},
|
||||
\ 'command': '%e %t',
|
||||
\ 'callback': 'ale#handlers#atools#Handle',
|
||||
\})
|
||||
12
ale_linters/apkbuild/secfixes_check.vim
Normal file
12
ale_linters/apkbuild/secfixes_check.vim
Normal file
@@ -0,0 +1,12 @@
|
||||
" Author: Leo <thinkabit.ukim@gmail.com>
|
||||
" Description: secfixes-check from atools linter for APKBUILDs
|
||||
|
||||
call ale#Set('apkbuild_secfixes_check_executable', 'secfixes-check')
|
||||
|
||||
call ale#linter#Define('apkbuild', {
|
||||
\ 'name': 'secfixes_check',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable': {b -> ale#Var(b, 'apkbuild_secfixes_check_executable')},
|
||||
\ 'command': '%e %t',
|
||||
\ 'callback': 'ale#handlers#atools#Handle',
|
||||
\})
|
||||
5
ale_linters/asciidoc/languagetool.vim
Normal file
5
ale_linters/asciidoc/languagetool.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
" Author: Horacio Sanson (hsanson [ät] gmail.com)
|
||||
" Description: languagetool for asciidoc files, copied from markdown.
|
||||
|
||||
|
||||
call ale#handlers#languagetool#DefineLinter('asciidoc')
|
||||
@@ -9,7 +9,7 @@ function! ale_linters#asm#gcc#GetCommand(buffer) abort
|
||||
" -fsyntax-only doesn't catch everything.
|
||||
return '%e -x assembler'
|
||||
\ . ' -o ' . g:ale#util#nul_file
|
||||
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||
\ . '-iquote %s:h'
|
||||
\ . ' ' . ale#Var(a:buffer, 'asm_gcc_options') . ' -'
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -18,7 +18,12 @@ function! ale_linters#bib#bibclean#get_type(str) abort
|
||||
endfunction
|
||||
|
||||
function! ale_linters#bib#bibclean#match_msg(line) abort
|
||||
return matchlist(a:line, '^\(.*\) "stdin", line \(.*\): \(.*\)$')
|
||||
" Legacy message pattern works for bibclean <= v2.11.4. If empty, try
|
||||
" the new message pattern for bibtex > v2.11.4
|
||||
let l:matches_legacy = matchlist(a:line, '^\(.*\) "stdin", line \(\d\+\): \(.*\)$')
|
||||
|
||||
return ! empty(l:matches_legacy) ? l:matches_legacy
|
||||
\ : matchlist(a:line, '^\(.*\) stdin:\(\d\+\):\(.*\)$')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#bib#bibclean#match_entry(line) abort
|
||||
|
||||
53
ale_linters/c/cc.vim
Normal file
53
ale_linters/c/cc.vim
Normal file
@@ -0,0 +1,53 @@
|
||||
" Author: w0rp <devw0rp@gmail.com>
|
||||
" Description: A C compiler linter for C files with gcc/clang, etc.
|
||||
|
||||
call ale#Set('c_cc_executable', '<auto>')
|
||||
call ale#Set('c_cc_options', '-std=c11 -Wall')
|
||||
|
||||
function! ale_linters#c#cc#GetExecutable(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'c_cc_executable')
|
||||
|
||||
" Default to either clang or gcc.
|
||||
if l:executable is# '<auto>'
|
||||
if ale#engine#IsExecutable(a:buffer, 'clang')
|
||||
let l:executable = 'clang'
|
||||
else
|
||||
let l:executable = 'gcc'
|
||||
endif
|
||||
endif
|
||||
|
||||
return l:executable
|
||||
endfunction
|
||||
|
||||
function! ale_linters#c#cc#GetCommand(buffer, output) abort
|
||||
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
||||
let l:ale_flags = ale#Var(a:buffer, 'c_cc_options')
|
||||
|
||||
if l:cflags =~# '-std='
|
||||
let l:ale_flags = substitute(
|
||||
\ l:ale_flags,
|
||||
\ '-std=\(c\|gnu\)[0-9]\{2\}',
|
||||
\ '',
|
||||
\ 'g')
|
||||
endif
|
||||
|
||||
" -iquote with the directory the file is in makes #include work for
|
||||
" headers in the same directory.
|
||||
"
|
||||
" `-o /dev/null` or `-o null` is needed to catch all errors,
|
||||
" -fsyntax-only doesn't catch everything.
|
||||
return '%e -S -x c'
|
||||
\ . ' -o ' . g:ale#util#nul_file
|
||||
\ . ' -iquote %s:h'
|
||||
\ . ale#Pad(l:cflags)
|
||||
\ . ale#Pad(l:ale_flags) . ' -'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'cc',
|
||||
\ 'aliases': ['gcc', 'clang'],
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': function('ale_linters#c#cc#GetExecutable'),
|
||||
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#c#cc#GetCommand'))},
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||
\})
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
call ale#Set('c_ccls_executable', 'ccls')
|
||||
call ale#Set('c_ccls_init_options', {})
|
||||
call ale#Set('c_build_dir', '')
|
||||
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'ccls',
|
||||
@@ -10,5 +11,5 @@ call ale#linter#Define('c', {
|
||||
\ 'executable': {b -> ale#Var(b, 'c_ccls_executable')},
|
||||
\ 'command': '%e',
|
||||
\ 'project_root': function('ale#handlers#ccls#GetProjectRoot'),
|
||||
\ 'initialization_options': {b -> ale#Var(b, 'c_ccls_init_options')},
|
||||
\ 'initialization_options': {b -> ale#handlers#ccls#GetInitOpts(b, 'c_ccls_init_options')},
|
||||
\})
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
" Author: Masahiro H https://github.com/mshr-h
|
||||
" Description: clang linter for c files
|
||||
|
||||
call ale#Set('c_clang_executable', 'clang')
|
||||
call ale#Set('c_clang_options', '-std=c11 -Wall')
|
||||
|
||||
function! ale_linters#c#clang#GetCommand(buffer, output) abort
|
||||
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
||||
|
||||
" -iquote with the directory the file is in makes #include work for
|
||||
" headers in the same directory.
|
||||
return '%e -S -x c -fsyntax-only'
|
||||
\ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||
\ . ale#Pad(l:cflags)
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'c_clang_options')) . ' -'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'clang',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': {b -> ale#Var(b, 'c_clang_executable')},
|
||||
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#c#clang#GetCommand'))},
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||
\})
|
||||
@@ -10,9 +10,11 @@ function! ale_linters#c#cppcheck#GetCommand(buffer) abort
|
||||
let l:buffer_path_include = empty(l:compile_commands_option)
|
||||
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
|
||||
\ : ''
|
||||
let l:template = ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
|
||||
|
||||
return l:cd_command
|
||||
\ . '%e -q --language=c'
|
||||
\ . l:template
|
||||
\ . ale#Pad(l:compile_commands_option)
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'c_cppcheck_options'))
|
||||
\ . l:buffer_path_include
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
" Author: w0rp <devw0rp@gmail.com>
|
||||
" Description: gcc linter for c files
|
||||
|
||||
call ale#Set('c_gcc_executable', 'gcc')
|
||||
call ale#Set('c_gcc_options', '-std=c11 -Wall')
|
||||
|
||||
function! ale_linters#c#gcc#GetCommand(buffer, output) abort
|
||||
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
||||
|
||||
" -iquote with the directory the file is in makes #include work for
|
||||
" headers in the same directory.
|
||||
"
|
||||
" `-o /dev/null` or `-o null` is needed to catch all errors,
|
||||
" -fsyntax-only doesn't catch everything.
|
||||
return '%e -S -x c'
|
||||
\ . ' -o ' . g:ale#util#nul_file
|
||||
\ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||
\ . ale#Pad(l:cflags)
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'c_gcc_options')) . ' -'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('c', {
|
||||
\ 'name': 'gcc',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': {b -> ale#Var(b, 'c_gcc_executable')},
|
||||
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#c#gcc#GetCommand'))},
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||
\})
|
||||
@@ -29,6 +29,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('cloudformation', {
|
||||
\ 'name': 'cloudformation',
|
||||
\ 'aliases': ['cfn-lint'],
|
||||
\ 'executable': 'cfn-lint',
|
||||
\ 'command': 'cfn-lint --template %t --format parseable',
|
||||
\ 'callback': 'ale_linters#cloudformation#cfn_python_lint#Handle',
|
||||
|
||||
53
ale_linters/cpp/cc.vim
Normal file
53
ale_linters/cpp/cc.vim
Normal file
@@ -0,0 +1,53 @@
|
||||
" Author: w0rp <devw0rp@gmail.com>
|
||||
" Description: A C++ compiler linter for C++ files with gcc/clang, etc.
|
||||
|
||||
call ale#Set('cpp_cc_executable', '<auto>')
|
||||
call ale#Set('cpp_cc_options', '-std=c++14 -Wall')
|
||||
|
||||
function! ale_linters#cpp#cc#GetExecutable(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'cpp_cc_executable')
|
||||
|
||||
" Default to either clang++ or gcc.
|
||||
if l:executable is# '<auto>'
|
||||
if ale#engine#IsExecutable(a:buffer, 'clang++')
|
||||
let l:executable = 'clang++'
|
||||
else
|
||||
let l:executable = 'gcc'
|
||||
endif
|
||||
endif
|
||||
|
||||
return l:executable
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cpp#cc#GetCommand(buffer, output) abort
|
||||
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
||||
let l:ale_flags = ale#Var(a:buffer, 'cpp_cc_options')
|
||||
|
||||
if l:cflags =~# '-std='
|
||||
let l:ale_flags = substitute(
|
||||
\ l:ale_flags,
|
||||
\ '-std=\(c\|gnu\)++[0-9]\{2\}',
|
||||
\ '',
|
||||
\ 'g')
|
||||
endif
|
||||
|
||||
" -iquote with the directory the file is in makes #include work for
|
||||
" headers in the same directory.
|
||||
"
|
||||
" `-o /dev/null` or `-o null` is needed to catch all errors,
|
||||
" -fsyntax-only doesn't catch everything.
|
||||
return '%e -S -x c++'
|
||||
\ . ' -o ' . g:ale#util#nul_file
|
||||
\ . ' -iquote %s:h'
|
||||
\ . ale#Pad(l:cflags)
|
||||
\ . ale#Pad(l:ale_flags) . ' -'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'cc',
|
||||
\ 'aliases': ['gcc', 'clang', 'g++', 'clang++'],
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': function('ale_linters#cpp#cc#GetExecutable'),
|
||||
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#cpp#cc#GetCommand'))},
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||
\})
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
call ale#Set('cpp_ccls_executable', 'ccls')
|
||||
call ale#Set('cpp_ccls_init_options', {})
|
||||
call ale#Set('c_build_dir', '')
|
||||
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'ccls',
|
||||
@@ -10,5 +11,5 @@ call ale#linter#Define('cpp', {
|
||||
\ 'executable': {b -> ale#Var(b, 'cpp_ccls_executable')},
|
||||
\ 'command': '%e',
|
||||
\ 'project_root': function('ale#handlers#ccls#GetProjectRoot'),
|
||||
\ 'initialization_options': {b -> ale#Var(b, 'cpp_ccls_init_options')},
|
||||
\ 'initialization_options': {b -> ale#handlers#ccls#GetInitOpts(b, 'cpp_ccls_init_options')},
|
||||
\})
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
" Author: Tomota Nakamura <https://github.com/tomotanakamura>
|
||||
" Description: clang linter for cpp files
|
||||
|
||||
call ale#Set('cpp_clang_executable', 'clang++')
|
||||
call ale#Set('cpp_clang_options', '-std=c++14 -Wall')
|
||||
|
||||
function! ale_linters#cpp#clang#GetCommand(buffer, output) abort
|
||||
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
||||
|
||||
" -iquote with the directory the file is in makes #include work for
|
||||
" headers in the same directory.
|
||||
return '%e -S -x c++ -fsyntax-only'
|
||||
\ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||
\ . ale#Pad(l:cflags)
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'cpp_clang_options')) . ' -'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'clang',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': {b -> ale#Var(b, 'cpp_clang_executable')},
|
||||
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#cpp#clang#GetCommand'))},
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||
\})
|
||||
@@ -23,6 +23,13 @@ function! ale_linters#cpp#clangtidy#GetCommand(buffer, output) abort
|
||||
let l:options = ale#Var(a:buffer, 'cpp_clangtidy_options')
|
||||
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
||||
let l:options .= !empty(l:options) ? ale#Pad(l:cflags) : l:cflags
|
||||
|
||||
" Tell clang-tidy a .h header with a C++ filetype in Vim is a C++ file
|
||||
" only when compile-commands.json file is not there. Adding these
|
||||
" flags makes clang-tidy completely ignore compile commmands.
|
||||
if expand('#' . a:buffer) =~# '\.h$'
|
||||
let l:options .= !empty(l:options) ? ' -x c++' : '-x c++'
|
||||
endif
|
||||
endif
|
||||
|
||||
" Get the options to pass directly to clang-tidy
|
||||
|
||||
@@ -10,9 +10,11 @@ function! ale_linters#cpp#cppcheck#GetCommand(buffer) abort
|
||||
let l:buffer_path_include = empty(l:compile_commands_option)
|
||||
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
|
||||
\ : ''
|
||||
let l:template = ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
|
||||
|
||||
return l:cd_command
|
||||
\ . '%e -q --language=c++'
|
||||
\ . l:template
|
||||
\ . ale#Pad(l:compile_commands_option)
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'cpp_cppcheck_options'))
|
||||
\ . l:buffer_path_include
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
" Author: geam <mdelage@student.42.fr>
|
||||
" Description: gcc linter for cpp files
|
||||
"
|
||||
call ale#Set('cpp_gcc_executable', 'gcc')
|
||||
call ale#Set('cpp_gcc_options', '-std=c++14 -Wall')
|
||||
|
||||
function! ale_linters#cpp#gcc#GetCommand(buffer, output) abort
|
||||
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
|
||||
|
||||
" -iquote with the directory the file is in makes #include work for
|
||||
" headers in the same directory.
|
||||
"
|
||||
" `-o /dev/null` or `-o null` is needed to catch all errors,
|
||||
" -fsyntax-only doesn't catch everything.
|
||||
return '%e -S -x c++'
|
||||
\ . ' -o ' . g:ale#util#nul_file
|
||||
\ . ' -iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||
\ . ale#Pad(l:cflags)
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'cpp_gcc_options')) . ' -'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('cpp', {
|
||||
\ 'name': 'gcc',
|
||||
\ 'aliases': ['g++'],
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': {b -> ale#Var(b, 'cpp_gcc_executable')},
|
||||
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#cpp#gcc#GetCommand'))},
|
||||
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
|
||||
\})
|
||||
@@ -5,9 +5,6 @@ call ale#Set('cuda_nvcc_executable', 'nvcc')
|
||||
call ale#Set('cuda_nvcc_options', '-std=c++11')
|
||||
|
||||
function! ale_linters#cuda#nvcc#GetCommand(buffer) abort
|
||||
" Unused: use ale#util#nul_file
|
||||
" let l:output_file = ale#util#Tempname() . '.ii'
|
||||
" call ale#command#ManageFile(a:buffer, l:output_file)
|
||||
return '%e -cuda'
|
||||
\ . ale#Pad(ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer)))
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'cuda_nvcc_options'))
|
||||
|
||||
@@ -6,7 +6,7 @@ function! ale_linters#dafny#dafny#Handle(buffer, lines) abort
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'filename': l:match[1],
|
||||
\ 'col': l:match[3] + 0,
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'text': l:match[5],
|
||||
@@ -14,13 +14,28 @@ function! ale_linters#dafny#dafny#Handle(buffer, lines) abort
|
||||
\ })
|
||||
endfor
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, '\v(.*)\((\d+),(\d+)\): (Verification of .{-} timed out after \d+ seconds)')
|
||||
call add(l:output, {
|
||||
\ 'filename': l:match[1],
|
||||
\ 'col': l:match[3] + 0,
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'text': l:match[4],
|
||||
\ 'type': 'E',
|
||||
\ })
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
function! ale_linters#dafny#dafny#GetCommand(buffer) abort
|
||||
return printf('dafny %%s /compile:0 /timeLimit:%d', ale#Var(a:buffer, 'dafny_dafny_timelimit'))
|
||||
endfunction
|
||||
|
||||
call ale#Set('dafny_dafny_timelimit', 10)
|
||||
call ale#linter#Define('dafny', {
|
||||
\ 'name': 'dafny',
|
||||
\ 'executable': 'dafny',
|
||||
\ 'command': 'dafny %s /compile:0',
|
||||
\ 'command': function('ale_linters#dafny#dafny#GetCommand'),
|
||||
\ 'callback': 'ale_linters#dafny#dafny#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\ })
|
||||
|
||||
29
ale_linters/dart/analysis_server.vim
Normal file
29
ale_linters/dart/analysis_server.vim
Normal file
@@ -0,0 +1,29 @@
|
||||
" Author: Nelson Yeung <nelsyeung@gmail.com>
|
||||
" Description: Check Dart files with dart analysis server LSP
|
||||
|
||||
call ale#Set('dart_analysis_server_executable', 'dart')
|
||||
|
||||
function! ale_linters#dart#analysis_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
|
||||
|
||||
function! ale_linters#dart#analysis_server#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'dart_analysis_server_executable')
|
||||
let l:dart = resolve(exepath(l:executable))
|
||||
|
||||
return '%e '
|
||||
\ . fnamemodify(l:dart, ':h') . '/snapshots/analysis_server.dart.snapshot'
|
||||
\ . ' --lsp'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('dart', {
|
||||
\ 'name': 'analysis_server',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#Var(b, 'dart_analysis_server_executable')},
|
||||
\ 'command': function('ale_linters#dart#analysis_server#GetCommand'),
|
||||
\ 'project_root': function('ale_linters#dart#analysis_server#GetProjectRoot'),
|
||||
\})
|
||||
@@ -32,14 +32,29 @@ function! ale_linters#dockerfile#dockerfile_lint#Handle(buffer, lines) abort
|
||||
let l:line = get(l:object, 'line', -1)
|
||||
let l:message = l:object['message']
|
||||
|
||||
if get(l:object, 'description', 'None') isnot# 'None'
|
||||
let l:message = l:message . '. ' . l:object['description']
|
||||
let l:link = get(l:object, 'reference_url', '')
|
||||
|
||||
if type(l:link) == v:t_list
|
||||
" Somehow, reference_url is returned as two-part list.
|
||||
" Anchor markers in that list are sometimes duplicated.
|
||||
" See https://github.com/projectatomic/dockerfile_lint/issues/134
|
||||
let l:link = join(l:link, '')
|
||||
let l:link = substitute(l:link, '##', '#', '')
|
||||
endif
|
||||
|
||||
let l:detail = l:message
|
||||
|
||||
if get(l:object, 'description', 'None') isnot# 'None'
|
||||
let l:detail .= "\n\n" . l:object['description']
|
||||
endif
|
||||
|
||||
let l:detail .= "\n\n" . l:link
|
||||
|
||||
call add(l:messages, {
|
||||
\ 'lnum': l:line,
|
||||
\ 'text': l:message,
|
||||
\ 'type': ale_linters#dockerfile#dockerfile_lint#GetType(l:type),
|
||||
\ 'detail': l:detail,
|
||||
\})
|
||||
endfor
|
||||
endfor
|
||||
|
||||
@@ -9,7 +9,7 @@ function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
|
||||
"
|
||||
" /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:pattern = '\v^/dev/stdin:(\d+):?(\d+)? ((DL|SC)(\d+) )?((.+)?: )?(.+)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
@@ -24,9 +24,19 @@ function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
|
||||
let l:colnum = l:match[2] + 0
|
||||
endif
|
||||
|
||||
let l:type = 'W'
|
||||
let l:text = l:match[6]
|
||||
let l:detail = l:match[6]
|
||||
" Shellcheck knows a 'style' severity - pin it to info level as well.
|
||||
if l:match[7] is# 'style'
|
||||
let l:type = 'I'
|
||||
elseif l:match[7] is# 'info'
|
||||
let l:type = 'I'
|
||||
elseif l:match[7] is# 'warning'
|
||||
let l:type = 'W'
|
||||
else
|
||||
let l:type = 'E'
|
||||
endif
|
||||
|
||||
let l:text = l:match[8]
|
||||
let l:detail = l:match[8]
|
||||
let l:domain = 'https://github.com/hadolint/hadolint/wiki/'
|
||||
|
||||
if l:match[4] is# 'SC'
|
||||
|
||||
@@ -45,13 +45,24 @@ function! ale_linters#elixir#credo#GetMode() abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ale_linters#elixir#credo#GetConfigFile() abort
|
||||
let l:config_file = get(g:, 'ale_elixir_credo_config_file', '')
|
||||
|
||||
if empty(l:config_file)
|
||||
return ''
|
||||
endif
|
||||
|
||||
return ' --config-file ' . l:config_file
|
||||
endfunction
|
||||
|
||||
function! ale_linters#elixir#credo#GetCommand(buffer) abort
|
||||
let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer)
|
||||
let l:project_root = ale#handlers#elixir#FindMixUmbrellaRoot(a:buffer)
|
||||
let l:mode = ale_linters#elixir#credo#GetMode()
|
||||
|
||||
return ale#path#CdString(l:project_root)
|
||||
\ . 'mix help credo && '
|
||||
\ . 'mix credo ' . ale_linters#elixir#credo#GetMode()
|
||||
\ . ale_linters#elixir#credo#GetConfigFile()
|
||||
\ . ' --format=flycheck --read-from-stdin %s'
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
|
||||
let g:ale_erlang_dialyzer_executable =
|
||||
\ get(g:, 'ale_erlang_dialyzer_executable', 'dialyzer')
|
||||
let g:ale_erlang_dialyzer_options =
|
||||
\ get(g:, 'ale_erlang_dialyzer_options', '-Wunmatched_returns'
|
||||
\ . ' -Werror_handling'
|
||||
\ . ' -Wrace_conditions'
|
||||
\ . ' -Wunderspecs')
|
||||
let g:ale_erlang_dialyzer_plt_file =
|
||||
\ get(g:, 'ale_erlang_dialyzer_plt_file', '')
|
||||
let g:ale_erlang_dialyzer_rebar3_profile =
|
||||
@@ -47,13 +52,12 @@ function! ale_linters#erlang#dialyzer#GetExecutable(buffer) abort
|
||||
endfunction
|
||||
|
||||
function! ale_linters#erlang#dialyzer#GetCommand(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'erlang_dialyzer_options')
|
||||
|
||||
let l:command = ale#Escape(ale_linters#erlang#dialyzer#GetExecutable(a:buffer))
|
||||
\ . ' -n'
|
||||
\ . ' --plt ' . ale#Escape(ale_linters#erlang#dialyzer#GetPlt(a:buffer))
|
||||
\ . ' -Wunmatched_returns'
|
||||
\ . ' -Werror_handling'
|
||||
\ . ' -Wrace_conditions'
|
||||
\ . ' -Wunderspecs'
|
||||
\ . ' ' . l:options
|
||||
\ . ' %s'
|
||||
|
||||
return l:command
|
||||
|
||||
39
ale_linters/erlang/elvis.vim
Normal file
39
ale_linters/erlang/elvis.vim
Normal file
@@ -0,0 +1,39 @@
|
||||
" Author: Dmitri Vereshchagin <dmitri.vereshchagin@gmail.com>
|
||||
" Description: Elvis linter for Erlang files
|
||||
|
||||
call ale#Set('erlang_elvis_executable', 'elvis')
|
||||
|
||||
function! ale_linters#erlang#elvis#Handle(buffer, lines) abort
|
||||
let l:pattern = '\v:(\d+):[^:]+:(.+)'
|
||||
let l:loclist = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:loclist, {
|
||||
\ 'lnum': str2nr(l:match[1]),
|
||||
\ 'text': s:AbbreviateMessage(l:match[2]),
|
||||
\ 'type': 'W',
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:loclist
|
||||
endfunction
|
||||
|
||||
function! s:AbbreviateMessage(text) abort
|
||||
let l:pattern = '\v\c^(line \d+ is too long):.*$'
|
||||
|
||||
return substitute(a:text, l:pattern, '\1.', '')
|
||||
endfunction
|
||||
|
||||
function! s:GetCommand(buffer) abort
|
||||
let l:file = ale#Escape(expand('#' . a:buffer . ':.'))
|
||||
|
||||
return '%e rock --output-format=parsable ' . l:file
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('erlang', {
|
||||
\ 'name': 'elvis',
|
||||
\ 'callback': 'ale_linters#erlang#elvis#Handle',
|
||||
\ 'executable': {b -> ale#Var(b, 'erlang_elvis_executable')},
|
||||
\ 'command': function('s:GetCommand'),
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
@@ -1,14 +1,22 @@
|
||||
" Author: Magnus Ottenklinger - https://github.com/evnu
|
||||
|
||||
let g:ale_erlang_erlc_executable = get(g:, 'ale_erlang_erlc_executable', 'erlc')
|
||||
let g:ale_erlang_erlc_options = get(g:, 'ale_erlang_erlc_options', '')
|
||||
|
||||
function! ale_linters#erlang#erlc#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'erlang_erlc_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#erlang#erlc#GetCommand(buffer) abort
|
||||
let l:output_file = ale#util#Tempname()
|
||||
call ale#command#ManageFile(a:buffer, l:output_file)
|
||||
|
||||
return 'erlc -o ' . ale#Escape(l:output_file)
|
||||
\ . ' ' . ale#Var(a:buffer, 'erlang_erlc_options')
|
||||
\ . ' %t'
|
||||
let l:command = ale#Escape(ale_linters#erlang#erlc#GetExecutable(a:buffer))
|
||||
\ . ' -o ' . ale#Escape(l:output_file)
|
||||
\ . ' ' . ale#Var(a:buffer, 'erlang_erlc_options')
|
||||
\ . ' %t'
|
||||
|
||||
return l:command
|
||||
endfunction
|
||||
|
||||
function! ale_linters#erlang#erlc#Handle(buffer, lines) abort
|
||||
@@ -90,7 +98,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('erlang', {
|
||||
\ 'name': 'erlc',
|
||||
\ 'executable': 'erlc',
|
||||
\ 'executable': function('ale_linters#erlang#erlc#GetExecutable'),
|
||||
\ 'command': function('ale_linters#erlang#erlc#GetCommand'),
|
||||
\ 'callback': 'ale_linters#erlang#erlc#Handle',
|
||||
\})
|
||||
|
||||
@@ -11,7 +11,7 @@ function! ale_linters#eruby#ruumba#GetCommand(buffer) abort
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'ruumba')
|
||||
\ . ' --format json --force-exclusion '
|
||||
\ . ale#Var(a:buffer, 'eruby_ruumba_options')
|
||||
\ . ' --stdin ' . ale#Escape(expand('#' . a:buffer . ':p'))
|
||||
\ . ' --stdin %s'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#eruby#ruumba#Handle(buffer, lines) abort
|
||||
|
||||
@@ -6,7 +6,6 @@ function! ale_linters#go#gofmt#GetCommand(buffer) abort
|
||||
\ . '%e -e %t'
|
||||
endfunction
|
||||
|
||||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'gofmt',
|
||||
\ 'output_stream': 'stderr',
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
call ale#Set('go_gopls_executable', 'gopls')
|
||||
call ale#Set('go_gopls_options', '--mode stdio')
|
||||
call ale#Set('go_gopls_init_options', {})
|
||||
|
||||
function! ale_linters#go#gopls#GetCommand(buffer) abort
|
||||
return ale#go#EnvString(a:buffer)
|
||||
@@ -31,4 +32,5 @@ call ale#linter#Define('go', {
|
||||
\ 'executable': {b -> ale#Var(b, 'go_gopls_executable')},
|
||||
\ 'command': function('ale_linters#go#gopls#GetCommand'),
|
||||
\ 'project_root': function('ale_linters#go#gopls#FindProjectRoot'),
|
||||
\ 'initialization_options': {b -> ale#Var(b, 'go_gopls_init_options')},
|
||||
\})
|
||||
|
||||
@@ -4,6 +4,28 @@
|
||||
call ale#Set('handlebars_embertemplatelint_executable', 'ember-template-lint')
|
||||
call ale#Set('handlebars_embertemplatelint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#handlebars#embertemplatelint#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'handlebars_embertemplatelint', [
|
||||
\ 'node_modules/.bin/ember-template-lint',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#handlebars#embertemplatelint#GetCommand(buffer, version) abort
|
||||
" Reading from stdin was introduced in ember-template-lint@1.6.0
|
||||
return ale#semver#GTE(a:version, [1, 6, 0])
|
||||
\ ? '%e --json --filename %s'
|
||||
\ : '%e --json %t'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#handlebars#embertemplatelint#GetCommandWithVersionCheck(buffer) abort
|
||||
return ale#semver#RunWithVersionCheck(
|
||||
\ a:buffer,
|
||||
\ ale_linters#handlebars#embertemplatelint#GetExecutable(a:buffer),
|
||||
\ '%e --version',
|
||||
\ function('ale_linters#handlebars#embertemplatelint#GetCommand'),
|
||||
\)
|
||||
endfunction
|
||||
|
||||
function! ale_linters#handlebars#embertemplatelint#Handle(buffer, lines) abort
|
||||
let l:output = []
|
||||
let l:json = ale#util#FuzzyJSONDecode(a:lines, {})
|
||||
@@ -30,10 +52,9 @@ function! ale_linters#handlebars#embertemplatelint#Handle(buffer, lines) abort
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('handlebars', {
|
||||
\ 'name': 'ember-template-lint',
|
||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'handlebars_embertemplatelint', [
|
||||
\ 'node_modules/.bin/ember-template-lint',
|
||||
\ ])},
|
||||
\ 'command': '%e --json %t',
|
||||
\ 'name': 'embertemplatelint',
|
||||
\ 'aliases': ['ember-template-lint'],
|
||||
\ 'executable': function('ale_linters#handlebars#embertemplatelint#GetExecutable'),
|
||||
\ 'command': function('ale_linters#handlebars#embertemplatelint#GetCommandWithVersionCheck'),
|
||||
\ 'callback': 'ale_linters#handlebars#embertemplatelint#Handle',
|
||||
\})
|
||||
|
||||
63
ale_linters/haskell/hls.vim
Normal file
63
ale_linters/haskell/hls.vim
Normal file
@@ -0,0 +1,63 @@
|
||||
" Author: Yen3 <yen3rc@gmail.com>
|
||||
" Description: A language server for haskell
|
||||
" The file is based on hie.vim (author: Luxed
|
||||
" <devildead13@gmail.com>). It search more project root files.
|
||||
"
|
||||
call ale#Set('haskell_hls_executable', 'haskell-language-server-wrapper')
|
||||
|
||||
function! ale_linters#haskell#hls#FindRootFile(buffer) abort
|
||||
let l:serach_root_files = [
|
||||
\ 'stack.yaml',
|
||||
\ 'cabal.project',
|
||||
\ 'package.yaml',
|
||||
\ 'hie.yaml'
|
||||
\ ]
|
||||
|
||||
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
|
||||
for l:root_file in l:serach_root_files
|
||||
if filereadable(l:path . l:root_file)
|
||||
return l:path
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! ale_linters#haskell#hls#GetProjectRoot(buffer) abort
|
||||
" Search for the project file first
|
||||
let l:project_file = ale_linters#haskell#hls#FindRootFile(a:buffer)
|
||||
|
||||
" If it's empty, search for the cabal file
|
||||
if empty(l:project_file)
|
||||
" Search all of the paths except for the root filesystem path.
|
||||
let l:paths = join(
|
||||
\ ale#path#Upwards(expand('#' . a:buffer . ':p:h'))[:-2],
|
||||
\ ','
|
||||
\)
|
||||
let l:project_file = globpath(l:paths, '*.cabal')
|
||||
endif
|
||||
|
||||
" If we still can't find one, use the current file.
|
||||
if empty(l:project_file)
|
||||
let l:project_file = expand('#' . a:buffer . ':p')
|
||||
endif
|
||||
|
||||
return fnamemodify(l:project_file, ':h')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#haskell#hls#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'haskell_hls_executable')
|
||||
|
||||
return ale#handlers#haskell_stack#EscapeExecutable(l:executable,
|
||||
\ 'haskell-language-server-wrapper')
|
||||
\ . ' --lsp'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('haskell', {
|
||||
\ 'name': 'hls',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'command': function('ale_linters#haskell#hls#GetCommand'),
|
||||
\ 'executable': {b -> ale#Var(b, 'haskell_hls_executable')},
|
||||
\ 'project_root': function('ale_linters#haskell#hls#GetProjectRoot'),
|
||||
\})
|
||||
33
ale_linters/inko/inko.vim
Normal file
33
ale_linters/inko/inko.vim
Normal file
@@ -0,0 +1,33 @@
|
||||
" Author: Yorick Peterse <yorick@yorickpeterse.com>
|
||||
" Description: linting of Inko source code using the Inko compiler
|
||||
|
||||
call ale#Set('inko_inko_executable', 'inko')
|
||||
|
||||
function! ale_linters#inko#inko#GetCommand(buffer) abort
|
||||
let l:include = ''
|
||||
|
||||
" Include the tests source directory, but only for test files.
|
||||
if expand('#' . a:buffer . ':p') =~? '\vtests[/\\]test[/\\]'
|
||||
let l:test_dir = ale#path#FindNearestDirectory(a:buffer, 'tests')
|
||||
|
||||
if isdirectory(l:test_dir)
|
||||
let l:include = '--include ' . ale#Escape(l:test_dir)
|
||||
endif
|
||||
endif
|
||||
|
||||
" We use %s instead of %t so the compiler determines the correct module
|
||||
" names for the file being edited. Not doing so may lead to errors in
|
||||
" certain cases.
|
||||
return '%e build --check --format=json'
|
||||
\ . ale#Pad(l:include)
|
||||
\ . ' %s'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('inko', {
|
||||
\ 'name': 'inko',
|
||||
\ 'executable': {b -> ale#Var(b, 'inko_inko_executable')},
|
||||
\ 'command': function('ale_linters#inko#inko#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#inko#Handle',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'lint_file': 1
|
||||
\})
|
||||
@@ -9,7 +9,7 @@ function! ale_linters#java#checkstyle#Handle(buffer, lines) abort
|
||||
let l:output = []
|
||||
|
||||
" modern checkstyle versions
|
||||
let l:pattern = '\v\[(WARN|ERROR)\] [a-zA-Z]?:?[^:]+:(\d+):(\d+)?:? (.*) \[(.+)\]$'
|
||||
let l:pattern = '\v\[(WARN|ERROR)\] [a-zA-Z]?:?[^:]+:(\d+):(\d+)?:? (.*) \[(.+)\]'
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
@@ -52,7 +52,7 @@ endfunction
|
||||
function! ale_linters#java#checkstyle#GetCommand(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'java_checkstyle_options')
|
||||
let l:config_option = ale#Var(a:buffer, 'java_checkstyle_config')
|
||||
let l:config = l:options !~# '\v(^| )-c' && !empty(l:config_option)
|
||||
let l:config = l:options !~# '\v(^| )-c ' && !empty(l:config_option)
|
||||
\ ? s:GetConfig(a:buffer, l:config_option)
|
||||
\ : ''
|
||||
|
||||
|
||||
@@ -20,25 +20,39 @@ endfunction
|
||||
function! ale_linters#java#eclipselsp#JarPath(buffer) abort
|
||||
let l:path = ale_linters#java#eclipselsp#TargetPath(a:buffer)
|
||||
|
||||
" Search jar file within repository path when manually built using mvn
|
||||
let l:repo_path = l:path . '/org.eclipse.jdt.ls.product/target/repository'
|
||||
let l:files = globpath(l:repo_path, '**/plugins/org.eclipse.equinox.launcher_\d\.\d\.\d\d\d\.*\.jar', 1, 1)
|
||||
if has('win32')
|
||||
let l:platform = 'win32'
|
||||
elseif has('macunix')
|
||||
let l:platform = 'macosx'
|
||||
else
|
||||
let l:platform = 'linux'
|
||||
endif
|
||||
|
||||
if len(l:files) == 1
|
||||
" Search jar file within repository path when manually built using mvn
|
||||
let l:files = globpath(l:path, '**/'.l:platform.'/**/plugins/org.eclipse.equinox.launcher_*\.jar', 1, 1)
|
||||
|
||||
if len(l:files) >= 1
|
||||
return l:files[0]
|
||||
endif
|
||||
|
||||
" Search jar file within VSCode extensions folder.
|
||||
let l:files = globpath(l:path, '**/plugins/org.eclipse.equinox.launcher_\d\.\d\.\d\d\d\.*\.jar', 1, 1)
|
||||
let l:files = globpath(l:path, '**/'.l:platform.'/plugins/org.eclipse.equinox.launcher_*\.jar', 1, 1)
|
||||
|
||||
if len(l:files) == 1
|
||||
if len(l:files) >= 1
|
||||
return l:files[0]
|
||||
endif
|
||||
|
||||
" Search jar file within unzipped tar.gz file
|
||||
let l:files = globpath(l:path, 'plugins/org.eclipse.equinox.launcher_*\.jar', 1, 1)
|
||||
|
||||
if len(l:files) >= 1
|
||||
return l:files[0]
|
||||
endif
|
||||
|
||||
" Search jar file within system package path
|
||||
let l:files = globpath('/usr/share/java/jdtls/plugins', 'org.eclipse.equinox.launcher_\d\.\d\.\d\d\d\.*\.jar', 1, 1)
|
||||
let l:files = globpath('/usr/share/java/jdtls/plugins', 'org.eclipse.equinox.launcher_*\.jar', 1, 1)
|
||||
|
||||
if len(l:files) == 1
|
||||
if len(l:files) >= 1
|
||||
return l:files[0]
|
||||
endif
|
||||
|
||||
@@ -166,7 +180,8 @@ function! ale_linters#java#eclipselsp#RunWithVersionCheck(buffer) abort
|
||||
return ale#command#Run(
|
||||
\ a:buffer,
|
||||
\ l:command,
|
||||
\ function('ale_linters#java#eclipselsp#CommandWithVersion')
|
||||
\ function('ale_linters#java#eclipselsp#CommandWithVersion'),
|
||||
\ { 'output_stream': 'both' }
|
||||
\)
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -9,13 +9,7 @@ call ale#Set('java_javac_classpath', '')
|
||||
call ale#Set('java_javac_sourcepath', '')
|
||||
|
||||
function! ale_linters#java#javac#RunWithImportPaths(buffer) abort
|
||||
let l:command = ''
|
||||
let l:pom_path = ale#path#FindNearestFile(a:buffer, 'pom.xml')
|
||||
|
||||
if !empty(l:pom_path) && executable('mvn')
|
||||
let l:command = ale#path#CdString(fnamemodify(l:pom_path, ':h'))
|
||||
\ . 'mvn dependency:build-classpath'
|
||||
endif
|
||||
let l:command = ale#maven#BuildClasspathCommand(a:buffer)
|
||||
|
||||
" Try to use Gradle if Maven isn't available.
|
||||
if empty(l:command)
|
||||
|
||||
@@ -1,26 +1,9 @@
|
||||
" Author: Daniel Lupu <lupu.daniel.f@gmail.com>
|
||||
" Description: xo for JavaScript files
|
||||
|
||||
call ale#Set('javascript_xo_executable', 'xo')
|
||||
call ale#Set('javascript_xo_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('javascript_xo_options', '')
|
||||
|
||||
function! ale_linters#javascript#xo#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'javascript_xo', [
|
||||
\ 'node_modules/.bin/xo',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#javascript#xo#GetCommand(buffer) abort
|
||||
return ale#Escape(ale_linters#javascript#xo#GetExecutable(a:buffer))
|
||||
\ . ' ' . ale#Var(a:buffer, 'javascript_xo_options')
|
||||
\ . ' --reporter json --stdin --stdin-filename %s'
|
||||
endfunction
|
||||
|
||||
" xo uses eslint and the output format is the same
|
||||
call ale#linter#Define('javascript', {
|
||||
\ 'name': 'xo',
|
||||
\ 'executable': function('ale_linters#javascript#xo#GetExecutable'),
|
||||
\ 'command': function('ale_linters#javascript#xo#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#eslint#HandleJSON',
|
||||
\ 'executable': function('ale#handlers#xo#GetExecutable'),
|
||||
\ 'command': function('ale#handlers#xo#GetLintCommand'),
|
||||
\ 'callback': 'ale#handlers#xo#HandleJSON',
|
||||
\})
|
||||
|
||||
32
ale_linters/json/jq.vim
Normal file
32
ale_linters/json/jq.vim
Normal file
@@ -0,0 +1,32 @@
|
||||
" Author: jD91mZM2 <me@krake.one>
|
||||
|
||||
function! ale_linters#json#jq#GetCommand(buffer) abort
|
||||
let l:executable = ale#fixers#jq#GetExecutable(a:buffer)
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
endfunction
|
||||
|
||||
function! ale_linters#json#jq#Handle(buffer, lines) abort
|
||||
" Matches patterns like the following:
|
||||
" parse error: Expected another key-value pair at line 4, column 3
|
||||
let l:pattern = '^parse error: \(.\+\) at line \(\d\+\), column \(\d\+\)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'text': l:match[1],
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'col': l:match[3] + 0,
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('json', {
|
||||
\ 'name': 'jq',
|
||||
\ 'executable': function('ale#fixers#jq#GetExecutable'),
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'command': function('ale_linters#json#jq#GetCommand'),
|
||||
\ 'callback': 'ale_linters#json#jq#Handle',
|
||||
\})
|
||||
14
ale_linters/json/spectral.vim
Normal file
14
ale_linters/json/spectral.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
" Author: t2h5 <https://github.com/t2h5>
|
||||
" Description: Integration of Stoplight Spectral CLI with ALE.
|
||||
|
||||
call ale#Set('json_spectral_executable', 'spectral')
|
||||
call ale#Set('json_spectral_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
call ale#linter#Define('json', {
|
||||
\ 'name': 'spectral',
|
||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'json_spectral', [
|
||||
\ 'node_modules/.bin/spectral',
|
||||
\ ])},
|
||||
\ 'command': '%e lint --ignore-unknown-format -q -f text %t',
|
||||
\ 'callback': 'ale#handlers#spectral#HandleSpectralOutput'
|
||||
\})
|
||||
@@ -6,9 +6,9 @@ call ale#Set('julia_executable', 'julia')
|
||||
|
||||
function! ale_linters#julia#languageserver#GetCommand(buffer) abort
|
||||
let l:julia_executable = ale#Var(a:buffer, 'julia_executable')
|
||||
let l:cmd_string = 'using LanguageServer; server = LanguageServer.LanguageServerInstance(isdefined(Base, :stdin) ? stdin : STDIN, isdefined(Base, :stdout) ? stdout : STDOUT, false); server.runlinter = true; run(server);'
|
||||
let l:cmd_string = 'using LanguageServer; using Pkg; import StaticLint; import SymbolServer; server = LanguageServer.LanguageServerInstance(isdefined(Base, :stdin) ? stdin : STDIN, isdefined(Base, :stdout) ? stdout : STDOUT, dirname(Pkg.Types.Context().env.project_file)); server.runlinter = true; run(server);'
|
||||
|
||||
return ale#Escape(l:julia_executable) . ' --startup-file=no --history-file=no -e ' . ale#Escape(l:cmd_string)
|
||||
return ale#Escape(l:julia_executable) . ' --project=@. --startup-file=no --history-file=no -e ' . ale#Escape(l:cmd_string)
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('julia', {
|
||||
|
||||
@@ -6,5 +6,5 @@ call ale#linter#Define('kotlin', {
|
||||
\ 'executable': 'ktlint',
|
||||
\ 'command': function('ale#handlers#ktlint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#ktlint#Handle',
|
||||
\ 'lint_file': 1
|
||||
\ 'output_stream': 'stderr'
|
||||
\})
|
||||
|
||||
@@ -1,11 +1,22 @@
|
||||
" Author: Ty-Lucas Kelley <tylucaskelley@gmail.com>
|
||||
" Description: Adds support for markdownlint
|
||||
|
||||
call ale#Set('markdown_markdownlint_options', '')
|
||||
|
||||
function! ale_linters#markdown#markdownlint#GetCommand(buffer) abort
|
||||
let l:executable = 'markdownlint'
|
||||
|
||||
let l:options = ale#Var(a:buffer, 'markdown_markdownlint_options')
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' %s'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'markdownlint',
|
||||
\ 'executable': 'markdownlint',
|
||||
\ 'lint_file': 1,
|
||||
\ 'output_stream': 'both',
|
||||
\ 'command': 'markdownlint %s',
|
||||
\ 'command': function('ale_linters#markdown#markdownlint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#markdownlint#Handle'
|
||||
\})
|
||||
|
||||
@@ -7,10 +7,9 @@ call ale#Set('nasm_nasm_options', '')
|
||||
function! ale_linters#nasm#nasm#GetCommand(buffer) abort
|
||||
" Note that NASM requires a trailing slash for the -I option.
|
||||
let l:separator = has('win32') ? '\' : '/'
|
||||
let l:path = fnamemodify(bufname(a:buffer), ':p:h') . l:separator
|
||||
let l:output_null = has('win32') ? 'NUL' : '/dev/null'
|
||||
|
||||
return '%e -X gnu -I ' . ale#Escape(l:path)
|
||||
return '%e -X gnu -I %s:h' . l:separator
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'nasm_nasm_options'))
|
||||
\ . ' %s'
|
||||
\ . ' -o ' . l:output_null
|
||||
|
||||
@@ -1,18 +1,51 @@
|
||||
" Author: Alistair Bill <@alibabzo>
|
||||
" Author: Maximilian Bosch <maximilian@mbosch.me>
|
||||
" Description: nix-instantiate linter for nix files
|
||||
|
||||
function! ale_linters#nix#nix#Command(buffer, output, meta) abort
|
||||
let l:version = a:output[0][22:]
|
||||
|
||||
if l:version =~# '^\(2.4\|3\).*'
|
||||
return 'nix-instantiate --log-format internal-json --parse -'
|
||||
else
|
||||
return 'nix-instantiate --parse -'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ale_linters#nix#nix#Handle(buffer, lines) abort
|
||||
let l:pattern = '^\(.\+\): \(.\+\), at .*:\(\d\+\):\(\d\+\)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[3] + 0,
|
||||
\ 'col': l:match[4] + 0,
|
||||
\ 'text': l:match[1] . ': ' . l:match[2],
|
||||
\ 'type': l:match[1] =~# '^error' ? 'E' : 'W',
|
||||
\})
|
||||
endfor
|
||||
if empty(a:lines)
|
||||
return l:output
|
||||
endif
|
||||
|
||||
if a:lines[0] =~# '^@nix .*'
|
||||
for l:line in a:lines
|
||||
if l:line =~# '^@nix .*'
|
||||
let l:result = json_decode(strpart(l:line, 4))
|
||||
|
||||
if has_key(l:result, 'column')
|
||||
call add(l:output, {
|
||||
\ 'type': 'E',
|
||||
\ 'lnum': l:result.line,
|
||||
\ 'col': l:result.column,
|
||||
\ 'text': l:result.raw_msg
|
||||
\})
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
let l:pattern = '^\(.\+\): \(.\+\) at .*:\(\d\+\):\(\d\+\)$'
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[3] + 0,
|
||||
\ 'col': l:match[4] + 0,
|
||||
\ 'text': l:match[1] . ': ' . substitute(l:match[2], ',$', '', ''),
|
||||
\ 'type': l:match[1] =~# '^error' ? 'E' : 'W',
|
||||
\})
|
||||
endfor
|
||||
endif
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
@@ -21,6 +54,10 @@ call ale#linter#Define('nix', {
|
||||
\ 'name': 'nix',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'executable': 'nix-instantiate',
|
||||
\ 'command': 'nix-instantiate --parse -',
|
||||
\ 'command': {buffer -> ale#command#Run(
|
||||
\ buffer,
|
||||
\ 'nix-instantiate --version',
|
||||
\ function('ale_linters#nix#nix#Command')
|
||||
\ )},
|
||||
\ 'callback': 'ale_linters#nix#nix#Handle',
|
||||
\})
|
||||
|
||||
16
ale_linters/nix/rnix_lsp.vim
Normal file
16
ale_linters/nix/rnix_lsp.vim
Normal file
@@ -0,0 +1,16 @@
|
||||
" Author: jD91mZM2 <me@krake.one>
|
||||
" Description: rnix-lsp language client
|
||||
|
||||
function! ale_linters#nix#rnix_lsp#GetProjectRoot(buffer) abort
|
||||
" rnix-lsp does not yet use the project root, so getting it right is not
|
||||
" important
|
||||
return fnamemodify(a:buffer, ':h')
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('nix', {
|
||||
\ 'name': 'rnix_lsp',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': 'rnix-lsp',
|
||||
\ 'command': '%e',
|
||||
\ 'project_root': function('ale_linters#nix#rnix_lsp#GetProjectRoot'),
|
||||
\})
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
call ale#Set('objc_ccls_executable', 'ccls')
|
||||
call ale#Set('objc_ccls_init_options', {})
|
||||
call ale#Set('c_build_dir', '')
|
||||
|
||||
call ale#linter#Define('objc', {
|
||||
\ 'name': 'ccls',
|
||||
@@ -10,5 +11,5 @@ call ale#linter#Define('objc', {
|
||||
\ 'executable': {b -> ale#Var(b, 'objc_ccls_executable')},
|
||||
\ 'command': '%e',
|
||||
\ 'project_root': function('ale#handlers#ccls#GetProjectRoot'),
|
||||
\ 'initialization_options': {b -> ale#Var(b, 'objc_ccls_init_options')},
|
||||
\ 'initialization_options': {b -> ale#handlers#ccls#GetInitOpts(b, 'objc_ccls_init_options')},
|
||||
\})
|
||||
|
||||
@@ -10,7 +10,7 @@ function! ale_linters#objc#clang#GetCommand(buffer) abort
|
||||
" -iquote with the directory the file is in makes #include work for
|
||||
" headers in the same directory.
|
||||
return 'clang -S -x objective-c -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||
\ . '-iquote %s:h'
|
||||
\ . ' ' . ale#Var(a:buffer, 'objc_clang_options') . ' -'
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ function! ale_linters#objcpp#clang#GetCommand(buffer) abort
|
||||
" -iquote with the directory the file is in makes #include work for
|
||||
" headers in the same directory.
|
||||
return 'clang++ -S -x objective-c++ -fsyntax-only '
|
||||
\ . '-iquote ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||
\ . '-iquote %s:h'
|
||||
\ . ' ' . ale#Var(a:buffer, 'objcpp_clang_options') . ' -'
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -9,6 +9,6 @@ call ale#linter#Define('ocaml', {
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': function('ale#handlers#ols#GetExecutable'),
|
||||
\ 'command': function('ale#handlers#ols#GetCommand'),
|
||||
\ 'language_callback': 'ale#handlers#ols#GetLanguage',
|
||||
\ 'language': function('ale#handlers#ols#GetLanguage'),
|
||||
\ 'project_root': function('ale#handlers#ols#GetProjectRoot'),
|
||||
\})
|
||||
|
||||
58
ale_linters/openapi/ibm_validator.vim
Normal file
58
ale_linters/openapi/ibm_validator.vim
Normal file
@@ -0,0 +1,58 @@
|
||||
" Author: Horacio Sanson <hsanson@gmail.com>
|
||||
|
||||
call ale#Set('openapi_ibm_validator_executable', 'lint-openapi')
|
||||
call ale#Set('openapi_ibm_validator_options', '')
|
||||
|
||||
function! ale_linters#openapi#ibm_validator#GetCommand(buffer) abort
|
||||
return '%e' . ale#Pad(ale#Var(a:buffer, 'openapi_ibm_validator_options'))
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#openapi#ibm_validator#Handle(buffer, lines) abort
|
||||
let l:output = []
|
||||
let l:type = 'E'
|
||||
let l:message = ''
|
||||
let l:nr = -1
|
||||
|
||||
for l:line in a:lines
|
||||
let l:match = matchlist(l:line, '^errors$')
|
||||
|
||||
if !empty(l:match)
|
||||
let l:type = 'E'
|
||||
endif
|
||||
|
||||
let l:match = matchlist(l:line, '^warnings$')
|
||||
|
||||
if !empty(l:match)
|
||||
let l:type = 'W'
|
||||
endif
|
||||
|
||||
let l:match = matchlist(l:line, '^ *Message : *\(.\+\)$')
|
||||
|
||||
if !empty(l:match)
|
||||
let l:message = l:match[1]
|
||||
endif
|
||||
|
||||
let l:match = matchlist(l:line, '^ *Line *: *\(\d\+\)$')
|
||||
|
||||
if !empty(l:match)
|
||||
let l:nr = l:match[1]
|
||||
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:nr + 0,
|
||||
\ 'col': 0,
|
||||
\ 'text': l:message,
|
||||
\ 'type': l:type,
|
||||
\})
|
||||
endif
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('openapi', {
|
||||
\ 'name': 'ibm_validator',
|
||||
\ 'executable': {b -> ale#Var(b, 'openapi_ibm_validator_executable')},
|
||||
\ 'command': function('ale_linters#openapi#ibm_validator#GetCommand'),
|
||||
\ 'callback': 'ale_linters#openapi#ibm_validator#Handle',
|
||||
\})
|
||||
9
ale_linters/openapi/yamllint.vim
Normal file
9
ale_linters/openapi/yamllint.vim
Normal file
@@ -0,0 +1,9 @@
|
||||
call ale#Set('yaml_yamllint_executable', 'yamllint')
|
||||
call ale#Set('yaml_yamllint_options', '')
|
||||
|
||||
call ale#linter#Define('openapi', {
|
||||
\ 'name': 'yamllint',
|
||||
\ 'executable': {b -> ale#Var(b, 'yaml_yamllint_executable')},
|
||||
\ 'command': function('ale#handlers#yamllint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#yamllint#Handle',
|
||||
\})
|
||||
@@ -88,7 +88,7 @@ function! ale_linters#perl6#perl6#Handle(buffer, lines) abort
|
||||
|
||||
try
|
||||
let l:json = json_decode(join(a:lines, ''))
|
||||
catch /E474/
|
||||
catch /E474\|E491/
|
||||
call add(l:output, {
|
||||
\ 'lnum': '1',
|
||||
\ 'text': 'Received output in the default Perl6 error format. See :ALEDetail for details',
|
||||
|
||||
32
ale_linters/php/intelephense.vim
Executable file
32
ale_linters/php/intelephense.vim
Executable file
@@ -0,0 +1,32 @@
|
||||
" Author: Eric Stern <eric@ericstern.com>,
|
||||
" Arnold Chand <creativenull@outlook.com>
|
||||
" Description: Intelephense language server integration for ALE
|
||||
|
||||
call ale#Set('php_intelephense_executable', 'intelephense')
|
||||
call ale#Set('php_intelephense_use_global', 1)
|
||||
call ale#Set('php_intelephense_config', {})
|
||||
|
||||
function! ale_linters#php#intelephense#GetProjectRoot(buffer) abort
|
||||
let l:composer_path = ale#path#FindNearestFile(a:buffer, 'composer.json')
|
||||
|
||||
if (!empty(l:composer_path))
|
||||
return fnamemodify(l:composer_path, ':h')
|
||||
endif
|
||||
|
||||
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
|
||||
|
||||
return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
|
||||
endfunction
|
||||
|
||||
function! ale_linters#php#intelephense#GetInitializationOptions(buffer) abort
|
||||
return ale#Var(a:buffer, 'php_intelephense_config')
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('php', {
|
||||
\ 'name': 'intelephense',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'initialization_options': function('ale_linters#php#intelephense#GetInitializationOptions'),
|
||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'php_intelephense', [])},
|
||||
\ 'command': '%e --stdio',
|
||||
\ 'project_root': function('ale_linters#php#intelephense#GetProjectRoot'),
|
||||
\})
|
||||
@@ -39,7 +39,7 @@ function! ale_linters#php#phan#Handle(buffer, lines) abort
|
||||
let l:pattern = '^Phan error: \(\w\+\): \(.\+\) in \(.\+\) on line \(\d\+\)$'
|
||||
else
|
||||
" /path/to/some-filename.php:18 ERRORTYPE message
|
||||
let l:pattern = '^.*:\(\d\+\)\s\(\w\+\)\s\(.\+\)$'
|
||||
let l:pattern = '^\(.*\):\(\d\+\)\s\(\w\+\)\s\(.\+\)$'
|
||||
endif
|
||||
|
||||
let l:output = []
|
||||
@@ -49,13 +49,15 @@ function! ale_linters#php#phan#Handle(buffer, lines) abort
|
||||
let l:dict = {
|
||||
\ 'lnum': l:match[4] + 0,
|
||||
\ 'text': l:match[2],
|
||||
\ 'filename': l:match[3],
|
||||
\ 'type': 'W',
|
||||
\}
|
||||
else
|
||||
let l:dict = {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'text': l:match[3],
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'text': l:match[4],
|
||||
\ 'type': 'W',
|
||||
\ 'filename': l:match[1],
|
||||
\}
|
||||
endif
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ 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)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
" Author: Matt Brown <https://github.com/muglug>
|
||||
" Description: plugin for Psalm, static analyzer for PHP
|
||||
|
||||
call ale#Set('psalm_langserver_executable', 'psalm')
|
||||
call ale#Set('psalm_langserver_options', '')
|
||||
call ale#Set('psalm_langserver_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('php_psalm_executable', 'psalm')
|
||||
call ale#Set('php_psalm_options', '')
|
||||
call ale#Set('php_psalm_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#php#psalm#GetProjectRoot(buffer) abort
|
||||
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
|
||||
@@ -12,13 +12,13 @@ function! ale_linters#php#psalm#GetProjectRoot(buffer) abort
|
||||
endfunction
|
||||
|
||||
function! ale_linters#php#psalm#GetCommand(buffer) abort
|
||||
return '%e --language-server' . ale#Pad(ale#Var(a:buffer, 'psalm_langserver_options'))
|
||||
return '%e --language-server' . ale#Pad(ale#Var(a:buffer, 'php_psalm_options'))
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('php', {
|
||||
\ 'name': 'psalm',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'psalm_langserver', [
|
||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'php_psalm', [
|
||||
\ 'vendor/bin/psalm',
|
||||
\ ])},
|
||||
\ 'command': function('ale_linters#php#psalm#GetCommand'),
|
||||
|
||||
80
ale_linters/php/tlint.vim
Normal file
80
ale_linters/php/tlint.vim
Normal file
@@ -0,0 +1,80 @@
|
||||
" Author: Jose Soto <jose@tighten.co>
|
||||
"
|
||||
" Description: Tighten Opinionated PHP Linting
|
||||
" Website: https://github.com/tightenco/tlint
|
||||
|
||||
call ale#Set('php_tlint_executable', 'tlint')
|
||||
call ale#Set('php_tlint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('php_tlint_options', '')
|
||||
|
||||
function! ale_linters#php#tlint#GetProjectRoot(buffer) abort
|
||||
let l:composer_path = ale#path#FindNearestFile(a:buffer, 'composer.json')
|
||||
|
||||
if !empty(l:composer_path)
|
||||
return fnamemodify(l:composer_path, ':h')
|
||||
endif
|
||||
|
||||
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
|
||||
|
||||
return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
|
||||
endfunction
|
||||
|
||||
function! ale_linters#php#tlint#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'php_tlint', [
|
||||
\ 'vendor/bin/tlint',
|
||||
\ 'tlint',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#php#tlint#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#php#tlint#GetExecutable(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'php_tlint_options')
|
||||
|
||||
return ale#node#Executable(a:buffer, l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' lint %s'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#php#tlint#Handle(buffer, lines) abort
|
||||
" Matches against lines like the following:
|
||||
"
|
||||
" ! There should be 1 space around `.` concatenations, and additional lines should always start with a `.`
|
||||
" 22 : ` $something = 'a'.'name';`
|
||||
"
|
||||
let l:loop_count = 0
|
||||
let l:messages_pattern = '^\! \(.*\)'
|
||||
let l:output = []
|
||||
let l:pattern = '^\(\d\+\) \:'
|
||||
let l:temp_messages = []
|
||||
|
||||
for l:message in ale#util#GetMatches(a:lines, l:messages_pattern)
|
||||
call add(l:temp_messages, l:message)
|
||||
endfor
|
||||
|
||||
let l:loop_count = 0
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:num = l:match[1]
|
||||
let l:text = l:temp_messages[l:loop_count]
|
||||
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:num,
|
||||
\ 'col': 0,
|
||||
\ 'text': l:text,
|
||||
\ 'type': 'W',
|
||||
\ 'sub_type': 'style',
|
||||
\})
|
||||
|
||||
let l:loop_count += 1
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('php', {
|
||||
\ 'name': 'tlint',
|
||||
\ 'executable': function('ale_linters#php#tlint#GetExecutable'),
|
||||
\ 'command': function('ale_linters#php#tlint#GetCommand'),
|
||||
\ 'callback': 'ale_linters#php#tlint#Handle',
|
||||
\ 'project_root': function('ale_linters#php#tlint#GetProjectRoot'),
|
||||
\})
|
||||
@@ -35,10 +35,11 @@ function! s:Subst(format, vars) abort
|
||||
endfunction
|
||||
|
||||
function! ale_linters#prolog#swipl#Handle(buffer, lines) abort
|
||||
let l:pattern = '\v^(ERROR|Warning)+%(:\s*[^:]+:(\d+)%(:(\d+))?)?:\s*(.*)$'
|
||||
let l:output = []
|
||||
let l:i = 0
|
||||
|
||||
let l:pattern = '\v^(ERROR|Warning)+%(:\s*[^:]+:(\d+)%(:(\d+))?)?:\s*(.*)$'
|
||||
|
||||
while l:i < len(a:lines)
|
||||
let l:match = matchlist(a:lines[l:i], l:pattern)
|
||||
|
||||
@@ -72,8 +73,17 @@ function! s:GetErrMsg(i, lines, text) abort
|
||||
let l:i = a:i + 1
|
||||
let l:text = []
|
||||
|
||||
while l:i < len(a:lines) && a:lines[l:i] =~# '^\s'
|
||||
call add(l:text, s:Trim(a:lines[l:i]))
|
||||
let l:pattern = '\v^(ERROR|Warning)?:?(.*)$'
|
||||
|
||||
while l:i < len(a:lines)
|
||||
let l:match = matchlist(a:lines[l:i], l:pattern)
|
||||
|
||||
if empty(l:match) || empty(l:match[2])
|
||||
let l:i += 1
|
||||
break
|
||||
endif
|
||||
|
||||
call add(l:text, s:Trim(l:match[2]))
|
||||
let l:i += 1
|
||||
endwhile
|
||||
|
||||
|
||||
@@ -8,13 +8,15 @@ function! ale_linters#puppet#puppet#Handle(buffer, lines) abort
|
||||
" 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"
|
||||
" Error: Could not parse for environment production: Syntax error at 'parameter1' (file: /tmp/modules/mariadb/manifests/slave.pp, line: 4, column: 5)
|
||||
let l:pattern = '^Error: .*: \(.\+\) \((file:\|at\) .\+\.pp\(, line: \|:\)\(\d\+\)\(, column: \|:\)\=\(\d*\)'
|
||||
" Error: Illegal attempt to assign to 'a Name'. Not an assignable reference (file: /tmp/modules/waffles/manifests/syrup.pp, line: 5, column: 11)
|
||||
" Error: Could not parse for environment production: Syntax error at end of input (file: /tmp/modules/bob/manifests/init.pp)
|
||||
let l:pattern = '^Error:\%(.*:\)\? \(.\+\) \((file:\|at\) .\+\.pp\(\(, line: \|:\)\(\d\+\)\(, column: \|:\)\=\(\d*\)\|)$\)'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[4] + 0,
|
||||
\ 'col': l:match[6] + 0,
|
||||
\ 'lnum': l:match[5] + 0,
|
||||
\ 'col': l:match[7] + 0,
|
||||
\ 'text': l:match[1],
|
||||
\})
|
||||
endfor
|
||||
|
||||
@@ -6,9 +6,7 @@ call ale#Set('pyrex_cython_executable', 'cython')
|
||||
call ale#Set('pyrex_cython_options', '--warning-extra')
|
||||
|
||||
function! ale_linters#pyrex#cython#GetCommand(buffer) abort
|
||||
let l:local_dir = ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
||||
|
||||
return '%e --working ' . l:local_dir . ' --include-dir ' . l:local_dir
|
||||
return '%e --working %s:h --include-dir %s:h'
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'pyrex_cython_options'))
|
||||
\ . ' --output-file ' . g:ale#util#nul_file . ' %t'
|
||||
endfunction
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
call ale#Set('python_flake8_executable', 'flake8')
|
||||
call ale#Set('python_flake8_options', '')
|
||||
call ale#Set('python_flake8_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('python_flake8_change_directory', 1)
|
||||
call ale#Set('python_flake8_change_directory', 'project')
|
||||
call ale#Set('python_flake8_auto_pipenv', 0)
|
||||
|
||||
function! s:UsingModule(buffer) abort
|
||||
@@ -38,10 +38,30 @@ function! ale_linters#python#flake8#RunWithVersionCheck(buffer) abort
|
||||
\)
|
||||
endfunction
|
||||
|
||||
function! ale_linters#python#flake8#GetCdString(buffer) abort
|
||||
let l:change_directory = ale#Var(a:buffer, 'python_flake8_change_directory')
|
||||
let l:cd_string = ''
|
||||
|
||||
if l:change_directory is# 'project'
|
||||
let l:project_root = ale#python#FindProjectRootIni(a:buffer)
|
||||
|
||||
if !empty(l:project_root)
|
||||
let l:cd_string = ale#path#CdString(l:project_root)
|
||||
endif
|
||||
endif
|
||||
|
||||
if (l:change_directory is# 'project' && empty(l:cd_string))
|
||||
\|| l:change_directory is# 1
|
||||
\|| l:change_directory is# 'file'
|
||||
let l:cd_string = ale#path#BufferCdString(a:buffer)
|
||||
endif
|
||||
|
||||
return l:cd_string
|
||||
endfunction
|
||||
|
||||
function! ale_linters#python#flake8#GetCommand(buffer, version) abort
|
||||
let l:cd_string = ale#Var(a:buffer, 'python_flake8_change_directory')
|
||||
\ ? ale#path#BufferCdString(a:buffer)
|
||||
\ : ''
|
||||
let l:cd_string = ale_linters#python#flake8#GetCdString(a:buffer)
|
||||
|
||||
let l:executable = ale_linters#python#flake8#GetExecutable(a:buffer)
|
||||
|
||||
let l:exec_args = l:executable =~? 'pipenv$'
|
||||
|
||||
34
ale_linters/python/jedils.vim
Normal file
34
ale_linters/python/jedils.vim
Normal file
@@ -0,0 +1,34 @@
|
||||
" Author: Dalius Dobravolskas <dalius.dobravolskas@gmail.com>
|
||||
" Description: https://github.com/pappasam/jedi-language-server
|
||||
|
||||
call ale#Set('python_jedils_executable', 'jedi-language-server')
|
||||
call ale#Set('python_jedils_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('python_jedils_auto_pipenv', 0)
|
||||
|
||||
function! ale_linters#python#jedils#GetExecutable(buffer) abort
|
||||
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_jedils_auto_pipenv'))
|
||||
\ && ale#python#PipenvPresent(a:buffer)
|
||||
return 'pipenv'
|
||||
endif
|
||||
|
||||
return ale#python#FindExecutable(a:buffer, 'python_jedils', ['jedi-language-server'])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#python#jedils#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#python#jedils#GetExecutable(a:buffer)
|
||||
|
||||
let l:exec_args = l:executable =~? 'pipenv$'
|
||||
\ ? ' run jedi-language-server'
|
||||
\ : ''
|
||||
|
||||
return ale#Escape(l:executable) . l:exec_args
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('python', {
|
||||
\ 'name': 'jedils',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': function('ale_linters#python#jedils#GetExecutable'),
|
||||
\ 'command': function('ale_linters#python#jedils#GetCommand'),
|
||||
\ 'project_root': function('ale#python#FindProjectRoot'),
|
||||
\ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
|
||||
\})
|
||||
@@ -16,17 +16,15 @@ function! ale_linters#python#pydocstyle#GetExecutable(buffer) abort
|
||||
endfunction
|
||||
|
||||
function! ale_linters#python#pydocstyle#GetCommand(buffer) abort
|
||||
let l:dir = fnamemodify(bufname(a:buffer), ':p:h')
|
||||
let l:executable = ale_linters#python#pydocstyle#GetExecutable(a:buffer)
|
||||
|
||||
let l:exec_args = l:executable =~? 'pipenv$'
|
||||
\ ? ' run pydocstyle'
|
||||
\ : ''
|
||||
|
||||
return ale#path#CdString(l:dir)
|
||||
return ale#path#BufferCdString(a:buffer)
|
||||
\ . ale#Escape(l:executable) . l:exec_args
|
||||
\ . ' ' . ale#Var(a:buffer, 'python_pydocstyle_options')
|
||||
\ . ' ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:t'))
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'python_pydocstyle_options'))
|
||||
\ . ' %s:t'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#python#pydocstyle#Handle(buffer, lines) abort
|
||||
|
||||
@@ -17,7 +17,7 @@ function! ale_linters#python#pylint#GetExecutable(buffer) abort
|
||||
return ale#python#FindExecutable(a:buffer, 'python_pylint', ['pylint'])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#python#pylint#GetCommand(buffer) abort
|
||||
function! ale_linters#python#pylint#GetCommand(buffer, version) abort
|
||||
let l:cd_string = ''
|
||||
|
||||
if ale#Var(a:buffer, 'python_pylint_change_directory')
|
||||
@@ -38,17 +38,23 @@ function! ale_linters#python#pylint#GetCommand(buffer) abort
|
||||
|
||||
return l:cd_string
|
||||
\ . ale#Escape(l:executable) . l:exec_args
|
||||
\ . ' ' . ale#Var(a:buffer, 'python_pylint_options')
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'python_pylint_options'))
|
||||
\ . ' --output-format text --msg-template="{path}:{line}:{column}: {msg_id} ({symbol}) {msg}" --reports n'
|
||||
\ . (ale#semver#GTE(a:version, [2, 4, 0]) ? ' --from-stdin' : '')
|
||||
\ . ' %s'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#python#pylint#Handle(buffer, lines) abort
|
||||
let l:output = ale#python#HandleTraceback(a:lines, 10)
|
||||
|
||||
if !empty(l:output)
|
||||
return l:output
|
||||
endif
|
||||
|
||||
" Matches patterns like the following:
|
||||
"
|
||||
" test.py:4:4: W0101 (unreachable) Unreachable code
|
||||
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):(\d+): ([[:alnum:]]+) \(([^(]*)\) (.*)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
"let l:failed = append(0, l:match)
|
||||
@@ -71,13 +77,19 @@ function! ale_linters#python#pylint#Handle(buffer, lines) abort
|
||||
let l:code_out = l:match[4]
|
||||
endif
|
||||
|
||||
call add(l:output, {
|
||||
let l:item = {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'col': l:match[2] + 1,
|
||||
\ 'text': l:match[5],
|
||||
\ 'code': l:code_out,
|
||||
\ 'type': l:code[:0] is# 'E' ? 'E' : 'W',
|
||||
\})
|
||||
\ 'type': 'W',
|
||||
\}
|
||||
|
||||
if l:code[:0] is# 'E'
|
||||
let l:item.type = 'E'
|
||||
endif
|
||||
|
||||
call add(l:output, l:item)
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
@@ -86,7 +98,17 @@ endfunction
|
||||
call ale#linter#Define('python', {
|
||||
\ 'name': 'pylint',
|
||||
\ 'executable': function('ale_linters#python#pylint#GetExecutable'),
|
||||
\ 'command': function('ale_linters#python#pylint#GetCommand'),
|
||||
\ 'lint_file': {buffer -> ale#semver#RunWithVersionCheck(
|
||||
\ buffer,
|
||||
\ ale#Var(buffer, 'python_pylint_executable'),
|
||||
\ '%e --version',
|
||||
\ {buffer, version -> !ale#semver#GTE(version, [2, 4, 0])},
|
||||
\ )},
|
||||
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
|
||||
\ buffer,
|
||||
\ ale#Var(buffer, 'python_pylint_executable'),
|
||||
\ '%e --version',
|
||||
\ function('ale_linters#python#pylint#GetCommand'),
|
||||
\ )},
|
||||
\ 'callback': 'ale_linters#python#pylint#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
||||
43
ale_linters/python/pyright.vim
Normal file
43
ale_linters/python/pyright.vim
Normal file
@@ -0,0 +1,43 @@
|
||||
call ale#Set('python_pyright_executable', 'pyright-langserver')
|
||||
call ale#Set('python_pyright_config', {})
|
||||
|
||||
function! ale_linters#python#pyright#GetConfig(buffer) abort
|
||||
let l:config = deepcopy(ale#Var(a:buffer, 'python_pyright_config'))
|
||||
|
||||
if !has_key(l:config, 'python')
|
||||
let l:config.python = {}
|
||||
endif
|
||||
|
||||
if type(l:config.python) is v:t_dict
|
||||
" Automatically detect the virtualenv path and use it.
|
||||
if !has_key(l:config.python, 'venvPath')
|
||||
let l:venv = ale#python#FindVirtualenv(a:buffer)
|
||||
|
||||
if !empty(l:venv)
|
||||
let l:config.python.venvPath = l:venv
|
||||
endif
|
||||
endif
|
||||
|
||||
" Automatically use the version of Python in virtualenv.
|
||||
if type(get(l:config.python, 'venvPath')) is v:t_string
|
||||
\&& !empty(l:config.python.venvPath)
|
||||
\&& !has_key(l:config.python, 'pythonPath')
|
||||
let l:config.python.pythonPath = ale#path#Simplify(
|
||||
\ l:config.python.venvPath
|
||||
\ . (has('win32') ? '/Scripts/python' : '/bin/python')
|
||||
\)
|
||||
endif
|
||||
endif
|
||||
|
||||
return l:config
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('python', {
|
||||
\ 'name': 'pyright',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#Var(b, 'python_pyright_executable')},
|
||||
\ 'command': '%e --stdio',
|
||||
\ 'project_root': function('ale#python#FindProjectRoot'),
|
||||
\ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
|
||||
\ 'lsp_config': function('ale_linters#python#pyright#GetConfig'),
|
||||
\})
|
||||
26
ale_linters/r/languageserver.vim
Normal file
26
ale_linters/r/languageserver.vim
Normal file
@@ -0,0 +1,26 @@
|
||||
" Author: Eric Zhao <21zhaoe@protonmail.com>
|
||||
" Description: Implementation of the Language Server Protocol for R.
|
||||
|
||||
call ale#Set('r_languageserver_cmd', 'languageserver::run()')
|
||||
call ale#Set('r_languageserver_config', {})
|
||||
|
||||
function! ale_linters#r#languageserver#GetCommand(buffer) abort
|
||||
let l:cmd_string = ale#Var(a:buffer, 'r_languageserver_cmd')
|
||||
|
||||
return 'Rscript --vanilla -e ' . ale#Escape(l:cmd_string)
|
||||
endfunction
|
||||
|
||||
function! ale_linters#r#languageserver#GetProjectRoot(buffer) abort
|
||||
let l:project_root = ale#path#FindNearestFile(a:buffer, '.Rprofile')
|
||||
|
||||
return !empty(l:project_root) ? fnamemodify(l:project_root, ':h') : fnamemodify(a:buffer, ':h')
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('r', {
|
||||
\ 'name': 'languageserver',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'lsp_config': {b -> ale#Var(b, 'r_languageserver_config')},
|
||||
\ 'executable': 'Rscript',
|
||||
\ 'command': function('ale_linters#r#languageserver#GetCommand'),
|
||||
\ 'project_root': function('ale_linters#r#languageserver#GetProjectRoot')
|
||||
\})
|
||||
@@ -9,6 +9,6 @@ call ale#linter#Define('reason', {
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': function('ale#handlers#ols#GetExecutable'),
|
||||
\ 'command': function('ale#handlers#ols#GetCommand'),
|
||||
\ 'language_callback': 'ale#handlers#ols#GetLanguage',
|
||||
\ 'language': function('ale#handlers#ols#GetLanguage'),
|
||||
\ 'project_root': function('ale#handlers#ols#GetProjectRoot'),
|
||||
\})
|
||||
|
||||
@@ -10,7 +10,7 @@ function! ale_linters#ruby#rubocop#GetCommand(buffer) abort
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'rubocop')
|
||||
\ . ' --format json --force-exclusion '
|
||||
\ . ale#Var(a:buffer, 'ruby_rubocop_options')
|
||||
\ . ' --stdin ' . ale#Escape(expand('#' . a:buffer . ':p'))
|
||||
\ . ' --stdin %s'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#ruby#rubocop#GetType(severity) abort
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
call ale#Set('ruby_sorbet_executable', 'srb')
|
||||
call ale#Set('ruby_sorbet_options', '')
|
||||
call ale#Set('ruby_sorbet_enable_watchman', 0)
|
||||
|
||||
function! ale_linters#ruby#sorbet#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'ruby_sorbet_executable')
|
||||
let l:options = ale#Var(a:buffer, 'ruby_sorbet_options')
|
||||
let l:enable_watchman = ale#Var(a:buffer, 'ruby_sorbet_enable_watchman')
|
||||
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'srb')
|
||||
\ . ' tc'
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --lsp --disable-watchman'
|
||||
\ . ' --lsp'
|
||||
\ . (l:enable_watchman ? '' : ' --disable-watchman')
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('ruby', {
|
||||
|
||||
@@ -11,7 +11,7 @@ function! ale_linters#ruby#standardrb#GetCommand(buffer) abort
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'standardrb')
|
||||
\ . ' --format json --force-exclusion '
|
||||
\ . ale#Var(a:buffer, 'ruby_standardrb_options')
|
||||
\ . ' --stdin ' . ale#Escape(expand('#' . a:buffer . ':p'))
|
||||
\ . ' --stdin %s'
|
||||
endfunction
|
||||
|
||||
" standardrb is based on RuboCop so the callback is the same
|
||||
|
||||
@@ -17,7 +17,7 @@ endfunction
|
||||
call ale#linter#Define('rust', {
|
||||
\ 'name': 'analyzer',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'lsp_config': {b -> ale#Var(b, 'rust_analyzer_config')},
|
||||
\ 'initialization_options': {b -> ale#Var(b, 'rust_analyzer_config')},
|
||||
\ 'executable': {b -> ale#Var(b, 'rust_analyzer_executable')},
|
||||
\ 'command': function('ale_linters#rust#analyzer#GetCommand'),
|
||||
\ 'project_root': function('ale_linters#rust#analyzer#GetProjectRoot'),
|
||||
|
||||
@@ -11,6 +11,7 @@ call ale#Set('rust_cargo_default_feature_behavior', 'default')
|
||||
call ale#Set('rust_cargo_include_features', '')
|
||||
call ale#Set('rust_cargo_use_clippy', 0)
|
||||
call ale#Set('rust_cargo_clippy_options', '')
|
||||
call ale#Set('rust_cargo_target_dir', '')
|
||||
|
||||
function! ale_linters#rust#cargo#GetCargoExecutable(bufnr) abort
|
||||
if ale#path#FindNearestFile(a:bufnr, 'Cargo.toml') isnot# ''
|
||||
@@ -31,6 +32,9 @@ function! ale_linters#rust#cargo#GetCommand(buffer, version) abort
|
||||
\ && ale#semver#GTE(a:version, [0, 22, 0])
|
||||
let l:use_tests = ale#Var(a:buffer, 'rust_cargo_check_tests')
|
||||
\ && ale#semver#GTE(a:version, [0, 22, 0])
|
||||
let l:target_dir = ale#Var(a:buffer, 'rust_cargo_target_dir')
|
||||
let l:use_target_dir = !empty(l:target_dir)
|
||||
\ && ale#semver#GTE(a:version, [0, 17, 0])
|
||||
|
||||
let l:include_features = ale#Var(a:buffer, 'rust_cargo_include_features')
|
||||
|
||||
@@ -82,6 +86,7 @@ function! ale_linters#rust#cargo#GetCommand(buffer, version) abort
|
||||
\ . (l:use_all_targets ? ' --all-targets' : '')
|
||||
\ . (l:use_examples ? ' --examples' : '')
|
||||
\ . (l:use_tests ? ' --tests' : '')
|
||||
\ . (l:use_target_dir ? (' --target-dir ' . ale#Escape(l:target_dir)) : '')
|
||||
\ . ' --frozen --message-format=json -q'
|
||||
\ . l:default_feature
|
||||
\ . l:include_features
|
||||
|
||||
33
ale_linters/salt/salt_lint.vim
Normal file
33
ale_linters/salt/salt_lint.vim
Normal file
@@ -0,0 +1,33 @@
|
||||
" Author: Benjamin BINIER <poulpatine@gmail.com>
|
||||
" Description: salt-lint, saltstack linter
|
||||
|
||||
call ale#Set('salt_salt_lint_executable', 'salt-lint')
|
||||
call ale#Set('salt_salt_lint_options', '')
|
||||
|
||||
function! ale_linters#salt#salt_lint#GetCommand(buffer) abort
|
||||
return '%e' . ale#Pad(ale#Var(a:buffer, 'salt_salt_lint_options'))
|
||||
\ . ' --json'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#salt#salt_lint#Handle(buffer, lines) abort
|
||||
let l:output = []
|
||||
|
||||
for l:error in ale#util#FuzzyJSONDecode(a:lines, [])
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:error.linenumber + 0,
|
||||
\ 'code': l:error.id + 0,
|
||||
\ 'text': l:error.message,
|
||||
\ 'type': l:error.severity is# 'HIGH' ? 'E' : 'W',
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('salt', {
|
||||
\ 'name': 'salt_lint',
|
||||
\ 'aliases': ['salt-lint'],
|
||||
\ 'executable': {b -> ale#Var(b, 'salt_salt_lint_executable')},
|
||||
\ 'command': function('ale_linters#salt#salt_lint#GetCommand'),
|
||||
\ 'callback': 'ale_linters#salt#salt_lint#Handle'
|
||||
\})
|
||||
43
ale_linters/sh/bashate.vim
Normal file
43
ale_linters/sh/bashate.vim
Normal file
@@ -0,0 +1,43 @@
|
||||
" Author: hsanson <hsanson@gmail.com>
|
||||
" Description: Lints sh files using bashate
|
||||
" URL: https://github.com/openstack/bashate
|
||||
|
||||
call ale#Set('sh_bashate_executable', 'bashate')
|
||||
call ale#Set('sh_bashate_options', '')
|
||||
|
||||
function! ale_linters#sh#bashate#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'sh_bashate_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#sh#bashate#GetCommand(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'sh_bashate_options')
|
||||
let l:executable = ale_linters#sh#bashate#GetExecutable(a:buffer)
|
||||
|
||||
return ale#Escape(l:executable) . ' ' . l:options . ' ' . '%t'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#sh#bashate#Handle(buffer, lines) abort
|
||||
" Matches patterns line the following:
|
||||
"
|
||||
" /path/to/script/file:694:1: E003 Indent not multiple of 4
|
||||
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[1]),
|
||||
\ 'col': str2nr(l:match[2]),
|
||||
\ 'text': l:match[3],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('sh', {
|
||||
\ 'name': 'bashate',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable': function('ale_linters#sh#bashate#GetExecutable'),
|
||||
\ 'command': function('ale_linters#sh#bashate#GetCommand'),
|
||||
\ 'callback': 'ale_linters#sh#bashate#Handle',
|
||||
\})
|
||||
@@ -1,5 +1,5 @@
|
||||
" Author: w0rp <devw0rp@gmail.com>
|
||||
" Description: Lints sh files using bash -n
|
||||
" Description: Lints shell files by invoking the shell with -n
|
||||
|
||||
" Backwards compatibility
|
||||
if exists('g:ale_linters_sh_shell_default_shell')
|
||||
|
||||
33
ale_linters/sql/sqllint.vim
Normal file
33
ale_linters/sql/sqllint.vim
Normal file
@@ -0,0 +1,33 @@
|
||||
" ale_linters/sql/sqllint.vim
|
||||
" Author: Joe Reynolds <joereynolds952@gmail.co>
|
||||
" Description: sql-lint for SQL files.
|
||||
" sql-lint can be found at
|
||||
" https://www.npmjs.com/package/sql-lint
|
||||
" https://github.com/joereynolds/sql-lint
|
||||
|
||||
function! ale_linters#sql#sqllint#Handle(buffer, lines) abort
|
||||
" Matches patterns like the following:
|
||||
"
|
||||
" stdin:1 [ER_NO_DB_ERROR] No database selected
|
||||
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,
|
||||
\ 'col': l:match[2] + 0,
|
||||
\ 'type': l:match[3][0],
|
||||
\ 'text': l:match[0],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('sql', {
|
||||
\ 'name': 'sqllint',
|
||||
\ 'aliases': ['sql-lint'],
|
||||
\ 'executable': 'sql-lint',
|
||||
\ 'command': 'sql-lint',
|
||||
\ 'callback': 'ale_linters#sql#sqllint#Handle',
|
||||
\})
|
||||
62
ale_linters/swift/swiftformat.vim
Normal file
62
ale_linters/swift/swiftformat.vim
Normal file
@@ -0,0 +1,62 @@
|
||||
" Author: Klaas Pieter Annema <https://github.com/klaaspieter>
|
||||
" Description: Support for swift-format https://github.com/apple/swift-format
|
||||
|
||||
let s:default_executable = 'swift-format'
|
||||
call ale#Set('swift_swiftformat_executable', s:default_executable)
|
||||
|
||||
function! ale_linters#swift#swiftformat#UseSwift(buffer) abort
|
||||
let l:swift_config = ale#path#FindNearestFile(a:buffer, 'Package.swift')
|
||||
let l:executable = ale#Var(a:buffer, 'swift_swiftformat_executable')
|
||||
|
||||
return !empty(l:swift_config) && l:executable is# s:default_executable
|
||||
endfunction
|
||||
|
||||
function! ale_linters#swift#swiftformat#GetExecutable(buffer) abort
|
||||
if ale_linters#swift#swiftformat#UseSwift(a:buffer)
|
||||
return 'swift'
|
||||
endif
|
||||
|
||||
return ale#Var(a:buffer, 'swift_swiftformat_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#swift#swiftformat#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#swift#swiftformat#GetExecutable(a:buffer)
|
||||
let l:args = '--mode lint %t'
|
||||
|
||||
if ale_linters#swift#swiftformat#UseSwift(a:buffer)
|
||||
let l:args = 'run swift-format' . ' ' . l:args
|
||||
endif
|
||||
|
||||
return ale#Escape(l:executable) . ' ' . l:args
|
||||
endfunction
|
||||
|
||||
function! ale_linters#swift#swiftformat#Handle(buffer, lines) abort
|
||||
" Matches lines of the following pattern:
|
||||
"
|
||||
" Sources/main.swift:4:21: warning: [DoNotUseSemicolons]: remove ';' and move the next statement to the new line
|
||||
" Sources/main.swift:3:12: warning: [Spacing]: remove 1 space
|
||||
let l:pattern = '\v^.*:(\d+):(\d+): (\S+) \[(\S+)\]: (.*)$'
|
||||
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',
|
||||
\ 'code': l:match[4],
|
||||
\ 'text': l:match[5],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
|
||||
call ale#linter#Define('swift', {
|
||||
\ 'name': 'swift-format',
|
||||
\ 'executable': function('ale_linters#swift#swiftformat#GetExecutable'),
|
||||
\ 'command': function('ale_linters#swift#swiftformat#GetCommand'),
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'language': 'swift',
|
||||
\ 'callback': 'ale_linters#swift#swiftformat#Handle'
|
||||
\})
|
||||
@@ -9,30 +9,40 @@ endfunction
|
||||
|
||||
function! ale_linters#terraform#terraform#GetCommand(buffer) abort
|
||||
return ale#Escape(ale_linters#terraform#terraform#GetExecutable(a:buffer))
|
||||
\ . ' fmt -no-color --check=true -'
|
||||
\ . ' validate -no-color -json '
|
||||
endfunction
|
||||
|
||||
function! ale_linters#terraform#terraform#GetType(severity) abort
|
||||
if a:severity is? 'warning'
|
||||
return 'W'
|
||||
endif
|
||||
|
||||
return 'E'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#terraform#terraform#Handle(buffer, lines) abort
|
||||
let l:head = '^Error running fmt: In <standard input>: '
|
||||
let l:output = []
|
||||
let l:patterns = [
|
||||
\ l:head.'At \(\d\+\):\(\d\+\): \(.*\)$',
|
||||
\ l:head.'\(.*\)$'
|
||||
\]
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:patterns)
|
||||
if len(l:match[2]) > 0
|
||||
let l:errors = ale#util#FuzzyJSONDecode(a:lines, {'diagnostics': []})
|
||||
let l:dir = expand('#' . a:buffer . ':p:h')
|
||||
let l:file = expand('#' . a:buffer . ':p')
|
||||
|
||||
for l:error in l:errors['diagnostics']
|
||||
if has_key(l:error, 'range')
|
||||
call add(l:output, {
|
||||
\ 'lnum': str2nr(l:match[1]),
|
||||
\ 'col': str2nr(l:match[2]),
|
||||
\ 'text': l:match[3],
|
||||
\ 'type': 'E',
|
||||
\ 'filename': ale#path#GetAbsPath(l:dir, l:error['range']['filename']),
|
||||
\ 'lnum': l:error['range']['start']['line'],
|
||||
\ 'col': l:error['range']['start']['column'],
|
||||
\ 'text': l:error['detail'],
|
||||
\ 'type': ale_linters#terraform#terraform#GetType(l:error['severity']),
|
||||
\})
|
||||
else
|
||||
call add(l:output, {
|
||||
\ 'lnum': line('$'),
|
||||
\ 'text': l:match[1],
|
||||
\ 'type': 'E',
|
||||
\ 'filename': l:file,
|
||||
\ 'lnum': 0,
|
||||
\ 'col': 0,
|
||||
\ 'text': l:error['detail'],
|
||||
\ 'type': ale_linters#terraform#terraform#GetType(l:error['severity']),
|
||||
\})
|
||||
endif
|
||||
endfor
|
||||
@@ -42,7 +52,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('terraform', {
|
||||
\ 'name': 'terraform',
|
||||
\ 'output_stream': 'stderr',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable': function('ale_linters#terraform#terraform#GetExecutable'),
|
||||
\ 'command': function('ale_linters#terraform#terraform#GetCommand'),
|
||||
\ 'callback': 'ale_linters#terraform#terraform#Handle',
|
||||
|
||||
38
ale_linters/terraform/terraform_ls.vim
Normal file
38
ale_linters/terraform/terraform_ls.vim
Normal file
@@ -0,0 +1,38 @@
|
||||
" Author: Horacio Sanson <hsanson@gmail.com>
|
||||
" Description: terraform-ls integration for ALE (cf. https://github.com/hashicorp/terraform-ls)
|
||||
|
||||
call ale#Set('terraform_terraform_executable', 'terraform')
|
||||
call ale#Set('terraform_ls_executable', 'terraform-ls')
|
||||
call ale#Set('terraform_ls_options', '')
|
||||
|
||||
function! ale_linters#terraform#terraform_ls#GetTerraformExecutable(buffer) abort
|
||||
let l:terraform_executable = ale#Var(a:buffer, 'terraform_terraform_executable')
|
||||
|
||||
if(ale#path#IsAbsolute(l:terraform_executable))
|
||||
return '-tf-exec ' . l:terraform_executable
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! ale_linters#terraform#terraform_ls#GetCommand(buffer) abort
|
||||
return '%e'
|
||||
\ . ale#Pad('serve')
|
||||
\ . ale#Pad(ale_linters#terraform#terraform_ls#GetTerraformExecutable(a:buffer))
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'terraform_ls_options'))
|
||||
endfunction
|
||||
|
||||
function! ale_linters#terraform#terraform_ls#GetProjectRoot(buffer) abort
|
||||
let l:tf_dir = ale#path#FindNearestDirectory(a:buffer, '.terraform')
|
||||
|
||||
return !empty(l:tf_dir) ? fnamemodify(l:tf_dir, ':h:h') : ''
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('terraform', {
|
||||
\ 'name': 'terraform_ls',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#Var(b, 'terraform_ls_executable')},
|
||||
\ 'command': function('ale_linters#terraform#terraform_ls#GetCommand'),
|
||||
\ 'project_root': function('ale_linters#terraform#terraform_ls#GetProjectRoot'),
|
||||
\ 'language': 'terraform',
|
||||
\})
|
||||
25
ale_linters/typescript/deno.vim
Normal file
25
ale_linters/typescript/deno.vim
Normal file
@@ -0,0 +1,25 @@
|
||||
" Author: Mohammed Chelouti - https://github.com/motato1
|
||||
" Description: Deno lsp linter for TypeScript files.
|
||||
|
||||
call ale#linter#Define('typescript', {
|
||||
\ 'name': 'deno',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': function('ale#handlers#deno#GetExecutable'),
|
||||
\ 'command': '%e lsp',
|
||||
\ 'project_root': function('ale#handlers#deno#GetProjectRoot'),
|
||||
\ 'initialization_options': function('ale_linters#typescript#deno#GetInitializationOptions'),
|
||||
\})
|
||||
|
||||
function! ale_linters#typescript#deno#GetInitializationOptions(buffer) abort
|
||||
let l:options = {
|
||||
\ 'enable': v:true,
|
||||
\ 'lint': v:true,
|
||||
\ 'unstable': v:false,
|
||||
\ }
|
||||
|
||||
if ale#Var(a:buffer, 'deno_unstable')
|
||||
let l:options.unstable = v:true
|
||||
endif
|
||||
|
||||
return l:options
|
||||
endfunction
|
||||
@@ -9,6 +9,7 @@ call ale#linter#Define('typescript', {
|
||||
\ 'name': 'tsserver',
|
||||
\ 'lsp': 'tsserver',
|
||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'typescript_tsserver', [
|
||||
\ '.yarn/sdks/typescript/bin/tsserver',
|
||||
\ 'node_modules/.bin/tsserver',
|
||||
\ ])},
|
||||
\ 'command': '%e',
|
||||
|
||||
@@ -1,23 +1,6 @@
|
||||
call ale#Set('typescript_xo_executable', 'xo')
|
||||
call ale#Set('typescript_xo_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('typescript_xo_options', '')
|
||||
|
||||
function! ale_linters#typescript#xo#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'typescript_xo', [
|
||||
\ 'node_modules/.bin/xo',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#typescript#xo#GetCommand(buffer) abort
|
||||
return ale#Escape(ale_linters#typescript#xo#GetExecutable(a:buffer))
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'typescript_xo_options'))
|
||||
\ . ' --reporter json --stdin --stdin-filename %s'
|
||||
endfunction
|
||||
|
||||
" xo uses eslint and the output format is the same
|
||||
call ale#linter#Define('typescript', {
|
||||
\ 'name': 'xo',
|
||||
\ 'executable': function('ale_linters#typescript#xo#GetExecutable'),
|
||||
\ 'command': function('ale_linters#typescript#xo#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#eslint#HandleJSON',
|
||||
\ 'executable': function('ale#handlers#xo#GetExecutable'),
|
||||
\ 'command': function('ale#handlers#xo#GetLintCommand'),
|
||||
\ 'callback': 'ale#handlers#xo#HandleJSON',
|
||||
\})
|
||||
|
||||
66
ale_linters/vala/vala_lint.vim
Normal file
66
ale_linters/vala/vala_lint.vim
Normal file
@@ -0,0 +1,66 @@
|
||||
" Author: Atsuya Takagi <asoftonight@gmail.com>
|
||||
" Description: A linter for Vala using Vala-Lint.
|
||||
|
||||
call ale#Set('vala_vala_lint_config_filename', 'vala-lint.conf')
|
||||
call ale#Set('vala_vala_lint_executable', 'io.elementary.vala-lint')
|
||||
|
||||
function! ale_linters#vala#vala_lint#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'vala_vala_lint_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#vala#vala_lint#GetCommand(buffer) abort
|
||||
let l:command = ale_linters#vala#vala_lint#GetExecutable(a:buffer)
|
||||
|
||||
let l:config_filename = ale#Var(a:buffer, 'vala_vala_lint_config_filename')
|
||||
let l:config_path = ale#path#FindNearestFile(a:buffer, l:config_filename)
|
||||
|
||||
if !empty(l:config_path)
|
||||
let l:command .= ' -c ' . l:config_path
|
||||
endif
|
||||
|
||||
return l:command . ' %s'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#vala#vala_lint#Handle(buffer, lines) abort
|
||||
let l:pattern = '^\s*\(\d\+\)\.\(\d\+\)\s\+\(error\|warn\)\s\+\(.\+\)\s\([A-Za-z0-9_\-]\+\)'
|
||||
let l:output = []
|
||||
|
||||
for l:line in a:lines
|
||||
" remove color escape sequences since vala-lint doesn't support
|
||||
" output without colors
|
||||
let l:cleaned_line = substitute(l:line, '\e\[[0-9;]\+[mK]', '', 'g')
|
||||
let l:match = matchlist(l:cleaned_line, l:pattern)
|
||||
|
||||
if len(l:match) == 0
|
||||
continue
|
||||
endif
|
||||
|
||||
let l:refined_type = l:match[3] is# 'warn' ? 'W' : 'E'
|
||||
let l:cleaned_text = substitute(l:match[4], '^\s*\(.\{-}\)\s*$', '\1', '')
|
||||
|
||||
let l:lnum = l:match[1] + 0
|
||||
let l:column = l:match[2] + 0
|
||||
let l:type = l:refined_type
|
||||
let l:text = l:cleaned_text
|
||||
let l:code = l:match[5]
|
||||
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:lnum,
|
||||
\ 'col': l:column,
|
||||
\ 'text': l:text,
|
||||
\ 'type': l:type,
|
||||
\ 'code': l:code,
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('vala', {
|
||||
\ 'name': 'vala_lint',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable': function('ale_linters#vala#vala_lint#GetExecutable'),
|
||||
\ 'command': function('ale_linters#vala#vala_lint#GetCommand'),
|
||||
\ 'callback': 'ale_linters#vala#vala_lint#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
5
ale_linters/verilog/hdl_checker.vim
Normal file
5
ale_linters/verilog/hdl_checker.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
" Author: suoto <andre820@gmail.com>
|
||||
" Description: Adds support for HDL Code Checker, which wraps vcom/vlog, ghdl
|
||||
" or xvhdl. More info on https://github.com/suoto/hdl_checker
|
||||
|
||||
call ale#handlers#hdl_checker#DefineLinter('verilog')
|
||||
@@ -13,14 +13,15 @@ function! ale_linters#verilog#vlog#Handle(buffer, lines) abort
|
||||
"Matches patterns like the following:
|
||||
"** Warning: add.v(7): (vlog-2623) Undefined variable: C.
|
||||
"** Error: file.v(1): (vlog-13294) Identifier must be declared with a port mode: C.
|
||||
let l:pattern = '^**\s\(\w*\):[a-zA-Z0-9\-\.\_\/ ]\+(\(\d\+\)):\s\+\(.*\)'
|
||||
let l:pattern = '^**\s\(\w*\): \([a-zA-Z0-9\-\.\_\/ ]\+\)(\(\d\+\)):\s\+\(.*\)'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'lnum': l:match[3] + 0,
|
||||
\ 'type': l:match[1] is? 'Error' ? 'E' : 'W',
|
||||
\ 'text': l:match[3],
|
||||
\ 'text': l:match[4],
|
||||
\ 'filename': l:match[2],
|
||||
\})
|
||||
endfor
|
||||
|
||||
@@ -28,13 +29,14 @@ function! ale_linters#verilog#vlog#Handle(buffer, lines) abort
|
||||
"** Warning: (vlog-2623) add.v(7): Undefined variable: C.
|
||||
"** Error: (vlog-13294) file.v(1): Identifier must be declared with a port mode: C.
|
||||
" let l:pattern = '^**\s\(\w*\):[a-zA-Z0-9\-\.\_\/ ]\+(\(\d\+\)):\s\+\(.*\)'
|
||||
let l:pattern = '^**\s\(\w*\):\s\([^)]*)\)[a-zA-Z0-9\-\.\_\/ ]\+(\(\d\+\)):\s\+\(.*\)'
|
||||
let l:pattern = '^**\s\(\w*\):\s\([^)]*)\) \([a-zA-Z0-9\-\.\_\/ ]\+\)(\(\d\+\)):\s\+\(.*\)'
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:match[3] + 0,
|
||||
\ 'lnum': l:match[4] + 0,
|
||||
\ 'type': l:match[1] is? 'Error' ? 'E' : 'W',
|
||||
\ 'text': l:match[2] . ' ' . l:match[4],
|
||||
\ 'text': l:match[2] . ' ' . l:match[5],
|
||||
\ 'filename': l:match[3],
|
||||
\})
|
||||
endfor
|
||||
|
||||
|
||||
5
ale_linters/vhdl/hdl_checker.vim
Normal file
5
ale_linters/vhdl/hdl_checker.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
" Author: suoto <andre820@gmail.com>
|
||||
" Description: Adds support for HDL Code Checker, which wraps vcom/vlog, ghdl
|
||||
" or xvhdl. More info on https://github.com/suoto/hdl_checker
|
||||
|
||||
call ale#handlers#hdl_checker#DefineLinter('vhdl')
|
||||
@@ -5,7 +5,7 @@
|
||||
call ale#Set('vim_vint_show_style_issues', 1)
|
||||
call ale#Set('vim_vint_executable', 'vint')
|
||||
let s:enable_neovim = has('nvim') ? ' --enable-neovim' : ''
|
||||
let s:format = '-f "{file_path}:{line_number}:{column_number}: {severity}: {description} (see {reference})"'
|
||||
let s:format = '-f "{file_path}:{line_number}:{column_number}: {severity}: {policy_name} - {description} (see {reference})"'
|
||||
|
||||
function! ale_linters#vim#vint#GetCommand(buffer, version) abort
|
||||
let l:can_use_no_color_flag = empty(a:version)
|
||||
@@ -13,12 +13,17 @@ function! ale_linters#vim#vint#GetCommand(buffer, version) abort
|
||||
|
||||
let l:warning_flag = ale#Var(a:buffer, 'vim_vint_show_style_issues') ? '-s' : '-w'
|
||||
|
||||
" Use the --stdin-display-name argument if supported, temp file otherwise.
|
||||
let l:stdin_or_temp = ale#semver#GTE(a:version, [0, 4, 0])
|
||||
\ ? ' --stdin-display-name %s -'
|
||||
\ : ' %t'
|
||||
|
||||
return '%e'
|
||||
\ . ' ' . l:warning_flag
|
||||
\ . (l:can_use_no_color_flag ? ' --no-color' : '')
|
||||
\ . s:enable_neovim
|
||||
\ . ' ' . s:format
|
||||
\ . ' %t'
|
||||
\ . l:stdin_or_temp
|
||||
endfunction
|
||||
|
||||
let s:word_regex_list = [
|
||||
|
||||
14
ale_linters/yaml/spectral.vim
Normal file
14
ale_linters/yaml/spectral.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
" Author: t2h5 <https://github.com/t2h5>
|
||||
" Description: Integration of Stoplight Spectral CLI with ALE.
|
||||
|
||||
call ale#Set('yaml_spectral_executable', 'spectral')
|
||||
call ale#Set('yaml_spectral_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
call ale#linter#Define('yaml', {
|
||||
\ 'name': 'spectral',
|
||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'yaml_spectral', [
|
||||
\ 'node_modules/.bin/spectral',
|
||||
\ ])},
|
||||
\ 'command': '%e lint --ignore-unknown-format -q -f text %t',
|
||||
\ 'callback': 'ale#handlers#spectral#HandleSpectralOutput'
|
||||
\})
|
||||
@@ -3,48 +3,9 @@
|
||||
call ale#Set('yaml_yamllint_executable', 'yamllint')
|
||||
call ale#Set('yaml_yamllint_options', '')
|
||||
|
||||
function! ale_linters#yaml#yamllint#GetCommand(buffer) abort
|
||||
return '%e' . ale#Pad(ale#Var(a:buffer, 'yaml_yamllint_options'))
|
||||
\ . ' -f parsable %t'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#yaml#yamllint#Handle(buffer, lines) abort
|
||||
" Matches patterns line the following:
|
||||
" something.yaml:1:1: [warning] missing document start "---" (document-start)
|
||||
" something.yml:2:1: [error] syntax error: expected the node content, but found '<stream end>'
|
||||
let l:pattern = '\v^.*:(\d+):(\d+): \[(error|warning)\] (.+)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:item = {
|
||||
\ 'lnum': l:match[1] + 0,
|
||||
\ 'col': l:match[2] + 0,
|
||||
\ 'text': l:match[4],
|
||||
\ 'type': l:match[3] is# 'error' ? 'E' : 'W',
|
||||
\}
|
||||
|
||||
let l:code_match = matchlist(l:item.text, '\v^(.+) \(([^)]+)\)$')
|
||||
|
||||
if !empty(l:code_match)
|
||||
if l:code_match[2] is# 'trailing-spaces'
|
||||
\&& !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
|
||||
" Skip warnings for trailing whitespace if the option is off.
|
||||
continue
|
||||
endif
|
||||
|
||||
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
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('yaml', {
|
||||
\ 'name': 'yamllint',
|
||||
\ 'executable': {b -> ale#Var(b, 'yaml_yamllint_executable')},
|
||||
\ 'command': function('ale_linters#yaml#yamllint#GetCommand'),
|
||||
\ 'callback': 'ale_linters#yaml#yamllint#Handle',
|
||||
\ 'command': function('ale#handlers#yamllint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#yamllint#Handle',
|
||||
\})
|
||||
|
||||
20
ale_linters/zig/zls.vim
Normal file
20
ale_linters/zig/zls.vim
Normal file
@@ -0,0 +1,20 @@
|
||||
" Author: CherryMan <skipper308@hotmail.ca>
|
||||
" Description: A language server for Zig
|
||||
|
||||
call ale#Set('zig_zls_executable', 'zls')
|
||||
call ale#Set('zig_zls_config', {})
|
||||
|
||||
function! ale_linters#zig#zls#GetProjectRoot(buffer) abort
|
||||
let l:build_rs = ale#path#FindNearestFile(a:buffer, 'build.zig')
|
||||
|
||||
return !empty(l:build_rs) ? fnamemodify(l:build_rs, ':h') : ''
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('zig', {
|
||||
\ 'name': 'zls',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'lsp_config': {b -> ale#Var(b, 'zig_zls_config')},
|
||||
\ 'executable': {b -> ale#Var(b, 'zig_zls_executable')},
|
||||
\ 'command': '%e',
|
||||
\ 'project_root': function('ale_linters#zig#zls#GetProjectRoot'),
|
||||
\})
|
||||
@@ -100,13 +100,7 @@ function! s:Lint(buffer, should_lint_file, timer_id) abort
|
||||
" Use the filetype from the buffer
|
||||
let l:filetype = getbufvar(a:buffer, '&filetype')
|
||||
let l:linters = ale#linter#Get(l:filetype)
|
||||
|
||||
" Apply ignore lists for linters only if needed.
|
||||
let l:ignore_config = ale#Var(a:buffer, 'linters_ignore')
|
||||
let l:disable_lsp = ale#Var(a:buffer, 'disable_lsp')
|
||||
let l:linters = !empty(l:ignore_config) || l:disable_lsp
|
||||
\ ? ale#engine#ignore#Exclude(l:filetype, l:linters, l:ignore_config, l:disable_lsp)
|
||||
\ : l:linters
|
||||
let l:linters = ale#linter#RemoveIgnored(a:buffer, l:filetype, l:linters)
|
||||
|
||||
" Tell other sources that they can start checking the buffer now.
|
||||
let g:ale_want_results_buffer = a:buffer
|
||||
@@ -163,7 +157,7 @@ function! ale#Queue(delay, ...) abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:current_ale_version = [2, 7, 0]
|
||||
let s:current_ale_version = [3, 1, 0]
|
||||
|
||||
" A function used to check for ALE features in files outside of the project.
|
||||
function! ale#Has(feature) abort
|
||||
@@ -263,6 +257,28 @@ function! ale#GetLocItemMessage(item, format_string) abort
|
||||
let l:msg = substitute(l:msg, '\V%linter%', '\=l:linter_name', 'g')
|
||||
" Replace %s with the text.
|
||||
let l:msg = substitute(l:msg, '\V%s', '\=a:item.text', 'g')
|
||||
" Windows may insert carriage return line endings (^M), strip these characters.
|
||||
let l:msg = substitute(l:msg, '\r', '', 'g')
|
||||
|
||||
return l:msg
|
||||
endfunction
|
||||
|
||||
" Given a buffer and a linter or fixer name, return an Array of two-item
|
||||
" Arrays describing how to map filenames to and from the local to foreign file
|
||||
" systems.
|
||||
function! ale#GetFilenameMappings(buffer, name) abort
|
||||
let l:linter_mappings = ale#Var(a:buffer, 'filename_mappings')
|
||||
|
||||
if type(l:linter_mappings) is v:t_list
|
||||
return l:linter_mappings
|
||||
endif
|
||||
|
||||
let l:name = a:name
|
||||
|
||||
if !has_key(l:linter_mappings, l:name)
|
||||
" Use * as a default setting for all tools.
|
||||
let l:name = '*'
|
||||
endif
|
||||
|
||||
return get(l:linter_mappings, l:name, [])
|
||||
endfunction
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user