mirror of
https://github.com/dense-analysis/ale.git
synced 2026-08-03 22:48:30 +08:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b0f8d91bc |
@@ -0,0 +1,62 @@
|
||||
---
|
||||
# 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 ftp://ftp.vim.org/pub/vim/pc/vim80-586w32.zip `
|
||||
-OutFile C:\vim.zip
|
||||
[IO.Compression.ZipFile]::ExtractToDirectory('C:\vim.zip', 'C:\vim')
|
||||
Invoke-WebRequest ftp://ftp.vim.org/pub/vim/pc/vim80-586rt.zip `
|
||||
-OutFile C:\rt.zip
|
||||
[IO.Compression.ZipFile]::ExtractToDirectory('C:\rt.zip', 'C:\vim')
|
||||
}
|
||||
# Clone Vader and check out the commit we want
|
||||
- ps: >-
|
||||
if (!(Test-Path -Path C:\vader)){
|
||||
git clone https://github.com/junegunn/vader.vim C:\vader 2> $null
|
||||
cd C:\vader
|
||||
git checkout -qf c6243dd81c98350df4dec608fa972df98fa2a3af 2> $null
|
||||
}
|
||||
|
||||
test_script:
|
||||
- cd C:\testplugin
|
||||
- 'C:\vim\vim\vim80\vim.exe -u test\vimrc "+Vader!
|
||||
test/*.vader test/*/*.vader test/*/*/*.vader test/*/*/*.vader"'
|
||||
@@ -1,9 +0,0 @@
|
||||
# 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
|
||||
@@ -1,90 +0,0 @@
|
||||
# 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",
|
||||
],
|
||||
)
|
||||
@@ -1 +0,0 @@
|
||||
* @w0rp
|
||||
+10
-60
@@ -11,10 +11,9 @@ on: # yamllint disable-line rule:truthy
|
||||
|
||||
jobs:
|
||||
build_image:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build docker run image
|
||||
shell: bash
|
||||
env:
|
||||
@@ -22,67 +21,18 @@ jobs:
|
||||
DOCKER_HUB_PASS: ${{ secrets.DOCKER_HUB_PASS }}
|
||||
run: ./run-tests --build-image
|
||||
test_ale:
|
||||
name: ${{ matrix.name }}
|
||||
needs: build_image
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- name: Lint
|
||||
test-args: --linters-only
|
||||
- name: Lua
|
||||
test-args: --lua-only
|
||||
- name: Neovim 0.10 Linux
|
||||
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
|
||||
vim-version:
|
||||
- '--vim-80-only'
|
||||
- '--vim-90-only'
|
||||
- '--neovim-07-only'
|
||||
- '--neovim-08-only'
|
||||
- '--lua-only'
|
||||
- '--linters-only'
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run tests
|
||||
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
|
||||
run: ./run-tests -v ${{ matrix.vim-version }}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
read_globals = {
|
||||
'vim',
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
# 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.
|
||||
+10
-60
@@ -1,78 +1,28 @@
|
||||
#############################################################################
|
||||
# Base testbed image copied from:
|
||||
# https://github.com/Vimjas/vim-testbed/blob/master/Dockerfile
|
||||
FROM alpine:3.23 as testbed
|
||||
ARG TESTBED_VIM_VERSION=24
|
||||
|
||||
RUN apk --no-cache upgrade
|
||||
FROM testbed/vim:${TESTBED_VIM_VERSION}
|
||||
|
||||
ENV PACKAGES="\
|
||||
build-base \
|
||||
linux-headers \
|
||||
cmake \
|
||||
coreutils \
|
||||
msgpack-c-dev \
|
||||
libtermkey-dev \
|
||||
libvterm-dev \
|
||||
unibilium-dev \
|
||||
ncurses-dev \
|
||||
lua5.1 \
|
||||
lua5.1-dev \
|
||||
lua5.1-lpeg \
|
||||
lua5.1-mpack \
|
||||
lua5.1-busted \
|
||||
bash \
|
||||
git \
|
||||
grep \
|
||||
sed \
|
||||
python2 \
|
||||
python3 \
|
||||
py3-pip \
|
||||
gettext-dev \
|
||||
libuv-dev \
|
||||
libluv \
|
||||
lua-luv-dev \
|
||||
utf8proc-dev \
|
||||
vint \
|
||||
curl \
|
||||
gettext-dev \
|
||||
libtool \
|
||||
ninja \
|
||||
tree-sitter-dev \
|
||||
grep \
|
||||
sed \
|
||||
"
|
||||
|
||||
RUN apk --update add $PACKAGES && \
|
||||
rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
|
||||
|
||||
RUN adduser -h /home/vimtest -s /bin/sh -D -u 8465 vimtest
|
||||
RUN install_vim -tag v8.0.0027 -build \
|
||||
-tag v9.0.0297 -build \
|
||||
-tag neovim:v0.7.0 -build \
|
||||
-tag neovim:v0.8.0 -build
|
||||
|
||||
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 pip install vim-vint==0.3.21
|
||||
|
||||
RUN git clone https://github.com/junegunn/vader.vim vader && \
|
||||
cd vader && git checkout c6243dd81c98350df4dec608fa972df98fa2a3af
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# 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://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://ci.appveyor.com/project/dense-analysis/ale) [](https://discord.gg/5zFD6pQxDk)
|
||||
|
||||

|
||||
|
||||
ALE (Asynchronous Lint Engine) is a plugin providing linting (syntax checking
|
||||
and semantic errors) in Neovim 0.7.0+ and Vim 8.2+ while you edit your text files,
|
||||
and semantic errors) in Neovim 0.7.0+ and Vim 8.0+ while you edit your text files,
|
||||
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>
|
||||
@@ -61,14 +61,6 @@ linting and fixing of code in Vim. ALE offers the following.
|
||||
* Windows support
|
||||
* Well-integrated with other plugins
|
||||
|
||||
## Sponsorship
|
||||
|
||||
If you would like to donate to Dense Analysis to say thank you for ALE, please
|
||||
consider visiting our [Sponsorship page](https://denseanalysis.org/sponsors/).
|
||||
Funds will be used to pay for our hosting fees and research. Whilst visiting our
|
||||
site, please feel free to make use of our educational resources and other
|
||||
recommended tools.
|
||||
|
||||
## Supported Languages and Tools
|
||||
|
||||
ALE supports a wide variety of languages and tools. See the
|
||||
|
||||
@@ -2,44 +2,11 @@
|
||||
" Description: ansible-lint for ansible-yaml files
|
||||
|
||||
call ale#Set('ansible_ansible_lint_executable', 'ansible-lint')
|
||||
call ale#Set('ansible_ansible_lint_auto_pipenv', 0)
|
||||
call ale#Set('ansible_ansible_lint_auto_poetry', 0)
|
||||
call ale#Set('ansible_ansible_lint_auto_uv', 0)
|
||||
call ale#Set('ansible_ansible_lint_change_directory', 1)
|
||||
|
||||
function! ale_linters#ansible#ansible_lint#GetExecutable(buffer) abort
|
||||
if (ale#Var(a:buffer, 'python_auto_pipenv')
|
||||
\ || ale#Var(a:buffer, 'ansible_ansible_lint_auto_pipenv'))
|
||||
\ && ale#python#PipenvPresent(a:buffer)
|
||||
return 'pipenv'
|
||||
endif
|
||||
|
||||
if (ale#Var(a:buffer, 'python_auto_poetry')
|
||||
\ || ale#Var(a:buffer, 'ansible_ansible_lint_auto_poetry'))
|
||||
\ && ale#python#PoetryPresent(a:buffer)
|
||||
return 'poetry'
|
||||
endif
|
||||
|
||||
if (ale#Var(a:buffer, 'python_auto_uv')
|
||||
\ || ale#Var(a:buffer, 'ansible_ansible_lint_auto_uv'))
|
||||
\ && ale#python#UvPresent(a:buffer)
|
||||
return 'uv'
|
||||
endif
|
||||
|
||||
return ale#Var(a:buffer, 'ansible_ansible_lint_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#ansible#ansible_lint#GetCwd(buffer) abort
|
||||
if ale#Var(a:buffer, 'ansible_ansible_lint_change_directory')
|
||||
" Run from project root if found, else from buffer dir.
|
||||
let l:project_root = ale#python#FindProjectRoot(a:buffer)
|
||||
|
||||
return !empty(l:project_root) ? l:project_root : '%s:h'
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! ale_linters#ansible#ansible_lint#Handle(buffer, version, lines) abort
|
||||
for l:line in a:lines[:10]
|
||||
if match(l:line, '^Traceback') >= 0
|
||||
@@ -136,50 +103,28 @@ function! ale_linters#ansible#ansible_lint#Handle(buffer, version, lines) abort
|
||||
endfunction
|
||||
|
||||
function! ale_linters#ansible#ansible_lint#GetCommand(buffer, version) abort
|
||||
let l:executable = ale_linters#ansible#ansible_lint#GetExecutable(a:buffer)
|
||||
|
||||
let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
|
||||
\ ? ' run ansible-lint'
|
||||
\ : ''
|
||||
|
||||
let l:opts_map = {
|
||||
\ '>=6.0.0': ' --nocolor -f json -x yaml %s',
|
||||
\ '>=5.0.0': ' --nocolor --parseable-severity -x yaml %s',
|
||||
\ '<5.0.0': ' --nocolor -p %t'
|
||||
let l:commands = {
|
||||
\ '>=6.0.0': '%e --nocolor -f json -x yaml %s',
|
||||
\ '>=5.0.0': '%e --nocolor --parseable-severity -x yaml %s',
|
||||
\ '<5.0.0': '%e --nocolor -p %t'
|
||||
\}
|
||||
|
||||
let l:cmd_opts = ale#semver#GTE(a:version, [6, 0]) ? l:opts_map['>=6.0.0'] :
|
||||
\ ale#semver#GTE(a:version, [5, 0]) ? l:opts_map['>=5.0.0'] :
|
||||
\ l:opts_map['<5.0.0']
|
||||
|
||||
let l:command = ale#Escape(l:executable) . l:exec_args . l:cmd_opts
|
||||
let l:command = ale#semver#GTE(a:version, [6, 0]) ? l:commands['>=6.0.0'] :
|
||||
\ ale#semver#GTE(a:version, [5, 0]) ? l:commands['>=5.0.0'] :
|
||||
\ l:commands['<5.0.0']
|
||||
|
||||
return l:command
|
||||
endfunction
|
||||
|
||||
function! ale_linters#ansible#ansible_lint#RunWithVersionCheck(buffer) abort
|
||||
let l:executable = ale_linters#ansible#ansible_lint#GetExecutable(a:buffer)
|
||||
|
||||
let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
|
||||
\ ? ' run ansible-lint'
|
||||
\ : ''
|
||||
|
||||
let l:command = ale#Escape(l:executable) . l:exec_args . ' --version'
|
||||
|
||||
return ale#semver#RunWithVersionCheck(
|
||||
\ a:buffer,
|
||||
\ l:executable,
|
||||
\ l:command,
|
||||
\ function('ale_linters#ansible#ansible_lint#GetCommand'),
|
||||
\)
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('ansible', {
|
||||
\ 'name': 'ansible_lint',
|
||||
\ 'aliases': ['ansible', 'ansible-lint'],
|
||||
\ 'executable': function('ale_linters#ansible#ansible_lint#GetExecutable'),
|
||||
\ 'cwd': function('ale_linters#ansible#ansible_lint#GetCwd'),
|
||||
\ 'command': function('ale_linters#ansible#ansible_lint#RunWithVersionCheck'),
|
||||
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
|
||||
\ buffer,
|
||||
\ ale_linters#ansible#ansible_lint#GetExecutable(buffer),
|
||||
\ '%e --version',
|
||||
\ function('ale_linters#ansible#ansible_lint#GetCommand'),
|
||||
\ )},
|
||||
\ 'lint_file': 1,
|
||||
\ 'callback': {buffer, lines -> ale#semver#RunWithVersionCheck(
|
||||
\ buffer,
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
" Author: Daniel M. Capella https://github.com/polyzen
|
||||
" Description: proselint for AsciiDoc files
|
||||
|
||||
call ale#Set('proselint_executable', 'proselint')
|
||||
|
||||
call ale#linter#Define('asciidoc', {
|
||||
\ 'name': 'proselint',
|
||||
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||
\ 'executable': 'proselint',
|
||||
\ 'command': 'proselint %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
" Author: rhysd https://rhysd.github.io
|
||||
" Description: Redpen, a proofreading tool (http://redpen.cc)
|
||||
|
||||
call ale#handlers#redpen#DefineLinter('asciidoc')
|
||||
call ale#linter#Define('asciidoc', {
|
||||
\ 'name': 'redpen',
|
||||
\ 'executable': 'redpen',
|
||||
\ 'command': 'redpen -f asciidoc -r json %t',
|
||||
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
|
||||
\})
|
||||
|
||||
@@ -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 %s:h'
|
||||
\ . '-iquote %s:h'
|
||||
\ . ' ' . ale#Var(a:buffer, 'asm_gcc_options') . ' -'
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
" 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'),
|
||||
\})
|
||||
@@ -5,14 +5,6 @@ call ale#Set('bitbake_oelint_adv_executable', 'oelint-adv')
|
||||
call ale#Set('bitbake_oelint_adv_options', '')
|
||||
call ale#Set('bitbake_oelint_adv_config', '.oelint.cfg')
|
||||
|
||||
function! ale_linters#bitbake#oelint_adv#StripAnsiCodes(line) abort
|
||||
return substitute(a:line, '\e\[[0-9;]\+[mK]', '', 'g')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#bitbake#oelint_adv#RemoveBranch(line) abort
|
||||
return substitute(a:line, ' \[branch:.*', '', 'g')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#bitbake#oelint_adv#Command(buffer) abort
|
||||
let l:config_file = ale#path#FindNearestFile(a:buffer,
|
||||
\ ale#Var(a:buffer, 'bitbake_oelint_adv_config'))
|
||||
@@ -25,25 +17,26 @@ function! ale_linters#bitbake#oelint_adv#Command(buffer) abort
|
||||
endfunction
|
||||
|
||||
function! ale_linters#bitbake#oelint_adv#Handle(buffer, lines) abort
|
||||
let l:pattern = '\v^(.{-}):(.{-}):(.{-}):(.{-}):(.{-})$'
|
||||
let l:pattern = '\v^(.+):(.+):(.+):(.+):(.+)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': str2nr(l:match[2]),
|
||||
\ 'type': l:match[3] is# 'error'
|
||||
\ ? 'E'
|
||||
\ : (l:match[3] is# 'warning' ? 'W' : 'I'),
|
||||
\ 'text': ale_linters#bitbake#oelint_adv#RemoveBranch(
|
||||
\ ale_linters#bitbake#oelint_adv#StripAnsiCodes(l:match[5])
|
||||
\ ),
|
||||
\ 'code': l:match[4],
|
||||
\})
|
||||
\ 'lnum': str2nr(l:match[2]),
|
||||
\ 'type': l:match[3] is# 'error'
|
||||
\ ? 'E' : (l:match[3] is# 'warning' ? 'W' : 'I'),
|
||||
\ 'text': StripAnsiCodes(l:match[5]),
|
||||
\ 'code': l:match[4]
|
||||
\ })
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
function! StripAnsiCodes(line) abort
|
||||
return substitute(a:line, '\e\[[0-9;]\+[mK]', '', 'g')
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('bitbake', {
|
||||
\ 'name': 'oelint_adv',
|
||||
\ 'output_stream': 'both',
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||
" Description: astgrep for c files
|
||||
|
||||
call ale#handlers#astgrep#Define('c')
|
||||
@@ -10,18 +10,13 @@ function! ale_linters#c#cppcheck#GetCommand(buffer) abort
|
||||
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
|
||||
\ : ''
|
||||
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'
|
||||
\ . l:template
|
||||
\ . ale#Pad(l:compile_commands_option)
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'c_cppcheck_options'))
|
||||
\ . l:buffer_path_include
|
||||
\ . l:source_file
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('c', {
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
" Author: J. Handsel <jennpbc@posteo.net>, Thyme-87 <thyme-87@posteo.me>
|
||||
" Description: use checkov for providing warnings for cloudformation via ale
|
||||
|
||||
call ale#Set('cloudformation_checkov_executable', 'checkov')
|
||||
call ale#Set('cloudformation_checkov_options', '')
|
||||
|
||||
function! ale_linters#cloudformation#checkov#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'cloudformation_checkov_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cloudformation#checkov#GetCommand(buffer) abort
|
||||
return '%e ' . '-f %t -o json --quiet --framework cloudformation ' . ale#Var(a:buffer, 'cloudformation_checkov_options')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cloudformation#checkov#Handle(buffer, lines) abort
|
||||
let l:output = []
|
||||
|
||||
let l:results = get(get(ale#util#FuzzyJSONDecode(a:lines, {}), 'results', []), 'failed_checks', [])
|
||||
|
||||
for l:violation in l:results
|
||||
call add(l:output, {
|
||||
\ 'filename': l:violation['file_path'],
|
||||
\ 'lnum': l:violation['file_line_range'][0],
|
||||
\ 'end_lnum': l:violation['file_line_range'][1],
|
||||
\ 'text': l:violation['check_name'] . ' [' . l:violation['check_id'] . ']',
|
||||
\ 'detail': l:violation['check_id'] . ': ' . l:violation['check_name'] . "\n" .
|
||||
\ 'For more information, see: '. l:violation['guideline'],
|
||||
\ 'type': 'W',
|
||||
\ })
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('cloudformation', {
|
||||
\ 'name': 'checkov',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable': function('ale_linters#cloudformation#checkov#GetExecutable'),
|
||||
\ 'command': function('ale_linters#cloudformation#checkov#GetCommand'),
|
||||
\ 'callback': 'ale_linters#cloudformation#checkov#Handle',
|
||||
\})
|
||||
@@ -1,4 +0,0 @@
|
||||
" 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'
|
||||
\ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
|
||||
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' %s'
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -10,18 +10,13 @@ function! ale_linters#cpp#cppcheck#GetCommand(buffer) abort
|
||||
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
|
||||
\ : ''
|
||||
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++'
|
||||
\ . l:template
|
||||
\ . ale#Pad(l:compile_commands_option)
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'cpp_cppcheck_options'))
|
||||
\ . l:buffer_path_include
|
||||
\ . l:source_file
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('cpp', {
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
" 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')
|
||||
|
||||
return 'mcs -unsafe --parse'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
" 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
|
||||
return '%e ' . ale#Pad(ale#Var(a:buffer, 'css_stylelint_options'))
|
||||
\ . ' --no-color --stdin-filename %s'
|
||||
\ . ' --stdin-filename %s'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('css', {
|
||||
|
||||
@@ -23,7 +23,7 @@ function! ale_linters#cuda#nvcc#HandleNVCCFormat(buffer, lines) abort
|
||||
\ 'lnum': str2nr(l:match[2]),
|
||||
\ 'type': l:match[4] =~# 'error' ? 'E' : 'W',
|
||||
\ 'text': l:match[5],
|
||||
\ 'filename': ale#path#Simplify(fnamemodify(l:match[1], ':p')),
|
||||
\ 'filename': fnamemodify(l:match[1], ':p'),
|
||||
\}
|
||||
|
||||
if !empty(l:match[3])
|
||||
|
||||
@@ -87,9 +87,7 @@ function! ale_linters#d#dmd#Handle(buffer, lines) abort
|
||||
" 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.G1L5xIizvB.d(8,8): Error: module weak_reference is in file 'dstruct/weak_reference.d' which cannot be read
|
||||
" 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:pattern = '\v^(\f+)\((\d+)(,(\d+))?\): (\w+): (.+)$'
|
||||
let l:output = []
|
||||
let l:dir = expand('#' . a:buffer . ':p:h')
|
||||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
" 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'),
|
||||
\})
|
||||
@@ -1,23 +0,0 @@
|
||||
" 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'),
|
||||
\})
|
||||
@@ -1,23 +0,0 @@
|
||||
" 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'),
|
||||
\})
|
||||
@@ -1,23 +0,0 @@
|
||||
" 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'),
|
||||
\})
|
||||
@@ -1,23 +0,0 @@
|
||||
" 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'),
|
||||
\})
|
||||
@@ -1,23 +0,0 @@
|
||||
" 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'),
|
||||
\})
|
||||
@@ -1,4 +0,0 @@
|
||||
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||
" Description: astgrep for elixir files
|
||||
|
||||
call ale#handlers#astgrep#Define('elixir')
|
||||
@@ -1,12 +0,0 @@
|
||||
" 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'),
|
||||
\})
|
||||
@@ -1,47 +0,0 @@
|
||||
" Author: gomfol12
|
||||
" Desciption: A linter for fortran using fortitude.
|
||||
|
||||
call ale#Set('fortran_fortitude_executable', 'fortitude')
|
||||
call ale#Set('fortran_fortitude_options', '')
|
||||
|
||||
let s:severity_map = {
|
||||
\ 'E': 'E',
|
||||
\ 'C': 'W',
|
||||
\ 'OB': 'I',
|
||||
\ 'MOD': 'I',
|
||||
\ 'S': 'I',
|
||||
\ 'PORT': 'I',
|
||||
\ 'FORT': 'I',
|
||||
\}
|
||||
|
||||
function! ale_linters#fortran#fortitude#Handle(buffer, lines) abort
|
||||
let l:output = []
|
||||
|
||||
for l:error in ale#util#FuzzyJSONDecode(a:lines, [])
|
||||
let l:prefix = matchstr(l:error['code'], '^\a\+')
|
||||
let l:type = get(s:severity_map, l:prefix, 'I')
|
||||
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:error['location']['row'],
|
||||
\ 'end_lnum': l:error['end_location']['row'],
|
||||
\ 'col': l:error['location']['column'],
|
||||
\ 'end_col': l:error['end_location']['column'],
|
||||
\ 'text': l:error['message'],
|
||||
\ 'type': l:type,
|
||||
\ 'code': l:error['code'],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('fortran', {
|
||||
\ 'name': 'fortitude',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable': {b -> ale#Var(b, 'fortran_fortitude_executable')},
|
||||
\ 'command': {b ->
|
||||
\ '%e' . ' check --output-format json' . ale#Pad(ale#Var(b, 'fortran_fortitude_options')) . ' %s'
|
||||
\ },
|
||||
\ 'callback': 'ale_linters#fortran#fortitude#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
@@ -1,11 +1,9 @@
|
||||
" Author: Jansen Mitchell https://github.com/JansenMitchell
|
||||
" Description: proselint for Fountain files
|
||||
|
||||
call ale#Set('proselint_executable', 'proselint')
|
||||
|
||||
call ale#linter#Define('fountain', {
|
||||
\ 'name': 'proselint',
|
||||
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\ 'name': 'proselint',
|
||||
\ 'executable': 'proselint',
|
||||
\ 'command': 'proselint %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
" 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')
|
||||
|
||||
return ale#go#EnvString(a:buffer) . '%e'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -13,11 +13,11 @@ function! ale_linters#go#staticcheck#GetCommand(buffer) abort
|
||||
|
||||
if l:lint_package
|
||||
return l:env . '%e'
|
||||
\ . ale#Pad(l:options) . ' .'
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
||||
endif
|
||||
|
||||
return l:env . '%e'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' %s:t'
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ function! ale_linters#groovy#npmgroovylint#GetCommand(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'groovy_npmgroovylint_options')
|
||||
|
||||
return '%e --failon none --output json'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||
" Description: astgrep for haskell files
|
||||
|
||||
call ale#handlers#astgrep#Define('haskell')
|
||||
@@ -1,11 +1,9 @@
|
||||
" Author: Daniel M. Capella https://github.com/polyzen
|
||||
" Description: proselint for Vim help files
|
||||
|
||||
call ale#Set('proselint_executable', 'proselint')
|
||||
|
||||
call ale#linter#Define('help', {
|
||||
\ 'name': 'proselint',
|
||||
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||
\ 'executable': 'proselint',
|
||||
\ 'command': 'proselint %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||
" Description: astgrep for html files
|
||||
|
||||
call ale#handlers#astgrep#Define('html')
|
||||
@@ -1,11 +1,9 @@
|
||||
" Author: Daniel M. Capella https://github.com/polyzen
|
||||
" Description: proselint for HTML files
|
||||
|
||||
call ale#Set('proselint_executable', 'proselint')
|
||||
|
||||
call ale#linter#Define('html', {
|
||||
\ 'name': 'proselint',
|
||||
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||
\ 'executable': 'proselint',
|
||||
\ 'command': 'proselint %t',
|
||||
\ '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')
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . ' --no-color --stdin-filename %s'
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --stdin-filename %s'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('html', {
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
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',
|
||||
\})
|
||||
@@ -1,4 +0,0 @@
|
||||
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||
" Description: astgrep for java files
|
||||
|
||||
call ale#handlers#astgrep#Define('java')
|
||||
@@ -1,4 +0,0 @@
|
||||
" 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')
|
||||
|
||||
return ale#node#Executable(a:buffer, l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --stdin %s'
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
" 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',
|
||||
\})
|
||||
@@ -1,4 +0,0 @@
|
||||
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||
" Description: astgrep for json files
|
||||
|
||||
call ale#handlers#astgrep#Define('json')
|
||||
@@ -1,4 +0,0 @@
|
||||
" 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
|
||||
let l:options = ale#Var(a:buffer, 'less_stylelint_options')
|
||||
|
||||
return '%e' . ale#Pad(l:options) . ' --no-color --stdin-filename %s'
|
||||
return '%e' . ale#Pad(l:options) . ' --stdin-filename %s'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('less', {
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
" 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',
|
||||
\})
|
||||
@@ -1,4 +0,0 @@
|
||||
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||
" Description: astgrep for lua files
|
||||
|
||||
call ale#handlers#astgrep#Define('lua')
|
||||
@@ -1,11 +1,9 @@
|
||||
" Author: Daniel M. Capella https://github.com/polyzen
|
||||
" Description: proselint for mail files
|
||||
|
||||
call ale#Set('proselint_executable', 'proselint')
|
||||
|
||||
call ale#linter#Define('mail', {
|
||||
\ 'name': 'proselint',
|
||||
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||
\ 'executable': 'proselint',
|
||||
\ 'command': 'proselint %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
" 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
|
||||
@@ -14,7 +14,7 @@ function! ale_linters#markdown#markdownlint#GetCommand(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'markdown_markdownlint_options')
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options) . ' %s'
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' %s'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
|
||||
@@ -17,7 +17,7 @@ function! ale_linters#markdown#mdl#GetCommand(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'markdown_mdl_options')
|
||||
|
||||
return ale#Escape(l:executable) . l:exec_args
|
||||
\ . ' -j' . ale#Pad(l:options)
|
||||
\ . ' -j' . (!empty(l:options) ? ' ' . l:options : '')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#markdown#mdl#Handle(buffer, lines) abort
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
" Author: poohzrn https://github.com/poohzrn
|
||||
" Description: proselint for Markdown files
|
||||
|
||||
call ale#Set('proselint_executable', 'proselint')
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'proselint',
|
||||
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||
\ 'executable': 'proselint',
|
||||
\ 'command': 'proselint %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
||||
|
||||
@@ -33,8 +33,9 @@ function! ale_linters#markdown#pymarkdown#GetCommand(buffer) abort
|
||||
\ : ''
|
||||
|
||||
return ale#Escape(l:executable) . l:exec_args
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'markdown_pymarkdown_options'))
|
||||
\ . ' scan-stdin'
|
||||
\ . ' '
|
||||
\ . ale#Var(a:buffer, 'markdown_pymarkdown_options')
|
||||
\ . 'scan-stdin'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#markdown#pymarkdown#Handle(buffer, lines) abort
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
" Author: rhysd https://rhysd.github.io
|
||||
" Description: Redpen, a proofreading tool (http://redpen.cc)
|
||||
|
||||
call ale#handlers#redpen#DefineLinter('markdown')
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'redpen',
|
||||
\ 'executable': 'redpen',
|
||||
\ 'command': 'redpen -f markdown -r json %t',
|
||||
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
|
||||
\})
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
" 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',
|
||||
\})
|
||||
@@ -1,4 +0,0 @@
|
||||
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||
" Description: astgrep for nix files
|
||||
|
||||
call ale#handlers#astgrep#Define('nix')
|
||||
@@ -1,11 +1,9 @@
|
||||
" Author: Daniel M. Capella https://github.com/polyzen
|
||||
" Description: proselint for nroff files
|
||||
|
||||
call ale#Set('proselint_executable', 'proselint')
|
||||
|
||||
call ale#linter#Define('nroff', {
|
||||
\ 'name': 'proselint',
|
||||
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||
\ 'executable': 'proselint',
|
||||
\ 'command': 'proselint %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
" Authors: ophirr33 <coghlan.ty@gmail.com>, rymdbar <https://rymdbar.x20.se/>
|
||||
" Description: Perl::LanguageServer for perl, from cpan.org
|
||||
|
||||
" This should have the same value as in perl.vim
|
||||
call ale#Set('perl_perl_executable', 'perl')
|
||||
" Please note that perl_perl_options does not exist here.
|
||||
|
||||
call ale#Set('perl_languageserver_config', {})
|
||||
|
||||
function! s:get_lsp_config(buffer) abort
|
||||
" This tool doesn't kick in unless workspace/didChangeConfiguration is
|
||||
" called, thus this function returning a fallback dict when there is no
|
||||
" config.
|
||||
let l:lsp_config = ale#Var(a:buffer, 'perl_languageserver_config')
|
||||
|
||||
return empty(l:lsp_config) ? { 'perl': { 'enable': 1 } } : l:lsp_config
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('perl', {
|
||||
\ 'name': 'languageserver',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#Var(b, 'perl_perl_executable')},
|
||||
\ 'command': '%e -MPerl::LanguageServer -ePerl::LanguageServer::run',
|
||||
\ 'lsp_config': {b -> s:get_lsp_config(b)},
|
||||
\ 'project_root': function('ale#handlers#perl#GetProjectRoot'),
|
||||
\ })
|
||||
@@ -1,15 +0,0 @@
|
||||
" 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'),
|
||||
\ })
|
||||
@@ -1,4 +0,0 @@
|
||||
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||
" Description: astgrep for php files
|
||||
|
||||
call ale#handlers#astgrep#Define('php')
|
||||
@@ -1,9 +1,6 @@
|
||||
" Author: Arizard <https://github.com/Arizard>
|
||||
" Description: PHPactor integration for ALE
|
||||
|
||||
call ale#Set('php_phpactor_executable', 'phpactor')
|
||||
call ale#Set('php_phpactor_init_options', {})
|
||||
|
||||
" Copied from langserver.vim
|
||||
function! ale_linters#php#phpactor#GetProjectRoot(buffer) abort
|
||||
let l:composer_path = ale#path#FindNearestFile(a:buffer, 'composer.json')
|
||||
@@ -20,8 +17,7 @@ endfunction
|
||||
call ale#linter#Define('php', {
|
||||
\ 'name': 'phpactor',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#Var(b, 'php_phpactor_executable')},
|
||||
\ 'executable': 'phpactor',
|
||||
\ 'command': '%e language-server',
|
||||
\ 'initialization_options': {b -> ale#Var(b, 'php_phpactor_init_options')},
|
||||
\ 'project_root': function('ale_linters#php#phpactor#GetProjectRoot'),
|
||||
\})
|
||||
|
||||
@@ -7,34 +7,6 @@ call ale#Set('php_phpcs_options', '')
|
||||
call ale#Set('php_phpcs_executable', 'phpcs')
|
||||
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
|
||||
let l:standard = ale#Var(a:buffer, 'php_phpcs_standard')
|
||||
let l:standard_option = !empty(l:standard)
|
||||
@@ -76,7 +48,7 @@ call ale#linter#Define('php', {
|
||||
\ 'vendor/bin/phpcs',
|
||||
\ 'phpcs'
|
||||
\ ])},
|
||||
\ 'cwd': function('ale_linters#php#phpcs#GetCwd'),
|
||||
\ 'cwd': '%s:h',
|
||||
\ 'command': function('ale_linters#php#phpcs#GetCommand'),
|
||||
\ 'callback': 'ale_linters#php#phpcs#Handle',
|
||||
\})
|
||||
|
||||
@@ -27,10 +27,6 @@ function! ale_linters#php#phpstan#GetCommand(buffer, version) abort
|
||||
|
||||
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 no configuration file is found, then use 4 as a default level
|
||||
let l:level = '4'
|
||||
@@ -87,10 +83,6 @@ function! ale_linters#php#phpstan#FindConfigFile(buffer) abort
|
||||
let l:result = ale#path#FindNearestFile(a:buffer, 'phpstan.neon.dist')
|
||||
endif
|
||||
|
||||
if empty(l:result)
|
||||
let l:result = ale#path#FindNearestFile(a:buffer, 'phpstan.dist.neon')
|
||||
endif
|
||||
|
||||
return l:result
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ function! ale_linters#php#tlint#GetCommand(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'php_tlint_options')
|
||||
|
||||
return ale#node#Executable(a:buffer, l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' lint %s'
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
" Author: Cian Butler https://github.com/butlerx
|
||||
" Description: proselint for PO files
|
||||
|
||||
call ale#Set('proselint_executable', 'proselint')
|
||||
|
||||
call ale#linter#Define('po', {
|
||||
\ 'name': 'proselint',
|
||||
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||
\ 'executable': 'proselint',
|
||||
\ 'command': 'proselint %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
" Author: Daniel M. Capella https://github.com/polyzen
|
||||
" Description: proselint for Pod files
|
||||
|
||||
call ale#Set('proselint_executable', 'proselint')
|
||||
|
||||
call ale#linter#Define('pod', {
|
||||
\ 'name': 'proselint',
|
||||
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||
\ 'executable': 'proselint',
|
||||
\ 'command': 'proselint %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
||||
|
||||
@@ -11,7 +11,7 @@ function! ale_linters#proto#buf_lint#GetCommand(buffer) abort
|
||||
|
||||
return '%e lint'
|
||||
\ . (!empty(l:config) ? ' --config=' . ale#Escape(l:config) : '')
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' %s#include_package_files=true'
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
" 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')
|
||||
|
||||
return ale#Escape(l:executable) . l:exec_args
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --format=default'
|
||||
\ . l:display_name_args . ' -'
|
||||
endfunction
|
||||
|
||||
@@ -36,7 +36,7 @@ function! ale_linters#python#pylsp#GetCwd(buffer) abort
|
||||
\ 'name': 'pylsp',
|
||||
\ 'project_root': function('ale#python#FindProjectRoot'),
|
||||
\}
|
||||
let l:root = ale#lsp_linter#FindProjectRoot(a:buffer, l:fake_linter)
|
||||
let l:root = ale#linter#GetRoot(a:buffer, l:fake_linter)
|
||||
|
||||
return !empty(l:root) ? l:root : v:null
|
||||
endfunction
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
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_options', '--stdio')
|
||||
call ale#Set('python_pyright_config', {})
|
||||
call ale#Set('python_pyright_auto_pipenv', 0)
|
||||
call ale#Set('python_pyright_auto_poetry', 0)
|
||||
@@ -14,7 +13,7 @@ function! ale_linters#python#pyright#GetCwd(buffer) abort
|
||||
\ 'name': 'pyright',
|
||||
\ 'project_root': function('ale#python#FindProjectRoot'),
|
||||
\}
|
||||
let l:root = ale#lsp_linter#FindProjectRoot(a:buffer, l:fake_linter)
|
||||
let l:root = ale#linter#GetRoot(a:buffer, l:fake_linter)
|
||||
|
||||
return !empty(l:root) ? l:root : v:null
|
||||
endfunction
|
||||
@@ -80,8 +79,7 @@ function! ale_linters#python#pyright#GetCommand(buffer) abort
|
||||
let l:env_string = ale#python#AutoVirtualenvEnvString(a:buffer)
|
||||
endif
|
||||
|
||||
return l:env_string . ale#Escape(l:executable) . l:exec_args .
|
||||
\ ale#Pad(ale#Var(a:buffer, 'python_pyright_options'))
|
||||
return l:env_string . ale#Escape(l:executable) . l:exec_args . ' --stdio'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('python', {
|
||||
|
||||
@@ -34,22 +34,6 @@ function! ale_linters#python#ruff#GetExecutable(buffer) abort
|
||||
return ale#python#FindExecutable(a:buffer, 'python_ruff', ['ruff'])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#python#ruff#RunWithVersionCheck(buffer) abort
|
||||
let l:executable = ale_linters#python#ruff#GetExecutable(a:buffer)
|
||||
let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
|
||||
\ ? ' run ruff'
|
||||
\ : ''
|
||||
|
||||
let l:command = ale#Escape(l:executable) . l:exec_args . ' --version'
|
||||
|
||||
return ale#semver#RunWithVersionCheck(
|
||||
\ a:buffer,
|
||||
\ l:executable,
|
||||
\ l:command,
|
||||
\ function('ale_linters#python#ruff#GetCommand'),
|
||||
\)
|
||||
endfunction
|
||||
|
||||
function! ale_linters#python#ruff#GetCwd(buffer) abort
|
||||
if ale#Var(a:buffer, 'python_ruff_change_directory')
|
||||
" Run from project root if found, else from buffer dir.
|
||||
@@ -92,10 +76,6 @@ function! ale_linters#python#ruff#Handle(buffer, lines) abort
|
||||
continue
|
||||
endtry
|
||||
|
||||
if empty(l:item)
|
||||
continue
|
||||
endif
|
||||
|
||||
if (l:item.code is# 'W291' || l:item.code is# 'W293')
|
||||
\&& !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
|
||||
" Skip warnings for trailing whitespace if the option is off.
|
||||
@@ -126,7 +106,12 @@ call ale#linter#Define('python', {
|
||||
\ 'name': 'ruff',
|
||||
\ 'executable': function('ale_linters#python#ruff#GetExecutable'),
|
||||
\ 'cwd': function('ale_linters#python#ruff#GetCwd'),
|
||||
\ 'command': function('ale_linters#python#ruff#RunWithVersionCheck'),
|
||||
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
|
||||
\ buffer,
|
||||
\ ale_linters#python#ruff#GetExecutable(buffer),
|
||||
\ '%e --version',
|
||||
\ function('ale_linters#python#ruff#GetCommand'),
|
||||
\ )},
|
||||
\ 'callback': 'ale_linters#python#ruff#Handle',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'read_buffer': 1,
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
" 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))
|
||||
\ . ' check %s:h --format json '
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#rego#opacheck#Handle(buffer, lines) abort
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
" 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,4 +1,9 @@
|
||||
" Author: rhysd https://rhysd.github.io
|
||||
" Description: Redpen, a proofreading tool (http://redpen.cc)
|
||||
|
||||
call ale#handlers#redpen#DefineLinter('review')
|
||||
call ale#linter#Define('review', {
|
||||
\ 'name': 'redpen',
|
||||
\ 'executable': 'redpen',
|
||||
\ 'command': 'redpen -f review -r json %t',
|
||||
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
|
||||
\})
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
" Author: Daniel M. Capella https://github.com/polyzen
|
||||
" Description: proselint for reStructuredrst files
|
||||
|
||||
call ale#Set('proselint_executable', 'proselint')
|
||||
" Description: proselint for reStructuredText files
|
||||
|
||||
call ale#linter#Define('rst', {
|
||||
\ 'name': 'proselint',
|
||||
\ 'executable': function('ale#proselint#GetExecutable'),
|
||||
\ 'command': function('ale#proselint#GetCommandWithVersionCheck'),
|
||||
\ 'executable': 'proselint',
|
||||
\ 'command': 'proselint %t',
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
||||
\})
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
" Author: rhysd https://rhysd.github.io
|
||||
" Description: Redpen, a proofreading tool (http://redpen.cc)
|
||||
|
||||
call ale#handlers#redpen#DefineLinter('rst')
|
||||
call ale#linter#Define('rst', {
|
||||
\ 'name': 'redpen',
|
||||
\ 'executable': 'redpen',
|
||||
\ 'command': 'redpen -f rest -r json %t',
|
||||
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
|
||||
\})
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
" Authors:
|
||||
" 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
|
||||
" Author: John Nduli https://github.com/jnduli
|
||||
" Description: Rstcheck for reStructuredText files
|
||||
|
||||
function! ale_linters#rst#rstcheck#Handle(buffer, lines) abort
|
||||
" matches: 'bad_rst.rst:1: (SEVERE/4) Title overline & underline
|
||||
@@ -29,35 +21,11 @@ function! ale_linters#rst#rstcheck#Handle(buffer, lines) abort
|
||||
return l:output
|
||||
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', {
|
||||
\ 'name': 'rstcheck',
|
||||
\ 'executable': 'rstcheck',
|
||||
\ 'cwd': '%s:h',
|
||||
\ 'command': function('ale_linters#rst#rstcheck#GetCommandWithVersionCheck'),
|
||||
\ 'command': 'rstcheck %t',
|
||||
\ 'callback': 'ale_linters#rst#rstcheck#Handle',
|
||||
\ 'output_stream': 'both',
|
||||
\})
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||
" Description: astgrep for ruby files
|
||||
|
||||
call ale#handlers#astgrep#Define('ruby')
|
||||
@@ -8,10 +8,7 @@ call ale#Set('ruby_solargraph_executable', 'solargraph')
|
||||
call ale#Set('ruby_solargraph_options', {})
|
||||
|
||||
function! ale_linters#ruby#solargraph#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'ruby_solargraph_executable')
|
||||
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'solargraph')
|
||||
\ . ale#Pad('stdio')
|
||||
return '%e' . ale#Pad('stdio')
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('ruby', {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
call ale#Set('ruby_sorbet_executable', 'srb')
|
||||
call ale#Set('ruby_sorbet_options', '')
|
||||
call ale#Set('ruby_sorbet_enable_watchman', 0)
|
||||
call ale#Set('ruby_sorbet_initialization_options', { 'highlightUntyped': v:false })
|
||||
|
||||
function! ale_linters#ruby#sorbet#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'ruby_sorbet_executable')
|
||||
@@ -10,7 +9,7 @@ function! ale_linters#ruby#sorbet#GetCommand(buffer) abort
|
||||
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'srb')
|
||||
\ . ' tc'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' --lsp'
|
||||
\ . (l:enable_watchman ? '' : ' --disable-watchman')
|
||||
endfunction
|
||||
@@ -22,6 +21,6 @@ call ale#linter#Define('ruby', {
|
||||
\ 'language': 'ruby',
|
||||
\ 'executable': {b -> ale#Var(b, 'ruby_sorbet_executable')},
|
||||
\ 'command': function('ale_linters#ruby#sorbet#GetCommand'),
|
||||
\ 'project_root': function('ale#ruby#FindProjectRoot'),
|
||||
\ 'initialization_options': {b -> ale#Var(b, 'ruby_sorbet_initialization_options')}
|
||||
\ 'project_root': function('ale#ruby#FindProjectRoot')
|
||||
\})
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
" 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')
|
||||
|
||||
return 'rustc --error-format=json'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . l:dependencies . ' -'
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ function! ale_linters#sass#sasslint#GetCommand(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'sass_sasslint_options')
|
||||
|
||||
return ale#node#Executable(a:buffer, l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' -v -q -f compact %t'
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -9,6 +9,6 @@ call ale#linter#Define('sass', {
|
||||
\ 'executable': {b -> ale#path#FindExecutable(b, 'sass_stylelint', [
|
||||
\ 'node_modules/.bin/stylelint',
|
||||
\ ])},
|
||||
\ 'command': '%e --no-color --stdin-filename %s',
|
||||
\ 'command': '%e --stdin-filename %s',
|
||||
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
|
||||
\})
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||
" Description: astgrep for scala files
|
||||
|
||||
call ale#handlers#astgrep#Define('scala')
|
||||
@@ -13,7 +13,6 @@ function! ale_linters#scala#metals#GetProjectRoot(buffer) abort
|
||||
|
||||
let l:potential_roots = [
|
||||
\ 'build.sc',
|
||||
\ 'build.mill',
|
||||
\ 'build.sbt',
|
||||
\ '.bloop',
|
||||
\ '.metals',
|
||||
|
||||
@@ -16,7 +16,7 @@ function! ale_linters#scss#sasslint#GetCommand(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'scss_sasslint_options')
|
||||
|
||||
return ale#node#Executable(a:buffer, l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' -v -q -f compact %t'
|
||||
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
|
||||
return '%e ' . ale#Pad(ale#Var(a:buffer, 'scss_stylelint_options'))
|
||||
\ . ' --no-color --stdin-filename %s'
|
||||
\ . ' --stdin-filename %s'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('scss', {
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||
" Description: astgrep for sh files
|
||||
|
||||
call ale#handlers#astgrep#Define('sh')
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user