mirror of
https://github.com/dense-analysis/ale.git
synced 2026-09-29 15:12:20 +08:00
Compare commits
84
Commits
4217461c48
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1789bc544 | ||
|
|
eff718bee9 | ||
|
|
1c6e71732f | ||
|
|
0aa1ea11e0 | ||
|
|
42d1062011 | ||
|
|
5c8ca023e6 | ||
|
|
a1ff838e9e | ||
|
|
199a95d386 | ||
|
|
9e2efaa4d3 | ||
|
|
40cbe2121b | ||
|
|
069baf559e | ||
|
|
c874be57bc | ||
|
|
94a8a88f0d | ||
|
|
5d4b0881b7 | ||
|
|
5fab9dec37 | ||
|
|
d0ea943232 | ||
|
|
db92671e57 | ||
|
|
44ff0049a7 | ||
|
|
178fe11356 | ||
|
|
860ebbd314 | ||
|
|
36d541facb | ||
|
|
7a7fc85e51 | ||
|
|
399c0ffd64 | ||
|
|
2a3af30fb6 | ||
|
|
c25eaa30df | ||
|
|
ec599ef5a7 | ||
|
|
2d5a15d501 | ||
|
|
f3d85691a5 | ||
|
|
307f2b99ff | ||
|
|
7b5b854fc4 | ||
|
|
916c8764ce | ||
|
|
641294465e | ||
|
|
c809c68f7e | ||
|
|
78122497f5 | ||
|
|
ab3531083c | ||
|
|
c59c0d1a57 | ||
|
|
051d12c72d | ||
|
|
6ba798d2e7 | ||
|
|
b1b027d5e6 | ||
|
|
674a8cced8 | ||
|
|
6b63f4e70a | ||
|
|
ba8b9cbab9 | ||
|
|
7940a46d5a | ||
|
|
90d8f8d2d2 | ||
|
|
3d3b75cdc5 | ||
|
|
0369442b06 | ||
|
|
69c945d5da | ||
|
|
cb8c4662aa | ||
|
|
d87b4956ad | ||
|
|
3c837714cd | ||
|
|
bee0b49067 | ||
|
|
be0dfdb671 | ||
|
|
b5f8cb296a | ||
|
|
af5a38c697 | ||
|
|
e762262f44 | ||
|
|
6d99629461 | ||
|
|
f730dedca7 | ||
|
|
9b51f66960 | ||
|
|
e3c1528619 | ||
|
|
646d956630 | ||
|
|
d59cb7b3c2 | ||
|
|
c0dd8167a6 | ||
|
|
8eb4803da9 | ||
|
|
0360a73644 | ||
|
|
dd6e6f1b15 | ||
|
|
fa3d4f2f13 | ||
|
|
710e1aac9c | ||
|
|
281eb4808c | ||
|
|
ca1da76d5e | ||
|
|
962a932ed4 | ||
|
|
395d9fa2aa | ||
|
|
5f286eb909 | ||
|
|
1f0f9ef28d | ||
|
|
e56b55b65d | ||
|
|
260c756a9b | ||
|
|
86d8ada5cb | ||
|
|
de2d3da738 | ||
|
|
b9d7f56471 | ||
|
|
6d8e4a641c | ||
|
|
d2f4090c33 | ||
|
|
59c6b4f7b0 | ||
|
|
21d5de18b2 | ||
|
|
ed26d1f1d9 | ||
|
|
9811114948 |
@@ -1,62 +0,0 @@
|
|||||||
---
|
|
||||||
# Disabling building for AppVeyor. We are just testing things.
|
|
||||||
build: false
|
|
||||||
clone_depth: 10
|
|
||||||
# Use the directory C:\testplugin so test directories will mostly work.
|
|
||||||
clone_folder: C:\testplugin
|
|
||||||
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
- /v\d+\.\d+\.(x|\d+)/
|
|
||||||
|
|
||||||
# Skip running Windows tests if we only change files that can't impact
|
|
||||||
# Windows tests.
|
|
||||||
skip_commits:
|
|
||||||
files:
|
|
||||||
- '.github/**/*'
|
|
||||||
- .gitattributes
|
|
||||||
- Dockerfile
|
|
||||||
- README.md
|
|
||||||
- doc/*
|
|
||||||
- lua/*
|
|
||||||
- run-tests
|
|
||||||
- supported-tools.md
|
|
||||||
- syntax/*
|
|
||||||
|
|
||||||
# Cache the vim and vader directories between builds.
|
|
||||||
cache:
|
|
||||||
- C:\vim -> .appveyor.yml
|
|
||||||
- C:\vader -> .appveyor.yml
|
|
||||||
|
|
||||||
init:
|
|
||||||
# Stop git from changing newlines
|
|
||||||
- git config --global core.autocrlf input
|
|
||||||
|
|
||||||
# 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: >-
|
|
||||||
if (!(Test-Path -Path C:\vim)){
|
|
||||||
Add-Type -A System.IO.Compression.FileSystem
|
|
||||||
Invoke-WebRequest https://github.com/dense-analysis/ale/releases/download/v4.0.0/vim80-586w32.zip `
|
|
||||||
-OutFile C:\vim.zip
|
|
||||||
[IO.Compression.ZipFile]::ExtractToDirectory('C:\vim.zip', 'C:\vim')
|
|
||||||
Invoke-WebRequest https://github.com/dense-analysis/ale/releases/download/v4.0.0/vim80-586rt.zip `
|
|
||||||
-OutFile C:\rt.zip
|
|
||||||
[IO.Compression.ZipFile]::ExtractToDirectory('C:\rt.zip', 'C:\vim')
|
|
||||||
}
|
|
||||||
# Clone Vader and check out the commit we want
|
|
||||||
- ps: >-
|
|
||||||
if (!(Test-Path -Path C:\vader)){
|
|
||||||
git clone https://github.com/junegunn/vader.vim C:\vader 2> $null
|
|
||||||
cd C:\vader
|
|
||||||
git checkout -qf c6243dd81c98350df4dec608fa972df98fa2a3af 2> $null
|
|
||||||
}
|
|
||||||
|
|
||||||
test_script:
|
|
||||||
- cd C:\testplugin
|
|
||||||
- 'C:\vim\vim\vim80\vim.exe -u test\vimrc "+Vader!
|
|
||||||
test/*.vader test/*/*.vader test/*/*/*.vader test/*/*/*.vader"'
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# Project-local Codex configuration.
|
||||||
|
#
|
||||||
|
# Command safety policy lives in .codex/rules/git-state.rules.
|
||||||
|
|
||||||
|
[[hooks.Stop]]
|
||||||
|
[[hooks.Stop.hooks]]
|
||||||
|
type = "command"
|
||||||
|
command = "cat >> .codex/stop-trigger"
|
||||||
|
timeout = 1
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
# Forbid Codex from changing Git repository state in this project.
|
||||||
|
#
|
||||||
|
# Read-only Git inspection, such as `git status`, `git diff`, `git log`, and
|
||||||
|
# `git show`, is intentionally not matched by this policy.
|
||||||
|
|
||||||
|
prefix_rule(
|
||||||
|
pattern = ["git", [
|
||||||
|
"add",
|
||||||
|
"am",
|
||||||
|
"apply",
|
||||||
|
"bisect",
|
||||||
|
"branch",
|
||||||
|
"checkout",
|
||||||
|
"cherry-pick",
|
||||||
|
"clean",
|
||||||
|
"commit",
|
||||||
|
"fetch",
|
||||||
|
"merge",
|
||||||
|
"mv",
|
||||||
|
"notes",
|
||||||
|
"pull",
|
||||||
|
"push",
|
||||||
|
"rebase",
|
||||||
|
"reflog",
|
||||||
|
"replace",
|
||||||
|
"reset",
|
||||||
|
"restore",
|
||||||
|
"revert",
|
||||||
|
"rm",
|
||||||
|
"stash",
|
||||||
|
"submodule",
|
||||||
|
"switch",
|
||||||
|
"tag",
|
||||||
|
"update-index",
|
||||||
|
"update-ref",
|
||||||
|
"worktree",
|
||||||
|
]],
|
||||||
|
decision = "forbidden",
|
||||||
|
justification = "Git commands that change the index, refs, branches, remotes, commits, or working tree are reserved for the user.",
|
||||||
|
match = [
|
||||||
|
"git add .",
|
||||||
|
"git commit -m test",
|
||||||
|
"git pull --rebase",
|
||||||
|
"git reset --hard HEAD",
|
||||||
|
"git restore --staged AGENTS.md",
|
||||||
|
],
|
||||||
|
not_match = [
|
||||||
|
"git diff -- AGENTS.md",
|
||||||
|
"git log --oneline -5",
|
||||||
|
"git show HEAD",
|
||||||
|
"git status --short",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
prefix_rule(
|
||||||
|
pattern = ["git", [
|
||||||
|
"-C",
|
||||||
|
"-c",
|
||||||
|
"--bare",
|
||||||
|
"--config-env",
|
||||||
|
"--exec-path",
|
||||||
|
"--git-dir",
|
||||||
|
"--git-dir=.git",
|
||||||
|
"--git-dir=/home/w0rp/ale/.git",
|
||||||
|
"--namespace",
|
||||||
|
"--no-optional-locks",
|
||||||
|
"--no-pager",
|
||||||
|
"--paginate",
|
||||||
|
"-P",
|
||||||
|
"--super-prefix",
|
||||||
|
"--work-tree",
|
||||||
|
"--work-tree=.",
|
||||||
|
"--work-tree=/home/w0rp/ale",
|
||||||
|
]],
|
||||||
|
decision = "forbidden",
|
||||||
|
justification = "Git global options can obscure or bypass repository state changes; run read-only Git commands from the repository root instead.",
|
||||||
|
match = [
|
||||||
|
"git -C /home/w0rp/ale status --short",
|
||||||
|
"git --git-dir .git status",
|
||||||
|
"git --git-dir=.git status",
|
||||||
|
"git --no-pager add .",
|
||||||
|
"git --work-tree . status",
|
||||||
|
],
|
||||||
|
not_match = [
|
||||||
|
"git diff -- AGENTS.md",
|
||||||
|
"git log --oneline -5",
|
||||||
|
"git show HEAD",
|
||||||
|
"git status --short",
|
||||||
|
],
|
||||||
|
)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
* @w0rp
|
||||||
+60
-10
@@ -11,9 +11,10 @@ on: # yamllint disable-line rule:truthy
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_image:
|
build_image:
|
||||||
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- name: Build docker run image
|
- name: Build docker run image
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
@@ -21,18 +22,67 @@ jobs:
|
|||||||
DOCKER_HUB_PASS: ${{ secrets.DOCKER_HUB_PASS }}
|
DOCKER_HUB_PASS: ${{ secrets.DOCKER_HUB_PASS }}
|
||||||
run: ./run-tests --build-image
|
run: ./run-tests --build-image
|
||||||
test_ale:
|
test_ale:
|
||||||
|
name: ${{ matrix.name }}
|
||||||
needs: build_image
|
needs: build_image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
vim-version:
|
include:
|
||||||
- '--vim-80-only'
|
- name: Lint
|
||||||
- '--vim-90-only'
|
test-args: --linters-only
|
||||||
- '--neovim-07-only'
|
- name: Lua
|
||||||
- '--neovim-08-only'
|
test-args: --lua-only
|
||||||
- '--lua-only'
|
- name: Neovim 0.10 Linux
|
||||||
- '--linters-only'
|
test-args: --neovim-010-only
|
||||||
|
- name: Neovim 0.12 Linux
|
||||||
|
test-args: --neovim-012-only
|
||||||
|
- name: Vim 8.2 Linux
|
||||||
|
test-args: --vim-82-only
|
||||||
|
- name: Vim 9.2 Linux
|
||||||
|
test-args: --vim-92-only
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: ./run-tests -v ${{ matrix.vim-version }}
|
run: ./run-tests -v ${{ matrix.test-args }}
|
||||||
|
test_ale_windows:
|
||||||
|
name: ${{ matrix.name }}
|
||||||
|
runs-on: windows-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- name: Neovim 0.10 Windows
|
||||||
|
editor: neovim
|
||||||
|
version: v0.10.4
|
||||||
|
- name: Neovim 0.12 Windows
|
||||||
|
editor: neovim
|
||||||
|
version: v0.12.1
|
||||||
|
- name: Vim 8.2 Windows
|
||||||
|
editor: vim
|
||||||
|
version: v8.2.4843
|
||||||
|
- name: Vim 9.2 Windows
|
||||||
|
editor: vim
|
||||||
|
version: v9.2.0329
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- name: Setup ${{ matrix.editor }} ${{ matrix.version }}
|
||||||
|
uses: rhysd/action-setup-vim@v1
|
||||||
|
id: editor
|
||||||
|
with:
|
||||||
|
neovim: ${{ matrix.editor == 'neovim' }}
|
||||||
|
version: ${{ matrix.version }}
|
||||||
|
- name: Clone Vader
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
git clone https://github.com/junegunn/vader.vim C:\vader
|
||||||
|
git -C C:\vader checkout -qf c6243dd81c98350df4dec608fa972df98fa2a3af
|
||||||
|
- name: Run tests
|
||||||
|
shell: cmd
|
||||||
|
env:
|
||||||
|
VIM_EXE: ${{ steps.editor.outputs.executable }}
|
||||||
|
VIM_HEADLESS: ${{ matrix.editor == 'neovim' && '--headless' || '--not-a-term' }}
|
||||||
|
run: |
|
||||||
|
set TMP=%CD:~0,2%\tmp
|
||||||
|
set TEMP=%CD:~0,2%\tmp
|
||||||
|
if not exist "%CD:~0,2%\tmp" mkdir "%CD:~0,2%\tmp"
|
||||||
|
run-tests.bat
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
read_globals = {
|
||||||
|
'vim',
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# ALE Instructions
|
||||||
|
|
||||||
|
## Basic Instructions
|
||||||
|
|
||||||
|
Read documentation from @doc/ale-development.txt to understand how to be an
|
||||||
|
ALE developer and how to match our standards.
|
||||||
|
|
||||||
|
Run all tests quickly with `./run-tests -q --fast`, which picks the quickest
|
||||||
|
version of Neovim we can run, and runs our linting checks.
|
||||||
|
|
||||||
|
You can quickly check an individual Vader test file by passing them as arguments
|
||||||
|
such as `./run-tests -q --fast test/path/some_file.vader`.
|
||||||
|
|
||||||
|
You can quickly run all Lua tests with `./run-tests -q --lua-only`.
|
||||||
|
|
||||||
|
|
||||||
|
For new Vim files, set `Author:` comments to the person doing the work.
|
||||||
|
Do not use Codex, OpenAI, or other tool names as the author.
|
||||||
|
|
||||||
|
## Writing Tests
|
||||||
|
|
||||||
|
For `test/test-files` they should almost always be 0 bytes in size and files
|
||||||
|
may be marked executable when testing searching for executables.
|
||||||
+60
-10
@@ -1,28 +1,78 @@
|
|||||||
ARG TESTBED_VIM_VERSION=24
|
#############################################################################
|
||||||
|
# Base testbed image copied from:
|
||||||
|
# https://github.com/Vimjas/vim-testbed/blob/master/Dockerfile
|
||||||
|
FROM alpine:3.23 as testbed
|
||||||
|
|
||||||
FROM testbed/vim:${TESTBED_VIM_VERSION}
|
RUN apk --no-cache upgrade
|
||||||
|
|
||||||
ENV PACKAGES="\
|
ENV PACKAGES="\
|
||||||
|
build-base \
|
||||||
|
linux-headers \
|
||||||
|
cmake \
|
||||||
|
coreutils \
|
||||||
|
msgpack-c-dev \
|
||||||
|
libtermkey-dev \
|
||||||
|
libvterm-dev \
|
||||||
|
unibilium-dev \
|
||||||
|
ncurses-dev \
|
||||||
lua5.1 \
|
lua5.1 \
|
||||||
lua5.1-dev \
|
lua5.1-dev \
|
||||||
|
lua5.1-lpeg \
|
||||||
|
lua5.1-mpack \
|
||||||
lua5.1-busted \
|
lua5.1-busted \
|
||||||
bash \
|
bash \
|
||||||
git \
|
git \
|
||||||
python2 \
|
|
||||||
python3 \
|
|
||||||
py3-pip \
|
|
||||||
grep \
|
grep \
|
||||||
sed \
|
sed \
|
||||||
|
python3 \
|
||||||
|
py3-pip \
|
||||||
|
gettext-dev \
|
||||||
|
libuv-dev \
|
||||||
|
libluv \
|
||||||
|
lua-luv-dev \
|
||||||
|
utf8proc-dev \
|
||||||
|
vint \
|
||||||
|
curl \
|
||||||
|
gettext-dev \
|
||||||
|
libtool \
|
||||||
|
ninja \
|
||||||
|
tree-sitter-dev \
|
||||||
"
|
"
|
||||||
|
|
||||||
RUN apk --update add $PACKAGES && \
|
RUN apk --update add $PACKAGES && \
|
||||||
rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
|
rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
RUN install_vim -tag v8.0.0027 -build \
|
RUN adduser -h /home/vimtest -s /bin/sh -D -u 8465 vimtest
|
||||||
-tag v9.0.0297 -build \
|
|
||||||
-tag neovim:v0.7.0 -build \
|
|
||||||
-tag neovim:v0.8.0 -build
|
|
||||||
|
|
||||||
RUN pip install vim-vint==0.3.21
|
RUN mkdir -p /vim /vim-build/bin /plugins
|
||||||
|
RUN chown vimtest:vimtest /home /plugins
|
||||||
|
|
||||||
|
# Useful during tests to have these packages in a deeper layer cached already.
|
||||||
|
# RUN apk --no-cache add --virtual vim-build build-base
|
||||||
|
|
||||||
|
ADD docker/argecho.sh /vim-build/bin/argecho
|
||||||
|
ADD docker/install_vim.sh /sbin/install_vim
|
||||||
|
ADD docker/run_vim.sh /sbin/run_vim
|
||||||
|
|
||||||
|
RUN chmod +x /vim-build/bin/argecho /sbin/install_vim /sbin/run_vim
|
||||||
|
|
||||||
|
# The user directory for setup
|
||||||
|
VOLUME /home/vimtest
|
||||||
|
|
||||||
|
# Your plugin
|
||||||
|
VOLUME /testplugin
|
||||||
|
|
||||||
|
ENTRYPOINT ["/sbin/run_vim"]
|
||||||
|
|
||||||
|
#############################################################################
|
||||||
|
# ALE Test image
|
||||||
|
#
|
||||||
|
FROM testbed
|
||||||
|
|
||||||
|
RUN install_vim -tag v8.2.5172 -build \
|
||||||
|
-tag v9.2.0329 -build \
|
||||||
|
-tag neovim:v0.10.4 -build \
|
||||||
|
-tag neovim:v0.12.1 -build
|
||||||
|
|
||||||
RUN git clone https://github.com/junegunn/vader.vim vader && \
|
RUN git clone https://github.com/junegunn/vader.vim vader && \
|
||||||
cd vader && git checkout c6243dd81c98350df4dec608fa972df98fa2a3af
|
cd vader && git checkout c6243dd81c98350df4dec608fa972df98fa2a3af
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# Asynchronous Lint Engine
|
# Asynchronous Lint Engine
|
||||||
|
|
||||||
[](https://www.vim.org/) [](https://neovim.io/) [](https://github.com/dense-analysis/ale/actions?query=event%3Apush+workflow%3ACI+branch%3Amaster++) [](https://ci.appveyor.com/project/dense-analysis/ale) [](https://discord.gg/5zFD6pQxDk)
|
[](https://www.vim.org/) [](https://neovim.io/) [](https://github.com/dense-analysis/ale/actions?query=event%3Apush+workflow%3ACI+branch%3Amaster++) [](https://discord.gg/5zFD6pQxDk)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
ALE (Asynchronous Lint Engine) is a plugin providing linting (syntax checking
|
ALE (Asynchronous Lint Engine) is a plugin providing linting (syntax checking
|
||||||
and semantic errors) in Neovim 0.7.0+ and Vim 8.0+ while you edit your text files,
|
and semantic errors) in Neovim 0.7.0+ and Vim 8.2+ while you edit your text files,
|
||||||
and acts as a Vim [Language Server Protocol](https://langserver.org/) client.
|
and acts as a Vim [Language Server Protocol](https://langserver.org/) client.
|
||||||
|
|
||||||
<video autoplay="true" muted="true" loop="true" controls="false" src="https://user-images.githubusercontent.com/3518142/210141215-8f2ff760-6a87-4704-a11e-c109b8e9ec41.mp4" title="An example showing what ALE can do."></video>
|
<video autoplay="true" muted="true" loop="true" controls="false" src="https://user-images.githubusercontent.com/3518142/210141215-8f2ff760-6a87-4704-a11e-c109b8e9ec41.mp4" title="An example showing what ALE can do."></video>
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
" Author: Daniel M. Capella https://github.com/polyzen
|
" Author: Daniel M. Capella https://github.com/polyzen
|
||||||
" Description: proselint for AsciiDoc files
|
" Description: proselint for AsciiDoc files
|
||||||
|
|
||||||
|
call ale#Set('proselint_executable', 'proselint')
|
||||||
|
|
||||||
call ale#linter#Define('asciidoc', {
|
call ale#linter#Define('asciidoc', {
|
||||||
\ 'name': 'proselint',
|
\ 'name': 'proselint',
|
||||||
\ 'executable': 'proselint',
|
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||||
\ 'command': 'proselint %t',
|
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ function! ale_linters#asm#gcc#GetCommand(buffer) abort
|
|||||||
" -fsyntax-only doesn't catch everything.
|
" -fsyntax-only doesn't catch everything.
|
||||||
return '%e -x assembler'
|
return '%e -x assembler'
|
||||||
\ . ' -o ' . g:ale#util#nul_file
|
\ . ' -o ' . g:ale#util#nul_file
|
||||||
\ . '-iquote %s:h'
|
\ . ' -iquote %s:h'
|
||||||
\ . ' ' . ale#Var(a:buffer, 'asm_gcc_options') . ' -'
|
\ . ' ' . ale#Var(a:buffer, 'asm_gcc_options') . ' -'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
" Author: Jelmer Vernooij <jelmer@jelmer.uk>
|
||||||
|
" Description: Language server for Debian package files
|
||||||
|
|
||||||
|
call ale#Set('autopkgtest_debian_lsp_executable', 'debian-lsp')
|
||||||
|
|
||||||
|
function! ale_linters#autopkgtest#debian_lsp#GetProjectRoot(buffer) abort
|
||||||
|
" Find the debian directory
|
||||||
|
let l:debian_dir = ale#path#FindNearestDirectory(a:buffer, 'debian')
|
||||||
|
|
||||||
|
if !empty(l:debian_dir)
|
||||||
|
return fnamemodify(l:debian_dir, ':h:h')
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('autopkgtest', {
|
||||||
|
\ 'name': 'debian_lsp',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'autopkgtest_debian_lsp_executable')},
|
||||||
|
\ 'command': '%e',
|
||||||
|
\ 'project_root': function('ale_linters#autopkgtest#debian_lsp#GetProjectRoot'),
|
||||||
|
\})
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for c files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('c')
|
||||||
@@ -10,13 +10,18 @@ function! ale_linters#c#cppcheck#GetCommand(buffer) abort
|
|||||||
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
|
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
|
||||||
\ : ''
|
\ : ''
|
||||||
let l:template = ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
|
let l:template = ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
|
||||||
|
" Versions >=2.13 don't allow using --project in conjunction with an
|
||||||
|
" explicit source file.
|
||||||
|
let l:source_file = stridx(l:compile_commands_option, '--project=') < 0
|
||||||
|
\ ? ' %t'
|
||||||
|
\ : ''
|
||||||
|
|
||||||
return '%e -q --language=c'
|
return '%e -q --language=c'
|
||||||
\ . l:template
|
\ . l:template
|
||||||
\ . ale#Pad(l:compile_commands_option)
|
\ . ale#Pad(l:compile_commands_option)
|
||||||
\ . ale#Pad(ale#Var(a:buffer, 'c_cppcheck_options'))
|
\ . ale#Pad(ale#Var(a:buffer, 'c_cppcheck_options'))
|
||||||
\ . l:buffer_path_include
|
\ . l:buffer_path_include
|
||||||
\ . ' %t'
|
\ . l:source_file
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('c', {
|
call ale#linter#Define('c', {
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for cpp files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('cpp')
|
||||||
@@ -18,7 +18,7 @@ function! ale_linters#cpp#clazy#GetCommand(buffer) abort
|
|||||||
return '%e'
|
return '%e'
|
||||||
\ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
|
\ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
|
||||||
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . ale#Pad(l:options)
|
||||||
\ . ' %s'
|
\ . ' %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -10,13 +10,18 @@ function! ale_linters#cpp#cppcheck#GetCommand(buffer) abort
|
|||||||
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
|
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
|
||||||
\ : ''
|
\ : ''
|
||||||
let l:template = ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
|
let l:template = ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
|
||||||
|
" Versions >=2.13 don't allow using --project in conjunction with an
|
||||||
|
" explicit source file.
|
||||||
|
let l:source_file = stridx(l:compile_commands_option, '--project=') < 0
|
||||||
|
\ ? ' %t'
|
||||||
|
\ : ''
|
||||||
|
|
||||||
return '%e -q --language=c++'
|
return '%e -q --language=c++'
|
||||||
\ . l:template
|
\ . l:template
|
||||||
\ . ale#Pad(l:compile_commands_option)
|
\ . ale#Pad(l:compile_commands_option)
|
||||||
\ . ale#Pad(ale#Var(a:buffer, 'cpp_cppcheck_options'))
|
\ . ale#Pad(ale#Var(a:buffer, 'cpp_cppcheck_options'))
|
||||||
\ . l:buffer_path_include
|
\ . l:buffer_path_include
|
||||||
\ . ' %t'
|
\ . l:source_file
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('cpp', {
|
call ale#linter#Define('cpp', {
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for cs files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('cs')
|
||||||
@@ -4,7 +4,7 @@ function! ale_linters#cs#mcs#GetCommand(buffer) abort
|
|||||||
let l:options = ale#Var(a:buffer, 'cs_mcs_options')
|
let l:options = ale#Var(a:buffer, 'cs_mcs_options')
|
||||||
|
|
||||||
return 'mcs -unsafe --parse'
|
return 'mcs -unsafe --parse'
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . ale#Pad(l:options)
|
||||||
\ . ' %t'
|
\ . ' %t'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for css files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('css')
|
||||||
@@ -6,7 +6,7 @@ call ale#Set('css_stylelint_use_global', get(g:, 'ale_use_global_executables', 0
|
|||||||
|
|
||||||
function! ale_linters#css#stylelint#GetCommand(buffer) abort
|
function! ale_linters#css#stylelint#GetCommand(buffer) abort
|
||||||
return '%e ' . ale#Pad(ale#Var(a:buffer, 'css_stylelint_options'))
|
return '%e ' . ale#Pad(ale#Var(a:buffer, 'css_stylelint_options'))
|
||||||
\ . ' --stdin-filename %s'
|
\ . ' --no-color --stdin-filename %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('css', {
|
call ale#linter#Define('css', {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ function! ale_linters#cuda#nvcc#HandleNVCCFormat(buffer, lines) abort
|
|||||||
\ 'lnum': str2nr(l:match[2]),
|
\ 'lnum': str2nr(l:match[2]),
|
||||||
\ 'type': l:match[4] =~# 'error' ? 'E' : 'W',
|
\ 'type': l:match[4] =~# 'error' ? 'E' : 'W',
|
||||||
\ 'text': l:match[5],
|
\ 'text': l:match[5],
|
||||||
\ 'filename': fnamemodify(l:match[1], ':p'),
|
\ 'filename': ale#path#Simplify(fnamemodify(l:match[1], ':p')),
|
||||||
\}
|
\}
|
||||||
|
|
||||||
if !empty(l:match[3])
|
if !empty(l:match[3])
|
||||||
|
|||||||
@@ -87,7 +87,9 @@ function! ale_linters#d#dmd#Handle(buffer, lines) abort
|
|||||||
" Matches patterns lines like the following:
|
" Matches patterns lines like the following:
|
||||||
" /tmp/tmp.qclsa7qLP7/file.d(1): Error: function declaration without return type. (Note that constructors are always named 'this')
|
" /tmp/tmp.qclsa7qLP7/file.d(1): Error: function declaration without return type. (Note that constructors are always named 'this')
|
||||||
" /tmp/tmp.G1L5xIizvB.d(8,8): Error: module weak_reference is in file 'dstruct/weak_reference.d' which cannot be read
|
" /tmp/tmp.G1L5xIizvB.d(8,8): Error: module weak_reference is in file 'dstruct/weak_reference.d' which cannot be read
|
||||||
let l:pattern = '\v^(\f+)\((\d+)(,(\d+))?\): (\w+): (.+)$'
|
" Use [^(]+ instead of \f+ because NeoVim's 'isfname' on Windows does
|
||||||
|
" not include \ or :, so \f+ cannot match Windows absolute paths.
|
||||||
|
let l:pattern = '\v^([^(]+)\((\d+)(,(\d+))?\): (\w+): (.+)$'
|
||||||
let l:output = []
|
let l:output = []
|
||||||
let l:dir = expand('#' . a:buffer . ':p:h')
|
let l:dir = expand('#' . a:buffer . ':p:h')
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
" Author: Jelmer Vernooij <jelmer@jelmer.uk>
|
||||||
|
" Description: Language server for Debian package files
|
||||||
|
|
||||||
|
call ale#Set('debchangelog_debian_lsp_executable', 'debian-lsp')
|
||||||
|
|
||||||
|
function! ale_linters#debchangelog#debian_lsp#GetProjectRoot(buffer) abort
|
||||||
|
" Find the debian directory
|
||||||
|
let l:debian_dir = ale#path#FindNearestDirectory(a:buffer, 'debian')
|
||||||
|
|
||||||
|
if !empty(l:debian_dir)
|
||||||
|
return fnamemodify(l:debian_dir, ':h:h')
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('debchangelog', {
|
||||||
|
\ 'name': 'debian_lsp',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'debchangelog_debian_lsp_executable')},
|
||||||
|
\ 'command': '%e',
|
||||||
|
\ 'project_root': function('ale_linters#debchangelog#debian_lsp#GetProjectRoot'),
|
||||||
|
\})
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
" Author: Jelmer Vernooij <jelmer@jelmer.uk>
|
||||||
|
" Description: Language server for Debian package files
|
||||||
|
|
||||||
|
call ale#Set('debcontrol_debian_lsp_executable', 'debian-lsp')
|
||||||
|
|
||||||
|
function! ale_linters#debcontrol#debian_lsp#GetProjectRoot(buffer) abort
|
||||||
|
" Find the debian directory
|
||||||
|
let l:debian_dir = ale#path#FindNearestDirectory(a:buffer, 'debian')
|
||||||
|
|
||||||
|
if !empty(l:debian_dir)
|
||||||
|
return fnamemodify(l:debian_dir, ':h:h')
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('debcontrol', {
|
||||||
|
\ 'name': 'debian_lsp',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'debcontrol_debian_lsp_executable')},
|
||||||
|
\ 'command': '%e',
|
||||||
|
\ 'project_root': function('ale_linters#debcontrol#debian_lsp#GetProjectRoot'),
|
||||||
|
\})
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
" Author: Jelmer Vernooij <jelmer@jelmer.uk>
|
||||||
|
" Description: Language server for Debian package files
|
||||||
|
|
||||||
|
call ale#Set('debcopyright_debian_lsp_executable', 'debian-lsp')
|
||||||
|
|
||||||
|
function! ale_linters#debcopyright#debian_lsp#GetProjectRoot(buffer) abort
|
||||||
|
" Find the debian directory
|
||||||
|
let l:debian_dir = ale#path#FindNearestDirectory(a:buffer, 'debian')
|
||||||
|
|
||||||
|
if !empty(l:debian_dir)
|
||||||
|
return fnamemodify(l:debian_dir, ':h:h')
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('debcopyright', {
|
||||||
|
\ 'name': 'debian_lsp',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'debcopyright_debian_lsp_executable')},
|
||||||
|
\ 'command': '%e',
|
||||||
|
\ 'project_root': function('ale_linters#debcopyright#debian_lsp#GetProjectRoot'),
|
||||||
|
\})
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
" Author: Jelmer Vernooij <jelmer@jelmer.uk>
|
||||||
|
" Description: Language server for Debian package files
|
||||||
|
|
||||||
|
call ale#Set('debsources_debian_lsp_executable', 'debian-lsp')
|
||||||
|
|
||||||
|
function! ale_linters#debsources#debian_lsp#GetProjectRoot(buffer) abort
|
||||||
|
" Find the debian directory
|
||||||
|
let l:debian_dir = ale#path#FindNearestDirectory(a:buffer, 'debian')
|
||||||
|
|
||||||
|
if !empty(l:debian_dir)
|
||||||
|
return fnamemodify(l:debian_dir, ':h:h')
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('debsources', {
|
||||||
|
\ 'name': 'debian_lsp',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'debsources_debian_lsp_executable')},
|
||||||
|
\ 'command': '%e',
|
||||||
|
\ 'project_root': function('ale_linters#debsources#debian_lsp#GetProjectRoot'),
|
||||||
|
\})
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
" Author: Jelmer Vernooij <jelmer@jelmer.uk>
|
||||||
|
" Description: Language server for Debian package files
|
||||||
|
|
||||||
|
call ale#Set('debupstream_debian_lsp_executable', 'debian-lsp')
|
||||||
|
|
||||||
|
function! ale_linters#debupstream#debian_lsp#GetProjectRoot(buffer) abort
|
||||||
|
" Find the debian directory
|
||||||
|
let l:debian_dir = ale#path#FindNearestDirectory(a:buffer, 'debian')
|
||||||
|
|
||||||
|
if !empty(l:debian_dir)
|
||||||
|
return fnamemodify(l:debian_dir, ':h:h')
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('debupstream', {
|
||||||
|
\ 'name': 'debian_lsp',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'debupstream_debian_lsp_executable')},
|
||||||
|
\ 'command': '%e',
|
||||||
|
\ 'project_root': function('ale_linters#debupstream#debian_lsp#GetProjectRoot'),
|
||||||
|
\})
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
" Author: Jelmer Vernooij <jelmer@jelmer.uk>
|
||||||
|
" Description: Language server for Debian package files
|
||||||
|
|
||||||
|
call ale#Set('debwatch_debian_lsp_executable', 'debian-lsp')
|
||||||
|
|
||||||
|
function! ale_linters#debwatch#debian_lsp#GetProjectRoot(buffer) abort
|
||||||
|
" Find the debian directory
|
||||||
|
let l:debian_dir = ale#path#FindNearestDirectory(a:buffer, 'debian')
|
||||||
|
|
||||||
|
if !empty(l:debian_dir)
|
||||||
|
return fnamemodify(l:debian_dir, ':h:h')
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('debwatch', {
|
||||||
|
\ 'name': 'debian_lsp',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'debwatch_debian_lsp_executable')},
|
||||||
|
\ 'command': '%e',
|
||||||
|
\ 'project_root': function('ale_linters#debwatch#debian_lsp#GetProjectRoot'),
|
||||||
|
\})
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for elixir files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('elixir')
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
" Author: Paul Monson <pmonson711@pm.me>
|
||||||
|
" Description: Expert integration (https://github.com/elixir-lang/expert)
|
||||||
|
|
||||||
|
call ale#Set('elixir_expert_executable', 'expert')
|
||||||
|
|
||||||
|
call ale#linter#Define('elixir', {
|
||||||
|
\ 'name': 'expert',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'elixir_expert_executable')},
|
||||||
|
\ 'command': '%e --stdio',
|
||||||
|
\ 'project_root': function('ale#handlers#elixir#FindMixUmbrellaRoot'),
|
||||||
|
\})
|
||||||
@@ -2,13 +2,13 @@
|
|||||||
" based on the ale ruumba and robocop linters
|
" based on the ale ruumba and robocop linters
|
||||||
" Description: ERB Lint, support for https://github.com/Shopify/erb-lint
|
" Description: ERB Lint, support for https://github.com/Shopify/erb-lint
|
||||||
|
|
||||||
call ale#Set('eruby_erblint_executable', 'erblint')
|
call ale#Set('eruby_erblint_executable', 'erb_lint')
|
||||||
call ale#Set('eruby_erblint_options', '')
|
call ale#Set('eruby_erblint_options', '')
|
||||||
|
|
||||||
function! ale_linters#eruby#erblint#GetCommand(buffer) abort
|
function! ale_linters#eruby#erblint#GetCommand(buffer) abort
|
||||||
let l:executable = ale#Var(a:buffer, 'eruby_erblint_executable')
|
let l:executable = ale#Var(a:buffer, 'eruby_erblint_executable')
|
||||||
|
|
||||||
return ale#ruby#EscapeExecutable(l:executable, 'erblint')
|
return ale#ruby#EscapeExecutable(l:executable, 'erb_lint')
|
||||||
\ . ' --format json '
|
\ . ' --format json '
|
||||||
\ . ale#Var(a:buffer, 'eruby_erblint_options')
|
\ . ale#Var(a:buffer, 'eruby_erblint_options')
|
||||||
\ . ' --stdin %s'
|
\ . ' --stdin %s'
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
" Author: Jansen Mitchell https://github.com/JansenMitchell
|
" Author: Jansen Mitchell https://github.com/JansenMitchell
|
||||||
" Description: proselint for Fountain files
|
" Description: proselint for Fountain files
|
||||||
|
|
||||||
|
call ale#Set('proselint_executable', 'proselint')
|
||||||
|
|
||||||
call ale#linter#Define('fountain', {
|
call ale#linter#Define('fountain', {
|
||||||
\ 'name': 'proselint',
|
\ 'name': 'proselint',
|
||||||
\ 'executable': 'proselint',
|
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||||
\ 'command': 'proselint %t',
|
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for go files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('go')
|
||||||
@@ -8,7 +8,7 @@ function! ale_linters#go#revive#GetCommand(buffer) abort
|
|||||||
let l:options = ale#Var(a:buffer, 'go_revive_options')
|
let l:options = ale#Var(a:buffer, 'go_revive_options')
|
||||||
|
|
||||||
return ale#go#EnvString(a:buffer) . '%e'
|
return ale#go#EnvString(a:buffer) . '%e'
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . ale#Pad(l:options)
|
||||||
\ . ' %t'
|
\ . ' %t'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ function! ale_linters#go#staticcheck#GetCommand(buffer) abort
|
|||||||
|
|
||||||
if l:lint_package
|
if l:lint_package
|
||||||
return l:env . '%e'
|
return l:env . '%e'
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
\ . ale#Pad(l:options) . ' .'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return l:env . '%e'
|
return l:env . '%e'
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . ale#Pad(l:options)
|
||||||
\ . ' %s:t'
|
\ . ' %s:t'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ function! ale_linters#groovy#npmgroovylint#GetCommand(buffer) abort
|
|||||||
let l:options = ale#Var(a:buffer, 'groovy_npmgroovylint_options')
|
let l:options = ale#Var(a:buffer, 'groovy_npmgroovylint_options')
|
||||||
|
|
||||||
return '%e --failon none --output json'
|
return '%e --failon none --output json'
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . ale#Pad(l:options)
|
||||||
\ . ' %t'
|
\ . ' %t'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for haskell files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('haskell')
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
" Author: Daniel M. Capella https://github.com/polyzen
|
" Author: Daniel M. Capella https://github.com/polyzen
|
||||||
" Description: proselint for Vim help files
|
" Description: proselint for Vim help files
|
||||||
|
|
||||||
|
call ale#Set('proselint_executable', 'proselint')
|
||||||
|
|
||||||
call ale#linter#Define('help', {
|
call ale#linter#Define('help', {
|
||||||
\ 'name': 'proselint',
|
\ 'name': 'proselint',
|
||||||
\ 'executable': 'proselint',
|
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||||
\ 'command': 'proselint %t',
|
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for html files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('html')
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
" Author: Daniel M. Capella https://github.com/polyzen
|
" Author: Daniel M. Capella https://github.com/polyzen
|
||||||
" Description: proselint for HTML files
|
" Description: proselint for HTML files
|
||||||
|
|
||||||
|
call ale#Set('proselint_executable', 'proselint')
|
||||||
|
|
||||||
call ale#linter#Define('html', {
|
call ale#linter#Define('html', {
|
||||||
\ 'name': 'proselint',
|
\ 'name': 'proselint',
|
||||||
\ 'executable': 'proselint',
|
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||||
\ 'command': 'proselint %t',
|
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ function! ale_linters#html#stylelint#GetCommand(buffer) abort
|
|||||||
let l:options = ale#Var(a:buffer, 'html_stylelint_options')
|
let l:options = ale#Var(a:buffer, 'html_stylelint_options')
|
||||||
|
|
||||||
return ale#Escape(l:executable)
|
return ale#Escape(l:executable)
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . ale#Pad(l:options)
|
||||||
\ . ' --stdin-filename %s'
|
\ . ' --no-color --stdin-filename %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('html', {
|
call ale#linter#Define('html', {
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
call ale#Set('html_superhtml_executable', 'superhtml')
|
||||||
|
call ale#Set('html_superhtml_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
|
|
||||||
|
function! ale_linters#html#superhtml#GetCommand(buffer) abort
|
||||||
|
return '%e check --stdin'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#html#superhtml#Handle(buffer, lines) abort
|
||||||
|
let l:output = []
|
||||||
|
let l:pattern = '^\(.*\):\(\d\+\):\(\d\+\): \(.*\)$'
|
||||||
|
|
||||||
|
for l:line in a:lines
|
||||||
|
let l:match = matchlist(l:line, l:pattern)
|
||||||
|
|
||||||
|
if !empty(l:match)
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': str2nr(l:match[2]),
|
||||||
|
\ 'col': str2nr(l:match[3]),
|
||||||
|
\ 'text': l:match[4],
|
||||||
|
\ 'type': 'E'
|
||||||
|
\})
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('html', {
|
||||||
|
\ 'name': 'superhtml',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'html_superhtml_executable')},
|
||||||
|
\ 'command': function('ale_linters#html#superhtml#GetCommand'),
|
||||||
|
\ 'output_stream': 'stderr',
|
||||||
|
\ 'callback': 'ale_linters#html#superhtml#Handle',
|
||||||
|
\})
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for java files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('java')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for javascript files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('javascript')
|
||||||
@@ -19,7 +19,7 @@ function! ale_linters#javascript#standard#GetCommand(buffer) abort
|
|||||||
let l:options = ale#Var(a:buffer, 'javascript_standard_options')
|
let l:options = ale#Var(a:buffer, 'javascript_standard_options')
|
||||||
|
|
||||||
return ale#node#Executable(a:buffer, l:executable)
|
return ale#node#Executable(a:buffer, l:executable)
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . ale#Pad(l:options)
|
||||||
\ . ' --stdin %s'
|
\ . ' --stdin %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
" Description: linter for jinja using j2lint
|
||||||
|
|
||||||
|
call ale#Set('jinja_j2lint_executable', 'j2lint')
|
||||||
|
call ale#Set('jinja_j2lint_options', '')
|
||||||
|
call ale#Set('jinja_j2lint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
|
call ale#Set('jinja_j2lint_auto_pipenv', 0)
|
||||||
|
call ale#Set('jinja_j2lint_auto_poetry', 0)
|
||||||
|
call ale#Set('jinja_j2lint_auto_uv', 0)
|
||||||
|
|
||||||
|
function! ale_linters#jinja#j2lint#GetExecutable(buffer) abort
|
||||||
|
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'jinja_j2lint_auto_pipenv'))
|
||||||
|
\ && ale#python#PipenvPresent(a:buffer)
|
||||||
|
return 'pipenv'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'jinja_j2lint_auto_poetry'))
|
||||||
|
\ && ale#python#PoetryPresent(a:buffer)
|
||||||
|
return 'poetry'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'jinja_j2lint_auto_uv'))
|
||||||
|
\ && ale#python#UvPresent(a:buffer)
|
||||||
|
return 'uv'
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ale#python#FindExecutable(a:buffer, 'jinja_j2lint', ['j2lint'])
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#jinja#j2lint#GetCommand(buffer) abort
|
||||||
|
let l:executable = ale_linters#jinja#j2lint#GetExecutable(a:buffer)
|
||||||
|
|
||||||
|
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
|
||||||
|
\ ? ' run j2lint'
|
||||||
|
\ : ''
|
||||||
|
|
||||||
|
return ale#Escape(l:executable) . l:exec_args
|
||||||
|
\ . ale#Pad(ale#Var(a:buffer, 'jinja_j2lint_options'))
|
||||||
|
\ . ' %t'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('jinja', {
|
||||||
|
\ 'name': 'j2lint',
|
||||||
|
\ 'executable': function('ale_linters#jinja#j2lint#GetExecutable'),
|
||||||
|
\ 'command': function('ale_linters#jinja#j2lint#GetCommand'),
|
||||||
|
\ 'callback': 'ale#handlers#unix#HandleAsError',
|
||||||
|
\})
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for json files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('json')
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
" Author: Johan Larsson <johan@jolars.co>
|
||||||
|
" Description: A language server, formatter, and linter for Julia
|
||||||
|
|
||||||
|
call ale#Set('julia_fatou_executable', 'fatou')
|
||||||
|
|
||||||
|
function! ale_linters#julia#fatou#GetProjectRoot(buffer) abort
|
||||||
|
let l:config = ale#path#FindNearestFile(a:buffer, 'fatou.toml')
|
||||||
|
|
||||||
|
return !empty(l:config) ? fnamemodify(l:config, ':h') : ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('julia', {
|
||||||
|
\ 'name': 'fatou',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'julia_fatou_executable')},
|
||||||
|
\ 'command': '%e lsp',
|
||||||
|
\ 'project_root': function('ale_linters#julia#fatou#GetProjectRoot'),
|
||||||
|
\})
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for kotlin files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('kotlin')
|
||||||
@@ -7,7 +7,7 @@ call ale#Set('less_stylelint_use_global', get(g:, 'ale_use_global_executables',
|
|||||||
function! ale_linters#less#stylelint#GetCommand(buffer) abort
|
function! ale_linters#less#stylelint#GetCommand(buffer) abort
|
||||||
let l:options = ale#Var(a:buffer, 'less_stylelint_options')
|
let l:options = ale#Var(a:buffer, 'less_stylelint_options')
|
||||||
|
|
||||||
return '%e' . ale#Pad(l:options) . ' --stdin-filename %s'
|
return '%e' . ale#Pad(l:options) . ' --no-color --stdin-filename %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('less', {
|
call ale#linter#Define('less', {
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
" Author: Sam Bottoni
|
||||||
|
" Description: lilypond linter for LilyPond files
|
||||||
|
|
||||||
|
call ale#Set('lilypond_lilypond_executable', 'lilypond')
|
||||||
|
|
||||||
|
let g:ale_lilypond_lilypond_options = get(g:, 'ale_lilypond_lilypond_options', '')
|
||||||
|
|
||||||
|
function! ale_linters#lilypond#lilypond#GetCommand(buffer) abort
|
||||||
|
return '%e --loglevel=WARNING -dbackend=null -dno-print-pages -o /tmp'
|
||||||
|
\ . ale#Pad(ale#Var(a:buffer, 'lilypond_lilypond_options'))
|
||||||
|
\ . ' %t 2>&1'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#lilypond#lilypond#Handle(buffer, lines) abort
|
||||||
|
let l:output = []
|
||||||
|
|
||||||
|
for l:line in a:lines
|
||||||
|
" Match: file:line:col: error|warning|programming error: message
|
||||||
|
let l:match = matchlist(l:line,
|
||||||
|
\ '\v^.*:(\d+):(\d+): (error|warning|programming error): (.*)$')
|
||||||
|
|
||||||
|
if !empty(l:match)
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': str2nr(l:match[1]),
|
||||||
|
\ 'col': str2nr(l:match[2]),
|
||||||
|
\ 'type': l:match[3] =~? 'error' ? 'E' : 'W',
|
||||||
|
\ 'text': l:match[4]
|
||||||
|
\})
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('lilypond', {
|
||||||
|
\ 'name': 'lilypond',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'lilypond_lilypond_executable')},
|
||||||
|
\ 'command': function('ale_linters#lilypond#lilypond#GetCommand'),
|
||||||
|
\ 'callback': 'ale_linters#lilypond#lilypond#Handle',
|
||||||
|
\})
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for lua files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('lua')
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
" Author: Daniel M. Capella https://github.com/polyzen
|
" Author: Daniel M. Capella https://github.com/polyzen
|
||||||
" Description: proselint for mail files
|
" Description: proselint for mail files
|
||||||
|
|
||||||
|
call ale#Set('proselint_executable', 'proselint')
|
||||||
|
|
||||||
call ale#linter#Define('mail', {
|
call ale#linter#Define('mail', {
|
||||||
\ 'name': 'proselint',
|
\ 'name': 'proselint',
|
||||||
\ 'executable': 'proselint',
|
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||||
\ 'command': 'proselint %t',
|
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
" Author: Armand Halbert <armand.halbert@gmail.com>
|
||||||
|
" Description: Harper for Markdown files
|
||||||
|
|
||||||
|
call ale#Set('markdown_harper_config', {
|
||||||
|
\ 'harper-ls': {
|
||||||
|
\ 'diagnosticSeverity': 'hint',
|
||||||
|
\ 'dialect': 'American',
|
||||||
|
\ 'linters': {
|
||||||
|
\ 'SpellCheck': v:true,
|
||||||
|
\ 'SentenceCapitalization': v:true,
|
||||||
|
\ 'RepeatedWords': v:true,
|
||||||
|
\ 'LongSentences': v:true,
|
||||||
|
\ 'AnA': v:true,
|
||||||
|
\ 'Spaces': v:true,
|
||||||
|
\ 'SpelledNumbers': v:false,
|
||||||
|
\ 'WrongQuotes': v:false,
|
||||||
|
\ },
|
||||||
|
\ },
|
||||||
|
\})
|
||||||
|
|
||||||
|
call ale#linter#Define('markdown', {
|
||||||
|
\ 'name': 'harper',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': 'harper-ls',
|
||||||
|
\ 'command': '%e --stdio',
|
||||||
|
\ 'project_root': function('ale_linters#markdown#harper#GetProjectRoot'),
|
||||||
|
\ 'lsp_config': {b -> ale#Var(b, 'markdown_harper_config')},
|
||||||
|
\})
|
||||||
|
|
||||||
|
function! ale_linters#markdown#harper#GetProjectRoot(buffer) abort
|
||||||
|
return fnamemodify(bufname(a:buffer), ':p:h')
|
||||||
|
endfunction
|
||||||
@@ -1,27 +1,29 @@
|
|||||||
" Author: Ty-Lucas Kelley <tylucaskelley@gmail.com>
|
" Author: Ty-Lucas Kelley <tylucaskelley@gmail.com>
|
||||||
" Description: Adds support for markdownlint
|
" Description: Adds support for markdownlint-cli
|
||||||
|
|
||||||
call ale#Set('markdown_markdownlint_executable', 'markdownlint')
|
call ale#Set('markdown_markdownlint_executable', 'markdownlint')
|
||||||
call ale#Set('markdown_markdownlint_options', '')
|
call ale#Set('markdown_markdownlint_options', '')
|
||||||
|
|
||||||
function! ale_linters#markdown#markdownlint#GetExecutable(buffer) abort
|
function! ale_linters#markdown#markdownlint#GetExecutable(buffer) abort
|
||||||
return ale#Var(a:buffer, 'markdown_markdownlint_executable')
|
return ale#handlers#markdownlint#GetExecutable(
|
||||||
|
\ a:buffer,
|
||||||
|
\ 'markdownlint',
|
||||||
|
\)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#markdown#markdownlint#GetCommand(buffer) abort
|
function! ale_linters#markdown#markdownlint#GetCommand(buffer) abort
|
||||||
let l:executable = ale_linters#markdown#markdownlint#GetExecutable(a:buffer)
|
return ale#handlers#markdownlint#GetCommand(
|
||||||
|
\ a:buffer,
|
||||||
let l:options = ale#Var(a:buffer, 'markdown_markdownlint_options')
|
\ 'markdownlint',
|
||||||
|
\)
|
||||||
return ale#Escape(l:executable)
|
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' %s'
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('markdown', {
|
call ale#linter#Define('markdown', {
|
||||||
\ 'name': 'markdownlint',
|
\ 'name': 'markdownlint_cli',
|
||||||
|
\ 'aliases': ['markdownlint', 'markdownlint-cli'],
|
||||||
\ 'executable': function('ale_linters#markdown#markdownlint#GetExecutable'),
|
\ 'executable': function('ale_linters#markdown#markdownlint#GetExecutable'),
|
||||||
\ 'lint_file': 1,
|
\ 'lint_file': 1,
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\ 'command': function('ale_linters#markdown#markdownlint#GetCommand'),
|
\ 'command': function('ale_linters#markdown#markdownlint#GetCommand'),
|
||||||
\ 'callback': 'ale#handlers#markdownlint#Handle'
|
\ 'callback': 'ale#handlers#markdownlint#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
" Author: Horacio Sanson
|
||||||
|
" Description: Adds support for markdownlint-cli2
|
||||||
|
|
||||||
|
call ale#Set('markdown_markdownlint_cli2_executable', 'markdownlint-cli2')
|
||||||
|
call ale#Set('markdown_markdownlint_cli2_options', '')
|
||||||
|
|
||||||
|
function! ale_linters#markdown#markdownlint_cli2#GetExecutable(buffer) abort
|
||||||
|
return ale#handlers#markdownlint#GetExecutable(
|
||||||
|
\ a:buffer,
|
||||||
|
\ 'markdownlint_cli2',
|
||||||
|
\)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#markdown#markdownlint_cli2#GetCommand(buffer) abort
|
||||||
|
return ale#handlers#markdownlint#GetCommand(
|
||||||
|
\ a:buffer,
|
||||||
|
\ 'markdownlint_cli2',
|
||||||
|
\)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('markdown', {
|
||||||
|
\ 'name': 'markdownlint_cli2',
|
||||||
|
\ 'aliases': ['markdownlint-cli2'],
|
||||||
|
\ 'executable': function('ale_linters#markdown#markdownlint_cli2#GetExecutable'),
|
||||||
|
\ 'lint_file': 1,
|
||||||
|
\ 'output_stream': 'both',
|
||||||
|
\ 'command': function('ale_linters#markdown#markdownlint_cli2#GetCommand'),
|
||||||
|
\ 'callback': 'ale#handlers#markdownlint#Handle',
|
||||||
|
\})
|
||||||
@@ -17,7 +17,7 @@ function! ale_linters#markdown#mdl#GetCommand(buffer) abort
|
|||||||
let l:options = ale#Var(a:buffer, 'markdown_mdl_options')
|
let l:options = ale#Var(a:buffer, 'markdown_mdl_options')
|
||||||
|
|
||||||
return ale#Escape(l:executable) . l:exec_args
|
return ale#Escape(l:executable) . l:exec_args
|
||||||
\ . ' -j' . (!empty(l:options) ? ' ' . l:options : '')
|
\ . ' -j' . ale#Pad(l:options)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#markdown#mdl#Handle(buffer, lines) abort
|
function! ale_linters#markdown#mdl#Handle(buffer, lines) abort
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
" Author: poohzrn https://github.com/poohzrn
|
" Author: poohzrn https://github.com/poohzrn
|
||||||
" Description: proselint for Markdown files
|
" Description: proselint for Markdown files
|
||||||
|
|
||||||
|
call ale#Set('proselint_executable', 'proselint')
|
||||||
|
|
||||||
call ale#linter#Define('markdown', {
|
call ale#linter#Define('markdown', {
|
||||||
\ 'name': 'proselint',
|
\ 'name': 'proselint',
|
||||||
\ 'executable': 'proselint',
|
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||||
\ 'command': 'proselint %t',
|
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -33,9 +33,8 @@ function! ale_linters#markdown#pymarkdown#GetCommand(buffer) abort
|
|||||||
\ : ''
|
\ : ''
|
||||||
|
|
||||||
return ale#Escape(l:executable) . l:exec_args
|
return ale#Escape(l:executable) . l:exec_args
|
||||||
\ . ' '
|
\ . ale#Pad(ale#Var(a:buffer, 'markdown_pymarkdown_options'))
|
||||||
\ . ale#Var(a:buffer, 'markdown_pymarkdown_options')
|
\ . ' scan-stdin'
|
||||||
\ . 'scan-stdin'
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#markdown#pymarkdown#Handle(buffer, lines) abort
|
function! ale_linters#markdown#pymarkdown#Handle(buffer, lines) abort
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
" Author: Evan Chen <evan@evanchen.cc>
|
||||||
|
" Description: Fast Markdown linter and formatter written in Rust
|
||||||
|
|
||||||
|
|
||||||
|
call ale#Set('markdown_rumdl_executable', 'rumdl')
|
||||||
|
call ale#Set('markdown_rumdl_options', '')
|
||||||
|
|
||||||
|
function! ale_linters#markdown#rumdl#GetProjectRoot(buffer) abort
|
||||||
|
let l:dotconfig = ale#path#FindNearestFile(a:buffer, '.rumdl.toml')
|
||||||
|
let l:config = ale#path#FindNearestFile(a:buffer, 'rumdl.toml')
|
||||||
|
|
||||||
|
if !empty(l:dotconfig) && !empty(l:config)
|
||||||
|
let l:nearest = len(l:dotconfig) >= len(l:config) ? l:dotconfig : l:config
|
||||||
|
|
||||||
|
return fnamemodify(l:nearest, ':h')
|
||||||
|
elseif !empty(l:dotconfig)
|
||||||
|
return fnamemodify(l:dotconfig, ':h')
|
||||||
|
elseif !empty(l:config)
|
||||||
|
return fnamemodify(l:config, ':h')
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Try to find nearest pyproject.toml
|
||||||
|
let l:pyproject_file = ale#path#FindNearestFile(a:buffer, 'pyproject.toml')
|
||||||
|
|
||||||
|
if !empty(l:pyproject_file)
|
||||||
|
return fnamemodify(l:pyproject_file . '/', ':p:h:h')
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Try to find nearest `git` directory
|
||||||
|
let l:gitdir = ale#path#FindNearestFile(a:buffer, '.git')
|
||||||
|
|
||||||
|
if !empty(l:gitdir)
|
||||||
|
return fnamemodify(l:gitdir . '/', ':p:h:h')
|
||||||
|
endif
|
||||||
|
|
||||||
|
return fnamemodify(bufname(a:buffer), ':p:h')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('markdown', {
|
||||||
|
\ 'name': 'rumdl',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'markdown_rumdl_executable')},
|
||||||
|
\ 'command': {b -> ale#Escape(ale#Var(b, 'markdown_rumdl_executable'))
|
||||||
|
\ . ' server --stdio'
|
||||||
|
\ . ale#Pad(ale#Var(b, 'markdown_rumdl_options'))},
|
||||||
|
\ 'project_root': function('ale_linters#markdown#rumdl#GetProjectRoot'),
|
||||||
|
\ 'language': 'markdown',
|
||||||
|
\})
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for nix files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('nix')
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
" Author: Daniel M. Capella https://github.com/polyzen
|
" Author: Daniel M. Capella https://github.com/polyzen
|
||||||
" Description: proselint for nroff files
|
" Description: proselint for nroff files
|
||||||
|
|
||||||
|
call ale#Set('proselint_executable', 'proselint')
|
||||||
|
|
||||||
call ale#linter#Define('nroff', {
|
call ale#linter#Define('nroff', {
|
||||||
\ 'name': 'proselint',
|
\ 'name': 'proselint',
|
||||||
\ 'executable': 'proselint',
|
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||||
\ 'command': 'proselint %t',
|
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
" Author: Johan Niklasson <johan@niklasson-embedded.se>
|
||||||
|
" Description: openscad-lsp support for OpenSCAD
|
||||||
|
|
||||||
|
call ale#Set('openscad_openscad_lsp_executable', 'openscad-lsp')
|
||||||
|
call ale#Set('openscad_openscad_lsp_options', '')
|
||||||
|
|
||||||
|
function! ale_linters#openscad#openscad_lsp#GetProjectRoot(buffer) abort
|
||||||
|
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
|
||||||
|
|
||||||
|
if !empty(l:git_path)
|
||||||
|
return fnamemodify(l:git_path, ':h:h')
|
||||||
|
endif
|
||||||
|
|
||||||
|
return expand('#' . a:buffer . ':p:h')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('openscad', {
|
||||||
|
\ 'name': 'openscad_lsp',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'openscad_openscad_lsp_executable')},
|
||||||
|
\ 'command': {b -> '%e --stdio' . ale#Pad(ale#Var(b, 'openscad_openscad_lsp_options'))},
|
||||||
|
\ 'project_root': function('ale_linters#openscad#openscad_lsp#GetProjectRoot'),
|
||||||
|
\})
|
||||||
@@ -5,23 +5,6 @@
|
|||||||
call ale#Set('perl_perl_executable', 'perl')
|
call ale#Set('perl_perl_executable', 'perl')
|
||||||
" Please note that perl_perl_options does not exist here.
|
" Please note that perl_perl_options does not exist here.
|
||||||
|
|
||||||
function! ale_linters#perl#languageserver#GetProjectRoot(buffer) abort
|
|
||||||
" Makefile.PL, https://perldoc.perl.org/ExtUtils::MakeMaker
|
|
||||||
" Build.PL, https://metacpan.org/pod/Module::Build
|
|
||||||
" dist.ini, https://metacpan.org/pod/Dist::Zilla
|
|
||||||
let l:potential_roots = [ 'Makefile.PL', 'Build.PL', 'dist.ini', '.git' ]
|
|
||||||
|
|
||||||
for l:root in l:potential_roots
|
|
||||||
let l:project_root = ale#path#FindNearestFile(a:buffer, l:root)
|
|
||||||
|
|
||||||
if !empty(l:project_root)
|
|
||||||
return fnamemodify(l:project_root . '/', ':p:h:h')
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
|
|
||||||
return fnamemodify(expand('#' . a:buffer . ':p:h'), ':p:h')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
call ale#Set('perl_languageserver_config', {})
|
call ale#Set('perl_languageserver_config', {})
|
||||||
|
|
||||||
function! s:get_lsp_config(buffer) abort
|
function! s:get_lsp_config(buffer) abort
|
||||||
@@ -39,5 +22,5 @@ call ale#linter#Define('perl', {
|
|||||||
\ 'executable': {b -> ale#Var(b, 'perl_perl_executable')},
|
\ 'executable': {b -> ale#Var(b, 'perl_perl_executable')},
|
||||||
\ 'command': '%e -MPerl::LanguageServer -ePerl::LanguageServer::run',
|
\ 'command': '%e -MPerl::LanguageServer -ePerl::LanguageServer::run',
|
||||||
\ 'lsp_config': {b -> s:get_lsp_config(b)},
|
\ 'lsp_config': {b -> s:get_lsp_config(b)},
|
||||||
\ 'project_root': function('ale_linters#perl#languageserver#GetProjectRoot'),
|
\ 'project_root': function('ale#handlers#perl#GetProjectRoot'),
|
||||||
\ })
|
\ })
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
" Author: rymdbar <https://rymdbar.x20.se/>
|
||||||
|
" Description: Perl Navigator Language Server
|
||||||
|
" See: https://github.com/bscan/PerlNavigator
|
||||||
|
|
||||||
|
call ale#Set('perl_perlnavigator_config', {})
|
||||||
|
call ale#Set('perl_perlnavigator_executable', 'perlnavigator')
|
||||||
|
|
||||||
|
call ale#linter#Define('perl', {
|
||||||
|
\ 'name': 'perlnavigator',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'perl_perlnavigator_executable')},
|
||||||
|
\ 'command': '%e --stdio',
|
||||||
|
\ 'lsp_config': {b -> ale#Var(b, 'perl_perlnavigator_config')},
|
||||||
|
\ 'project_root': function('ale#handlers#perl#GetProjectRoot'),
|
||||||
|
\ })
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for php files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('php')
|
||||||
@@ -7,6 +7,34 @@ call ale#Set('php_phpcs_options', '')
|
|||||||
call ale#Set('php_phpcs_executable', 'phpcs')
|
call ale#Set('php_phpcs_executable', 'phpcs')
|
||||||
call ale#Set('php_phpcs_use_global', get(g:, 'ale_use_global_executables', 0))
|
call ale#Set('php_phpcs_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
|
|
||||||
|
function! ale_linters#php#phpcs#GetCwd(buffer) abort
|
||||||
|
let l:result = ale#path#Dirname(ale_linters#php#phpcs#FindProjectRoot(a:buffer))
|
||||||
|
|
||||||
|
return empty(l:result) ? v:null : l:result
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#php#phpcs#FindProjectRoot(buffer) abort
|
||||||
|
let l:result = ale#path#FindNearestFile(a:buffer, 'phpcs.xml')
|
||||||
|
|
||||||
|
if empty(l:result)
|
||||||
|
let l:result = ale#path#FindNearestFile(a:buffer, 'phpcs.xml.dist')
|
||||||
|
endif
|
||||||
|
|
||||||
|
if empty(l:result)
|
||||||
|
let l:result = ale#path#FindNearestFile(a:buffer, '.phpcs.xml')
|
||||||
|
endif
|
||||||
|
|
||||||
|
if empty(l:result)
|
||||||
|
let l:result = ale#path#FindNearestFile(a:buffer, '.phpcs.xml.dist')
|
||||||
|
endif
|
||||||
|
|
||||||
|
if empty(l:result)
|
||||||
|
let l:result = ale#path#FindNearestFile(a:buffer, 'composer.json')
|
||||||
|
endif
|
||||||
|
|
||||||
|
return l:result
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#php#phpcs#GetCommand(buffer) abort
|
function! ale_linters#php#phpcs#GetCommand(buffer) abort
|
||||||
let l:standard = ale#Var(a:buffer, 'php_phpcs_standard')
|
let l:standard = ale#Var(a:buffer, 'php_phpcs_standard')
|
||||||
let l:standard_option = !empty(l:standard)
|
let l:standard_option = !empty(l:standard)
|
||||||
@@ -48,7 +76,7 @@ call ale#linter#Define('php', {
|
|||||||
\ 'vendor/bin/phpcs',
|
\ 'vendor/bin/phpcs',
|
||||||
\ 'phpcs'
|
\ 'phpcs'
|
||||||
\ ])},
|
\ ])},
|
||||||
\ 'cwd': '%s:h',
|
\ 'cwd': function('ale_linters#php#phpcs#GetCwd'),
|
||||||
\ 'command': function('ale_linters#php#phpcs#GetCommand'),
|
\ 'command': function('ale_linters#php#phpcs#GetCommand'),
|
||||||
\ 'callback': 'ale_linters#php#phpcs#Handle',
|
\ 'callback': 'ale_linters#php#phpcs#Handle',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ function! ale_linters#php#phpstan#GetCommand(buffer, version) abort
|
|||||||
|
|
||||||
let l:level = ale#Var(a:buffer, 'php_phpstan_level')
|
let l:level = ale#Var(a:buffer, 'php_phpstan_level')
|
||||||
|
|
||||||
|
if type(l:level) is v:t_number
|
||||||
|
let l:level = string(l:level)
|
||||||
|
endif
|
||||||
|
|
||||||
if empty(l:level) && empty(ale_linters#php#phpstan#FindConfigFile(a:buffer))
|
if empty(l:level) && empty(ale_linters#php#phpstan#FindConfigFile(a:buffer))
|
||||||
" if no configuration file is found, then use 4 as a default level
|
" if no configuration file is found, then use 4 as a default level
|
||||||
let l:level = '4'
|
let l:level = '4'
|
||||||
@@ -83,6 +87,10 @@ function! ale_linters#php#phpstan#FindConfigFile(buffer) abort
|
|||||||
let l:result = ale#path#FindNearestFile(a:buffer, 'phpstan.neon.dist')
|
let l:result = ale#path#FindNearestFile(a:buffer, 'phpstan.neon.dist')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if empty(l:result)
|
||||||
|
let l:result = ale#path#FindNearestFile(a:buffer, 'phpstan.dist.neon')
|
||||||
|
endif
|
||||||
|
|
||||||
return l:result
|
return l:result
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ function! ale_linters#php#tlint#GetCommand(buffer) abort
|
|||||||
let l:options = ale#Var(a:buffer, 'php_tlint_options')
|
let l:options = ale#Var(a:buffer, 'php_tlint_options')
|
||||||
|
|
||||||
return ale#node#Executable(a:buffer, l:executable)
|
return ale#node#Executable(a:buffer, l:executable)
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . ale#Pad(l:options)
|
||||||
\ . ' lint %s'
|
\ . ' lint %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
" Author: Cian Butler https://github.com/butlerx
|
" Author: Cian Butler https://github.com/butlerx
|
||||||
" Description: proselint for PO files
|
" Description: proselint for PO files
|
||||||
|
|
||||||
|
call ale#Set('proselint_executable', 'proselint')
|
||||||
|
|
||||||
call ale#linter#Define('po', {
|
call ale#linter#Define('po', {
|
||||||
\ 'name': 'proselint',
|
\ 'name': 'proselint',
|
||||||
\ 'executable': 'proselint',
|
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||||
\ 'command': 'proselint %t',
|
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
" Author: Daniel M. Capella https://github.com/polyzen
|
" Author: Daniel M. Capella https://github.com/polyzen
|
||||||
" Description: proselint for Pod files
|
" Description: proselint for Pod files
|
||||||
|
|
||||||
|
call ale#Set('proselint_executable', 'proselint')
|
||||||
|
|
||||||
call ale#linter#Define('pod', {
|
call ale#linter#Define('pod', {
|
||||||
\ 'name': 'proselint',
|
\ 'name': 'proselint',
|
||||||
\ 'executable': 'proselint',
|
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||||
\ 'command': 'proselint %t',
|
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ function! ale_linters#proto#buf_lint#GetCommand(buffer) abort
|
|||||||
|
|
||||||
return '%e lint'
|
return '%e lint'
|
||||||
\ . (!empty(l:config) ? ' --config=' . ale#Escape(l:config) : '')
|
\ . (!empty(l:config) ? ' --config=' . ale#Escape(l:config) : '')
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . ale#Pad(l:options)
|
||||||
\ . ' %s#include_package_files=true'
|
\ . ' %s#include_package_files=true'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for python files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('python')
|
||||||
@@ -87,7 +87,7 @@ function! ale_linters#python#flake8#GetCommand(buffer, version) abort
|
|||||||
let l:options = ale#Var(a:buffer, 'python_flake8_options')
|
let l:options = ale#Var(a:buffer, 'python_flake8_options')
|
||||||
|
|
||||||
return ale#Escape(l:executable) . l:exec_args
|
return ale#Escape(l:executable) . l:exec_args
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . ale#Pad(l:options)
|
||||||
\ . ' --format=default'
|
\ . ' --format=default'
|
||||||
\ . l:display_name_args . ' -'
|
\ . l:display_name_args . ' -'
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ call ale#Set('python_pyrefly_use_global', get(g:, 'ale_use_global_executables',
|
|||||||
call ale#Set('python_pyrefly_auto_pipenv', 0)
|
call ale#Set('python_pyrefly_auto_pipenv', 0)
|
||||||
call ale#Set('python_pyrefly_auto_poetry', 0)
|
call ale#Set('python_pyrefly_auto_poetry', 0)
|
||||||
call ale#Set('python_pyrefly_auto_uv', 0)
|
call ale#Set('python_pyrefly_auto_uv', 0)
|
||||||
|
call ale#Set('python_pyrefly_config', {'python': {'pyrefly': {'displayTypeErrors': 'force-on'}}})
|
||||||
|
|
||||||
function! ale_linters#python#pyrefly#GetExecutable(buffer) abort
|
function! ale_linters#python#pyrefly#GetExecutable(buffer) abort
|
||||||
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pyrefly_auto_pipenv'))
|
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pyrefly_auto_pipenv'))
|
||||||
@@ -54,4 +55,5 @@ call ale#linter#Define('python', {
|
|||||||
\ 'project_root': function('ale#python#FindProjectRoot'),
|
\ 'project_root': function('ale#python#FindProjectRoot'),
|
||||||
\ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
|
\ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
|
||||||
\ 'cwd': function('ale_linters#python#pyrefly#GetCwd'),
|
\ 'cwd': function('ale_linters#python#pyrefly#GetCwd'),
|
||||||
|
\ 'lsp_config': {b -> ale#Var(b, 'python_pyrefly_config')},
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
call ale#Set('python_pyright_use_global', get(g:, 'ale_use_global_executables', 0))
|
call ale#Set('python_pyright_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
call ale#Set('python_pyright_executable', 'pyright-langserver')
|
call ale#Set('python_pyright_executable', 'pyright-langserver')
|
||||||
|
call ale#Set('python_pyright_options', '--stdio')
|
||||||
call ale#Set('python_pyright_config', {})
|
call ale#Set('python_pyright_config', {})
|
||||||
call ale#Set('python_pyright_auto_pipenv', 0)
|
call ale#Set('python_pyright_auto_pipenv', 0)
|
||||||
call ale#Set('python_pyright_auto_poetry', 0)
|
call ale#Set('python_pyright_auto_poetry', 0)
|
||||||
@@ -79,7 +80,8 @@ function! ale_linters#python#pyright#GetCommand(buffer) abort
|
|||||||
let l:env_string = ale#python#AutoVirtualenvEnvString(a:buffer)
|
let l:env_string = ale#python#AutoVirtualenvEnvString(a:buffer)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return l:env_string . ale#Escape(l:executable) . l:exec_args . ' --stdio'
|
return l:env_string . ale#Escape(l:executable) . l:exec_args .
|
||||||
|
\ ale#Pad(ale#Var(a:buffer, 'python_pyright_options'))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('python', {
|
call ale#linter#Define('python', {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ call ale#Set('python_ruff_change_directory', 1)
|
|||||||
call ale#Set('python_ruff_auto_pipenv', 0)
|
call ale#Set('python_ruff_auto_pipenv', 0)
|
||||||
call ale#Set('python_ruff_auto_poetry', 0)
|
call ale#Set('python_ruff_auto_poetry', 0)
|
||||||
call ale#Set('python_ruff_auto_uv', 0)
|
call ale#Set('python_ruff_auto_uv', 0)
|
||||||
|
call ale#Set('python_ruff_human_readable', 0)
|
||||||
|
|
||||||
call ale#fix#registry#Add('ruff',
|
call ale#fix#registry#Add('ruff',
|
||||||
\ 'ale#fixers#ruff#Fix',
|
\ 'ale#fixers#ruff#Fix',
|
||||||
@@ -113,7 +114,7 @@ function! ale_linters#python#ruff#Handle(buffer, lines) abort
|
|||||||
\ 'col': l:item.location.column,
|
\ 'col': l:item.location.column,
|
||||||
\ 'end_lnum': l:item.end_location.row,
|
\ 'end_lnum': l:item.end_location.row,
|
||||||
\ 'end_col': l:item.end_location.column - 1,
|
\ 'end_col': l:item.end_location.column - 1,
|
||||||
\ 'code': l:item.code,
|
\ 'code': ale#Var(a:buffer, 'python_ruff_human_readable') ? l:item.name : l:item.code,
|
||||||
\ 'text': l:item.message,
|
\ 'text': l:item.message,
|
||||||
\ 'type': l:item.code =~? '\vE\d+' ? 'E' : 'W',
|
\ 'type': l:item.code =~? '\vE\d+' ? 'E' : 'W',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
" Author: w0rp <dev@w0rp.com>
|
||||||
|
" Description: Astral's Python type checker and language server
|
||||||
|
|
||||||
|
call ale#Set('python_ty_executable', 'ty')
|
||||||
|
call ale#Set('python_ty_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||||
|
call ale#Set('python_ty_auto_pipenv', 0)
|
||||||
|
call ale#Set('python_ty_auto_poetry', 0)
|
||||||
|
call ale#Set('python_ty_auto_uv', 0)
|
||||||
|
call ale#Set('python_ty_config', {})
|
||||||
|
|
||||||
|
function! ale_linters#python#ty#GetExecutable(buffer) abort
|
||||||
|
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_ty_auto_pipenv'))
|
||||||
|
\ && ale#python#PipenvPresent(a:buffer)
|
||||||
|
return 'pipenv'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_ty_auto_poetry'))
|
||||||
|
\ && ale#python#PoetryPresent(a:buffer)
|
||||||
|
return 'poetry'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_ty_auto_uv'))
|
||||||
|
\ && ale#python#UvPresent(a:buffer)
|
||||||
|
return 'uv'
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ale#python#FindExecutable(a:buffer, 'python_ty', ['ty'])
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Force the cwd of the server to be the same as the project root.
|
||||||
|
function! ale_linters#python#ty#GetCwd(buffer) abort
|
||||||
|
let l:fake_linter = {
|
||||||
|
\ 'name': 'ty',
|
||||||
|
\ 'project_root': function('ale#python#FindProjectRoot'),
|
||||||
|
\}
|
||||||
|
let l:root = ale#lsp_linter#FindProjectRoot(a:buffer, l:fake_linter)
|
||||||
|
|
||||||
|
return !empty(l:root) ? l:root : v:null
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#python#ty#GetCommand(buffer) abort
|
||||||
|
let l:executable = ale_linters#python#ty#GetExecutable(a:buffer)
|
||||||
|
let l:exec_args = [
|
||||||
|
\ ale#Escape(l:executable),
|
||||||
|
\]
|
||||||
|
\ + (l:executable =~? '\(pipenv\|poetry\|uv\)$' ? ['run', 'ty'] : [])
|
||||||
|
\ + [
|
||||||
|
\ 'server',
|
||||||
|
\]
|
||||||
|
|
||||||
|
return join(l:exec_args, ' ')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('python', {
|
||||||
|
\ 'name': 'ty',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': function('ale_linters#python#ty#GetExecutable'),
|
||||||
|
\ 'cwd': function('ale_linters#python#ty#GetCwd'),
|
||||||
|
\ 'command': function('ale_linters#python#ty#GetCommand'),
|
||||||
|
\ 'project_root': function('ale#python#FindProjectRoot'),
|
||||||
|
\ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
|
||||||
|
\ 'lsp_config': {b -> ale#Var(b, 'python_ty_config')},
|
||||||
|
\})
|
||||||
@@ -12,7 +12,7 @@ function! ale_linters#rego#opacheck#GetCommand(buffer) abort
|
|||||||
|
|
||||||
return ale#Escape(ale_linters#rego#opacheck#GetExecutable(a:buffer))
|
return ale#Escape(ale_linters#rego#opacheck#GetExecutable(a:buffer))
|
||||||
\ . ' check %s:h --format json '
|
\ . ' check %s:h --format json '
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . ale#Pad(l:options)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#rego#opacheck#Handle(buffer, lines) abort
|
function! ale_linters#rego#opacheck#Handle(buffer, lines) abort
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
" Author: John Jackson <john@johnridesa.bike>
|
||||||
|
" Description: The official language server for ReScript.
|
||||||
|
|
||||||
|
call ale#Set('rescript_language_server_executable', 'rescript-language-server')
|
||||||
|
call ale#Set(
|
||||||
|
\ 'rescript_language_server_use_global',
|
||||||
|
\ get(g:, 'ale_use_global_executables', v:true),
|
||||||
|
\ )
|
||||||
|
|
||||||
|
function! s:GetProjectRoot(buffer) abort
|
||||||
|
let l:config_file = ale#path#FindNearestFile(a:buffer, 'rescript.json')
|
||||||
|
|
||||||
|
return !empty(l:config_file) ? fnamemodify(l:config_file, ':h') : ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('rescript', {
|
||||||
|
\ 'name': 'rescript_language_server',
|
||||||
|
\ 'lsp': 'stdio',
|
||||||
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'rescript_language_server', [
|
||||||
|
\ 'node_modules/.bin/rescript-language-server'
|
||||||
|
\ ])},
|
||||||
|
\ 'command': '%e --stdio',
|
||||||
|
\ 'project_root': function('s:GetProjectRoot'),
|
||||||
|
\})
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
" Author: Daniel M. Capella https://github.com/polyzen
|
" Author: Daniel M. Capella https://github.com/polyzen
|
||||||
" Description: proselint for reStructuredText files
|
" Description: proselint for reStructuredrst files
|
||||||
|
|
||||||
|
call ale#Set('proselint_executable', 'proselint')
|
||||||
|
|
||||||
call ale#linter#Define('rst', {
|
call ale#linter#Define('rst', {
|
||||||
\ 'name': 'proselint',
|
\ 'name': 'proselint',
|
||||||
\ 'executable': 'proselint',
|
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||||
\ 'command': 'proselint %t',
|
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
" Author: John Nduli https://github.com/jnduli
|
" Authors:
|
||||||
" Description: Rstcheck for reStructuredText files
|
" John Nduli https://github.com/jnduli,
|
||||||
|
" Michael Goerz https://github.com/goerz
|
||||||
|
|
||||||
|
call ale#Set('rst_rstcheck_executable', 'rstcheck')
|
||||||
|
call ale#Set('rst_rstcheck_options', '')
|
||||||
|
|
||||||
|
function! ale_linters#rst#rstcheck#GetExecutable(buffer) abort
|
||||||
|
return ale#Var(a:buffer, 'rst_rstcheck_executable')
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#rst#rstcheck#Handle(buffer, lines) abort
|
function! ale_linters#rst#rstcheck#Handle(buffer, lines) abort
|
||||||
" matches: 'bad_rst.rst:1: (SEVERE/4) Title overline & underline
|
" matches: 'bad_rst.rst:1: (SEVERE/4) Title overline & underline
|
||||||
@@ -21,11 +29,35 @@ function! ale_linters#rst#rstcheck#Handle(buffer, lines) abort
|
|||||||
return l:output
|
return l:output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#rst#rstcheck#GetCommand(buffer, version) abort
|
||||||
|
let l:executable = ale_linters#rst#rstcheck#GetExecutable(a:buffer)
|
||||||
|
let l:options = ale#Var(a:buffer, 'rst_rstcheck_options')
|
||||||
|
let l:dir = expand('#' . a:buffer . ':p:h')
|
||||||
|
let l:exec_args = ale#Pad(l:options)
|
||||||
|
|
||||||
|
if ale#semver#GTE(a:version, [3, 4, 0])
|
||||||
|
let l:exec_args .= ' --config ' . ale#Escape(l:dir)
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ale#Escape(l:executable)
|
||||||
|
\ . l:exec_args
|
||||||
|
\ . ' %t'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#rst#rstcheck#GetCommandWithVersionCheck(buffer) abort
|
||||||
|
return ale#semver#RunWithVersionCheck(
|
||||||
|
\ a:buffer,
|
||||||
|
\ ale_linters#rst#rstcheck#GetExecutable(a:buffer),
|
||||||
|
\ '%e --version',
|
||||||
|
\ function('ale_linters#rst#rstcheck#GetCommand')
|
||||||
|
\)
|
||||||
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('rst', {
|
call ale#linter#Define('rst', {
|
||||||
\ 'name': 'rstcheck',
|
\ 'name': 'rstcheck',
|
||||||
\ 'executable': 'rstcheck',
|
\ 'executable': 'rstcheck',
|
||||||
\ 'cwd': '%s:h',
|
\ 'cwd': '%s:h',
|
||||||
\ 'command': 'rstcheck %t',
|
\ 'command': function('ale_linters#rst#rstcheck#GetCommandWithVersionCheck'),
|
||||||
\ 'callback': 'ale_linters#rst#rstcheck#Handle',
|
\ 'callback': 'ale_linters#rst#rstcheck#Handle',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for ruby files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('ruby')
|
||||||
@@ -8,7 +8,10 @@ call ale#Set('ruby_solargraph_executable', 'solargraph')
|
|||||||
call ale#Set('ruby_solargraph_options', {})
|
call ale#Set('ruby_solargraph_options', {})
|
||||||
|
|
||||||
function! ale_linters#ruby#solargraph#GetCommand(buffer) abort
|
function! ale_linters#ruby#solargraph#GetCommand(buffer) abort
|
||||||
return '%e' . ale#Pad('stdio')
|
let l:executable = ale#Var(a:buffer, 'ruby_solargraph_executable')
|
||||||
|
|
||||||
|
return ale#ruby#EscapeExecutable(l:executable, 'solargraph')
|
||||||
|
\ . ale#Pad('stdio')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('ruby', {
|
call ale#linter#Define('ruby', {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ function! ale_linters#ruby#sorbet#GetCommand(buffer) abort
|
|||||||
|
|
||||||
return ale#ruby#EscapeExecutable(l:executable, 'srb')
|
return ale#ruby#EscapeExecutable(l:executable, 'srb')
|
||||||
\ . ' tc'
|
\ . ' tc'
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . ale#Pad(l:options)
|
||||||
\ . ' --lsp'
|
\ . ' --lsp'
|
||||||
\ . (l:enable_watchman ? '' : ' --disable-watchman')
|
\ . (l:enable_watchman ? '' : ' --disable-watchman')
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for rust files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('rust')
|
||||||
@@ -20,7 +20,7 @@ function! ale_linters#rust#rustc#RustcCommand(buffer) abort
|
|||||||
let l:options = ale#Var(a:buffer, 'rust_rustc_options')
|
let l:options = ale#Var(a:buffer, 'rust_rustc_options')
|
||||||
|
|
||||||
return 'rustc --error-format=json'
|
return 'rustc --error-format=json'
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . ale#Pad(l:options)
|
||||||
\ . l:dependencies . ' -'
|
\ . l:dependencies . ' -'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ function! ale_linters#sass#sasslint#GetCommand(buffer) abort
|
|||||||
let l:options = ale#Var(a:buffer, 'sass_sasslint_options')
|
let l:options = ale#Var(a:buffer, 'sass_sasslint_options')
|
||||||
|
|
||||||
return ale#node#Executable(a:buffer, l:executable)
|
return ale#node#Executable(a:buffer, l:executable)
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . ale#Pad(l:options)
|
||||||
\ . ' -v -q -f compact %t'
|
\ . ' -v -q -f compact %t'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,6 @@ call ale#linter#Define('sass', {
|
|||||||
\ 'executable': {b -> ale#path#FindExecutable(b, 'sass_stylelint', [
|
\ 'executable': {b -> ale#path#FindExecutable(b, 'sass_stylelint', [
|
||||||
\ 'node_modules/.bin/stylelint',
|
\ 'node_modules/.bin/stylelint',
|
||||||
\ ])},
|
\ ])},
|
||||||
\ 'command': '%e --stdin-filename %s',
|
\ 'command': '%e --no-color --stdin-filename %s',
|
||||||
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
|
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
|
||||||
\})
|
\})
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for scala files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('scala')
|
||||||
@@ -16,7 +16,7 @@ function! ale_linters#scss#sasslint#GetCommand(buffer) abort
|
|||||||
let l:options = ale#Var(a:buffer, 'scss_sasslint_options')
|
let l:options = ale#Var(a:buffer, 'scss_sasslint_options')
|
||||||
|
|
||||||
return ale#node#Executable(a:buffer, l:executable)
|
return ale#node#Executable(a:buffer, l:executable)
|
||||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
\ . ale#Pad(l:options)
|
||||||
\ . ' -v -q -f compact %t'
|
\ . ' -v -q -f compact %t'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ call ale#Set('scss_stylelint_use_global', get(g:, 'ale_use_global_executables',
|
|||||||
|
|
||||||
function! ale_linters#scss#stylelint#GetCommand(buffer) abort
|
function! ale_linters#scss#stylelint#GetCommand(buffer) abort
|
||||||
return '%e ' . ale#Pad(ale#Var(a:buffer, 'scss_stylelint_options'))
|
return '%e ' . ale#Pad(ale#Var(a:buffer, 'scss_stylelint_options'))
|
||||||
\ . ' --stdin-filename %s'
|
\ . ' --no-color --stdin-filename %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('scss', {
|
call ale#linter#Define('scss', {
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for sh files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('sh')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for solidity files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('solidity')
|
||||||
@@ -7,7 +7,7 @@ call ale#Set('stylus_stylelint_use_global', get(g:, 'ale_use_global_executables'
|
|||||||
function! ale_linters#stylus#stylelint#GetCommand(buffer) abort
|
function! ale_linters#stylus#stylelint#GetCommand(buffer) abort
|
||||||
return '%e'
|
return '%e'
|
||||||
\ . ale#Pad(ale#Var(a:buffer, 'stylus_stylelint_options'))
|
\ . ale#Pad(ale#Var(a:buffer, 'stylus_stylelint_options'))
|
||||||
\ . ' --stdin-filename %s'
|
\ . ' --no-color --stdin-filename %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('stylus', {
|
call ale#linter#Define('stylus', {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ call ale#Set('sugarss_stylelint_use_global', get(g:, 'ale_use_global_executables
|
|||||||
function! ale_linters#sugarss#stylelint#GetCommand(buffer) abort
|
function! ale_linters#sugarss#stylelint#GetCommand(buffer) abort
|
||||||
return '%e ' . ale#Pad(ale#Var(a:buffer, 'sugarss_stylelint_options'))
|
return '%e ' . ale#Pad(ale#Var(a:buffer, 'sugarss_stylelint_options'))
|
||||||
\ . ' --syntax=sugarss'
|
\ . ' --syntax=sugarss'
|
||||||
\ . ' --stdin-filename %s'
|
\ . ' --no-color --stdin-filename %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('sugarss', {
|
call ale#linter#Define('sugarss', {
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||||
|
" Description: astgrep for swift files
|
||||||
|
|
||||||
|
call ale#handlers#astgrep#Define('swift')
|
||||||
@@ -25,6 +25,10 @@ endfunction
|
|||||||
function! ale_linters#terraform#terraform_ls#GetProjectRoot(buffer) abort
|
function! ale_linters#terraform#terraform_ls#GetProjectRoot(buffer) abort
|
||||||
let l:tf_dir = ale#path#FindNearestDirectory(a:buffer, '.terraform')
|
let l:tf_dir = ale#path#FindNearestDirectory(a:buffer, '.terraform')
|
||||||
|
|
||||||
|
if empty(l:tf_dir)
|
||||||
|
let l:tf_dir = ale#path#FindNearestDirectory(a:buffer, '.')
|
||||||
|
endif
|
||||||
|
|
||||||
return !empty(l:tf_dir) ? fnamemodify(l:tf_dir, ':h:h') : ''
|
return !empty(l:tf_dir) ? fnamemodify(l:tf_dir, ':h:h') : ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
" Description: trivy for Terraform files
|
||||||
|
"
|
||||||
|
" See: https://www.terraform.io/
|
||||||
|
" https://github.com/aquasecurity/trivy
|
||||||
|
|
||||||
|
call ale#Set('terraform_trivy_options', '')
|
||||||
|
call ale#Set('terraform_trivy_executable', 'trivy')
|
||||||
|
|
||||||
|
function! ale_linters#terraform#trivy#Handle(buffer, lines) abort
|
||||||
|
let l:output = []
|
||||||
|
let l:json = ale#util#FuzzyJSONDecode(a:lines, {})
|
||||||
|
|
||||||
|
if empty(get(l:json, 'Results'))
|
||||||
|
return l:output
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:fname = expand('#' . a:buffer . ':t')
|
||||||
|
|
||||||
|
for l:result in get(l:json, 'Results', [])
|
||||||
|
for l:misconfig in get(l:result, 'Misconfigurations', [])
|
||||||
|
let l:severity = get(l:misconfig, 'Severity', 'MEDIUM')
|
||||||
|
|
||||||
|
if l:severity is# 'LOW'
|
||||||
|
let l:type = 'I'
|
||||||
|
elseif l:severity is# 'CRITICAL' || l:severity is# 'HIGH'
|
||||||
|
let l:type = 'E'
|
||||||
|
else
|
||||||
|
let l:type = 'W'
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:cause = get(l:misconfig, 'CauseMetadata', {})
|
||||||
|
let l:title = get(l:misconfig, 'Title', '')
|
||||||
|
let l:id = get(l:misconfig, 'ID', '')
|
||||||
|
let l:desc = get(l:misconfig, 'Description', '')
|
||||||
|
|
||||||
|
" Module findings store the location in the caller's file
|
||||||
|
" in CauseMetadata.Occurrences. Use those when available.
|
||||||
|
let l:occurrences = get(l:cause, 'Occurrences', [])
|
||||||
|
|
||||||
|
if !empty(l:occurrences)
|
||||||
|
for l:occurrence in l:occurrences
|
||||||
|
if get(l:occurrence, 'Filename', '') is# l:fname
|
||||||
|
let l:loc = get(l:occurrence, 'Location', {})
|
||||||
|
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': get(l:loc, 'StartLine', 1),
|
||||||
|
\ 'end_lnum': get(l:loc, 'EndLine', get(l:loc, 'StartLine', 1)),
|
||||||
|
\ 'text': l:title . ' [' . l:id . ']',
|
||||||
|
\ 'detail': l:id . ': ' . l:title . "\n" . l:desc,
|
||||||
|
\ 'code': l:id,
|
||||||
|
\ 'type': l:type,
|
||||||
|
\})
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
elseif get(l:result, 'Target', '') is# l:fname
|
||||||
|
call add(l:output, {
|
||||||
|
\ 'lnum': get(l:cause, 'StartLine', 1),
|
||||||
|
\ 'end_lnum': get(l:cause, 'EndLine', get(l:cause, 'StartLine', 1)),
|
||||||
|
\ 'text': l:title . ' [' . l:id . ']',
|
||||||
|
\ 'detail': l:id . ': ' . l:title . "\n" . l:desc,
|
||||||
|
\ 'code': l:id,
|
||||||
|
\ 'type': l:type,
|
||||||
|
\})
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return l:output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Construct command arguments to trivy with `terraform_trivy_options`.
|
||||||
|
function! ale_linters#terraform#trivy#GetCommand(buffer) abort
|
||||||
|
let l:cmd = '%e config --format json'
|
||||||
|
|
||||||
|
let l:opts = ale#Var(a:buffer, 'terraform_trivy_options')
|
||||||
|
|
||||||
|
if !empty(l:opts)
|
||||||
|
let l:cmd .= ' ' . l:opts
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:cmd .= ' .'
|
||||||
|
|
||||||
|
return l:cmd
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call ale#linter#Define('terraform', {
|
||||||
|
\ 'name': 'trivy',
|
||||||
|
\ 'executable': {b -> ale#Var(b, 'terraform_trivy_executable')},
|
||||||
|
\ 'cwd': '%s:h',
|
||||||
|
\ 'command': function('ale_linters#terraform#trivy#GetCommand'),
|
||||||
|
\ 'callback': 'ale_linters#terraform#trivy#Handle',
|
||||||
|
\})
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user