Repository: dense-analysis/ale
Branch: master
Commit: 69c945d5daec
Files: 2221
Total size: 4.0 MB
Directory structure:
gitextract_id28numa/
├── AGENTS.md
├── Dockerfile
├── LICENSE
├── README.md
├── ale_linters/
│ ├── ada/
│ │ ├── adals.vim
│ │ ├── cspell.vim
│ │ └── gcc.vim
│ ├── ansible/
│ │ ├── ansible_lint.vim
│ │ └── language_server.vim
│ ├── apiblueprint/
│ │ └── drafter.vim
│ ├── apkbuild/
│ │ ├── apkbuild_lint.vim
│ │ └── secfixes_check.vim
│ ├── asciidoc/
│ │ ├── alex.vim
│ │ ├── cspell.vim
│ │ ├── languagetool.vim
│ │ ├── proselint.vim
│ │ ├── redpen.vim
│ │ ├── textlint.vim
│ │ ├── vale.vim
│ │ └── writegood.vim
│ ├── asm/
│ │ ├── gcc.vim
│ │ └── llvm_mc.vim
│ ├── astro/
│ │ └── eslint.vim
│ ├── avra/
│ │ └── avra.vim
│ ├── awk/
│ │ └── gawk.vim
│ ├── bats/
│ │ └── shellcheck.vim
│ ├── bib/
│ │ └── bibclean.vim
│ ├── bicep/
│ │ ├── az_bicep.vim
│ │ └── bicep.vim
│ ├── bindzone/
│ │ └── checkzone.vim
│ ├── bitbake/
│ │ └── oelint_adv.vim
│ ├── bzl/
│ │ └── buildifier.vim
│ ├── c/
│ │ ├── cc.vim
│ │ ├── ccls.vim
│ │ ├── clangcheck.vim
│ │ ├── clangd.vim
│ │ ├── clangtidy.vim
│ │ ├── cppcheck.vim
│ │ ├── cpplint.vim
│ │ ├── cquery.vim
│ │ ├── cspell.vim
│ │ └── flawfinder.vim
│ ├── c3/
│ │ └── c3lsp.vim
│ ├── cairo/
│ │ ├── scarb.vim
│ │ ├── sierra.vim
│ │ └── starknet.vim
│ ├── chef/
│ │ ├── cookstyle.vim
│ │ └── foodcritic.vim
│ ├── clojure/
│ │ ├── clj_kondo.vim
│ │ └── joker.vim
│ ├── cloudformation/
│ │ ├── cfn_python_lint.vim
│ │ └── checkov.vim
│ ├── cmake/
│ │ ├── cmake_lint.vim
│ │ └── cmakelint.vim
│ ├── coffee/
│ │ ├── coffee.vim
│ │ └── coffeelint.vim
│ ├── cpp/
│ │ ├── cc.vim
│ │ ├── ccls.vim
│ │ ├── clangcheck.vim
│ │ ├── clangd.vim
│ │ ├── clangtidy.vim
│ │ ├── clazy.vim
│ │ ├── cppcheck.vim
│ │ ├── cpplint.vim
│ │ ├── cquery.vim
│ │ ├── cspell.vim
│ │ └── flawfinder.vim
│ ├── crystal/
│ │ ├── ameba.vim
│ │ └── crystal.vim
│ ├── cs/
│ │ ├── csc.vim
│ │ ├── cspell.vim
│ │ ├── mcs.vim
│ │ └── mcsc.vim
│ ├── css/
│ │ ├── cspell.vim
│ │ ├── csslint.vim
│ │ ├── fecs.vim
│ │ ├── stylelint.vim
│ │ └── vscodecss.vim
│ ├── cucumber/
│ │ └── cucumber.vim
│ ├── cuda/
│ │ ├── clangd.vim
│ │ └── nvcc.vim
│ ├── cypher/
│ │ └── cypher_lint.vim
│ ├── d/
│ │ ├── dls.vim
│ │ └── dmd.vim
│ ├── dafny/
│ │ └── dafny.vim
│ ├── dart/
│ │ ├── analysis_server.vim
│ │ ├── dart_analyze.vim
│ │ └── language_server.vim
│ ├── desktop/
│ │ └── desktop_file_validate.vim
│ ├── dockerfile/
│ │ ├── dockerfile_lint.vim
│ │ ├── dockerlinter.vim
│ │ └── hadolint.vim
│ ├── elixir/
│ │ ├── credo.vim
│ │ ├── cspell.vim
│ │ ├── dialyxir.vim
│ │ ├── dogma.vim
│ │ ├── elixir_ls.vim
│ │ ├── expert.vim
│ │ ├── lexical.vim
│ │ └── mix.vim
│ ├── elm/
│ │ ├── ls.vim
│ │ └── make.vim
│ ├── erlang/
│ │ ├── dialyzer.vim
│ │ ├── elvis.vim
│ │ ├── erlang_ls.vim
│ │ ├── erlc.vim
│ │ └── syntaxerl.vim
│ ├── eruby/
│ │ ├── erb.vim
│ │ ├── erblint.vim
│ │ ├── erubi.vim
│ │ ├── erubis.vim
│ │ └── ruumba.vim
│ ├── fish/
│ │ └── fish.vim
│ ├── fortran/
│ │ ├── fortitude.vim
│ │ ├── gcc.vim
│ │ └── language_server.vim
│ ├── fountain/
│ │ └── proselint.vim
│ ├── fuse/
│ │ └── fusionlint.vim
│ ├── gitcommit/
│ │ └── gitlint.vim
│ ├── gleam/
│ │ └── gleamlsp.vim
│ ├── glimmer/
│ │ └── embertemplatelint.vim
│ ├── glsl/
│ │ ├── glslang.vim
│ │ └── glslls.vim
│ ├── go/
│ │ ├── bingo.vim
│ │ ├── cspell.vim
│ │ ├── gobuild.vim
│ │ ├── gofmt.vim
│ │ ├── golangci_lint.vim
│ │ ├── gopls.vim
│ │ ├── gosimple.vim
│ │ ├── gotype.vim
│ │ ├── govet.vim
│ │ ├── langserver.vim
│ │ ├── revive.vim
│ │ └── staticcheck.vim
│ ├── gohtmltmpl/
│ │ └── djlint.vim
│ ├── graphql/
│ │ ├── eslint.vim
│ │ └── gqlint.vim
│ ├── groovy/
│ │ └── npmgroovylint.vim
│ ├── hack/
│ │ ├── hack.vim
│ │ └── hhast.vim
│ ├── haml/
│ │ └── hamllint.vim
│ ├── handlebars/
│ │ ├── djlint.vim
│ │ └── embertemplatelint.vim
│ ├── haskell/
│ │ ├── cabal_ghc.vim
│ │ ├── cspell.vim
│ │ ├── ghc.vim
│ │ ├── ghc_mod.vim
│ │ ├── hdevtools.vim
│ │ ├── hie.vim
│ │ ├── hlint.vim
│ │ ├── hls.vim
│ │ ├── stack_build.vim
│ │ └── stack_ghc.vim
│ ├── help/
│ │ ├── alex.vim
│ │ ├── cspell.vim
│ │ ├── proselint.vim
│ │ └── writegood.vim
│ ├── html/
│ │ ├── alex.vim
│ │ ├── angular.vim
│ │ ├── cspell.vim
│ │ ├── djlint.vim
│ │ ├── eslint.vim
│ │ ├── fecs.vim
│ │ ├── htmlhint.vim
│ │ ├── proselint.vim
│ │ ├── stylelint.vim
│ │ ├── superhtml.vim
│ │ ├── tidy.vim
│ │ ├── vscodehtml.vim
│ │ └── writegood.vim
│ ├── htmlangular/
│ │ └── djlint.vim
│ ├── htmldjango/
│ │ └── djlint.vim
│ ├── hurl/
│ │ └── hurlfmt.vim
│ ├── idris/
│ │ └── idris.vim
│ ├── ink/
│ │ └── ls.vim
│ ├── inko/
│ │ └── inko.vim
│ ├── ispc/
│ │ └── ispc.vim
│ ├── java/
│ │ ├── checkstyle.vim
│ │ ├── cspell.vim
│ │ ├── eclipselsp.vim
│ │ ├── javac.vim
│ │ ├── javalsp.vim
│ │ └── pmd.vim
│ ├── javascript/
│ │ ├── biome.vim
│ │ ├── cspell.vim
│ │ ├── deno.vim
│ │ ├── eslint.vim
│ │ ├── fecs.vim
│ │ ├── flow.vim
│ │ ├── flow_ls.vim
│ │ ├── jscs.vim
│ │ ├── jshint.vim
│ │ ├── standard.vim
│ │ ├── tsserver.vim
│ │ └── xo.vim
│ ├── jinja/
│ │ ├── djlint.vim
│ │ └── j2lint.vim
│ ├── json/
│ │ ├── biome.vim
│ │ ├── cspell.vim
│ │ ├── eslint.vim
│ │ ├── jq.vim
│ │ ├── jsonlint.vim
│ │ ├── spectral.vim
│ │ └── vscodejson.vim
│ ├── json5/
│ │ └── eslint.vim
│ ├── jsonc/
│ │ ├── biome.vim
│ │ └── eslint.vim
│ ├── jsonnet/
│ │ ├── jsonnet_lint.vim
│ │ └── jsonnetfmt.vim
│ ├── julia/
│ │ └── languageserver.vim
│ ├── kotlin/
│ │ ├── kotlinc.vim
│ │ ├── ktlint.vim
│ │ └── languageserver.vim
│ ├── lean/
│ │ └── lake.vim
│ ├── less/
│ │ ├── lessc.vim
│ │ └── stylelint.vim
│ ├── llvm/
│ │ └── llc.vim
│ ├── lua/
│ │ ├── cspell.vim
│ │ ├── lua_language_server.vim
│ │ ├── luac.vim
│ │ ├── luacheck.vim
│ │ └── selene.vim
│ ├── mail/
│ │ ├── alex.vim
│ │ ├── languagetool.vim
│ │ ├── proselint.vim
│ │ └── vale.vim
│ ├── make/
│ │ └── checkmake.vim
│ ├── markdown/
│ │ ├── alex.vim
│ │ ├── cspell.vim
│ │ ├── languagetool.vim
│ │ ├── markdownlint.vim
│ │ ├── marksman.vim
│ │ ├── mdl.vim
│ │ ├── proselint.vim
│ │ ├── pymarkdown.vim
│ │ ├── redpen.vim
│ │ ├── remark_lint.vim
│ │ ├── textlint.vim
│ │ ├── vale.vim
│ │ └── writegood.vim
│ ├── matlab/
│ │ └── mlint.vim
│ ├── mercury/
│ │ └── mmc.vim
│ ├── nasm/
│ │ └── nasm.vim
│ ├── nim/
│ │ ├── nimcheck.vim
│ │ └── nimlsp.vim
│ ├── nix/
│ │ ├── deadnix.vim
│ │ ├── nix.vim
│ │ ├── rnix_lsp.vim
│ │ └── statix.vim
│ ├── nroff/
│ │ ├── alex.vim
│ │ ├── proselint.vim
│ │ └── writegood.vim
│ ├── nunjucks/
│ │ └── djlint.vim
│ ├── objc/
│ │ ├── ccls.vim
│ │ ├── clang.vim
│ │ └── clangd.vim
│ ├── objcpp/
│ │ ├── clang.vim
│ │ └── clangd.vim
│ ├── ocaml/
│ │ ├── merlin.vim
│ │ ├── ocamllsp.vim
│ │ └── ols.vim
│ ├── ocamlinterface/
│ │ ├── merlin.vim
│ │ └── ocamllsp.vim
│ ├── odin/
│ │ └── ols.vim
│ ├── openapi/
│ │ ├── ibm_validator.vim
│ │ └── yamllint.vim
│ ├── openscad/
│ │ └── sca2d.vim
│ ├── perl/
│ │ ├── languageserver.vim
│ │ ├── perl.vim
│ │ └── perlcritic.vim
│ ├── perl6/
│ │ └── perl6.vim
│ ├── php/
│ │ ├── cspell.vim
│ │ ├── intelephense.vim
│ │ ├── langserver.vim
│ │ ├── phan.vim
│ │ ├── php.vim
│ │ ├── phpactor.vim
│ │ ├── phpcs.vim
│ │ ├── phpmd.vim
│ │ ├── phpstan.vim
│ │ ├── psalm.vim
│ │ └── tlint.vim
│ ├── po/
│ │ ├── alex.vim
│ │ ├── msgfmt.vim
│ │ ├── proselint.vim
│ │ └── writegood.vim
│ ├── pod/
│ │ ├── alex.vim
│ │ ├── proselint.vim
│ │ └── writegood.vim
│ ├── pony/
│ │ └── ponyc.vim
│ ├── powershell/
│ │ ├── cspell.vim
│ │ ├── powershell.vim
│ │ └── psscriptanalyzer.vim
│ ├── prolog/
│ │ └── swipl.vim
│ ├── proto/
│ │ ├── buf_lint.vim
│ │ ├── protoc_gen_lint.vim
│ │ └── protolint.vim
│ ├── pug/
│ │ └── puglint.vim
│ ├── puppet/
│ │ ├── languageserver.vim
│ │ ├── puppet.vim
│ │ └── puppetlint.vim
│ ├── purescript/
│ │ └── ls.vim
│ ├── pyrex/
│ │ └── cython.vim
│ ├── python/
│ │ ├── bandit.vim
│ │ ├── cspell.vim
│ │ ├── flake8.vim
│ │ ├── flakehell.vim
│ │ ├── jedils.vim
│ │ ├── mypy.vim
│ │ ├── prospector.vim
│ │ ├── pycln.vim
│ │ ├── pycodestyle.vim
│ │ ├── pydocstyle.vim
│ │ ├── pyflakes.vim
│ │ ├── pylama.vim
│ │ ├── pylint.vim
│ │ ├── pylsp.vim
│ │ ├── pyre.vim
│ │ ├── pyrefly.vim
│ │ ├── pyright.vim
│ │ ├── refurb.vim
│ │ ├── ruff.vim
│ │ ├── unimport.vim
│ │ └── vulture.vim
│ ├── qml/
│ │ ├── qmlfmt.vim
│ │ └── qmllint.vim
│ ├── r/
│ │ ├── languageserver.vim
│ │ └── lintr.vim
│ ├── racket/
│ │ ├── langserver.vim
│ │ └── raco.vim
│ ├── reason/
│ │ ├── ls.vim
│ │ ├── merlin.vim
│ │ └── ols.vim
│ ├── rego/
│ │ ├── cspell.vim
│ │ └── opacheck.vim
│ ├── rescript/
│ │ └── rescript_language_server.vim
│ ├── review/
│ │ └── redpen.vim
│ ├── robot/
│ │ └── rflint.vim
│ ├── roc/
│ │ └── roc_language_server.vim
│ ├── rst/
│ │ ├── alex.vim
│ │ ├── cspell.vim
│ │ ├── proselint.vim
│ │ ├── redpen.vim
│ │ ├── rstcheck.vim
│ │ ├── textlint.vim
│ │ ├── vale.vim
│ │ └── writegood.vim
│ ├── ruby/
│ │ ├── brakeman.vim
│ │ ├── cspell.vim
│ │ ├── debride.vim
│ │ ├── packwerk.vim
│ │ ├── rails_best_practices.vim
│ │ ├── reek.vim
│ │ ├── rubocop.vim
│ │ ├── ruby.vim
│ │ ├── solargraph.vim
│ │ ├── sorbet.vim
│ │ ├── standardrb.vim
│ │ └── steep.vim
│ ├── rust/
│ │ ├── analyzer.vim
│ │ ├── cargo.vim
│ │ ├── cspell.vim
│ │ ├── rls.vim
│ │ └── rustc.vim
│ ├── salt/
│ │ └── salt_lint.vim
│ ├── sass/
│ │ ├── sasslint.vim
│ │ └── stylelint.vim
│ ├── scala/
│ │ ├── cspell.vim
│ │ ├── fsc.vim
│ │ ├── metals.vim
│ │ ├── sbtserver.vim
│ │ ├── scalac.vim
│ │ └── scalastyle.vim
│ ├── scss/
│ │ ├── sasslint.vim
│ │ ├── scsslint.vim
│ │ └── stylelint.vim
│ ├── sh/
│ │ ├── bashate.vim
│ │ ├── cspell.vim
│ │ ├── language_server.vim
│ │ ├── shell.vim
│ │ └── shellcheck.vim
│ ├── slim/
│ │ └── slimlint.vim
│ ├── sml/
│ │ ├── smlnj.vim
│ │ └── smlnj_cm.vim
│ ├── solidity/
│ │ ├── solc.vim
│ │ ├── solhint.vim
│ │ └── solium.vim
│ ├── spec/
│ │ └── rpmlint.vim
│ ├── sql/
│ │ ├── sqlfluff.vim
│ │ ├── sqlint.vim
│ │ └── sqllint.vim
│ ├── stylus/
│ │ └── stylelint.vim
│ ├── sugarss/
│ │ └── stylelint.vim
│ ├── svelte/
│ │ └── svelteserver.vim
│ ├── swift/
│ │ ├── appleswiftformat.vim
│ │ ├── cspell.vim
│ │ ├── sourcekitlsp.vim
│ │ └── swiftlint.vim
│ ├── systemd/
│ │ └── systemd_analyze.vim
│ ├── tcl/
│ │ └── nagelfar.vim
│ ├── terraform/
│ │ ├── checkov.vim
│ │ ├── terraform.vim
│ │ ├── terraform_ls.vim
│ │ ├── terraform_lsp.vim
│ │ ├── tflint.vim
│ │ └── tfsec.vim
│ ├── testft/
│ │ └── testlinter.vim
│ ├── tex/
│ │ ├── alex.vim
│ │ ├── chktex.vim
│ │ ├── cspell.vim
│ │ ├── lacheck.vim
│ │ ├── proselint.vim
│ │ ├── redpen.vim
│ │ ├── texlab.vim
│ │ ├── textlint.vim
│ │ ├── vale.vim
│ │ └── writegood.vim
│ ├── texinfo/
│ │ ├── alex.vim
│ │ ├── cspell.vim
│ │ ├── proselint.vim
│ │ └── writegood.vim
│ ├── text/
│ │ ├── alex.vim
│ │ ├── cspell.vim
│ │ ├── languagetool.vim
│ │ ├── proselint.vim
│ │ ├── redpen.vim
│ │ ├── textlint.vim
│ │ ├── vale.vim
│ │ └── writegood.vim
│ ├── thrift/
│ │ ├── thrift.vim
│ │ └── thriftcheck.vim
│ ├── toml/
│ │ └── tombi.vim
│ ├── typescript/
│ │ ├── biome.vim
│ │ ├── cspell.vim
│ │ ├── deno.vim
│ │ ├── eslint.vim
│ │ ├── standard.vim
│ │ ├── tslint.vim
│ │ ├── tsserver.vim
│ │ ├── typecheck.vim
│ │ └── xo.vim
│ ├── v/
│ │ └── v.vim
│ ├── vala/
│ │ └── vala_lint.vim
│ ├── verilog/
│ │ ├── hdl_checker.vim
│ │ ├── iverilog.vim
│ │ ├── slang.vim
│ │ ├── verible_ls.vim
│ │ ├── verilator.vim
│ │ ├── vlog.vim
│ │ ├── xvlog.vim
│ │ └── yosys.vim
│ ├── vhdl/
│ │ ├── ghdl.vim
│ │ ├── hdl_checker.vim
│ │ ├── vcom.vim
│ │ └── xvhdl.vim
│ ├── vim/
│ │ ├── ale_custom_linting_rules.vim
│ │ ├── vimls.vim
│ │ └── vint.vim
│ ├── vue/
│ │ ├── cspell.vim
│ │ ├── vls.vim
│ │ └── volar.vim
│ ├── wgsl/
│ │ └── naga.vim
│ ├── xhtml/
│ │ ├── alex.vim
│ │ ├── cspell.vim
│ │ ├── proselint.vim
│ │ └── writegood.vim
│ ├── xml/
│ │ └── xmllint.vim
│ ├── yaml/
│ │ ├── actionlint.vim
│ │ ├── circleci.vim
│ │ ├── gitlablint.vim
│ │ ├── ls.vim
│ │ ├── spectral.vim
│ │ ├── swaglint.vim
│ │ ├── yamllint.vim
│ │ └── yq.vim
│ ├── yang/
│ │ └── yang_lsp.vim
│ ├── yara/
│ │ └── yls.vim
│ ├── zeek/
│ │ └── zeek.vim
│ └── zig/
│ ├── zlint.vim
│ └── zls.vim
├── autoload/
│ ├── ale/
│ │ ├── ant.vim
│ │ ├── args.vim
│ │ ├── assert.vim
│ │ ├── balloon.vim
│ │ ├── c.vim
│ │ ├── code_action.vim
│ │ ├── codefix.vim
│ │ ├── command.vim
│ │ ├── completion/
│ │ │ └── python.vim
│ │ ├── completion.vim
│ │ ├── cursor.vim
│ │ ├── d.vim
│ │ ├── debugging.vim
│ │ ├── definition.vim
│ │ ├── dhall.vim
│ │ ├── engine/
│ │ │ └── ignore.vim
│ │ ├── engine.vim
│ │ ├── events.vim
│ │ ├── filename_mapping.vim
│ │ ├── filerename.vim
│ │ ├── filetypes.vim
│ │ ├── fix/
│ │ │ └── registry.vim
│ │ ├── fix.vim
│ │ ├── fixers/
│ │ │ ├── alejandra.vim
│ │ │ ├── apkbuild_fixer.vim
│ │ │ ├── appleswiftformat.vim
│ │ │ ├── astyle.vim
│ │ │ ├── autoflake.vim
│ │ │ ├── autoimport.vim
│ │ │ ├── autopep8.vim
│ │ │ ├── bibclean.vim
│ │ │ ├── biome.vim
│ │ │ ├── black.vim
│ │ │ ├── brittany.vim
│ │ │ ├── buf_format.vim
│ │ │ ├── buildifier.vim
│ │ │ ├── clangformat.vim
│ │ │ ├── clangtidy.vim
│ │ │ ├── cljfmt.vim
│ │ │ ├── cmakeformat.vim
│ │ │ ├── crystal.vim
│ │ │ ├── css_beautify.vim
│ │ │ ├── dart_format.vim
│ │ │ ├── dartfmt.vim
│ │ │ ├── deno.vim
│ │ │ ├── dfmt.vim
│ │ │ ├── dhall_format.vim
│ │ │ ├── dhall_freeze.vim
│ │ │ ├── dhall_lint.vim
│ │ │ ├── djlint.vim
│ │ │ ├── dotnet_format.vim
│ │ │ ├── dprint.vim
│ │ │ ├── dune.vim
│ │ │ ├── elm_format.vim
│ │ │ ├── erbformatter.vim
│ │ │ ├── erblint.vim
│ │ │ ├── erlang_mode.vim
│ │ │ ├── erlfmt.vim
│ │ │ ├── eslint.vim
│ │ │ ├── fecs.vim
│ │ │ ├── fish_indent.vim
│ │ │ ├── fixjson.vim
│ │ │ ├── floskell.vim
│ │ │ ├── forge.vim
│ │ │ ├── fourmolu.vim
│ │ │ ├── generic.vim
│ │ │ ├── generic_python.vim
│ │ │ ├── gleam_format.vim
│ │ │ ├── gnatpp.vim
│ │ │ ├── gofmt.vim
│ │ │ ├── gofumpt.vim
│ │ │ ├── goimports.vim
│ │ │ ├── golangci_lint.vim
│ │ │ ├── golines.vim
│ │ │ ├── gomod.vim
│ │ │ ├── google_java_format.vim
│ │ │ ├── gopls.vim
│ │ │ ├── hackfmt.vim
│ │ │ ├── help.vim
│ │ │ ├── hfmt.vim
│ │ │ ├── hindent.vim
│ │ │ ├── hlint.vim
│ │ │ ├── html_beautify.vim
│ │ │ ├── htmlbeautifier.vim
│ │ │ ├── hurlfmt.vim
│ │ │ ├── importjs.vim
│ │ │ ├── isort.vim
│ │ │ ├── jq.vim
│ │ │ ├── json_pytool.vim
│ │ │ ├── jsonnetfmt.vim
│ │ │ ├── ktlint.vim
│ │ │ ├── kulala_fmt.vim
│ │ │ ├── latexindent.vim
│ │ │ ├── lua_format.vim
│ │ │ ├── luafmt.vim
│ │ │ ├── markdownlint.vim
│ │ │ ├── mix_format.vim
│ │ │ ├── nickel_format.vim
│ │ │ ├── nimpretty.vim
│ │ │ ├── nixfmt.vim
│ │ │ ├── nixpkgsfmt.vim
│ │ │ ├── npmgroovylint.vim
│ │ │ ├── ocamlformat.vim
│ │ │ ├── ocp_indent.vim
│ │ │ ├── opafmt.vim
│ │ │ ├── ormolu.vim
│ │ │ ├── packer.vim
│ │ │ ├── pandoc.vim
│ │ │ ├── perltidy.vim
│ │ │ ├── pgformatter.vim
│ │ │ ├── php_cs_fixer.vim
│ │ │ ├── phpcbf.vim
│ │ │ ├── pint.vim
│ │ │ ├── prettier.vim
│ │ │ ├── prettier_eslint.vim
│ │ │ ├── prettier_standard.vim
│ │ │ ├── protolint.vim
│ │ │ ├── ptop.vim
│ │ │ ├── puppetlint.vim
│ │ │ ├── purs_tidy.vim
│ │ │ ├── purty.vim
│ │ │ ├── pycln.vim
│ │ │ ├── pyflyby.vim
│ │ │ ├── pymarkdown.vim
│ │ │ ├── qmlfmt.vim
│ │ │ ├── raco_fmt.vim
│ │ │ ├── refmt.vim
│ │ │ ├── remark_lint.vim
│ │ │ ├── reorder_python_imports.vim
│ │ │ ├── rescript_format.vim
│ │ │ ├── roc_annotate.vim
│ │ │ ├── roc_format.vim
│ │ │ ├── rubocop.vim
│ │ │ ├── rubyfmt.vim
│ │ │ ├── ruff.vim
│ │ │ ├── ruff_format.vim
│ │ │ ├── rufo.vim
│ │ │ ├── rustfmt.vim
│ │ │ ├── rustywind.vim
│ │ │ ├── scadformat.vim
│ │ │ ├── scalafmt.vim
│ │ │ ├── shfmt.vim
│ │ │ ├── sorbet.vim
│ │ │ ├── sqlfluff.vim
│ │ │ ├── sqlfmt.vim
│ │ │ ├── sqlformat.vim
│ │ │ ├── standard.vim
│ │ │ ├── standardrb.vim
│ │ │ ├── statix.vim
│ │ │ ├── stylelint.vim
│ │ │ ├── styler.vim
│ │ │ ├── stylish_haskell.vim
│ │ │ ├── stylua.vim
│ │ │ ├── swiftformat.vim
│ │ │ ├── syntax_tree.vim
│ │ │ ├── terraform.vim
│ │ │ ├── textlint.vim
│ │ │ ├── tidy.vim
│ │ │ ├── tombi_format.vim
│ │ │ ├── tombi_lint.vim
│ │ │ ├── tslint.vim
│ │ │ ├── typstyle.vim
│ │ │ ├── uncrustify.vim
│ │ │ ├── unimport.vim
│ │ │ ├── verible_format.vim
│ │ │ ├── vfmt.vim
│ │ │ ├── xmllint.vim
│ │ │ ├── xo.vim
│ │ │ ├── yamlfix.vim
│ │ │ ├── yamlfmt.vim
│ │ │ ├── yapf.vim
│ │ │ ├── yq.vim
│ │ │ └── zigfmt.vim
│ │ ├── floating_preview.vim
│ │ ├── fzf.vim
│ │ ├── go.vim
│ │ ├── gradle/
│ │ │ └── init.gradle
│ │ ├── gradle.vim
│ │ ├── handlers/
│ │ │ ├── alex.vim
│ │ │ ├── atools.vim
│ │ │ ├── biome.vim
│ │ │ ├── c3lsp.vim
│ │ │ ├── cairo.vim
│ │ │ ├── ccls.vim
│ │ │ ├── cppcheck.vim
│ │ │ ├── cpplint.vim
│ │ │ ├── cspell.vim
│ │ │ ├── css.vim
│ │ │ ├── deadnix.vim
│ │ │ ├── deno.vim
│ │ │ ├── djlint.vim
│ │ │ ├── elixir.vim
│ │ │ ├── embertemplatelint.vim
│ │ │ ├── eslint.vim
│ │ │ ├── fecs.vim
│ │ │ ├── flawfinder.vim
│ │ │ ├── gawk.vim
│ │ │ ├── gcc.vim
│ │ │ ├── go.vim
│ │ │ ├── haskell.vim
│ │ │ ├── haskell_stack.vim
│ │ │ ├── hdl_checker.vim
│ │ │ ├── hlint.vim
│ │ │ ├── inko.vim
│ │ │ ├── ktlint.vim
│ │ │ ├── languagetool.vim
│ │ │ ├── markdownlint.vim
│ │ │ ├── naga.vim
│ │ │ ├── ocamllsp.vim
│ │ │ ├── ols.vim
│ │ │ ├── openscad.vim
│ │ │ ├── pony.vim
│ │ │ ├── redpen.vim
│ │ │ ├── ruby.vim
│ │ │ ├── rust.vim
│ │ │ ├── scala.vim
│ │ │ ├── sh.vim
│ │ │ ├── shellcheck.vim
│ │ │ ├── sml.vim
│ │ │ ├── spectral.vim
│ │ │ ├── statix.vim
│ │ │ ├── textlint.vim
│ │ │ ├── tslint.vim
│ │ │ ├── tsserver.vim
│ │ │ ├── unix.vim
│ │ │ ├── vale.vim
│ │ │ ├── writegood.vim
│ │ │ ├── xo.vim
│ │ │ └── yamllint.vim
│ │ ├── highlight.vim
│ │ ├── history.vim
│ │ ├── hover.vim
│ │ ├── java.vim
│ │ ├── job.vim
│ │ ├── julia.vim
│ │ ├── linter.vim
│ │ ├── list.vim
│ │ ├── loclist_jumping.vim
│ │ ├── lsp/
│ │ │ ├── message.vim
│ │ │ ├── reset.vim
│ │ │ ├── response.vim
│ │ │ └── tsserver_message.vim
│ │ ├── lsp.vim
│ │ ├── lsp_linter.vim
│ │ ├── lsp_window.vim
│ │ ├── lua.vim
│ │ ├── maven.vim
│ │ ├── node.vim
│ │ ├── organize_imports.vim
│ │ ├── other_source.vim
│ │ ├── path.vim
│ │ ├── pattern_options.vim
│ │ ├── powershell.vim
│ │ ├── preview.vim
│ │ ├── proselint.vim
│ │ ├── python.vim
│ │ ├── racket.vim
│ │ ├── references.vim
│ │ ├── rename.vim
│ │ ├── ruby.vim
│ │ ├── semver.vim
│ │ ├── sign.vim
│ │ ├── socket.vim
│ │ ├── statusline.vim
│ │ ├── swift.vim
│ │ ├── symbol.vim
│ │ ├── test.vim
│ │ ├── toggle.vim
│ │ ├── uri/
│ │ │ └── jdt.vim
│ │ ├── uri.vim
│ │ ├── util.vim
│ │ └── virtualtext.vim
│ ├── ale.vim
│ └── asyncomplete/
│ └── sources/
│ └── ale.vim
├── doc/
│ ├── ale-ada.txt
│ ├── ale-ansible.txt
│ ├── ale-apkbuild.txt
│ ├── ale-asciidoc.txt
│ ├── ale-asm.txt
│ ├── ale-astro.txt
│ ├── ale-avra.txt
│ ├── ale-awk.txt
│ ├── ale-bats.txt
│ ├── ale-bazel.txt
│ ├── ale-bib.txt
│ ├── ale-bicep.txt
│ ├── ale-bindzone.txt
│ ├── ale-bitbake.txt
│ ├── ale-c.txt
│ ├── ale-c3.txt
│ ├── ale-cairo.txt
│ ├── ale-chef.txt
│ ├── ale-clojure.txt
│ ├── ale-cloudformation.txt
│ ├── ale-cmake.txt
│ ├── ale-cpp.txt
│ ├── ale-cs.txt
│ ├── ale-css.txt
│ ├── ale-cuda.txt
│ ├── ale-d.txt
│ ├── ale-dafny.txt
│ ├── ale-dart.txt
│ ├── ale-desktop.txt
│ ├── ale-development.txt
│ ├── ale-dhall.txt
│ ├── ale-dockerfile.txt
│ ├── ale-elixir.txt
│ ├── ale-elm.txt
│ ├── ale-erlang.txt
│ ├── ale-eruby.txt
│ ├── ale-fish.txt
│ ├── ale-fortran.txt
│ ├── ale-fountain.txt
│ ├── ale-fuse.txt
│ ├── ale-gitcommit.txt
│ ├── ale-gleam.txt
│ ├── ale-glsl.txt
│ ├── ale-go.txt
│ ├── ale-gohtmltmpl.txt
│ ├── ale-graphql.txt
│ ├── ale-groovy.txt
│ ├── ale-hack.txt
│ ├── ale-handlebars.txt
│ ├── ale-haskell.txt
│ ├── ale-hcl.txt
│ ├── ale-help.txt
│ ├── ale-html.txt
│ ├── ale-htmlangular.txt
│ ├── ale-htmldjango.txt
│ ├── ale-http.txt
│ ├── ale-hurl.txt
│ ├── ale-idris.txt
│ ├── ale-ink.txt
│ ├── ale-inko.txt
│ ├── ale-ispc.txt
│ ├── ale-java.txt
│ ├── ale-javascript.txt
│ ├── ale-jinja.txt
│ ├── ale-json.txt
│ ├── ale-json5.txt
│ ├── ale-jsonc.txt
│ ├── ale-jsonnet.txt
│ ├── ale-julia.txt
│ ├── ale-kotlin.txt
│ ├── ale-latex.txt
│ ├── ale-lean.txt
│ ├── ale-less.txt
│ ├── ale-llvm.txt
│ ├── ale-lua.txt
│ ├── ale-make.txt
│ ├── ale-markdown.txt
│ ├── ale-mercury.txt
│ ├── ale-nasm.txt
│ ├── ale-nickel.txt
│ ├── ale-nim.txt
│ ├── ale-nix.txt
│ ├── ale-nroff.txt
│ ├── ale-nunjucks.txt
│ ├── ale-objc.txt
│ ├── ale-objcpp.txt
│ ├── ale-ocaml.txt
│ ├── ale-odin.txt
│ ├── ale-openapi.txt
│ ├── ale-openscad.txt
│ ├── ale-packer.txt
│ ├── ale-pascal.txt
│ ├── ale-pawn.txt
│ ├── ale-perl.txt
│ ├── ale-perl6.txt
│ ├── ale-php.txt
│ ├── ale-po.txt
│ ├── ale-pod.txt
│ ├── ale-pony.txt
│ ├── ale-powershell.txt
│ ├── ale-prolog.txt
│ ├── ale-proto.txt
│ ├── ale-pug.txt
│ ├── ale-puppet.txt
│ ├── ale-purescript.txt
│ ├── ale-pyrex.txt
│ ├── ale-python.txt
│ ├── ale-qml.txt
│ ├── ale-r.txt
│ ├── ale-racket.txt
│ ├── ale-reasonml.txt
│ ├── ale-rego.txt
│ ├── ale-rescript.txt
│ ├── ale-rest.txt
│ ├── ale-restructuredtext.txt
│ ├── ale-robot.txt
│ ├── ale-roc.txt
│ ├── ale-ruby.txt
│ ├── ale-rust.txt
│ ├── ale-salt.tmt
│ ├── ale-sass.txt
│ ├── ale-scala.txt
│ ├── ale-scss.txt
│ ├── ale-sh.txt
│ ├── ale-sml.txt
│ ├── ale-solidity.txt
│ ├── ale-spec.txt
│ ├── ale-sql.txt
│ ├── ale-stylus.txt
│ ├── ale-sugarss.txt
│ ├── ale-supported-languages-and-tools.txt
│ ├── ale-svelte.txt
│ ├── ale-swift.txt
│ ├── ale-systemd.txt
│ ├── ale-tcl.txt
│ ├── ale-terraform.txt
│ ├── ale-tex.txt
│ ├── ale-texinfo.txt
│ ├── ale-text.txt
│ ├── ale-thrift.txt
│ ├── ale-toml.txt
│ ├── ale-typescript.txt
│ ├── ale-typst.html
│ ├── ale-v.txt
│ ├── ale-vala.txt
│ ├── ale-verilog.txt
│ ├── ale-vhdl.txt
│ ├── ale-vim-help.txt
│ ├── ale-vim.txt
│ ├── ale-vue.txt
│ ├── ale-wgsl.txt
│ ├── ale-xhtml.txt
│ ├── ale-xml.txt
│ ├── ale-yaml.txt
│ ├── ale-yang.txt
│ ├── ale-yara.txt
│ ├── ale-zeek.txt
│ ├── ale-zig.txt
│ └── ale.txt
├── ftplugin/
│ ├── ale-fix-suggest.vim
│ ├── ale-info.vim
│ ├── ale-preview-selection.vim
│ └── ale-preview.vim
├── lspconfig.vim
├── lua/
│ └── ale/
│ ├── diagnostics.lua
│ ├── init.lua
│ ├── lsp.lua
│ └── util.lua
├── plugin/
│ └── ale.vim
├── rplugin/
│ └── python3/
│ └── deoplete/
│ └── sources/
│ └── ale.py
├── run-tests
├── run-tests.bat
├── supported-tools.md
├── syntax/
│ ├── ale-fix-suggest.vim
│ ├── ale-info.vim
│ └── ale-preview-selection.vim
└── test/
├── completion/
│ ├── test_ale_import_command.vader
│ ├── test_complete_events.vader
│ ├── test_completion_events.vader
│ ├── test_completion_filtering.vader
│ ├── test_completion_prefixes.vader
│ ├── test_lsp_completion_messages.vader
│ ├── test_lsp_completion_parsing.vader
│ ├── test_omnifunc_completion.vader
│ ├── test_public_completion_api.vader
│ └── test_tsserver_completion_parsing.vader
├── fix/
│ ├── test_ale_fix.vader
│ ├── test_ale_fix_aliases.vader
│ ├── test_ale_fix_completion.vader
│ ├── test_ale_fix_completion_filter.vader
│ ├── test_ale_fix_ignore.vader
│ └── test_ale_fix_suggest.vader
├── fixers/
│ ├── test_alejandra_fixer_callback.vader
│ ├── test_apkbuild_fixer_callback.vader
│ ├── test_appleswiftformat_fixer_callback.vader
│ ├── test_astyle_fixer_callback.vader
│ ├── test_autoflake_fixer_callback.vader
│ ├── test_autoimport_fixer_callback.vader
│ ├── test_autopep8_fixer_callback.vader
│ ├── test_bibclean_fixer_callback.vader
│ ├── test_biome_fixer_callback.vader
│ ├── test_black_fixer_callback.vader
│ ├── test_break_up_long_lines_python_fixer.vader
│ ├── test_brittany_fixer_callback.vader
│ ├── test_buf_format_fixer_callback.vader
│ ├── test_buildifier_fixer_callback.vader
│ ├── test_clangformat_fixer_callback.vader
│ ├── test_clangtidy_fixer_callback.vader
│ ├── test_cljfmt_fixer_callback.vader
│ ├── test_cmakeformat_fixer_callback.vader
│ ├── test_crystal_format_fixer_callback.vader
│ ├── test_css_beautify_fixer_callback.vader
│ ├── test_dart_format_fixer_callback.vader
│ ├── test_dartfmt_fixer_callback.vader
│ ├── test_dfmt_fixer_callback.vader
│ ├── test_dhall_format_fixer_callback.vader
│ ├── test_dhall_freeze_fixer_callback.vader
│ ├── test_dhall_lint_fixer_callback.vader
│ ├── test_djlint_fixer_callback.vader
│ ├── test_dotnet_format_fixer_callback.vader
│ ├── test_dprint_fixer_callback.vader
│ ├── test_dune_fixer_callback.vader
│ ├── test_elm_format_fixer_callback.vader
│ ├── test_erbformatter_fixer_callback.vader
│ ├── test_erblint_fixer_callback.vader
│ ├── test_erlang_mode_fixer_callback.vader
│ ├── test_erlfmt_fixer_callback.vader
│ ├── test_eslint_fixer_callback.vader
│ ├── test_fecs_fixer_callback.vader
│ ├── test_fish_indent_fixer_callback.vader
│ ├── test_fixjson_fixer_callback.vader
│ ├── test_floskell_fixer_callback.vader
│ ├── test_forge_fixer_callback.vader
│ ├── test_fourmolu_fixer_callback.vader
│ ├── test_gleam_format_fixer_callback.vader
│ ├── test_gnatpp_fixer_callback.vader
│ ├── test_gofmt_fixer_callback.vader
│ ├── test_gofumpt_fixer.vader
│ ├── test_goimports_fixer_callback.vader
│ ├── test_golangci_lint_fixer_callback.vader
│ ├── test_golines_fixer_callback.vader
│ ├── test_gomod_fixer_callback.vader
│ ├── test_goofle_java_format_fixer_callback.vader
│ ├── test_gopls_fixer_callback.vader
│ ├── test_hackfmt_fixer_callback.vader
│ ├── test_hfmt_fixer_callback.vader
│ ├── test_hindent_fixer_callback.vader
│ ├── test_hlint_fixer_callback.vader
│ ├── test_html_beautify_fixer_callback.vader
│ ├── test_htmlbeautifier_fixer_callback.vader
│ ├── test_hurlfmt_fixer_callback.vader
│ ├── test_importjs_fixer_callback.vader
│ ├── test_isort_fixer_callback.vader
│ ├── test_jq_fixer_callback.vader
│ ├── test_jsonnetfmt_fixer_callback.vader
│ ├── test_ktlint_fixer_callback.vader
│ ├── test_kulala_fmt_fixer_callback.vader
│ ├── test_latexindent_fixer_callback.vader
│ ├── test_lua_format_fixer_callback.vader
│ ├── test_luafmt_fixer_callback.vader
│ ├── test_markdownlint_fixer_callback.vader
│ ├── test_mix_format_fixer_callback.vader
│ ├── test_nickel_format_fixer_callback.vader
│ ├── test_nimpretty_fixer_callback.vader
│ ├── test_nixfmt_fixer_callback.vader
│ ├── test_nixpkgsfmt_fixer_callback.vader
│ ├── test_npmgroovylint_fixer_callback.vader
│ ├── test_ocamlformat_fixer_callback.vader
│ ├── test_ocp_indent_fixer_callback.vader
│ ├── test_opa_fmt_fixer_callback.vader
│ ├── test_ormolu_fixer_callback.vader
│ ├── test_packer_fmt_fixer_callback.vader
│ ├── test_pandoc_fixer_callback.vader
│ ├── test_perltidy_fixer_callback.vader
│ ├── test_pgformatter_fixer_callback.vader
│ ├── test_php_cs_fixer.vader
│ ├── test_phpcbf_fixer_callback.vader
│ ├── test_pint_fixer.vader
│ ├── test_prettier_eslint_fixer.callback.vader
│ ├── test_prettier_fixer_callback.vader
│ ├── test_prettier_standard_callback.vader
│ ├── test_protolint_fixer_callback.vader
│ ├── test_ptop_fixer_callback.vader
│ ├── test_puppetlint_fixer_callback.vader
│ ├── test_purs_tidy_fixer_callback.vader
│ ├── test_purty_fixer_callback.vader
│ ├── test_pycln_fixer_callback.vader
│ ├── test_pyflyby_fixer_callback.vader
│ ├── test_pymarkdown_fixer_callback.vader
│ ├── test_python_add_blank_lines_fixer.vader
│ ├── test_qmlfmt_fixer_callback.vader
│ ├── test_raco_fmt_fixer_callback.vader
│ ├── test_refmt_fixer_callback.vader
│ ├── test_remark_lint_fixer_callback.vader
│ ├── test_reorder_python_imports_fixer_callback.vader
│ ├── test_rescript_fixer_callback.vader
│ ├── test_roc_annotate_fixer_callback.vader
│ ├── test_roc_format_fixer_callback.vader
│ ├── test_rubocop_fixer_callback.vader
│ ├── test_rubyfmt_fixer_callback.vader
│ ├── test_ruff_fixer_callback.vader
│ ├── test_ruff_format_fixer_callback.vader
│ ├── test_rufo_fixer_callback.vader
│ ├── test_rustfmt_fixer_callback.vader
│ ├── test_rustywind_fixer_callback.vader
│ ├── test_scadformat_fixer.vader
│ ├── test_scalafmt_fixer_callback.vader
│ ├── test_shfmt_fixer_callback.vader
│ ├── test_sorbet_fixer_callback.vader
│ ├── test_sqlfmt_fixer_callback.vader
│ ├── test_sqlformat_fixer_callback.vader
│ ├── test_standard_fixer_callback.vader
│ ├── test_standardrb_fixer_callback.vader
│ ├── test_statix_fixer.vader
│ ├── test_stylelint_fixer_callback.vader
│ ├── test_styler_fixer_callback.vader
│ ├── test_stylish_haskell_fixer_callback.vader
│ ├── test_stylua_fixer_callback.vader
│ ├── test_swiftformat_fixer_callback.vader
│ ├── test_syntax_tree_fixer_callback.vader
│ ├── test_terraform_fmt_fixer_callback.vader
│ ├── test_textlint_fixer_callback.vader
│ ├── test_tidy_fixer_callback.vader
│ ├── test_tombi_format_fixer_callback.vader
│ ├── test_tombi_lint_fixer_callback.vader
│ ├── test_trim_whitespace.vader
│ ├── test_tslint_fixer_callback.vader
│ ├── test_typstyle_fixer_callback.vader
│ ├── test_uncrustify_fixer_callback.vader
│ ├── test_unimport_fixer_callback.vader
│ ├── test_verible_format_fixer_callback.vader
│ ├── test_vfmt_fixer_callback.vader
│ ├── test_vim_help_tags_alignment_fixer.vader
│ ├── test_xmllint_fixer_callback.vader
│ ├── test_xo_fixer_callback.vader
│ ├── test_xots_fixer_callback.vader
│ ├── test_yamlfix_fixer_callback.vader
│ ├── test_yamlfmt_fixer_callback.vader
│ ├── test_yapf_fixer_callback.vader
│ └── test_zigfmt_fixer_callback.vader
├── handler/
│ ├── test_actionlint_handler.vader
│ ├── test_ada_gcc_handler.vader
│ ├── test_alex_handler.vader
│ ├── test_ameba_handler.vader
│ ├── test_ansible_lint_handler.vader
│ ├── test_appleswiftformat_handler.vader
│ ├── test_asm_handler.vader
│ ├── test_atools_handler.vader
│ ├── test_avra_handler.vader
│ ├── test_bandit_handler.vader
│ ├── test_bashate_handler.vader
│ ├── test_bibclean_handler.vader
│ ├── test_bicep_az_bicep_handler.vader
│ ├── test_bicep_bicep_handler.vader
│ ├── test_bindzone_checkzone.vader
│ ├── test_bitbake_oelint_adv_handler.vader
│ ├── test_brakeman_handler.vader
│ ├── test_buildifier_handler.vader
│ ├── test_cfn_python_lint_handler.vader
│ ├── test_checkmake_handler.vader
│ ├── test_checkov_handler.vader
│ ├── test_checkstyle_handler.vader
│ ├── test_circleci_handler.vader
│ ├── test_clang_handler.vader
│ ├── test_clojure_clj_kondo_handler.vader
│ ├── test_clojure_joker_handler.vader
│ ├── test_cloudformation_checkov_handler.vader
│ ├── test_cmake_lint_handler.vader
│ ├── test_coffeelint_handler.vader
│ ├── test_common_handlers.vader
│ ├── test_cookstyle_handler.vader
│ ├── test_cppcheck_handler.vader
│ ├── test_cpplint_handler.vader
│ ├── test_credo_handler.vader
│ ├── test_crystal_handler.vader
│ ├── test_csc_handler.vader
│ ├── test_cspell_handler.vader
│ ├── test_cucumber_handler.vader
│ ├── test_cuda_nvcc_handler.vader
│ ├── test_cypher_lint_handler.vader
│ ├── test_dafny_handler.vader
│ ├── test_dart_analyze_handler.vader
│ ├── test_deadnix_handler.vader
│ ├── test_debride_handler.vader
│ ├── test_desktop_file_validate_handler.vader
│ ├── test_djlint_handler.vader
│ ├── test_dmd_handler.vader
│ ├── test_dockerfile_lint_handler.vader
│ ├── test_dockerlinter_handler.vader
│ ├── test_dogma_handler.vader
│ ├── test_drafter_handler.vader
│ ├── test_elmmake_handler.vader
│ ├── test_embertemplatelint_handler.vader
│ ├── test_erblint_handler.vader
│ ├── test_erlang_dialyzer_handler.vader
│ ├── test_erlang_elvis_handler.vader
│ ├── test_eslint_handler.vader
│ ├── test_eslint_json_handler.vader
│ ├── test_fecs_handler.vader
│ ├── test_fish_handler.vader
│ ├── test_flake8_handler.vader
│ ├── test_flakehell_handler.vader
│ ├── test_flawfinder_handler.vader
│ ├── test_flow_handler.vader
│ ├── test_foodcritic_handler.vader
│ ├── test_fortitude_handler.vader
│ ├── test_fortran_handler.vader
│ ├── test_gawk_handler.vader
│ ├── test_gcc_handler.vader
│ ├── test_ghc_handler.vader
│ ├── test_ghc_mod_handler.vader
│ ├── test_ghdl_handler.vader
│ ├── test_gitlablint_handler.vader
│ ├── test_gitlint_handler.vader
│ ├── test_glslang_handler.vader
│ ├── test_go_generic_handler.vader
│ ├── test_gobuild_handler.vader
│ ├── test_golangci_lint_handler.vader
│ ├── test_hadolint.vader
│ ├── test_haskell_stack_handler.vader
│ ├── test_hlint_handler.vader
│ ├── test_hurlfmt_handler.vader
│ ├── test_ibm_openapi_validator_handler.vader
│ ├── test_idris_handler.vader
│ ├── test_inko_handler.vader
│ ├── test_ispc_ispc_handler.vader
│ ├── test_javac_handler.vader
│ ├── test_jq_handler.vader
│ ├── test_jscs_handler.vader
│ ├── test_ktlint_handler.vader
│ ├── test_lacheck_handler.vader
│ ├── test_languagetool_handler.vader
│ ├── test_lessc_handler.vader
│ ├── test_llc_handler.vader
│ ├── test_llvm_mc_handler.vader
│ ├── test_lua_selene_handler.vader
│ ├── test_luac_handler.vader
│ ├── test_luacheck_handler.vader
│ ├── test_markdownlint_handler.vader
│ ├── test_mcs_handler.vader
│ ├── test_mcsc_handler.vader
│ ├── test_mdl_handler.vader
│ ├── test_mercury_mmc_handler.vader
│ ├── test_mix_handler.vader
│ ├── test_msgfmt_hander.vader
│ ├── test_mypy_handler.vader
│ ├── test_naga_handler.vader
│ ├── test_nagelfar_handler.vader
│ ├── test_nasm_handler.vader
│ ├── test_nim_handler.vader
│ ├── test_nix_handler.vader
│ ├── test_npmgroovylint_handler.vader
│ ├── test_openscad_handler.vader
│ ├── test_packwerk_handler.vader
│ ├── test_perl6_handler.vader
│ ├── test_perl_handler.vader
│ ├── test_perlcritic_handler.vader
│ ├── test_php_handler.vader
│ ├── test_php_phan_handler.vader
│ ├── test_php_phpmd_handler.vader
│ ├── test_phpcs_handler.vader
│ ├── test_phpstan_handler.vader
│ ├── test_pmd_handler.vader
│ ├── test_pony_handler.vader
│ ├── test_powershell_handler.vader
│ ├── test_prospector_handler.vader
│ ├── test_psscriptanalyzer_handler.vader
│ ├── test_puglint_handler.vader
│ ├── test_puppet_handler.vader
│ ├── test_pycodestyle_handler.vader
│ ├── test_pydocstyle_handler.vader
│ ├── test_pyflakes_handler.vader
│ ├── test_pylama_handler.vader
│ ├── test_pylint_handler.vader
│ ├── test_pyrex_cython_handler.vader
│ ├── test_qmlfmt_handler.vader
│ ├── test_qmllint_handler.vader
│ ├── test_raco_handler.vader
│ ├── test_rails_best_practices_handler.vader
│ ├── test_redpen_handler.vader
│ ├── test_reek_handler.vader
│ ├── test_remark_lint_handler.vader
│ ├── test_rflint_handler.vader
│ ├── test_rpmlint_handler.vader
│ ├── test_rstcheck_lint_handler.vader
│ ├── test_rubocop_handler.vader
│ ├── test_ruby_handler.vader
│ ├── test_ruff_handler.vader
│ ├── test_rust_handler.vader
│ ├── test_salt_salt_lint.vader
│ ├── test_scala_handler.vader
│ ├── test_scalastyle_handler.vader
│ ├── test_scarb_handler.vader
│ ├── test_shell_handler.vader
│ ├── test_shellcheck_handler.vader
│ ├── test_sierra_handler.vader
│ ├── test_slang_handler.vader
│ ├── test_slim_handler.vader
│ ├── test_sml_handler.vader
│ ├── test_solc_handler.vader
│ ├── test_solhint_handler.vader
│ ├── test_spectral_handler.vader
│ ├── test_sql_sqlfluff_handler.vader
│ ├── test_sqlint_handler.vader
│ ├── test_sqllint_handler.vader
│ ├── test_standard_handler.vader
│ ├── test_starknet_handler.vader
│ ├── test_statix_handler.vader
│ ├── test_steep_handler.vader
│ ├── test_stylelint_handler.vader
│ ├── test_swaglint_handler.vader
│ ├── test_swiftlint_handler.vader
│ ├── test_swipl_handler.vader
│ ├── test_syntaxerl_handler.vader
│ ├── test_systemd_analyze_handler.vader
│ ├── test_terraform_handler.vader
│ ├── test_textlint_handler.vader
│ ├── test_tflint_handler.vader
│ ├── test_tfsec_handler.vader
│ ├── test_thrift_handler.vader
│ ├── test_thriftcheck_handler.vader
│ ├── test_tlint_handler.vader
│ ├── test_tslint_handler.vader
│ ├── test_typecheck_handler.vader
│ ├── test_unimport_handler.vader
│ ├── test_v_handler.vader
│ ├── test_vala_lint_handler.vader
│ ├── test_vale_handler.vader
│ ├── test_vcom_handler.vader
│ ├── test_verilator_handler.vader
│ ├── test_vint_handler.vader
│ ├── test_vlog_handler.vader
│ ├── test_vulture_handler.vader
│ ├── test_write_good_handler.vader
│ ├── test_xmllint_handler.vader
│ ├── test_xvhdl_handler.vader
│ ├── test_xvlog_handler.vader
│ ├── test_yamllint_handler.vader
│ ├── test_yosys_handler.vader
│ ├── test_yq_handler.vader
│ ├── test_zeek_handler.vader
│ └── test_zlint_handler.vader
├── jsonnet_files/
│ └── testfile.jsonnet
├── linter/
│ ├── test_ada_gcc.vader
│ ├── test_adals.vader
│ ├── test_alex.vader
│ ├── test_ameba.vader
│ ├── test_angular.vader
│ ├── test_ansible_language_server.vader
│ ├── test_ansible_lint.vader
│ ├── test_asciidoc_textlint.vader
│ ├── test_asm_gcc.vader
│ ├── test_avra_avra.vader
│ ├── test_bandit.vader
│ ├── test_bashate.vader
│ ├── test_bib_bibclean.vader
│ ├── test_bicep_az_bicep.vader
│ ├── test_bicep_bicep.vader
│ ├── test_bindzone_checkzone.vader
│ ├── test_bingo.vader
│ ├── test_biome.vader
│ ├── test_bitbake.vader
│ ├── test_brakeman.vader
│ ├── test_buf_lint.vader
│ ├── test_bzl_buildifier.vader
│ ├── test_c3_c3lsp.vader
│ ├── test_c_cc.vader
│ ├── test_c_ccls.vader
│ ├── test_c_clang_tidy.vader
│ ├── test_c_clangcheck.vader
│ ├── test_c_clangd.vader
│ ├── test_c_cppcheck.vader
│ ├── test_c_cquery.vader
│ ├── test_c_flawfinder.vader
│ ├── test_c_import_paths.vader
│ ├── test_cargo.vader
│ ├── test_checkmake.vader
│ ├── test_checkov.vader
│ ├── test_checkstyle.vader
│ ├── test_circleci.vader
│ ├── test_clang_tidy.vader
│ ├── test_clj_kondo.vader
│ ├── test_cloudformation_checkov.vader
│ ├── test_cmake_cmake_lint.vader
│ ├── test_cookstyle.vader
│ ├── test_cpp_cc.vader
│ ├── test_cpp_ccls.vader
│ ├── test_cpp_clangcheck.vader
│ ├── test_cpp_clazy.vader
│ ├── test_cpp_cppcheck.vader
│ ├── test_cpp_cquery.vader
│ ├── test_cpp_flawfinder.vader
│ ├── test_cpplint.vader
│ ├── test_cs_csc.vader
│ ├── test_cs_mcs.vader
│ ├── test_cs_mcsc.vader
│ ├── test_cspell.vader
│ ├── test_css_csslint.vader
│ ├── test_css_stylelint.vader
│ ├── test_cucumber.vader
│ ├── test_cuda_nvcc.vader
│ ├── test_cypher_lint.vader
│ ├── test_d_dls.vader
│ ├── test_dart_analysis_server.vader
│ ├── test_dart_language_server.vader
│ ├── test_desktop_file_validate.vader
│ ├── test_dialyxir.vader
│ ├── test_djlint.vader
│ ├── test_dmd_commandline.vader
│ ├── test_dockerfile_lint.vader
│ ├── test_dockerlinter.vader
│ ├── test_dogma.vader
│ ├── test_eclipselsp.vader
│ ├── test_elixir_credo.vader
│ ├── test_elixir_expert.vader
│ ├── test_elixir_ls.vader
│ ├── test_elixir_mix.vader
│ ├── test_elm_ls.vader
│ ├── test_elm_make.vader
│ ├── test_embertemplatelint.vader
│ ├── test_erb.vader
│ ├── test_erblint.vader
│ ├── test_erlang_dialyzer.vader
│ ├── test_erlang_elvis.vader
│ ├── test_erlang_erlang_ls.vader
│ ├── test_erlang_erlc.vader
│ ├── test_erlang_syntaxerl.vader
│ ├── test_erubi.vader
│ ├── test_erubis.vader
│ ├── test_eslint.vader
│ ├── test_fecs.vader
│ ├── test_flake8.vader
│ ├── test_flakehell.vader
│ ├── test_flow.vader
│ ├── test_foodcritic.vader
│ ├── test_fortitude.vader
│ ├── test_fortran_fortls.vader
│ ├── test_fsc.vader
│ ├── test_fusionlint.vader
│ ├── test_gawk.vader
│ ├── test_gfortran.vader
│ ├── test_ghdl.vader
│ ├── test_gitlint.vader
│ ├── test_gleam_gleamlsp.vader
│ ├── test_glslang.vader
│ ├── test_glslls.vader
│ ├── test_gobuild.vader
│ ├── test_gofmt.vader
│ ├── test_golangci_lint.vader
│ ├── test_golangserver.vader
│ ├── test_gopls.vader
│ ├── test_gosimple.vader
│ ├── test_gotype.vader
│ ├── test_govet.vader
│ ├── test_graphql_gqlint.vader
│ ├── test_hadolint.vader
│ ├── test_haml_hamllint.vader
│ ├── test_haskell_cabal_ghc.vader
│ ├── test_haskell_ghc.vader
│ ├── test_haskell_ghc_mod.vader
│ ├── test_haskell_hdevtools.vader
│ ├── test_haskell_hie.vader
│ ├── test_haskell_hlint.vader
│ ├── test_haskell_hls.vader
│ ├── test_haskell_stack_build.vader
│ ├── test_haskell_stack_ghc.vader
│ ├── test_hdl_checker_options.vader
│ ├── test_html_stylelint.vader
│ ├── test_htmlhint.vader
│ ├── test_hurlfmt.vader
│ ├── test_ibm_openapi_validator.vader
│ ├── test_idris.vader
│ ├── test_ink_ls.vader
│ ├── test_inko_inko.vader
│ ├── test_ispc_ispc.vader
│ ├── test_iverilog.vader
│ ├── test_j2lint.vader
│ ├── test_javac.vader
│ ├── test_javalsp.vader
│ ├── test_javascript_deno_lsp.vader
│ ├── test_javascript_tsserver.vader
│ ├── test_jedils.vader
│ ├── test_jq.vader
│ ├── test_jscs.vader
│ ├── test_jshint.vader
│ ├── test_json_vscodejson.vader
│ ├── test_jsonlint.vader
│ ├── test_jsonnet_lint.vader
│ ├── test_jsonnetfmt.vader
│ ├── test_julia_languageserver.vader
│ ├── test_kotlin_languageserver.vader
│ ├── test_kotlinc.vader
│ ├── test_languagetool.vader
│ ├── test_lean_lake.vader
│ ├── test_less_stylelint.vader
│ ├── test_lessc.vader
│ ├── test_lexical.vader
│ ├── test_lintr.vader
│ ├── test_llc.vader
│ ├── test_llvm_mc.vader
│ ├── test_lua_language_server.vader
│ ├── test_lua_selene.vader
│ ├── test_luac.vader
│ ├── test_luacheck.vader
│ ├── test_markdown_markdownlint.vader
│ ├── test_markdown_marksman.vader
│ ├── test_markdown_mdl.vader
│ ├── test_markdown_vale.vader
│ ├── test_mercury_mmc.vader
│ ├── test_mypy.vader
│ ├── test_naga.vader
│ ├── test_nagelfar.vader
│ ├── test_nasm_nasm.vader
│ ├── test_nimlsp.vader
│ ├── test_nix_deadnix.vader
│ ├── test_nix_statix.vader
│ ├── test_npmgroovylint.vader
│ ├── test_objc_ccls.vader
│ ├── test_ocaml_ocamllsp.vader
│ ├── test_ocaml_ols.vader
│ ├── test_ocamlinterface_ocamllsp.vader
│ ├── test_odin_ols.vader
│ ├── test_openscad_sca2d.vader
│ ├── test_packwerk.vader
│ ├── test_perl.vader
│ ├── test_perl6.vader
│ ├── test_perl_languageserver.vader
│ ├── test_perlcritic.vader
│ ├── test_php.vader
│ ├── test_php_intelephense.vader
│ ├── test_php_langserver.vader
│ ├── test_phpactor.vader
│ ├── test_phpcs.vader
│ ├── test_phpmd.vader
│ ├── test_phpstan.vader
│ ├── test_pony_ponyc.vader
│ ├── test_prospector.vader
│ ├── test_proto.vader
│ ├── test_protolint.vader
│ ├── test_psalm.vader
│ ├── test_puglint.vader
│ ├── test_puppet_languageserver.vader
│ ├── test_purescript_ls.vader
│ ├── test_pycln.vader
│ ├── test_pycodestyle.vader
│ ├── test_pydocstyle.vader
│ ├── test_pyflakes.vader
│ ├── test_pylama.vader
│ ├── test_pylint.vader
│ ├── test_pylsp.vader
│ ├── test_pymarkdown.vader
│ ├── test_pymarkdown_handler.vader
│ ├── test_pyre.vader
│ ├── test_pyrefly.vader
│ ├── test_pyrex_cython.vader
│ ├── test_pyright.vader
│ ├── test_qmlfmt.vader
│ ├── test_r_languageserver.vader
│ ├── test_racket_langserver.vader
│ ├── test_racket_raco.vader
│ ├── test_rails_best_practices.vader
│ ├── test_reason_ls.vader
│ ├── test_reason_ols.vader
│ ├── test_redpen.vader
│ ├── test_reek.vader
│ ├── test_refurb.vader
│ ├── test_rego_opacheck.vader
│ ├── test_remark_lint.vader
│ ├── test_rescript_language_server.vader
│ ├── test_revive.vader
│ ├── test_rflint.vader
│ ├── test_rnix.vader
│ ├── test_roc_roc_language_server.vader
│ ├── test_rst_rstcheck.vader
│ ├── test_rst_textlint.vader
│ ├── test_rubocop.vader
│ ├── test_ruby.vader
│ ├── test_ruby_debride.vader
│ ├── test_ruby_solargraph.vader
│ ├── test_ruby_steep.vader
│ ├── test_ruff.vader
│ ├── test_rust_analyzer.vader
│ ├── test_rust_rls.vader
│ ├── test_rustc.vader
│ ├── test_ruumba.vader
│ ├── test_sass_sasslint.vader
│ ├── test_scala_metals.vader
│ ├── test_scala_sbtserver.vader
│ ├── test_scalac.vader
│ ├── test_scalastyle.vader
│ ├── test_scss_sasslint.vader
│ ├── test_scss_stylelint.vader
│ ├── test_shellcheck.vader
│ ├── test_slang.vader
│ ├── test_slimlint.vader
│ ├── test_solc.vader
│ ├── test_solc_commit.vader
│ ├── test_solhint.vader
│ ├── test_sorbet.vader
│ ├── test_spectral.vader
│ ├── test_sql_sqlfluff.vader
│ ├── test_sqllint.vader
│ ├── test_standard.vader
│ ├── test_standardrb.vader
│ ├── test_standardts.vader
│ ├── test_starknet.vader
│ ├── test_staticcheck.vader
│ ├── test_sugarss_stylelint.vader
│ ├── test_superhtml.vader
│ ├── test_svelteserver.vader
│ ├── test_swaglint.vader
│ ├── test_swift_appleswiftformat.vader
│ ├── test_swift_sourcekitlsp.vader
│ ├── test_swiftlint.vader
│ ├── test_systemd_analyze.vader
│ ├── test_terraform_ls.vader
│ ├── test_terraform_lsp.vader
│ ├── test_terraform_terraform.vader
│ ├── test_terraform_tflint.vader
│ ├── test_terraform_tfsec.vader
│ ├── test_tex_chktex.vader
│ ├── test_tex_lacheck.vader
│ ├── test_tex_textlint.vader
│ ├── test_texlab.vader
│ ├── test_text_vale.vader
│ ├── test_textlint.vader
│ ├── test_thrift.vader
│ ├── test_thriftcheck.vader
│ ├── test_toml_tombi.vader
│ ├── test_tslint.vader
│ ├── test_typescript_deno_lsp.vader
│ ├── test_typescript_tsserver.vader
│ ├── test_unimport.vader
│ ├── test_v_command_callback.vader
│ ├── test_vcom.vader
│ ├── test_verilator.vader
│ ├── test_verilog_verible_ls.vader
│ ├── test_vim_vimls.vader
│ ├── test_vint.vader
│ ├── test_vlog.vader
│ ├── test_volar.vader
│ ├── test_vulture.vader
│ ├── test_write_good.vader
│ ├── test_xmllint.vader
│ ├── test_xo.vader
│ ├── test_xots.vader
│ ├── test_xvhdl.vader
│ ├── test_xvlog.vader
│ ├── test_yaml_actionlint.vader
│ ├── test_yaml_ls.vader
│ ├── test_yang_lsp.vader
│ ├── test_yara_yls.vader
│ ├── test_yq.vader
│ ├── test_zeek.vader
│ ├── test_zig_zlint.vader
│ └── test_zig_zls.vader
├── lsp/
│ ├── test_closing_documents.vader
│ ├── test_did_save_event.vader
│ ├── test_engine_lsp_response_handling.vader
│ ├── test_handling_window_requests.vader
│ ├── test_lsp_address_split.vader
│ ├── test_lsp_client_messages.vader
│ ├── test_lsp_command_formatting.vader
│ ├── test_lsp_connections.vader
│ ├── test_lsp_custom_request.vader
│ ├── test_lsp_error_parsing.vader
│ ├── test_lsp_root_detection.vader
│ ├── test_lsp_startup.vader
│ ├── test_other_initialize_message_handling.vader
│ ├── test_read_lsp_diagnostics.vader
│ ├── test_reset_lsp.vader
│ └── test_update_config.vader
├── lua/
│ ├── ale_diagnostics_spec.lua
│ ├── ale_env_spec.lua
│ ├── ale_get_filename_mappings_spec.lua
│ ├── ale_has_spec.lua
│ ├── ale_lsp_send_message_spec.lua
│ ├── ale_lsp_start_spec.lua
│ ├── ale_pad_spec.lua
│ ├── ale_queue_spec.lua
│ ├── ale_var_spec.lua
│ └── windows_escaping_spec.lua
├── python/
│ └── test_deoplete_source.py
├── script/
│ ├── block-padding-checker
│ ├── check-duplicate-tags
│ ├── check-supported-tools-tables
│ ├── check-tag-alignment
│ ├── check-tag-references
│ ├── check-toc
│ ├── custom-checks
│ ├── custom-linting-rules
│ ├── dumb_named_pipe_server.py
│ ├── dumb_tcp_client.py
│ ├── dumb_tcp_server.py
│ ├── run-lua-tests
│ ├── run-vader-tests
│ └── run-vint
├── sign/
│ ├── test_linting_sets_signs.vader
│ ├── test_sign_column_highlighting.vader
│ ├── test_sign_limits.vader
│ ├── test_sign_parsing.vader
│ └── test_sign_placement.vader
├── smoke_test.vader
├── test-files/
│ ├── .circleci/
│ │ └── config.yml
│ ├── .gitignore
│ ├── ada/
│ │ └── testfile.adb
│ ├── ant/
│ │ ├── ant-project/
│ │ │ └── build.xml
│ │ └── bin/
│ │ └── ant
│ ├── bazel/
│ │ ├── BUILD
│ │ ├── WORKSPACE
│ │ └── defs.bzl
│ ├── bib/
│ │ └── dummy.bib
│ ├── biome/
│ │ ├── json/
│ │ │ ├── biome.json
│ │ │ └── src/
│ │ │ └── test.ts
│ │ └── jsonc/
│ │ ├── biome.jsonc
│ │ └── src/
│ │ └── test.ts
│ ├── bzl/
│ │ └── bazel-package/
│ │ └── BUILD.bazel
│ ├── c/
│ │ ├── build_compile_commands_project/
│ │ │ └── build/
│ │ │ ├── bad_folder_to_test_priority
│ │ │ └── compile_commands.json
│ │ ├── configure_project/
│ │ │ ├── Makefile
│ │ │ ├── configure
│ │ │ ├── include/
│ │ │ │ └── test.h
│ │ │ └── subdir/
│ │ │ └── Makefile
│ │ ├── dummy.c
│ │ ├── git_and_nested_makefiles/
│ │ │ ├── include/
│ │ │ │ └── test.h
│ │ │ └── src/
│ │ │ └── Makefile
│ │ ├── gnumakefile_project/
│ │ │ ├── GNUmakefile
│ │ │ └── file.c
│ │ ├── h_file_project/
│ │ │ ├── Makefile
│ │ │ ├── subdir/
│ │ │ │ └── dummy
│ │ │ └── test.h
│ │ ├── hpp_file_project/
│ │ │ ├── Makefile
│ │ │ ├── subdir/
│ │ │ │ └── dummy
│ │ │ └── test.hpp
│ │ ├── json_project/
│ │ │ ├── build/
│ │ │ │ └── compile_commands.json
│ │ │ ├── include/
│ │ │ │ └── test.h
│ │ │ └── subdir/
│ │ │ └── dummy
│ │ └── makefile_project/
│ │ ├── Makefile
│ │ ├── _astylerc
│ │ ├── args
│ │ ├── include/
│ │ │ └── test.h
│ │ └── subdir/
│ │ ├── args
│ │ ├── dummy
│ │ └── file.c
│ ├── cargo/
│ │ ├── Cargo.toml
│ │ └── workspace_paths/
│ │ ├── Cargo.toml
│ │ └── subpath/
│ │ └── Cargo.toml
│ ├── ccls/
│ │ ├── with_build_dir/
│ │ │ └── unusual_build_dir_name/
│ │ │ └── compile_commands.json
│ │ ├── with_ccls/
│ │ │ └── .ccls
│ │ ├── with_ccls-root/
│ │ │ └── .ccls-root
│ │ └── with_compile_commands_json/
│ │ └── compile_commands.json
│ ├── checkstyle/
│ │ └── other_config.xml
│ ├── clangd/
│ │ ├── with_build_dir/
│ │ │ └── unusual_build_dir_name/
│ │ │ └── compile_commands.json
│ │ └── with_compile_commands/
│ │ └── compile_commands.json
│ ├── clangformat/
│ │ └── with_clangformat/
│ │ └── .clang-format
│ ├── cpp/
│ │ ├── .astylerc
│ │ └── dummy.cpp
│ ├── cppcheck/
│ │ ├── one/
│ │ │ ├── compile_commands.json
│ │ │ └── two/
│ │ │ └── three/
│ │ │ ├── file.c
│ │ │ └── file.cpp
│ │ └── with_build_dir/
│ │ └── build/
│ │ └── compile_commands.json
│ ├── cquery/
│ │ ├── build/
│ │ │ └── compile_commands.json
│ │ └── with_cquery/
│ │ └── .cquery
│ ├── csslint/
│ │ ├── other-app/
│ │ │ └── testfile.css
│ │ └── some-app/
│ │ ├── .csslintrc
│ │ └── subdir/
│ │ └── testfile.css
│ ├── cucumber/
│ │ └── features/
│ │ ├── cuke.feature
│ │ └── step_definitions/
│ │ └── base_steps.rb
│ ├── d/
│ │ └── test.d
│ ├── dart/
│ │ ├── .packages
│ │ └── testfile.dart
│ ├── dprint/
│ │ ├── blank.ts
│ │ └── dprint.json
│ ├── elixir/
│ │ ├── mix_project/
│ │ │ ├── lib/
│ │ │ │ └── app.ex
│ │ │ └── mix.exs
│ │ ├── testfile.ex
│ │ └── umbrella_project/
│ │ ├── apps/
│ │ │ ├── app1/
│ │ │ │ ├── lib/
│ │ │ │ │ └── app.ex
│ │ │ │ └── mix.exs
│ │ │ └── app2/
│ │ │ ├── lib/
│ │ │ │ └── app.ex
│ │ │ └── mix.exs
│ │ └── mix.exs
│ ├── elm/
│ │ ├── newapp/
│ │ │ ├── elm.json
│ │ │ ├── src/
│ │ │ │ └── Main.elm
│ │ │ └── tests/
│ │ │ └── TestSuite.elm
│ │ ├── newapp-notests/
│ │ │ ├── elm.json
│ │ │ └── tests/
│ │ │ └── TestMain.elm
│ │ ├── oldapp/
│ │ │ ├── elm-package.json
│ │ │ ├── src/
│ │ │ │ └── Main.elm
│ │ │ └── tests/
│ │ │ └── TestSuite.elm
│ │ └── src/
│ │ └── subdir/
│ │ └── testfile.elm
│ ├── erlang/
│ │ ├── app_with_elvis_config/
│ │ │ └── elvis.config
│ │ ├── app_with_erlang_ls_config/
│ │ │ ├── _build/
│ │ │ │ └── default/
│ │ │ │ └── lib/
│ │ │ │ └── dep/
│ │ │ │ └── erlang_ls.config
│ │ │ ├── deps/
│ │ │ │ └── dep/
│ │ │ │ └── erlang_ls.config
│ │ │ └── erlang_ls.config
│ │ ├── app_with_erlfmt/
│ │ │ └── erlfmt
│ │ ├── erlang_mk_app/
│ │ │ ├── deps/
│ │ │ │ └── dep/
│ │ │ │ └── erlang.mk
│ │ │ └── erlang.mk
│ │ ├── kerl_otp_root/
│ │ │ └── .kerl_config
│ │ └── rebar3_app/
│ │ └── _checkouts/
│ │ └── dep/
│ │ └── _build/
│ │ └── .gitkeep
│ ├── eruby/
│ │ └── dummy.html.erb
│ ├── eslint/
│ │ ├── astro-app/
│ │ │ ├── .eslintrc.js
│ │ │ ├── package.json
│ │ │ ├── src/
│ │ │ │ └── pages/
│ │ │ │ └── index.astro
│ │ │ └── tsconfig.json
│ │ ├── other-app/
│ │ │ └── subdir/
│ │ │ └── testfile.js
│ │ ├── package.json
│ │ ├── react-app/
│ │ │ ├── .eslintrc.js
│ │ │ ├── subdir/
│ │ │ │ ├── testfile.css
│ │ │ │ ├── testfile.js
│ │ │ │ └── testfile.ts
│ │ │ ├── subdir-with-config/
│ │ │ │ └── .eslintrc
│ │ │ └── subdir-with-package-json/
│ │ │ └── package.json
│ │ └── yarn2-app/
│ │ ├── .eslintrc.js
│ │ ├── .yarn/
│ │ │ └── sdks/
│ │ │ └── eslint/
│ │ │ └── bin/
│ │ │ └── eslint.js
│ │ └── subdir/
│ │ └── testfile.js
│ ├── fecs/
│ │ └── fecs
│ ├── fish/
│ │ └── testfile.fish
│ ├── flow/
│ │ ├── a/
│ │ │ ├── .flowconfig
│ │ │ └── sub/
│ │ │ └── dummy
│ │ └── b/
│ │ └── sub/
│ │ └── dummy
│ ├── fortls-project/
│ │ └── .fortls
│ ├── gleam/
│ │ ├── gleam.toml
│ │ └── testfile.gleam
│ ├── go/
│ │ ├── go.mod
│ │ ├── go1/
│ │ │ └── prj1/
│ │ │ └── file.go
│ │ ├── go2/
│ │ │ └── prj2/
│ │ │ └── file.go
│ │ ├── gopath/
│ │ │ └── bin/
│ │ │ ├── gopls
│ │ │ └── staticcheck
│ │ ├── testfile.go
│ │ └── testfile2.go
│ ├── gradle/
│ │ ├── build-gradle-project/
│ │ │ ├── build.gradle
│ │ │ └── src/
│ │ │ └── main/
│ │ │ └── kotlin/
│ │ │ └── dummy.kt
│ │ ├── gradle
│ │ ├── non-gradle-project/
│ │ │ └── src/
│ │ │ └── main/
│ │ │ └── kotlin/
│ │ │ └── dummy.kt
│ │ ├── settings-gradle-project/
│ │ │ ├── settings.gradle
│ │ │ └── src/
│ │ │ └── main/
│ │ │ └── kotlin/
│ │ │ └── dummy.kt
│ │ ├── unwrapped-project/
│ │ │ ├── build.gradle
│ │ │ ├── settings.gradle
│ │ │ └── src/
│ │ │ └── main/
│ │ │ └── kotlin/
│ │ │ └── dummy.kt
│ │ └── wrapped-project/
│ │ ├── build.gradle
│ │ ├── gradlew
│ │ ├── settings.gradle
│ │ └── src/
│ │ └── main/
│ │ └── kotlin/
│ │ └── dummy.kt
│ ├── hamllint/
│ │ ├── haml-lint-and-rubocop/
│ │ │ ├── .haml-lint.yml
│ │ │ ├── .rubocop.yml
│ │ │ └── subdir/
│ │ │ └── file.haml
│ │ ├── haml-lint-yml/
│ │ │ ├── .haml-lint.yml
│ │ │ └── subdir/
│ │ │ └── file.haml
│ │ └── rubocop-yml/
│ │ ├── .rubocop.yml
│ │ └── subdir/
│ │ └── file.haml
│ ├── haskell/
│ │ ├── haskell-packages-project/
│ │ │ ├── cabal.project
│ │ │ └── package-a/
│ │ │ ├── package-a.cabal
│ │ │ └── src/
│ │ │ └── folder/
│ │ │ └── dummy.hs
│ │ └── haskell-simple-package/
│ │ └── package-a/
│ │ ├── package-a.cabal
│ │ └── src/
│ │ └── folder/
│ │ └── dummy.hs
│ ├── hdl_server/
│ │ ├── foo.vhd
│ │ ├── with_config_file/
│ │ │ ├── .hdl_checker.config
│ │ │ ├── _hdl_checker.config
│ │ │ └── foo.vhd
│ │ └── with_git/
│ │ └── files/
│ │ └── foo.vhd
│ ├── hie_paths/
│ │ └── file.hs
│ ├── html_beautify/
│ │ ├── html-beautify
│ │ └── test.html
│ ├── htmlhint/
│ │ └── with_config/
│ │ └── .htmlhintrc
│ ├── ink/
│ │ └── story/
│ │ └── main.ink
│ ├── inko/
│ │ ├── test.inko
│ │ └── tests/
│ │ └── test/
│ │ └── test_foo.inko
│ ├── java/
│ │ ├── no_main/
│ │ │ └── src/
│ │ │ └── test/
│ │ │ └── java/
│ │ │ └── com/
│ │ │ └── something/
│ │ │ └── dummy
│ │ ├── with_jaxb/
│ │ │ └── src/
│ │ │ └── main/
│ │ │ ├── java/
│ │ │ │ └── com/
│ │ │ │ └── something/
│ │ │ │ └── dummy
│ │ │ └── jaxb/
│ │ │ └── com/
│ │ │ └── something/
│ │ │ └── dummy
│ │ └── with_main/
│ │ ├── build/
│ │ │ ├── gen/
│ │ │ │ └── main/
│ │ │ │ └── java/
│ │ │ │ └── com/
│ │ │ │ └── something/
│ │ │ │ └── dummy
│ │ │ └── gen2/
│ │ │ └── main/
│ │ │ └── java/
│ │ │ └── com/
│ │ │ └── something/
│ │ │ └── dummy
│ │ └── src/
│ │ ├── main/
│ │ │ └── java/
│ │ │ └── com/
│ │ │ └── something/
│ │ │ └── dummy
│ │ └── test/
│ │ └── java/
│ │ └── com/
│ │ └── something/
│ │ └── dummy
│ ├── javascript/
│ │ └── test.js
│ ├── javascript_deno/
│ │ ├── custom_import_map.json
│ │ ├── import_map.json
│ │ ├── main.js
│ │ └── tsconfig.json
│ ├── json/
│ │ └── testfile.json
│ ├── jsonlint/
│ │ ├── app/
│ │ │ └── src/
│ │ │ └── app.json
│ │ └── app-without-jsonlint/
│ │ └── src/
│ │ └── app.json
│ ├── julia/
│ │ ├── REQUIRE
│ │ └── test.jl
│ ├── kotlin/
│ │ └── testfile.kt
│ ├── lean/
│ │ ├── lakefile_lean/
│ │ │ ├── Main.lean
│ │ │ └── lakefile.lean
│ │ └── lakefile_toml/
│ │ ├── Main.lean
│ │ └── lakefile.toml
│ ├── long-line/
│ │ └── setup.cfg
│ ├── lua/
│ │ └── testfile.lua
│ ├── markdown/
│ │ └── testfile.md
│ ├── maven/
│ │ ├── maven-java-project/
│ │ │ ├── module1/
│ │ │ │ ├── mvnw
│ │ │ │ ├── mvnw.cmd
│ │ │ │ ├── pom.xml
│ │ │ │ └── src/
│ │ │ │ └── main/
│ │ │ │ └── java/
│ │ │ │ └── dummy1.java
│ │ │ └── module2/
│ │ │ ├── pom.xml
│ │ │ └── src/
│ │ │ └── main/
│ │ │ └── java/
│ │ │ └── dummy2.java
│ │ ├── maven-kotlin-project/
│ │ │ ├── pom.xml
│ │ │ └── src/
│ │ │ └── main/
│ │ │ └── kotlin/
│ │ │ └── dummy.kt
│ │ ├── mvn
│ │ └── non-maven-project/
│ │ └── src/
│ │ └── main/
│ │ └── java/
│ │ └── dummy.java
│ ├── nim/
│ │ └── with-git/
│ │ └── src/
│ │ └── source.nim
│ ├── ocaml/
│ │ └── testfile.ml
│ ├── ocamllsp/
│ │ └── dune-project
│ ├── odin/
│ │ └── main.odin
│ ├── ols/
│ │ └── .merlin
│ ├── openscad/
│ │ └── dummy.scad
│ ├── pascal/
│ │ └── test.pas
│ ├── perl/
│ │ ├── dist-zilla/
│ │ │ ├── dist.ini
│ │ │ └── subdir/
│ │ │ └── empty.pl
│ │ ├── extutils-makemaker/
│ │ │ ├── Makefile.PL
│ │ │ └── subdir/
│ │ │ └── empty.pl
│ │ └── module-build/
│ │ ├── Build.PL
│ │ └── subdir/
│ │ └── empty.pl
│ ├── php/
│ │ ├── project-with-php-cs-fixer/
│ │ │ ├── test.php
│ │ │ └── vendor/
│ │ │ └── bin/
│ │ │ └── php-cs-fixer
│ │ ├── project-with-phpcbf/
│ │ │ ├── foo/
│ │ │ │ └── test.php
│ │ │ └── vendor/
│ │ │ └── bin/
│ │ │ └── phpcbf
│ │ ├── project-with-pint/
│ │ │ ├── test.php
│ │ │ └── vendor/
│ │ │ └── bin/
│ │ │ └── pint
│ │ ├── project-without-php-cs-fixer/
│ │ │ └── test.php
│ │ ├── project-without-phpcbf/
│ │ │ └── foo/
│ │ │ └── test.php
│ │ ├── project-without-pint/
│ │ │ └── test.php
│ │ ├── vendor/
│ │ │ └── bin/
│ │ │ └── php-language-server.php
│ │ ├── with-composer/
│ │ │ ├── composer.json
│ │ │ └── vendor/
│ │ │ └── bin/
│ │ │ └── php-language-server.php
│ │ └── with-git/
│ │ └── vendor/
│ │ └── bin/
│ │ └── php-language-server.php
│ ├── phpcs/
│ │ ├── project-with-phpcs/
│ │ │ ├── foo/
│ │ │ │ └── test.php
│ │ │ └── vendor/
│ │ │ └── bin/
│ │ │ └── phpcs
│ │ └── project-without-phpcs/
│ │ └── foo/
│ │ └── test.php
│ ├── prettier/
│ │ ├── testfile
│ │ ├── testfile.css
│ │ ├── testfile.js
│ │ ├── testfile.json
│ │ ├── testfile.scss
│ │ ├── testfile.ts
│ │ ├── with_config/
│ │ │ ├── .prettierrc
│ │ │ └── testfile.js
│ │ └── with_prettierignore/
│ │ ├── .prettierignore
│ │ └── src/
│ │ └── testfile.js
│ ├── proto/
│ │ └── testfile.proto
│ ├── psalm/
│ │ └── vendor/
│ │ └── bin/
│ │ └── psalm
│ ├── puglint/
│ │ ├── package.json
│ │ ├── puglint_rc_dir/
│ │ │ └── .pug-lintrc
│ │ ├── puglint_rc_js_dir/
│ │ │ └── .pug-lintrc.js
│ │ └── puglint_rc_json_dir/
│ │ └── .pug-lintrc.json
│ ├── puppet/
│ │ ├── dummy.pp
│ │ ├── new-style-module/
│ │ │ ├── lib/
│ │ │ │ └── puppet/
│ │ │ │ └── types/
│ │ │ │ └── exampletype.rb
│ │ │ ├── metadata.json
│ │ │ └── template/
│ │ │ └── template.epp
│ │ └── old-style-module/
│ │ ├── manifests/
│ │ │ └── init.pp
│ │ └── templates/
│ │ └── template.epp
│ ├── purescript/
│ │ ├── bower/
│ │ │ ├── Foo.purs
│ │ │ └── bower.json
│ │ ├── psc-package/
│ │ │ ├── Foo.purs
│ │ │ └── psc-package.json
│ │ └── spago/
│ │ ├── Foo.purs
│ │ └── spago.dhall
│ ├── python/
│ │ ├── namespace_package_manifest/
│ │ │ ├── MANIFEST.in
│ │ │ └── namespace/
│ │ │ └── foo/
│ │ │ ├── __init__.py
│ │ │ └── bar.py
│ │ ├── namespace_package_pytest/
│ │ │ ├── namespace/
│ │ │ │ └── foo/
│ │ │ │ ├── __init__.py
│ │ │ │ └── bar.py
│ │ │ └── pytest.ini
│ │ ├── namespace_package_setup/
│ │ │ ├── namespace/
│ │ │ │ └── foo/
│ │ │ │ ├── __init__.py
│ │ │ │ └── bar.py
│ │ │ └── setup.cfg
│ │ ├── namespace_package_tox/
│ │ │ ├── namespace/
│ │ │ │ └── foo/
│ │ │ │ ├── __init__.py
│ │ │ │ └── bar.py
│ │ │ └── tox.ini
│ │ ├── no_virtualenv/
│ │ │ └── subdir/
│ │ │ └── foo/
│ │ │ ├── COMMIT_EDITMSG
│ │ │ ├── __init__.py
│ │ │ └── bar.py
│ │ ├── pyre_configuration_dir/
│ │ │ ├── .pyre_configuration.local
│ │ │ └── foo/
│ │ │ ├── __init__.py
│ │ │ └── bar.py
│ │ ├── python-package-project/
│ │ │ ├── .flake8
│ │ │ └── package-name/
│ │ │ └── module.py
│ │ ├── with_bandit/
│ │ │ ├── .bandit
│ │ │ └── namespace/
│ │ │ └── foo/
│ │ │ ├── __init__.py
│ │ │ └── bar.py
│ │ ├── with_mypy_ini_and_pytest_ini/
│ │ │ ├── mypy.ini
│ │ │ └── tests/
│ │ │ ├── pytest.ini
│ │ │ └── testsubfolder/
│ │ │ └── my_tests.py
│ │ └── with_virtualenv/
│ │ ├── dir_with_yapf_config/
│ │ │ └── .style.yapf
│ │ ├── env/
│ │ │ ├── Scripts/
│ │ │ │ └── activate
│ │ │ └── bin/
│ │ │ ├── activate
│ │ │ ├── autoflake
│ │ │ ├── autoimport
│ │ │ ├── autopep8
│ │ │ ├── black
│ │ │ ├── flake8
│ │ │ ├── flakehell
│ │ │ ├── gitlint
│ │ │ ├── isort
│ │ │ ├── jedi-language-server
│ │ │ ├── mypy
│ │ │ ├── pycln
│ │ │ ├── pyflakes
│ │ │ ├── pylama
│ │ │ ├── pylint
│ │ │ ├── pylsp
│ │ │ ├── pyre
│ │ │ ├── pyrefly
│ │ │ ├── pyright-langserver
│ │ │ ├── refurb
│ │ │ ├── reorder-python-imports
│ │ │ ├── ruff
│ │ │ ├── tidy-imports
│ │ │ ├── unimport
│ │ │ ├── vulture
│ │ │ ├── yamlfix
│ │ │ └── yapf
│ │ └── subdir/
│ │ └── foo/
│ │ ├── COMMIT_EDITMSG
│ │ ├── __init__.py
│ │ ├── bar.py
│ │ └── bar.pyi
│ ├── r/
│ │ └── .Rprofile
│ ├── racket/
│ │ ├── many-inits/
│ │ │ ├── a/
│ │ │ │ ├── b/
│ │ │ │ │ ├── c/
│ │ │ │ │ │ ├── foo.rkt
│ │ │ │ │ │ └── init.rkt
│ │ │ │ │ ├── foo.rkt
│ │ │ │ │ └── init.rkt
│ │ │ │ ├── foo.rkt
│ │ │ │ └── init.rkt
│ │ │ ├── foo.rkt
│ │ │ └── init.rkt
│ │ └── simple-script/
│ │ └── foo.rkt
│ ├── reasonml/
│ │ ├── bsconfig.json
│ │ └── testfile.re
│ ├── rescript/
│ │ ├── rescript.json
│ │ ├── testfile-noextension
│ │ ├── testfile.res
│ │ └── testfile.resi
│ ├── roc/
│ │ └── main.roc
│ ├── ruby/
│ │ ├── dummy.rb
│ │ ├── nested/
│ │ │ ├── dummy.rb
│ │ │ └── foo/
│ │ │ ├── Steepfile
│ │ │ ├── dummy.rb
│ │ │ ├── one/
│ │ │ │ └── dummy.rb
│ │ │ └── two/
│ │ │ ├── Steepfile
│ │ │ ├── dummmy.rb
│ │ │ └── three/
│ │ │ └── dummy.rb
│ │ ├── not_a_rails_app/
│ │ │ └── file.rb
│ │ ├── valid_rails_app/
│ │ │ ├── app/
│ │ │ │ ├── dummy.rb
│ │ │ │ ├── models/
│ │ │ │ │ └── thing.rb
│ │ │ │ └── views/
│ │ │ │ └── my_great_view.html.erb
│ │ │ ├── config/
│ │ │ │ └── dummy.rb
│ │ │ └── db/
│ │ │ └── dummy.rb
│ │ ├── valid_ruby_app1/
│ │ │ ├── Rakefile
│ │ │ └── lib/
│ │ │ └── file.rb
│ │ ├── valid_ruby_app2/
│ │ │ ├── Gemfile
│ │ │ └── lib/
│ │ │ └── file.rb
│ │ ├── valid_ruby_app3/
│ │ │ ├── .solargraph.yml
│ │ │ └── lib/
│ │ │ └── file.rb
│ │ └── with_config/
│ │ ├── .rubocop.yml
│ │ └── .standard.yml
│ ├── rust/
│ │ ├── cargo/
│ │ │ ├── Cargo.toml
│ │ │ └── testfile.rs
│ │ └── rust-project/
│ │ ├── rust-project.json
│ │ └── testfile.rs
│ ├── rustywind/
│ │ └── test.html
│ ├── scala/
│ │ ├── dummy.scala
│ │ ├── invalid_sbt_project/
│ │ │ └── Main.scala
│ │ └── valid_sbt_project/
│ │ ├── Main.scala
│ │ └── build.sbt
│ ├── slimlint/
│ │ ├── .rubocop.yml
│ │ └── subdir/
│ │ └── file.slim
│ ├── smlnj/
│ │ ├── cm/
│ │ │ ├── foo.sml
│ │ │ ├── path/
│ │ │ │ └── to/
│ │ │ │ └── bar.sml
│ │ │ └── sources.cm
│ │ └── file/
│ │ └── qux.sml
│ ├── solhint/
│ │ ├── Contract.sol
│ │ └── package.json
│ ├── spectral/
│ │ └── openapi.yaml
│ ├── stack/
│ │ └── stack.yaml
│ ├── stylua/
│ │ ├── stylua_config_dir/
│ │ │ └── stylua.toml
│ │ └── stylua_dot_config_dir/
│ │ └── .stylua.toml
│ ├── swaglint/
│ │ └── docs/
│ │ └── swagger.yaml
│ ├── swift/
│ │ ├── dummy.swift
│ │ ├── non-swift-package-project/
│ │ │ └── src/
│ │ │ └── folder/
│ │ │ └── dummy.swift
│ │ ├── swift-package-project/
│ │ │ ├── Package.swift
│ │ │ └── src/
│ │ │ └── folder/
│ │ │ └── dummy.swift
│ │ └── swift-package-project-with-config/
│ │ ├── .swift-format
│ │ ├── Package.swift
│ │ └── src/
│ │ └── folder/
│ │ └── dummy.swift
│ ├── swiftlint/
│ │ ├── cocoapods/
│ │ │ └── Pods/
│ │ │ └── SwiftLint/
│ │ │ └── swiftlint
│ │ ├── cocoapods-and-react-native/
│ │ │ ├── Pods/
│ │ │ │ └── SwiftLint/
│ │ │ │ └── swiftlint
│ │ │ └── ios/
│ │ │ └── Pods/
│ │ │ └── SwiftLint/
│ │ │ └── swiftlint
│ │ └── react-native/
│ │ └── ios/
│ │ └── Pods/
│ │ └── SwiftLint/
│ │ └── swiftlint
│ ├── terraform/
│ │ ├── .terraform/
│ │ │ └── dummy
│ │ └── main.tf
│ ├── tex/
│ │ ├── sample1.tex
│ │ ├── sample2.tex
│ │ └── testfile.tex
│ ├── tflint/
│ │ └── foo/
│ │ ├── .tflint.hcl
│ │ └── bar.tf
│ ├── tfsec/
│ │ ├── json/
│ │ │ ├── .tfsec/
│ │ │ │ └── config.json
│ │ │ └── main.tf
│ │ └── yml/
│ │ ├── .tfsec/
│ │ │ └── config.yml
│ │ └── main.tf
│ ├── tidy/
│ │ ├── .tidyrc
│ │ ├── test.html
│ │ └── tidy
│ ├── toml/
│ │ └── tombi/
│ │ ├── pyprojecttoml/
│ │ │ ├── pyproject.toml
│ │ │ └── subdir/
│ │ │ └── file.toml
│ │ └── tombitoml/
│ │ ├── subdir/
│ │ │ └── file.toml
│ │ └── tombi.toml
│ ├── top/
│ │ ├── ale-special-directory-name-dont-use-this-please/
│ │ │ └── empty-file
│ │ ├── example.ini
│ │ ├── middle/
│ │ │ └── bottom/
│ │ │ └── dummy.txt
│ │ ├── needle_dir/
│ │ │ ├── needle
│ │ │ └── target/
│ │ │ ├── needle/
│ │ │ │ └── .gitkeep
│ │ │ └── query/
│ │ │ └── buffer.txt
│ │ └── needle_file/
│ │ ├── needle/
│ │ │ └── .gitkeep
│ │ └── target/
│ │ ├── needle
│ │ └── query/
│ │ └── buffer.txt
│ ├── tsserver/
│ │ ├── src/
│ │ │ ├── file1.ts
│ │ │ └── level-1/
│ │ │ ├── file2.ts
│ │ │ ├── level-2/
│ │ │ │ └── file3.ts
│ │ │ └── tsconfig.json
│ │ └── tsconfig.json
│ ├── typescript/
│ │ ├── custom_import_map.json
│ │ ├── import_map.json
│ │ ├── test.ts
│ │ └── tsconfig.json
│ ├── verilog/
│ │ └── verible/
│ │ ├── module.sv
│ │ └── verible.filelist
│ ├── vim/
│ │ ├── invalid_vim_project/
│ │ │ └── test.vim
│ │ ├── path_with_autoload/
│ │ │ ├── autoload/
│ │ │ │ └── test.vim
│ │ │ └── test.vim
│ │ ├── path_with_initvim/
│ │ │ └── init.vim
│ │ ├── path_with_plugin/
│ │ │ ├── plugin/
│ │ │ │ └── test.vim
│ │ │ └── test.vim
│ │ └── path_with_vimrc/
│ │ └── .vimrc
│ ├── volar/
│ │ ├── package.json
│ │ └── src/
│ │ └── App.vue
│ ├── xml/
│ │ └── dummy.xml
│ ├── xo/
│ │ └── monorepo/
│ │ ├── package.json
│ │ └── packages/
│ │ └── a/
│ │ ├── index.js
│ │ ├── index.ts
│ │ └── package.json
│ ├── yaml/
│ │ └── test.yaml
│ ├── yara/
│ │ └── dummy.yar
│ └── zig/
│ └── build.zig
├── test_ale_has.vader
├── test_ale_info.vader
├── test_ale_info_to_clipboard.vader
├── test_ale_lint_command.vader
├── test_ale_lint_stop_command.vader
├── test_ale_populate_command.vader
├── test_ale_toggle.vader
├── test_ale_var.vader
├── test_alejobstarted_autocmd.vader
├── test_alelint_autocmd.vader
├── test_ant_build_classpath_command.vader
├── test_ant_find_project_root.vader
├── test_autocmd_commands.vader
├── test_balloon_messages.vader
├── test_c_flag_parsing.vader
├── test_cleanup.vader
├── test_code_action.vader
├── test_code_action_corner_cases.vader
├── test_codefix.vader
├── test_computed_lint_file_values.vader
├── test_cursor_warnings.vader
├── test_deferred_command_string.vader
├── test_deferred_executable_string.vader
├── test_deno_executable_detection.vader
├── test_disabling_ale.vader
├── test_env_function.vader
├── test_errors_removed_after_filetype_changed.vader
├── test_filename_mapping.vader
├── test_filerename.vader
├── test_filetype_guessing.vader
├── test_filetype_linter_defaults.vader
├── test_find_nearest_directory.vader
├── test_find_nearest_file.vader
├── test_find_nearest_file_or_directory.vader
├── test_find_references.vader
├── test_floating_preview.vader
├── test_format_command.vader
├── test_format_temporary_file_creation.vader
├── test_function_arg_count.vader
├── test_fuzzy_json_decode.vader
├── test_get_abspath.vader
├── test_get_loclist.vader
├── test_getmatches.vader
├── test_go_to_definition.vader
├── test_gradle_build_classpath_command.vader
├── test_gradle_find_executable.vader
├── test_gradle_find_project_root.vader
├── test_helptags.vader
├── test_highlight_placement.vader
├── test_highlight_position_chunking.vader
├── test_history_saving.vader
├── test_hover.vader
├── test_hover_parsing.vader
├── test_ignoring_linters.vader
├── test_line_join.vader
├── test_lint_file_linters.vader
├── test_lint_on_enter_when_file_changed.vader
├── test_lint_on_filetype_changed.vader
├── test_linter_defintion_processing.vader
├── test_linter_retrieval.vader
├── test_linter_type_mapping.vader
├── test_linting_blacklist.vader
├── test_linting_updates_loclist.vader
├── test_list_formatting.vader
├── test_list_opening.vader
├── test_list_titles.vader
├── test_load_all_linters.vader
├── test_loclist_binary_search.vader
├── test_loclist_corrections.vader
├── test_loclist_jumping.vader
├── test_loclist_sorting.vader
├── test_maven_build_classpath_command.vader
├── test_maven_find_executable.vader
├── test_maven_find_project_root.vader
├── test_neovim_diagnostics.vader
├── test_no_linting_on_write_quit.vader
├── test_organize_imports.vader
├── test_other_sources.vader
├── test_parse_command_args.vader
├── test_path_dirname.vader
├── test_path_equality.vader
├── test_path_upwards.vader
├── test_path_uri.vader
├── test_pattern_options.vader
├── test_prepare_command.vader
├── test_proselint_get_command.vader
├── test_proselint_get_executable.vader
├── test_python_pipenv.vader
├── test_python_poetry.vader
├── test_python_traceback.vader
├── test_python_uv.vader
├── test_python_virtualenv.vader
├── test_quickfix_deduplication.vader
├── test_quitting_variable.vader
├── test_redundant_tsserver_rendering_avoided.vader
├── test_regex_escaping.vader
├── test_rename.vader
├── test_resolve_local_path.vader
├── test_results_not_cleared_when_opening_loclist.vader
├── test_sandbox_execution.vader
├── test_semver_utils.vader
├── test_set_list_timers.vader
├── test_setting_loclist_from_another_buffer.vader
├── test_setting_problems_found_in_previous_buffers.vader
├── test_shell_detection.vader
├── test_should_do_nothing_conditions.vader
├── test_sml_command.vader
├── test_socket_connections.vader
├── test_statusline.vader
├── test_swift_find_project_root.vader
├── test_symbol_search.vader
├── test_temporary_file_management.vader
├── test_tmpdir_wrapper.vader
├── test_vim8_processid_parsing.vader
├── test_virtualtext.vader
├── test_windows_escaping.vader
├── test_wrap_comand.vader
├── test_writefile_function.vader
├── util/
│ └── test_cd_string_commands.vader
├── v_files/
│ └── testfile.v
└── vimrc
================================================
FILE CONTENTS
================================================
================================================
FILE: AGENTS.md
================================================
# ALE Agent instructions
1. Read documentation from `doc/ale-development.txt` to understand how to be an
ALE developer.
2. Run Vader/Vim tests with `./run-tests -q --fast test/path/some_file.vader`
3. When editing Lua code run Lua tests with `./run-tests -q --lua-only`
================================================
FILE: Dockerfile
================================================
ARG TESTBED_VIM_VERSION=24
FROM testbed/vim:${TESTBED_VIM_VERSION}
ENV PACKAGES="\
lua5.1 \
lua5.1-dev \
lua5.1-busted \
bash \
git \
python2 \
python3 \
py3-pip \
grep \
sed \
"
RUN apk --update add $PACKAGES && \
rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
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 pip install vim-vint==0.3.21
RUN git clone https://github.com/junegunn/vader.vim vader && \
cd vader && git checkout c6243dd81c98350df4dec608fa972df98fa2a3af
ARG GIT_VERSION
LABEL Version=${GIT_VERSION}
LABEL Name=denseanalysis/ale
================================================
FILE: LICENSE
================================================
Copyright (c) 2016-2023, Dense Analysis
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================
FILE: README.md
================================================
# 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)

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 acts as a Vim [Language Server Protocol](https://langserver.org/) client.
ALE makes use of Neovim and Vim 8 job control functions and timers to
run linters on the contents of text buffers and return errors as
text is changed in Vim. This allows for displaying warnings and
errors in files being edited in Vim before files have been saved
back to a filesystem.
In other words, this plugin allows you to lint while you type.
ALE offers support for fixing code with command line tools in a non-blocking
manner with the `:ALEFix` feature, supporting tools in many languages, like
`prettier`, `eslint`, `autopep8`, and more.
ALE acts as a "language client" to support a variety of Language Server Protocol
features, including:
* Diagnostics (via Language Server Protocol linters)
* Go To Definition (`:ALEGoToDefinition`)
* Completion (Built in completion support, or with Deoplete)
* Finding references (`:ALEFindReferences`)
* Hover information (`:ALEHover`)
* Symbol search (`:ALESymbolSearch`)
If you don't care about Language Server Protocol, ALE won't load any of the code
for working with it unless needed. One of ALE's general missions is that you
won't pay for the features that you don't use.
**Help Wanted:** If you would like to help maintain this plugin by managing the
many issues and pull requests that are submitted, please send the author an
email at [dev@w0rp.com](mailto:dev@w0rp.com?subject=Helping%20with%20ALE).
If you enjoy this plugin, feel free to contribute or check out the author's
other content at [w0rp.com](https://w0rp.com).
## Why ALE?
ALE has been around for many years, and there are many ways to run asynchronous
linting and fixing of code in Vim. ALE offers the following.
* No dependencies for ALE itself
* Lightweight plugin architecture (No JavaScript or Python required)
* Low memory footprint
* Runs virtually everywhere, including remote shells, and in `git commit`
* Out of the box support for running particular linters and language servers
* Near-zero configuration with custom code for better defaults
* Highly customizable and well-documented (`:help ale-options`)
* Breaking changes for the plugin are extremely rare
* Integrates with Neovim's LSP client (0.8+) and diagnostics (0.7+)
* Support for older Vim and Neovim versions
* 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
[full list](supported-tools.md) in the
[Supported Languages and Tools](supported-tools.md) page.
## Usage
### Linting
Once this plugin is installed, while editing your files in supported
languages and tools which have been correctly installed,
this plugin will send the contents of your text buffers to a variety of
programs for checking the syntax and semantics of your programs. By default,
linters will be re-run in the background to check your syntax when you open
new buffers or as you make edits to your files.
The behavior of linting can be configured with a variety of options,
documented in [the Vim help file](doc/ale.txt). For more information on the
options ALE offers, consult `:help ale-options` for global options and `:help
ale-integration-options` for options specified to particular linters.
### Fixing
ALE can fix files with the `ALEFix` command. Functions need to be configured
either in each buffer with a `b:ale_fixers`, or globally with `g:ale_fixers`.
The recommended way to configure fixers is to define a List in an ftplugin file.
```vim
" In ~/.vim/ftplugin/javascript.vim, or somewhere similar.
" Fix files with prettier, and then ESLint.
let b:ale_fixers = ['prettier', 'eslint']
" Equivalent to the above.
let b:ale_fixers = {'javascript': ['prettier', 'eslint']}
```
You can also configure your fixers from vimrc using `g:ale_fixers`, before or
after ALE has been loaded.
A `*` in place of the filetype will apply a List of fixers to all files which
do not match some filetype in the Dictionary.
Note that using a plain List for `g:ale_fixers` is not supported.
```vim
" In ~/.vim/vimrc, or somewhere similar.
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'javascript': ['eslint'],
\}
```
If you want to automatically fix files when you save them, you need to turn
a setting on in vimrc.
```vim
" Set this variable to 1 to fix files when you save them.
let g:ale_fix_on_save = 1
```
The `:ALEFixSuggest` command will suggest some supported tools for fixing code.
Both `g:ale_fixers` and `b:ale_fixers` can also accept functions, including
lambda functions, as fixers, for fixing files with custom tools.
See `:help ale-fix` for complete information on how to fix files with ALE.
### Completion
ALE offers some support for completion via hijacking of omnicompletion while you
type. All of ALE's completion information must come from Language Server
Protocol linters, or from `tsserver` for TypeScript.
When running ALE in Neovim 0.8+, ALE will integrate with Neovim's LSP client by
default, and any auto-completion plugin that uses the native LSP client will
work when ALE runs language servers.
[nvim-cmp](https://github.com/hrsh7th/nvim-cmp) is recommended as a
completion plugin worth trying in Neovim.
ALE integrates with [Deoplete](https://github.com/Shougo/deoplete.nvim) as a
completion source, named `'ale'`. You can configure Deoplete to only use ALE as
the source of completion information, or mix it with other sources.
```vim
" Use ALE and also some plugin 'foobar' as completion sources for all code.
call deoplete#custom#option('sources', {
\ '_': ['ale', 'foobar'],
\})
```
ALE also offers its own automatic completion support, which does not require any
other plugins, and can be enabled by changing a setting before ALE is loaded.
```vim
" Enable completion where available.
" This setting must be set before ALE is loaded.
"
" You should not turn this setting on if you wish to use ALE as a completion
" source for other completion plugins, like Deoplete.
let g:ale_completion_enabled = 1
```
ALE provides an omni-completion function you can use for triggering
completion manually with ``.
```vim
set omnifunc=ale#completion#OmniFunc
```
ALE supports automatic imports from external modules. This behavior is enabled
by default and can be disabled by setting:
```vim
let g:ale_completion_autoimport = 0
```
Note that disabling auto import can result in missing completion items from some
LSP servers (e.g. eclipselsp). See `:help ale-completion` for more information.
### Go To Definition
ALE supports jumping to the definition of words under your cursor with the
`:ALEGoToDefinition` command using any enabled Language Server Protocol linters
and `tsserver`. In Neovim 0.8+, you can also use Neovim's built in `gd` keybind
and more.
See `:help ale-go-to-definition` for more information.
### Find References
ALE supports finding references for words under your cursor with the
`:ALEFindReferences` command using any enabled Language Server Protocol linters
and `tsserver`.
See `:help ale-find-references` for more information.
### Hovering
ALE supports "hover" information for printing brief information about symbols at
the cursor taken from Language Server Protocol linters and `tsserver` with the
`ALEHover` command.
Truncated information will be displayed when the cursor rests on a symbol by
default, as long as there are no problems on the same line.
The information can be displayed in a `balloon` tooltip in Vim or GVim by
hovering your mouse over symbols. Mouse hovering is enabled by default in GVim,
and needs to be configured for Vim 8.1+ in terminals.
See `:help ale-hover` for more information.
### Symbol Search
ALE supports searching for workspace symbols via Language Server Protocol
linters with the `ALESymbolSearch` command.
Search queries can be performed to find functions, types, and more which are
similar to a given query string.
See `:help ale-symbol-search` for more information.
### Refactoring: Rename, Actions
ALE supports renaming symbols in code such as variables or class
names with the `ALERename` command.
`ALEFileRename` will rename file and fix import paths (tsserver
only).
`ALECodeAction` will execute actions on the cursor or applied to a visual
range selection, such as automatically fixing errors.
See `:help ale-refactor` for more information.
## Installation
Add ALE to your runtime path in the usual ways.
If you have trouble reading `:help ale`, try the following.
```vim
packloadall | silent! helptags ALL
```
#### Vim `packload`:
```bash
mkdir -p ~/.vim/pack/git-plugins/start
git clone --depth 1 https://github.com/dense-analysis/ale.git ~/.vim/pack/git-plugins/start/ale
```
#### Neovim `packload`:
```bash
mkdir -p ~/.local/share/nvim/site/pack/git-plugins/start
git clone --depth 1 https://github.com/dense-analysis/ale.git ~/.local/share/nvim/site/pack/git-plugins/start/ale
```
#### Windows `packload`:
```bash
# Run these commands in the "Git for Windows" Bash terminal
mkdir -p ~/vimfiles/pack/git-plugins/start
git clone --depth 1 https://github.com/dense-analysis/ale.git ~/vimfiles/pack/git-plugins/start/ale
```
#### [vim-plug](https://github.com/junegunn/vim-plug)
```vim
Plug 'dense-analysis/ale'
```
#### [Vundle](https://github.com/VundleVim/Vundle.vim)
```vim
Plugin 'dense-analysis/ale'
```
#### [Pathogen](https://github.com/tpope/vim-pathogen)
```vim
git clone https://github.com/dense-analysis/ale ~/.vim/bundle/ale
```
#### [lazy.nvim](https://github.com/folke/lazy.nvim)
```lua
{
'dense-analysis/ale',
config = function()
-- Configuration goes here.
local g = vim.g
g.ale_ruby_rubocop_auto_correct_all = 1
g.ale_linters = {
ruby = {'rubocop', 'ruby'},
lua = {'lua_language_server'}
}
end
}
```
## Contributing
If you would like to see support for more languages and tools, please
[create an issue](https://github.com/dense-analysis/ale/issues)
or [create a pull request](https://github.com/dense-analysis/ale/pulls).
If your tool can read from stdin or you have code to suggest which is good,
support can be happily added for it.
If you are interested in the general direction of the project, check out the
[wiki home page](https://github.com/dense-analysis/ale/wiki). The wiki includes
a Roadmap for the future, and more.
If you'd liked to discuss ALE and more check out the Dense Analysis Discord
server here: https://discord.gg/5zFD6pQxDk
## FAQ
### How do I disable particular linters?
By default, all available tools for all supported languages will be run. If you
want to only select a subset of the tools, you can define `b:ale_linters` for a
single buffer, or `g:ale_linters` globally.
The recommended way to configure linters is to define a List in an ftplugin
file.
```vim
" In ~/.vim/ftplugin/javascript.vim, or somewhere similar.
" Enable ESLint only for JavaScript.
let b:ale_linters = ['eslint']
" Equivalent to the above.
let b:ale_linters = {'javascript': ['eslint']}
```
You can also declare which linters you want to run in your vimrc file, before or
after ALE has been loaded.
```vim
" In ~/.vim/vimrc, or somewhere similar.
let g:ale_linters = {
\ 'javascript': ['eslint'],
\}
```
For all languages unspecified in the dictionary, all possible linters will
be run for those languages, just as when the dictionary is not defined.
Running many linters should not typically obstruct editing in Vim,
as they will all be executed in separate processes simultaneously.
If you don't want ALE to run anything other than what you've explicitly asked
for, you can set `g:ale_linters_explicit` to `1`.
```vim
" Only run linters named in ale_linters settings.
let g:ale_linters_explicit = 1
```
This plugin will look for linters in the [`ale_linters`](ale_linters) directory.
Each directory within corresponds to a particular filetype in Vim, and each file
in each directory corresponds to the name of a particular linter.
### How do I disable a particular warning or error?
Warnings and errors should be configured in project configuration files for the
relevant tools. ALE supports disabling only warnings relating to trailing
whitespace, which Vim users often fix automatically.
```vim
" Disable whitespace warnings
let g:ale_warn_about_trailing_whitespace = 0
```
Users generally should not ignore warnings or errors in projects by changing
settings in their own editor. Instead, configure tools appropriately so any
other user of the same project will see the same problems.
### How can I see what ALE has configured for the current file?
Run the following to see what is currently configured:
```vim
:ALEInfo
```
### How can I disable virtual text appearing at ends of lines?
By default, ALE displays errors and warnings with virtual text. The problems ALE
shows appear with comment-like syntax after every problem found. You can set ALE
to only show problems where the cursor currently lies like so.
```vim
let g:ale_virtualtext_cursor = 'current'
```
If you want to disable virtual text completely, apply the following.
```vim
let g:ale_virtualtext_cursor = 'disabled'
```
### How can I customise signs?
Use these options to specify what text should be used for signs:
```vim
let g:ale_sign_error = '>>'
let g:ale_sign_warning = '--'
```
ALE sets some background colors automatically for warnings and errors
in the sign gutter, with the names `ALEErrorSign` and `ALEWarningSign`.
These colors can be customised, or even removed completely:
```vim
highlight clear ALEErrorSign
highlight clear ALEWarningSign
```
You can configure the sign gutter open at all times, if you wish.
```vim
let g:ale_sign_column_always = 1
```
### How can I change or disable the highlights ALE uses?
ALE's highlights problems with highlight groups which link to `SpellBad`,
`SpellCap`, `error`, and `todo` groups by default. The characters that are
highlighted depend on the linters being used, and the information provided to
ALE.
Highlighting can be disabled completely by setting `g:ale_set_highlights` to
`0`.
```vim
" Set this in your vimrc file to disabling highlighting
let g:ale_set_highlights = 0
```
You can control all of the highlights ALE uses, say if you are using a different
color scheme which produces ugly highlights. For example:
```vim
highlight ALEWarning ctermbg=DarkMagenta
```
See `:help ale-highlights` for more information.
### How can I change the format for echo messages?
There are 3 global options that allow customizing the echoed message.
- `g:ale_echo_msg_format` where:
* `%s` is the error message itself
* `%...code...%` is an optional error code, and most characters can be
written between the `%` characters.
* `%linter%` is the linter name
* `%severity%` is the severity type
- `g:ale_echo_msg_error_str` is the string used for error severity.
- `g:ale_echo_msg_warning_str` is the string used for warning severity.
So for example this:
```vim
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
```
Will give you:

See `:help g:ale_echo_msg_format` for more information.
### How can I customise the statusline?
#### lightline
[lightline](https://github.com/itchyny/lightline.vim) does not have built-in
support for ALE, nevertheless there is a plugin that adds this functionality:
[maximbaz/lightline-ale](https://github.com/maximbaz/lightline-ale).
For more information, check out the sources of that plugin,
`:help ale#statusline#Count()` and
[lightline documentation](https://github.com/itchyny/lightline.vim#advanced-configuration).
#### vim-airline
[vim-airline](https://github.com/vim-airline/vim-airline) integrates with ALE
for displaying error information in the status bar. If you want to see the
status for ALE in a nice format, it is recommended to use vim-airline with ALE.
The airline extension can be enabled by adding the following to your vimrc:
```vim
" Set this. Airline will handle the rest.
let g:airline#extensions#ale#enabled = 1
```
#### Custom statusline
You can implement your own statusline function without adding any other plugins.
ALE provides some functions to assist in this endeavour, including:
* `ale#statusline#Count`: Which returns the number of problems found by ALE
for a specified buffer.
* `ale#statusline#FirstProblem`: Which returns a dictionary containing the
full loclist details of the first problem of a specified type found by ALE
in a buffer. (e.g. The first style warning in the current buffer.)
This can be useful for displaying more detailed information such as the
line number of the first problem in a file.
Say you want to display all errors as one figure, and all non-errors as another
figure. You can do the following:
```vim
function! LinterStatus() abort
let l:counts = ale#statusline#Count(bufnr(''))
let l:all_errors = l:counts.error + l:counts.style_error
let l:all_non_errors = l:counts.total - l:all_errors
return l:counts.total == 0 ? 'OK' : printf(
\ '%dW %dE',
\ all_non_errors,
\ all_errors
\)
endfunction
set statusline=%{LinterStatus()}
```
See `:help ale#statusline#Count()` or `:help ale#statusline#FirstProblem()`
for more information.
### How can I change the borders for floating preview windows?
Borders for floating preview windows are enabled by default. You can use the
`g:ale_floating_window_border` setting to configure them.
You could disable the border with an empty list.
```vim
let g:ale_floating_window_border = []
```
If the terminal supports Unicode, you might try setting the value like below, to
make it look nicer.
```vim
let g:ale_floating_window_border = ['│', '─', '╭', '╮', '╯', '╰', '│', '─']
```
Since vim's default uses nice Unicode characters when possible, you can trick
ale into using that default with
```vim
let g:ale_floating_window_border = repeat([''], 8)
```
### Will this plugin eat all of my laptop battery power?
ALE takes advantage of the power of various tools to check your code. This of
course means that CPU time will be used to continuously check your code. If you
are concerned about the CPU time ALE will spend, which will of course imply
some cost to battery life, you can adjust your settings to make your CPU do
less work.
First, consider increasing the delay before which ALE will run any linters
while you type. ALE uses a timeout which is cancelled and reset every time you
type, and this delay can be increased so linters are run less often. See
`:help g:ale_lint_delay` for more information.
If you don't wish to run linters while you type, you can disable that behavior.
Set `g:ale_lint_on_text_changed` to `never`. You won't get as frequent error
checking, but ALE shouldn't block your ability to edit a document after you save
a file, so the asynchronous nature of the plugin will still be an advantage.
If you are still concerned, you can turn the automatic linting off altogether,
including the option `g:ale_lint_on_enter`, and you can run ALE manually with
`:ALELint`.
### How can I use ALE with other LSP clients?
ALE offers an API for letting any other plugin integrate with ALE. If you are
interested in writing an integration, see `:help ale-lint-other-sources`.
If you're running ALE in Neovim with
[nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) for configuring
particular language servers, ALE will automatically disable its LSP
functionality for any language servers configured with nvim-lspconfig by
default. The following setting is applied by default:
```vim
let g:ale_disable_lsp = 'auto'
```
If you are running ALE in combination with another LSP client, you may wish to
disable ALE's LSP functionality entirely. You can change the setting to `1` to
always disable all LSP functionality.
```vim
let g:ale_disable_lsp = 1
```
You can also use `b:ale_disable_lsp` in your ftplugin files to enable or disable
LSP features in ALE for different filetypes.
#### Neovim Diagnostics
If you are running Neovim 0.7 or later, you can make ALE display errors and
warnings via the Neovim diagnostics API.
```vim
let g:ale_use_neovim_diagnostics_api = 1
```
#### coc.nvim
[coc.nvim](https://github.com/neoclide/coc.nvim) is a popular Vim plugin written
in TypeScript and dependent on the [npm](https://www.npmjs.com/) ecosystem for
providing full IDE features to Vim. Both ALE and coc.nvim implement
[Language Server Protocol](https://microsoft.github.io/language-server-protocol/)
(LSP) clients for supporting diagnostics (linting with a live server), and other
features like auto-completion, and others listed above.
ALE is primarily focused on integrating with external programs through virtually
any means, provided the plugin remains almost entirely written in Vim script.
coc.nvim is primarily focused on bringing IDE features to Vim. If you want to
run external programs on your files to check for errors, and also use the most
advanced IDE features, you might want to use both plugins at the same time.
The easiest way to get both plugins to work together is to configure coc.nvim to
send diagnostics to ALE, so ALE controls how all problems are presented to you,
and to disable all LSP features in ALE, so ALE doesn't try to provide LSP
features already provided by coc.nvim, such as auto-completion.
Open your coc.nvim configuration file with `:CocConfig` and add
`"diagnostic.displayByAle": true` to your settings.
#### vim-lsp
[vim-lsp](https://github.com/prabirshrestha/vim-lsp) is a popular plugin as
implementation of Language Server Protocol (LSP) client for Vim. It provides
all the LSP features including auto completion, diagnostics, go to definitions,
etc.
[vim-lsp-ale](https://github.com/rhysd/vim-lsp-ale) is a bridge plugin to solve
the problem when using both ALE and vim-lsp. With the plugin, diagnostics are
provided by vim-lsp and ALE can handle all the errors. Please read
[vim-lsp-ale's documentation](https://github.com/rhysd/vim-lsp-ale/blob/master/doc/vim-lsp-ale.txt)
for more details.
### How can I execute some code when ALE starts or stops linting?
ALE runs its own [autocmd](http://vimdoc.sourceforge.net/htmldoc/autocmd.html)
events when a lint or fix cycle are started and stopped. There is also an event
that runs when a linter job has been successfully started. These events can be
used to call arbitrary functions during these respective parts of the ALE's
operation.
```vim
augroup YourGroup
autocmd!
autocmd User ALELintPre call YourFunction()
autocmd User ALELintPost call YourFunction()
autocmd User ALEJobStarted call YourFunction()
autocmd User ALEFixPre call YourFunction()
autocmd User ALEFixPost call YourFunction()
augroup END
```
### How can I navigate between errors quickly?
ALE offers some commands with `` keybinds for moving between warnings and
errors quickly. You can map the keys Ctrl+j and Ctrl+k to moving between errors
for example:
```vim
nmap (ale_previous_wrap)
nmap (ale_next_wrap)
```
For more information, consult the online documentation with
`:help ale-navigation-commands`.
### How can I run linters only when I save files?
ALE offers an option `g:ale_lint_on_save` for enabling running the linters when
files are saved. This option is enabled by default. If you only wish to run
linters when files are saved, you can turn the other options off.
```vim
" Write this in your vimrc file
let g:ale_lint_on_text_changed = 'never'
let g:ale_lint_on_insert_leave = 0
" You can disable this option too
" if you don't want linters to run on opening a file
let g:ale_lint_on_enter = 0
```
If for whatever reason you don't wish to run linters again when you save files,
you can set `g:ale_lint_on_save` to `0`.
### How can I use the quickfix list instead of the loclist?
The quickfix list can be enabled by turning the `g:ale_set_quickfix` option on.
If you wish to also disable the loclist, you can disable the `g:ale_set_loclist`
option.
```vim
" Write this in your vimrc file
let g:ale_set_loclist = 0
let g:ale_set_quickfix = 1
```
If you wish to show Vim windows for the loclist or quickfix items when a file
contains warnings or errors, `g:ale_open_list` can be set to `1`.
`g:ale_keep_list_window_open` can be set to `1` if you wish to keep the window
open even after errors disappear.
```vim
let g:ale_open_list = 1
" Set this if you want to.
" This can be useful if you are combining ALE with
" some other plugin which sets quickfix errors, etc.
let g:ale_keep_list_window_open = 1
```
You can also set `let g:ale_list_vertical = 1` to open the windows vertically
instead of the default horizontally.
### Why isn't ALE checking my filetype?
#### stylelint for JSX
First, install eslint and install stylelint with
[stylelint-processor-styled-components](https://github.com/styled-components/stylelint-processor-styled-components).
Supposing you have installed both tools correctly, configure your .jsx files so
`jsx` is included in the filetype. You can use an `autocmd` for this.
```vim
augroup FiletypeGroup
autocmd!
au BufNewFile,BufRead *.jsx set filetype=javascript.jsx
augroup END
```
Supposing the filetype has been set correctly, you can set the following
options in a jsx.vim ftplugin file.
```vim
" In ~/.vim/ftplugin/jsx.vim, or somewhere similar.
let b:ale_linter_aliases = ['css', 'javascript']
let b:ale_linters = ['stylelint', 'eslint']
```
Or if you want, you can configure the linters from your vimrc file.
```vim
" In ~/.vim/vimrc, or somewhere similar.
let g:ale_linter_aliases = {'jsx': ['css', 'javascript']}
let g:ale_linters = {'jsx': ['stylelint', 'eslint']}
```
ALE will alias the `jsx` filetype so it uses the `css` filetype linters, and
use the original Array of selected linters for `jsx` from the `g:ale_linters`
object. All available linters will be used for the filetype `javascript`, and
no linter will be run twice for the same file.
#### Checking Vue with ESLint
To check Vue files with ESLint, your ESLint project configuration file must be
configured to use the [Vue plugin](https://github.com/vuejs/eslint-plugin-vue).
After that, you need to configure ALE so it will run the JavaScript ESLint
linter on your files. The settings you need are similar to the settings needed
for checking JSX code with both stylelint and ESLint, in the previous section.
```vim
" In ~/.vim/ftplugin/vue.vim, or somewhere similar.
" Run both javascript and vue linters for vue files.
let b:ale_linter_aliases = ['javascript', 'vue']
" Select the eslint and vls linters.
let b:ale_linters = ['eslint', 'vls']
```
Run `:ALEInfo` to see which linters are available after telling ALE to run
JavaScript linters on Vue files. Not all linters support checking Vue files.
If you don't want to configure your linters in ftplugin files for some reason,
you can configure them from your vimrc file instead.
```vim
" In ~/.vim/vimrc, or somewhere similar.
let g:ale_linter_aliases = {'vue': ['vue', 'javascript']}
let g:ale_linters = {'vue': ['eslint', 'vls']}
```
### How can I configure my C or C++ project?
The structure of C and C++ projects varies wildly from project to project, with
many different build tools being used for building them, and many different
formats for project configuration files. ALE can run compilers easily, but
ALE cannot easily detect which compiler flags to use.
Some tools and build configurations can generate
[compile_commands.json](https://clang.llvm.org/docs/JSONCompilationDatabase.html)
files. The `cppcheck`, `clangcheck`, `clangtidy` and `cquery` linters can read
these files for automatically determining the appropriate compiler flags to
use.
For linting with compilers like `gcc` and `clang`, and with other tools, you
will need to tell ALE which compiler flags to use yourself. You can use
different options for different projects with the `g:ale_pattern_options`
setting. Consult the documentation for that setting for more information.
`b:ale_linters` can be used to select which tools you want to run, say if you
want to use only `gcc` for one project, and only `clang` for another.
ALE will attempt to parse `compile_commands.json` files to discover compiler
flags to use when linting code. See `:help g:ale_c_parse_compile_commands` for
more information. See Clang's documentation for
[compile_commands.json files](https://clang.llvm.org/docs/JSONCompilationDatabase.html).
You should strongly consider generating them in your builds, which is easy to do
with CMake.
You can also configure ALE to automatically run `make -n` to run dry runs on
`Makefile`s to discover compiler flags. This can execute arbitrary code, so the
option is disabled by default. See `:help g:ale_c_parse_makefile`.
### How can I run linters or fixers via Docker or a VM?
ALE supports running linters or fixers via Docker, virtual machines, or in
combination with any remote machine with a different file system, so long as the
tools are well-integrated with ALE, and ALE is properly configured to run the
correct commands and map filename paths between different file systems. See
`:help ale-lint-other-machines` for the full documentation on how to configure
ALE to support this.
================================================
FILE: ale_linters/ada/adals.vim
================================================
" Author: Bartek Jasicki http://github.com/thindil
" Description: Support for Ada Language Server
call ale#Set('ada_adals_executable', 'ada_language_server')
call ale#Set('ada_adals_project', 'default.gpr')
call ale#Set('ada_adals_encoding', 'utf-8')
function! ale_linters#ada#adals#GetAdaLSConfig(buffer) abort
return {
\ 'ada.projectFile': ale#Var(a:buffer, 'ada_adals_project'),
\ 'ada.defaultCharset': ale#Var(a:buffer, 'ada_adals_encoding')
\}
endfunction
function! ale_linters#ada#adals#GetRootDirectory(buffer) abort
return fnamemodify(bufname(a:buffer), ':p:h')
endfunction
call ale#linter#Define('ada', {
\ 'name': 'adals',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'ada_adals_executable')},
\ 'command': '%e',
\ 'project_root': function('ale_linters#ada#adals#GetRootDirectory'),
\ 'lsp_config': function('ale_linters#ada#adals#GetAdaLSConfig')
\})
================================================
FILE: ale_linters/ada/cspell.vim
================================================
scriptencoding utf-8
" Author: David Houston
" Description: cspell support for Ada files.
call ale#handlers#cspell#DefineLinter('ada')
================================================
FILE: ale_linters/ada/gcc.vim
================================================
" Author: Martino Pilia
" Description: Lint Ada files with GCC
call ale#Set('ada_gcc_executable', 'gcc')
" -gnatwa: activate most optional warnings
" -gnatq: try semantic analysis even if syntax errors have been found
call ale#Set('ada_gcc_options', '-gnatwa -gnatq')
function! ale_linters#ada#gcc#GetCommand(buffer) abort
" Build a suitable output file name. The output file is specified because
" the .ali file may be created even if no code generation is attempted.
" The output file name must match the source file name (except for the
" extension), so here we cannot use the null file as output.
let l:tmp_dir = fnamemodify(ale#command#CreateDirectory(a:buffer), ':p')
let l:out_file = l:tmp_dir . fnamemodify(bufname(a:buffer), ':t:r') . '.o'
" -gnatc: Check syntax and semantics only (no code generation attempted)
return '%e -x ada -c -gnatc'
\ . ' -o ' . ale#Escape(l:out_file)
\ . ' -I %s:h'
\ . ale#Pad(ale#Var(a:buffer, 'ada_gcc_options'))
\ . ' %t'
endfunction
" For the message format please refer to:
" https://gcc.gnu.org/onlinedocs/gnat_ugn/Output-and-Error-Message-Control.html
" https://gcc.gnu.org/onlinedocs/gnat_ugn/Warning-Message-Control.html
function! ale_linters#ada#gcc#Handle(buffer, lines) abort
" Error format: :::
" Warning format: ::: warning:
let l:re = '\v(.+):([0-9]+):([0-9]+):\s+(warning:)?\s*(.+)\s*'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:re)
call add(l:output, {
\ 'bufnr': a:buffer,
\ 'lnum': str2nr(l:match[2]),
\ 'col': str2nr(l:match[3]),
\ 'type': l:match[4] is# 'warning:' ? 'W' : 'E',
\ 'text': l:match[5],
\})
endfor
return l:output
endfunction
call ale#linter#Define('ada', {
\ 'name': 'gcc',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'ada_gcc_executable')},
\ 'command': function('ale_linters#ada#gcc#GetCommand'),
\ 'callback': 'ale_linters#ada#gcc#Handle',
\})
================================================
FILE: ale_linters/ansible/ansible_lint.vim
================================================
" Authors: Bjorn Neergaard , Vytautas Macionis
" 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
return [{
\ 'lnum': 1,
\ 'text': 'An exception was thrown. See :ALEDetail',
\ 'detail': join(a:lines, "\n"),
\}]
endif
endfor
let l:version_group = ale#semver#GTE(a:version, [6, 0, 0]) ? '>=6.0.0' :
\ ale#semver#GTE(a:version, [5, 0, 0]) ? '>=5.0.0' :
\ '<5.0.0'
let l:output = []
if '>=6.0.0' is# l:version_group
let l:error_codes = { 'blocker': 'E', 'critical': 'E', 'major': 'W', 'minor': 'W', 'info': 'I' }
let l:linter_issues = ale#util#FuzzyJSONDecode(a:lines, [])
for l:issue in l:linter_issues
if ale#path#IsBufferPath(a:buffer, l:issue.location.path)
if exists('l:issue.location.positions')
let l:coord_keyname = 'positions'
else
let l:coord_keyname = 'lines'
endif
let l:column_member = printf(
\ 'l:issue.location.%s.begin.column', l:coord_keyname
\)
call add(l:output, {
\ 'lnum': exists(l:column_member) ? l:issue.location[l:coord_keyname].begin.line :
\ l:issue.location[l:coord_keyname].begin,
\ 'col': exists(l:column_member) ? l:issue.location[l:coord_keyname].begin.column : 0,
\ 'text': l:issue.check_name,
\ 'detail': l:issue.description,
\ 'code': l:issue.severity,
\ 'type': l:error_codes[l:issue.severity],
\})
endif
endfor
endif
if '>=5.0.0' is# l:version_group
" Matches patterns line the following:
" test.yml:3:148: syntax-check 'var' is not a valid attribute for a Play
" roles/test/tasks/test.yml:8: [package-latest] [VERY_LOW] Package installs should not use latest
" D:\test\tasks\test.yml:8: [package-latest] [VERY_LOW] package installs should not use latest
let l:pattern = '\v^(%([a-zA-Z]:)?[^:]+):(\d+):%((\d+):)? %(\[([-[:alnum:]]+)\]) %(\[([_[:alnum:]]+)\]) (.*)$'
let l:error_codes = { 'VERY_HIGH': 'E', 'HIGH': 'E', 'MEDIUM': 'W', 'LOW': 'W', 'VERY_LOW': 'W', 'INFO': 'I' }
for l:match in ale#util#GetMatches(a:lines, l:pattern)
if ale#path#IsBufferPath(a:buffer, l:match[1])
call add(l:output, {
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'text': l:match[6],
\ 'code': l:match[4],
\ 'type': l:error_codes[l:match[5]],
\})
endif
endfor
endif
if '<5.0.0' is# l:version_group
" Matches patterns line the following:
" test.yml:35: [EANSIBLE0002] Trailing whitespace
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?: \[?([[:alnum:]]+)\]? (.*)$'
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:code = l:match[4]
if l:code is# 'EANSIBLE0002'
\&& !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
" Skip warnings for trailing whitespace if the option is off.
continue
endif
if ale#path#IsBufferPath(a:buffer, l:match[1])
call add(l:output, {
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'text': l:match[5],
\ 'code': l:code,
\ 'type': l:code[:0] is# 'E' ? 'E' : 'W',
\})
endif
endfor
endif
return l:output
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: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
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'),
\ 'lint_file': 1,
\ 'callback': {buffer, lines -> ale#semver#RunWithVersionCheck(
\ buffer,
\ ale_linters#ansible#ansible_lint#GetExecutable(buffer),
\ '%e --version',
\ {buffer, version -> ale_linters#ansible#ansible_lint#Handle(
\ buffer,
\ l:version,
\ lines)},
\ )},
\})
================================================
FILE: ale_linters/ansible/language_server.vim
================================================
" Author: Horacio Sanson
" Description: Support ansible language server https://github.com/ansible/ansible-language-server/
call ale#Set('ansible_language_server_executable', 'ansible-language-server')
call ale#Set('ansible_language_server_config', {})
function! ale_linters#ansible#language_server#Executable(buffer) abort
return ale#Var(a:buffer, 'ansible_language_server_executable')
endfunction
function! ale_linters#ansible#language_server#GetCommand(buffer) abort
let l:executable = ale_linters#ansible#language_server#Executable(a:buffer)
return ale#Escape(l:executable) . ' --stdio'
endfunction
function! ale_linters#ansible#language_server#FindProjectRoot(buffer) abort
let l:dir = fnamemodify(
\ ale#path#FindNearestFile(a:buffer, 'ansible.cfg'),
\ ':h'
\)
if l:dir isnot# '.' && isdirectory(l:dir)
return l:dir
endif
let l:dir = fnamemodify(
\ ale#path#FindNearestDirectory(a:buffer, '.git'),
\ ':h:h'
\)
if l:dir isnot# '.' && isdirectory(l:dir)
return l:dir
endif
return ''
endfunction
call ale#linter#Define('ansible', {
\ 'name': 'language_server',
\ 'aliases': ['ansible_language_server', 'ansible-language-server'],
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#ansible#language_server#Executable'),
\ 'command': function('ale_linters#ansible#language_server#GetCommand'),
\ 'project_root': function('ale_linters#ansible#language_server#FindProjectRoot'),
\ 'lsp_config': {b -> ale#Var(b, 'ansible_language_server_config')}
\})
================================================
FILE: ale_linters/apiblueprint/drafter.vim
================================================
" Author: nametake https://nametake.github.io
" Description: apiblueprint parser
function! ale_linters#apiblueprint#drafter#HandleErrors(buffer, lines) abort
" Matches patterns line the following:
"
" warning: (3) unable to parse response signature, expected 'response [] [()]'; line 4, column 3k - line 4, column 22
" warning: (10) message-body asset is expected to be a pre-formatted code block, separate it by a newline and indent every of its line by 12 spaces or 3 tabs; line 30, column 5 - line 30, column 9; line 31, column 9 - line 31, column 14; line 32, column 9 - line 32, column 14
let l:pattern = '\(^.*\): (\d\+) \(.\{-\}\); line \(\d\+\), column \(\d\+\) - line \d\+, column \d\+\(.*; line \d\+, column \d\+ - line \(\d\+\), column \(\d\+\)\)\{-\}$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines[2:], l:pattern)
let l:item = {
\ 'type': l:match[1] is# 'warning' ? 'W' : 'E',
\ 'text': l:match[2],
\ 'lnum': l:match[3] + 0,
\ 'col': l:match[4] + 0,
\}
if l:match[5] isnot# ''
let l:item.end_lnum = l:match[6] + 0
let l:item.end_col = l:match[7] + 0
endif
call add(l:output, l:item)
endfor
return l:output
endfunction
call ale#linter#Define('apiblueprint', {
\ 'name': 'drafter',
\ 'output_stream': 'stderr',
\ 'executable': 'drafter',
\ 'command': 'drafter --use-line-num --validate',
\ 'callback': 'ale_linters#apiblueprint#drafter#HandleErrors',
\})
================================================
FILE: ale_linters/apkbuild/apkbuild_lint.vim
================================================
" Author: Leo
" Description: apkbuild-lint from atools linter for APKBUILDs
call ale#Set('apkbuild_apkbuild_lint_executable', 'apkbuild-lint')
call ale#linter#Define('apkbuild', {
\ 'name': 'apkbuild_lint',
\ 'output_stream': 'stdout',
\ 'executable': {b -> ale#Var(b, 'apkbuild_apkbuild_lint_executable')},
\ 'command': '%e %t',
\ 'callback': 'ale#handlers#atools#Handle',
\})
================================================
FILE: ale_linters/apkbuild/secfixes_check.vim
================================================
" Author: Leo
" Description: secfixes-check from atools linter for APKBUILDs
call ale#Set('apkbuild_secfixes_check_executable', 'secfixes-check')
call ale#linter#Define('apkbuild', {
\ 'name': 'secfixes_check',
\ 'output_stream': 'stdout',
\ 'executable': {b -> ale#Var(b, 'apkbuild_secfixes_check_executable')},
\ 'command': '%e %t',
\ 'callback': 'ale#handlers#atools#Handle',
\})
================================================
FILE: ale_linters/asciidoc/alex.vim
================================================
" Author: Johannes Wienke
" Description: alex for asciidoc files
call ale#handlers#alex#DefineLinter('asciidoc', '--text')
================================================
FILE: ale_linters/asciidoc/cspell.vim
================================================
scriptencoding utf-8
" Author: David Houston
" Description: cspell support for ASCIIDoc files.
call ale#handlers#cspell#DefineLinter('asciidoc')
================================================
FILE: ale_linters/asciidoc/languagetool.vim
================================================
" Author: Horacio Sanson (hsanson [ät] gmail.com)
" Description: languagetool for asciidoc files, copied from markdown.
call ale#handlers#languagetool#DefineLinter('asciidoc')
================================================
FILE: ale_linters/asciidoc/proselint.vim
================================================
" 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'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
\})
================================================
FILE: ale_linters/asciidoc/redpen.vim
================================================
" Author: rhysd https://rhysd.github.io
" Description: Redpen, a proofreading tool (http://redpen.cc)
call ale#handlers#redpen#DefineLinter('asciidoc')
================================================
FILE: ale_linters/asciidoc/textlint.vim
================================================
" Author: TANIGUCHI Masaya
" Description: textlint for AsciiDoc files
call ale#linter#Define('asciidoc', {
\ 'name': 'textlint',
\ 'executable': function('ale#handlers#textlint#GetExecutable'),
\ 'command': function('ale#handlers#textlint#GetCommand'),
\ 'callback': 'ale#handlers#textlint#HandleTextlintOutput',
\})
================================================
FILE: ale_linters/asciidoc/vale.vim
================================================
" Author: Jeff Kreeftmeijer https://github.com/jeffkreeftmeijer
" Description: vale for AsciiDoc files
call ale#linter#Define('asciidoc', {
\ 'name': 'vale',
\ 'executable': 'vale',
\ 'command': 'vale --output=line %t',
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
\})
================================================
FILE: ale_linters/asciidoc/writegood.vim
================================================
" Author: Sumner Evans
" Description: write-good for AsciiDoc files
call ale#handlers#writegood#DefineLinter('asciidoc')
================================================
FILE: ale_linters/asm/gcc.vim
================================================
" Author: Lucas Kolstad
" Description: gcc linter for asm files
call ale#Set('asm_gcc_executable', 'gcc')
call ale#Set('asm_gcc_options', '-Wall')
function! ale_linters#asm#gcc#GetCommand(buffer) abort
" `-o /dev/null` or `-o null` is needed to catch all errors,
" -fsyntax-only doesn't catch everything.
return '%e -x assembler'
\ . ' -o ' . g:ale#util#nul_file
\ . ' -iquote %s:h'
\ . ' ' . ale#Var(a:buffer, 'asm_gcc_options') . ' -'
endfunction
function! ale_linters#asm#gcc#Handle(buffer, lines) abort
let l:pattern = '^.\+:\(\d\+\): \([^:]\+\): \(.\+\)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'type': l:match[2] =~? 'error' ? 'E' : 'W',
\ 'text': l:match[3],
\})
endfor
return l:output
endfunction
call ale#linter#Define('asm', {
\ 'name': 'gcc',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'asm_gcc_executable')},
\ 'command': function('ale_linters#asm#gcc#GetCommand'),
\ 'callback': 'ale_linters#asm#gcc#Handle',
\})
================================================
FILE: ale_linters/asm/llvm_mc.vim
================================================
" Author: uidops
" Description: llvm-mc linter for asm files
call ale#Set('asm_llvm_mc_executable', 'llvm-mc')
call ale#Set('asm_llvm_mc_options', '')
function! ale_linters#asm#llvm_mc#GetCommand(buffer) abort
return '%e --assemble'
\ . ' --filetype=asm'
\ . ' -o ' . g:ale#util#nul_file
\ . ' ' . ale#Var(a:buffer, 'asm_llvm_mc_options')
endfunction
function! ale_linters#asm#llvm_mc#Handle(buffer, lines) abort
let l:pattern = '^.\+:\(\d\+\):\(\d\+\): \([^:]\+\): \(.\+\)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'type': l:match[3] =~? 'error' ? 'E' : 'W',
\ 'text': l:match[4],
\})
endfor
return l:output
endfunction
call ale#linter#Define('asm', {
\ 'name': 'llvm_mc',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'asm_llvm_mc_executable')},
\ 'command': function('ale_linters#asm#llvm_mc#GetCommand'),
\ 'callback': 'ale_linters#asm#llvm_mc#Handle',
\})
================================================
FILE: ale_linters/astro/eslint.vim
================================================
" Author: Hyuksang Kwon
" Description: eslint for astro files
call ale#linter#Define('astro', {
\ 'name': 'eslint',
\ 'output_stream': 'both',
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
\ 'cwd': function('ale#handlers#eslint#GetCwd'),
\ 'command': function('ale#handlers#eslint#GetCommand'),
\ 'callback': 'ale#handlers#eslint#HandleJSON',
\})
================================================
FILE: ale_linters/avra/avra.vim
================================================
" Author: Utkarsh Verma
" Description: AVRA linter for avra syntax.
call ale#Set('avra_avra_executable', 'avra')
call ale#Set('avra_avra_options', '')
function! ale_linters#avra#avra#GetCommand(buffer) abort
return '%e'
\ . ' %t'
\ . ale#Pad(ale#Var(a:buffer, 'avra_avra_options'))
\ . ' -o ' . g:ale#util#nul_file
endfunction
function! ale_linters#avra#avra#Handle(buffer, lines) abort
" Note that we treat 'fatal' as errors.
let l:pattern = '^\S\+(\(\d\+\))\s\+:\s\+\(\S\+\)\s\+:\s\+\(.\+\)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'type': l:match[2] =~? 'Error' ? 'E' : 'W',
\ 'text': l:match[3],
\})
endfor
return l:output
endfunction
call ale#linter#Define('avra', {
\ 'name': 'avra',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'avra_avra_executable')},
\ 'command': function('ale_linters#avra#avra#GetCommand'),
\ 'callback': 'ale_linters#avra#avra#Handle',
\})
================================================
FILE: ale_linters/awk/gawk.vim
================================================
" Author: kmarc
" Description: This file adds support for using GNU awk with scripts.
call ale#Set('awk_gawk_executable', 'gawk')
call ale#Set('awk_gawk_options', '')
function! ale_linters#awk#gawk#GetCommand(buffer) abort
" note the --source 'BEGIN ...' is to prevent
" gawk from attempting to execute the body of the script
" it is linting.
return '%e --source ' . ale#Escape('BEGIN { exit } END { exit 1 }')
\ . ' --lint'
\ . ale#Pad(ale#Var(a:buffer, 'awk_gawk_options'))
\ . ' -f %t /dev/null'
endfunction
call ale#linter#Define('awk', {
\ 'name': 'gawk',
\ 'executable': {b -> ale#Var(b, 'awk_gawk_executable')},
\ 'command': function('ale_linters#awk#gawk#GetCommand'),
\ 'callback': 'ale#handlers#gawk#HandleGawkFormat',
\ 'output_stream': 'both'
\})
================================================
FILE: ale_linters/bats/shellcheck.vim
================================================
" Author: Ian2020
" Description: shellcheck linter for bats scripts.
call ale#handlers#shellcheck#DefineLinter('bats')
================================================
FILE: ale_linters/bib/bibclean.vim
================================================
" Author: Horacio Sanson - https://github.com/hsanson
" Description: Support for bibclean linter for BibTeX files.
call ale#Set('bib_bibclean_executable', 'bibclean')
function! ale_linters#bib#bibclean#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'bib_bibclean_executable')
return ale#Escape(l:executable) . ' -file-position '
endfunction
function! ale_linters#bib#bibclean#get_type(str) abort
if a:str is# '??'
return 'E'
else
return 'W'
endif
endfunction
function! ale_linters#bib#bibclean#match_msg(line) abort
" Legacy message pattern works for bibclean <= v2.11.4. If empty, try
" the new message pattern for bibtex > v2.11.4
let l:matches_legacy = matchlist(a:line, '^\(.*\) "stdin", line \(\d\+\): \(.*\)$')
return ! empty(l:matches_legacy) ? l:matches_legacy
\ : matchlist(a:line, '^\(.*\) stdin:\(\d\+\):\(.*\)$')
endfunction
function! ale_linters#bib#bibclean#match_entry(line) abort
return matchlist(a:line, 'Entry input byte=.* line=\(.*\) column=\(.*\) output .*$')
endfunction
function! ale_linters#bib#bibclean#match_value(line) abort
return matchlist(a:line, 'Value input byte=.* line=\(.*\) column=\(.*\) output .*$')
endfunction
function! ale_linters#bib#bibclean#Handle(buffer, lines) abort
let l:output = []
let l:type = 'E'
let l:msg = ''
for l:line in a:lines
if empty(l:msg)
let l:mlist = ale_linters#bib#bibclean#match_msg(l:line)
if !empty(l:mlist)
let l:msg = l:mlist[3]
let l:type = ale_linters#bib#bibclean#get_type(l:mlist[1])
endif
else
if l:type is# 'E'
let l:mlist = ale_linters#bib#bibclean#match_entry(l:line)
else
let l:mlist = ale_linters#bib#bibclean#match_value(l:line)
endif
if !empty(l:mlist)
call add(l:output, {
\ 'lnum': l:mlist[1],
\ 'col': l:mlist[2],
\ 'text': l:msg,
\ 'type': l:type
\})
let l:msg = ''
endif
endif
endfor
return l:output
endfunction
call ale#linter#Define('bib', {
\ 'name': 'bibclean',
\ 'executable': {b -> ale#Var(b, 'bib_bibclean_executable')},
\ 'command': function('ale_linters#bib#bibclean#GetCommand'),
\ 'output_stream': 'stderr',
\ 'callback': 'ale_linters#bib#bibclean#Handle',
\})
================================================
FILE: ale_linters/bicep/az_bicep.vim
================================================
" Author: Carl Smedstad
" Description: az_bicep for bicep files
let g:ale_bicep_az_bicep_executable =
\ get(g:, 'ale_bicep_az_bicep_executable', 'az')
let g:ale_bicep_az_bicep_options =
\ get(g:, 'ale_bicep_az_bicep_options', '')
function! ale_linters#bicep#az_bicep#Executable(buffer) abort
return ale#Var(a:buffer, 'bicep_az_bicep_executable')
endfunction
function! ale_linters#bicep#az_bicep#Command(buffer) abort
let l:executable = ale_linters#bicep#az_bicep#Executable(a:buffer)
let l:options = ale#Var(a:buffer, 'bicep_az_bicep_options')
if has('win32')
let l:nullfile = 'NUL'
else
let l:nullfile = '/dev/null'
endif
return ale#Escape(l:executable)
\ . ' bicep build --outfile '
\ . l:nullfile
\ . ' --file '
\ . '%s '
\ . l:options
endfunction
function! ale_linters#bicep#az_bicep#Handle(buffer, lines) abort
let l:pattern = '\v^([A-Z]+)?(:\s)?(.*)\((\d+),(\d+)\)\s:\s([a-zA-Z]*)\s([-a-zA-Z0-9]*):\s(.*)'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
if l:match[1] is# 'ERROR'
let l:type = 'E'
elseif l:match[1] is# 'WARNING'
let l:type = 'W'
elseif l:match[6] is# 'Error'
let l:type = 'E'
elseif l:match[6] is# 'Warning'
let l:type = 'W'
else
let l:type = 'I'
endif
call add(l:output, {
\ 'filename': l:match[3],
\ 'lnum': l:match[4] + 0,
\ 'col': l:match[5] + 0,
\ 'type': l:type,
\ 'code': l:match[7],
\ 'text': l:match[8],
\})
endfor
return l:output
endfunction
call ale#linter#Define('bicep', {
\ 'name': 'az_bicep',
\ 'executable': function('ale_linters#bicep#az_bicep#Executable'),
\ 'command': function('ale_linters#bicep#az_bicep#Command'),
\ 'callback': 'ale_linters#bicep#az_bicep#Handle',
\ 'output_stream': 'stderr',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/bicep/bicep.vim
================================================
" Author: Carl Smedstad
" Description: bicep for bicep files
let g:ale_bicep_bicep_executable =
\ get(g:, 'ale_bicep_bicep_executable', 'bicep')
let g:ale_bicep_bicep_options =
\ get(g:, 'ale_bicep_bicep_options', '')
function! ale_linters#bicep#bicep#Executable(buffer) abort
return ale#Var(a:buffer, 'bicep_bicep_executable')
endfunction
function! ale_linters#bicep#bicep#Command(buffer) abort
let l:executable = ale_linters#bicep#bicep#Executable(a:buffer)
let l:options = ale#Var(a:buffer, 'bicep_bicep_options')
if has('win32')
let l:nullfile = 'NUL'
else
let l:nullfile = '/dev/null'
endif
return ale#Escape(l:executable)
\ . ' build --outfile '
\ . l:nullfile
\ . ' '
\ . l:options
\ . ' %s'
endfunction
function! ale_linters#bicep#bicep#Handle(buffer, lines) abort
let l:pattern = '\v^(.*)\((\d+),(\d+)\)\s:\s([a-zA-Z]*)\s([-a-zA-Z0-9]*):\s(.*)'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
if l:match[4] is# 'Error'
let l:type = 'E'
elseif l:match[4] is# 'Warning'
let l:type = 'W'
else
let l:type = 'I'
endif
call add(l:output, {
\ 'filename': l:match[1],
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'type': l:type,
\ 'code': l:match[5],
\ 'text': l:match[6],
\})
endfor
return l:output
endfunction
call ale#linter#Define('bicep', {
\ 'name': 'bicep',
\ 'executable': function('ale_linters#bicep#bicep#Executable'),
\ 'command': function('ale_linters#bicep#bicep#Command'),
\ 'callback': 'ale_linters#bicep#bicep#Handle',
\ 'output_stream': 'both',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/bindzone/checkzone.vim
================================================
" Description: named-checkzone for bindzone
call ale#Set('bindzone_checkzone_executable', 'named-checkzone')
call ale#Set('bindzone_checkzone_options', '-c IN')
function! ale_linters#bindzone#checkzone#GetCommand(buffer) abort
return '%e' . ale#Pad(ale#Var(a:buffer, 'bindzone_checkzone_options'))
\ . ' example.com %t'
endfunction
function! ale_linters#bindzone#checkzone#Handle(buffer, lines) abort
let l:warning_pattern = '\vzone example.com/IN: (.+)$'
let l:error_pattern = '\v:(\d+): (.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:error_pattern)
let l:lnum = l:match[1]
let l:text = l:match[2]
call add(l:output, {'text': l:text, 'lnum': l:lnum + 0, 'type': 'E'})
endfor
for l:match in ale#util#GetMatches(a:lines, l:warning_pattern)
let l:text = l:match[1]
" Ignore information messages
let l:scrub_match = matchlist(l:text, '\v(loaded serial|not loaded due to) ')
if empty(l:scrub_match)
call add(l:output, {'text': l:text, 'lnum': 0, 'type': 'W'})
endif
endfor
return l:output
endfunction
call ale#linter#Define('bindzone', {
\ 'name': 'checkzone',
\ 'executable': {b -> ale#Var(b, 'bindzone_checkzone_executable')},
\ 'command': function('ale_linters#bindzone#checkzone#GetCommand'),
\ 'callback': 'ale_linters#bindzone#checkzone#Handle',
\ 'read_buffer': 0,
\})
================================================
FILE: ale_linters/bitbake/oelint_adv.vim
================================================
" Author: offa
" Description: oelint-adv for BitBake files
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'))
return ((!empty(l:config_file))
\ ? 'OELINT_CONFIG=' . ale#Escape(l:config_file) . ' '
\ : '')
\ . '%e --quiet '
\ . ale#Pad(ale#Var(a:buffer, 'bitbake_oelint_adv_options')) . '%s'
endfunction
function! ale_linters#bitbake#oelint_adv#Handle(buffer, lines) abort
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],
\})
endfor
return l:output
endfunction
call ale#linter#Define('bitbake', {
\ 'name': 'oelint_adv',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#Var(b, 'bitbake_oelint_adv_executable')},
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#bitbake#oelint_adv#Command'),
\ 'callback': 'ale_linters#bitbake#oelint_adv#Handle',
\ })
================================================
FILE: ale_linters/bzl/buildifier.vim
================================================
" Author: Chuck Grindel
" Description: Bazel Starlark lint support using buildifier.
function! ale_linters#bzl#buildifier#GetCommand(buffer) abort
let l:executable = ale#Escape(ale#fixers#buildifier#GetExecutable(a:buffer))
let l:options = ale#Var(a:buffer, 'bazel_buildifier_options')
let l:filename = ale#Escape(bufname(a:buffer))
let l:command = l:executable . ' -mode check -lint warn -path %s'
if l:options isnot# ''
let l:command .= ' ' . l:options
endif
return l:command
endfunction
function! ale_linters#bzl#buildifier#Handle(buffer, lines) abort
let l:pattern = '\v^[^:]+:(\d+):(\d+)?:?\s+(syntax error near)?(.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'text': l:match[3] . l:match[4],
\ 'type': l:match[3] is# 'syntax error near' ? 'E' : 'W',
\})
endfor
return l:output
endfunction
call ale#linter#Define('bzl', {
\ 'name': 'buildifier',
\ 'output_stream': 'both',
\ 'executable': function('ale#fixers#buildifier#GetExecutable'),
\ 'command': function('ale_linters#bzl#buildifier#GetCommand'),
\ 'callback': function('ale_linters#bzl#buildifier#Handle'),
\})
================================================
FILE: ale_linters/c/cc.vim
================================================
" Author: w0rp
" Description: A C compiler linter for C files with gcc/clang, etc.
call ale#Set('c_cc_executable', '')
call ale#Set('c_cc_options', '-std=c11 -Wall')
call ale#Set('c_cc_use_header_lang_flag', -1)
call ale#Set('c_cc_header_exts', ['h'])
function! ale_linters#c#cc#GetExecutable(buffer) abort
let l:executable = ale#Var(a:buffer, 'c_cc_executable')
" Default to either clang or gcc.
if l:executable is# ''
if ale#engine#IsExecutable(a:buffer, 'clang')
let l:executable = 'clang'
else
let l:executable = 'gcc'
endif
endif
return l:executable
endfunction
function! ale_linters#c#cc#GetCommand(buffer, output) abort
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
let l:ale_flags = ale#Var(a:buffer, 'c_cc_options')
if l:cflags =~# '-std='
let l:ale_flags = substitute(
\ l:ale_flags,
\ '-std=\(c\|gnu\)[0-9]\{2\}',
\ '',
\ 'g')
endif
" Select the correct language flag depending on the executable, options
" and file extension
let l:executable = ale_linters#c#cc#GetExecutable(a:buffer)
let l:use_header_lang_flag = ale#Var(a:buffer, 'c_cc_use_header_lang_flag')
let l:header_exts = ale#Var(a:buffer, 'c_cc_header_exts')
let l:lang_flag = ale#c#GetLanguageFlag(
\ a:buffer,
\ l:executable,
\ l:use_header_lang_flag,
\ l:header_exts,
\ 'c')
" -iquote with the directory the file is in makes #include work for
" headers in the same directory.
"
" `-o /dev/null` or `-o null` is needed to catch all errors,
" -fsyntax-only doesn't catch everything.
return '%e -S -x ' . l:lang_flag
\ . ' -o ' . g:ale#util#nul_file
\ . ' -iquote %s:h'
\ . ale#Pad(l:cflags)
\ . ale#Pad(l:ale_flags) . ' -'
endfunction
call ale#linter#Define('c', {
\ 'name': 'cc',
\ 'aliases': ['gcc', 'clang'],
\ 'output_stream': 'stderr',
\ 'executable': function('ale_linters#c#cc#GetExecutable'),
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#c#cc#GetCommand'))},
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
\})
================================================
FILE: ale_linters/c/ccls.vim
================================================
" Author: Ye Jingchen , Ben Falconer , jtalowell
" Description: A language server for C
call ale#Set('c_ccls_executable', 'ccls')
call ale#Set('c_ccls_init_options', {})
call ale#Set('c_build_dir', '')
call ale#linter#Define('c', {
\ 'name': 'ccls',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'c_ccls_executable')},
\ 'command': '%e',
\ 'project_root': function('ale#handlers#ccls#GetProjectRoot'),
\ 'initialization_options': {b -> ale#handlers#ccls#GetInitOpts(b, 'c_ccls_init_options')},
\})
================================================
FILE: ale_linters/c/clangcheck.vim
================================================
" Author: gagbo
" : luibo
" : Jorengarenar
" Description: clang-check linter for C files
" modified from cpp/clangcheck.vim to match for C
call ale#Set('c_clangcheck_executable', 'clang-check')
call ale#Set('c_clangcheck_options', '')
call ale#Set('c_build_dir', '')
function! ale_linters#c#clangcheck#GetCommand(buffer) abort
let l:user_options = ale#Var(a:buffer, 'c_clangcheck_options')
" Try to find compilation database to link automatically
let l:build_dir = ale#Var(a:buffer, 'c_build_dir')
if empty(l:build_dir)
let [l:root, l:json_file] = ale#c#FindCompileCommands(a:buffer)
let l:build_dir = ale#path#Dirname(l:json_file)
endif
" The extra arguments in the command are used to prevent .plist files from
" being generated. These are only added if no build directory can be
" detected.
return '%e -analyze %s'
\ . (empty(l:build_dir) ? ' --extra-arg=-Xclang --extra-arg=-analyzer-output=text --extra-arg=-fno-color-diagnostics': '')
\ . ale#Pad(l:user_options)
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
endfunction
call ale#linter#Define('c', {
\ 'name': 'clangcheck',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'c_clangcheck_executable')},
\ 'command': function('ale_linters#c#clangcheck#GetCommand'),
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/c/clangd.vim
================================================
" Author: Andrey Melentyev
" Description: Clangd language server
call ale#Set('c_clangd_executable', 'clangd')
call ale#Set('c_clangd_options', '')
call ale#Set('c_build_dir', '')
function! ale_linters#c#clangd#GetCommand(buffer) abort
let l:build_dir = ale#c#GetBuildDirectory(a:buffer)
return '%e'
\ . ale#Pad(ale#Var(a:buffer, 'c_clangd_options'))
\ . (!empty(l:build_dir) ? ' -compile-commands-dir=' . ale#Escape(l:build_dir) : '')
endfunction
call ale#linter#Define('c', {
\ 'name': 'clangd',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'c_clangd_executable')},
\ 'command': function('ale_linters#c#clangd#GetCommand'),
\ 'project_root': function('ale#c#FindProjectRoot'),
\})
================================================
FILE: ale_linters/c/clangtidy.vim
================================================
" Author: vdeurzen , w0rp ,
" gagbo , Andrej Radovic
" Description: clang-tidy linter for c files
call ale#Set('c_clangtidy_executable', 'clang-tidy')
" Set this option to check the checks clang-tidy will apply.
" The number of checks that can be applied to C files is limited in contrast to
" C++
"
" Consult the check list in clang-tidy's documentation:
" http://clang.llvm.org/extra/clang-tidy/checks/list.html
call ale#Set('c_clangtidy_checks', [])
" Set this option to manually set some options for clang-tidy to use as compile
" flags.
" This will disable compile_commands.json detection.
call ale#Set('c_clangtidy_options', '')
" Set this option to manually set options for clang-tidy directly.
call ale#Set('c_clangtidy_extra_options', '')
call ale#Set('c_build_dir', '')
function! ale_linters#c#clangtidy#GetCommand(buffer, output) abort
let l:checks = join(ale#Var(a:buffer, 'c_clangtidy_checks'), ',')
let l:build_dir = ale#c#GetBuildDirectory(a:buffer)
let l:options = ''
" Get the extra options if we couldn't find a build directory.
if empty(l:build_dir)
let l:options = ale#Var(a:buffer, 'c_clangtidy_options')
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
let l:options .= !empty(l:options) ? ale#Pad(l:cflags) : l:cflags
endif
" Get the options to pass directly to clang-tidy
let l:extra_options = ale#Var(a:buffer, 'c_clangtidy_extra_options')
return '%e'
\ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
\ . (!empty(l:extra_options) ? ' ' . ale#Escape(l:extra_options) : '')
\ . ' %s'
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
\ . (!empty(l:options) ? ' -- ' . l:options : '')
endfunction
call ale#linter#Define('c', {
\ 'name': 'clangtidy',
\ 'output_stream': 'stdout',
\ 'executable': {b -> ale#Var(b, 'c_clangtidy_executable')},
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#c#clangtidy#GetCommand'))},
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/c/cppcheck.vim
================================================
" Author: Bart Libert
" Description: cppcheck linter for c files
call ale#Set('c_cppcheck_executable', 'cppcheck')
call ale#Set('c_cppcheck_options', '--enable=style')
function! ale_linters#c#cppcheck#GetCommand(buffer) abort
let l:compile_commands_option = ale#handlers#cppcheck#GetCompileCommandsOptions(a:buffer)
let l:buffer_path_include = empty(l:compile_commands_option)
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
\ : ''
let l:template = ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
" 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
endfunction
call ale#linter#Define('c', {
\ 'name': 'cppcheck',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#Var(b, 'c_cppcheck_executable')},
\ 'cwd': function('ale#handlers#cppcheck#GetCwd'),
\ 'command': function('ale_linters#c#cppcheck#GetCommand'),
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
\})
================================================
FILE: ale_linters/c/cpplint.vim
================================================
" Author: Justin Huang
" Description: cpplint for c files
call ale#Set('c_cpplint_executable', 'cpplint')
call ale#Set('c_cpplint_options', '')
function! ale_linters#c#cpplint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'c_cpplint_options')
return '%e' . ale#Pad(l:options) . ' %s'
endfunction
call ale#linter#Define('c', {
\ 'name': 'cpplint',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'c_cpplint_executable')},
\ 'command': function('ale_linters#c#cpplint#GetCommand'),
\ 'callback': 'ale#handlers#cpplint#HandleCppLintFormat',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/c/cquery.vim
================================================
" Author: Ben Falconer , jtalowell
" Description: A language server for C
call ale#Set('c_cquery_executable', 'cquery')
call ale#Set('c_cquery_cache_directory', expand('~/.cache/cquery'))
function! ale_linters#c#cquery#GetProjectRoot(buffer) abort
" Try to find cquery configuration files first.
let l:config = ale#path#FindNearestFile(a:buffer, '.cquery')
if !empty(l:config)
return fnamemodify(l:config, ':h')
endif
" Fall back on default project root detection.
return ale#c#FindProjectRoot(a:buffer)
endfunction
function! ale_linters#c#cquery#GetInitializationOptions(buffer) abort
return {'cacheDirectory': ale#Var(a:buffer, 'c_cquery_cache_directory')}
endfunction
call ale#linter#Define('c', {
\ 'name': 'cquery',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'c_cquery_executable')},
\ 'command': '%e',
\ 'project_root': function('ale_linters#c#cquery#GetProjectRoot'),
\ 'initialization_options': function('ale_linters#c#cquery#GetInitializationOptions'),
\})
================================================
FILE: ale_linters/c/cspell.vim
================================================
scriptencoding utf-8
" Author: David Houston
" Description: cspell support for C files.
call ale#handlers#cspell#DefineLinter('c')
================================================
FILE: ale_linters/c/flawfinder.vim
================================================
" Author: Christian Gibbons
" Description: flawfinder linter for c files
call ale#Set('c_flawfinder_executable', 'flawfinder')
call ale#Set('c_flawfinder_options', '')
call ale#Set('c_flawfinder_minlevel', 1)
call ale#Set('c_flawfinder_error_severity', 6)
function! ale_linters#c#flawfinder#GetCommand(buffer) abort
" Set the minimum vulnerability level for flawfinder to bother with
let l:minlevel = ' --minlevel=' . ale#Var(a:buffer, 'c_flawfinder_minlevel')
return '%e -CDQS'
\ . ale#Pad(ale#Var(a:buffer, 'c_flawfinder_options'))
\ . l:minlevel
\ . ' %t'
endfunction
call ale#linter#Define('c', {
\ 'name': 'flawfinder',
\ 'output_stream': 'stdout',
\ 'executable': {b -> ale#Var(b, 'c_flawfinder_executable')},
\ 'command': function('ale_linters#c#flawfinder#GetCommand'),
\ 'callback': 'ale#handlers#flawfinder#HandleFlawfinderFormat',
\})
================================================
FILE: ale_linters/c3/c3lsp.vim
================================================
" Author: Koni Marti
" Description: A Language Server implementation for C3
call ale#Set('c3_c3lsp_executable', 'c3lsp')
call ale#Set('c3_c3lsp_options', '')
call ale#Set('c3_c3lsp_init_options', {})
function! ale_linters#c3#c3lsp#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'c3_c3lsp_executable')
return ale#Escape(l:executable) . ale#Pad(ale#Var(a:buffer, 'c3_c3lsp_options'))
endfunction
call ale#linter#Define('c3', {
\ 'name': 'c3lsp',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'c3_c3lsp_executable')},
\ 'command': function('ale_linters#c3#c3lsp#GetCommand'),
\ 'project_root': function('ale#handlers#c3lsp#GetProjectRoot'),
\ 'lsp_config': {b -> ale#handlers#c3lsp#GetInitOpts(b, 'c3_c3lsp_init_options')},
\})
================================================
FILE: ale_linters/cairo/scarb.vim
================================================
" Author: 0xhyoga <0xhyoga@gmx.com>,
" Description: scarb for cairo files
function! ale_linters#cairo#scarb#GetScarbExecutable(bufnr) abort
if ale#path#FindNearestFile(a:bufnr, 'Scarb.toml') isnot# ''
return 'scarb'
else
" if there is no Scarb.toml file, we don't use scarb even if it exists,
" so we return '', because executable('') apparently always fails
return ''
endif
endfunction
function! ale_linters#cairo#scarb#GetCommand(buffer, version) abort
return 'scarb build'
endfunction
call ale#linter#Define('cairo', {
\ 'name': 'scarb',
\ 'executable': function('ale_linters#cairo#scarb#GetScarbExecutable'),
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
\ buffer,
\ ale_linters#cairo#scarb#GetScarbExecutable(buffer),
\ '%e --version',
\ function('ale_linters#cairo#scarb#GetCommand'),
\ )},
\ 'callback': 'ale#handlers#cairo#HandleCairoErrors',
\ 'output_stream': 'both',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/cairo/sierra.vim
================================================
" Author: 0xHyoga <0xHyoga@gmx.com>
" Description: Report Starknet compile to sierra errors in cairo 1.0 code
call ale#Set('cairo_sierra_executable', 'starknet-compile')
call ale#Set('cairo_sierra_options', '')
function! ale_linters#cairo#sierra#Handle(buffer, lines) abort
" Matches patterns like the following:
" Error: Expected ';' but got '('
" --> /path/to/file/file.cairo:1:10:)
let l:pattern = '\v(error|warning): (.*)$'
let l:line_and_column_pattern = '\v\.cairo:(\d+):(\d+)'
let l:output = []
for l:line in a:lines
let l:match = matchlist(l:line, l:pattern)
if len(l:match) == 0
let l:match = matchlist(l:line, l:line_and_column_pattern)
if len(l:match) > 0
let l:index = len(l:output) - 1
let l:output[l:index]['lnum'] = l:match[1] + 0
let l:output[l:index]['col'] = l:match[2] + 0
endif
else
let l:isError = l:match[1] is? 'Error'
call add(l:output, {
\ 'lnum': 0,
\ 'col': 0,
\ 'text': l:match[2],
\ 'type': l:isError ? 'E' : 'W',
\})
endif
endfor
return l:output
endfunction
function! ale_linters#cairo#sierra#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'cairo_sierra_executable')
return l:executable . ale#Pad(ale#Var(a:buffer, 'cairo_sierra_options')) . ' %s'
endfunction
call ale#linter#Define('cairo', {
\ 'name': 'sierra',
\ 'executable': {b -> ale#Var(b, 'cairo_sierra_executable')},
\ 'command': function('ale_linters#cairo#sierra#GetCommand'),
\ 'callback': 'ale_linters#cairo#sierra#Handle',
\ 'output_stream': 'stderr',
\})
================================================
FILE: ale_linters/cairo/starknet.vim
================================================
" Author: 0xHyoga <0xHyoga@gmx.com>
" Description: Report starknet-compile errors in cairo code (pre-starknet
" 1.0). This is deprecated but kept for backwards compatability.
call ale#Set('cairo_starknet_executable', 'starknet-compile')
call ale#Set('cairo_starknet_options', '')
function! ale_linters#cairo#starknet#Handle(buffer, lines) abort
" Error always on the first line
" e.g ex01.cairo:20:6: Could not find module 'contracts.utils.ex00_base'. Searched in the following paths:
let l:pattern = '\v\.cairo:(\d+):(\d+):+ (.*)'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': str2nr(l:match[1]),
\ 'col': str2nr(l:match[2]),
\ 'type': 'E',
\ 'text': l:match[3],
\})
endfor
return l:output
endfunction
function! ale_linters#cairo#starknet#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'cairo_starknet_executable')
return l:executable . ale#Pad(ale#Var(a:buffer, 'cairo_starknet_options')) . ' %s'
endfunction
call ale#linter#Define('cairo', {
\ 'name': 'starknet',
\ 'executable': {b -> ale#Var(b, 'cairo_starknet_executable')},
\ 'command': function('ale_linters#cairo#starknet#GetCommand'),
\ 'callback': 'ale_linters#cairo#starknet#Handle',
\ 'output_stream': 'stderr',
\})
================================================
FILE: ale_linters/chef/cookstyle.vim
================================================
" Author: Raphael Hoegger - https://github.com/pfuender
" Description: Cookstyle (RuboCop based), a code style analyzer for Ruby files
call ale#Set('chef_cookstyle_executable', 'cookstyle')
call ale#Set('chef_cookstyle_options', '')
function! ale_linters#chef#cookstyle#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'chef_cookstyle_options')
return '%e' . ale#Pad(escape(l:options, '~')) . ' --force-exclusion --format json --stdin ' . ' %s'
endfunction
function! ale_linters#chef#cookstyle#Handle(buffer, lines) abort
if len(a:lines) == 0
return []
endif
let l:errors = ale#util#FuzzyJSONDecode(a:lines[0], {})
if !has_key(l:errors, 'summary')
\|| l:errors['summary']['offense_count'] == 0
\|| empty(l:errors['files'])
return []
endif
let l:output = []
for l:error in l:errors['files'][0]['offenses']
let l:start_col = str2nr(l:error['location']['start_column'])
let l:end_col = str2nr(l:error['location']['last_column'])
if !l:end_col
let l:end_col = l:start_col + 1
endif
call add(l:output, {
\ 'lnum': str2nr(l:error['location']['line']),
\ 'col': l:start_col,
\ 'end_col': l:end_col,
\ 'code': l:error['cop_name'],
\ 'text': l:error['message'],
\ 'type': l:error['severity'] is? 'convention' ? 'W' : 'E',
\})
endfor
return l:output
endfunction
call ale#linter#Define('chef', {
\ 'name': 'cookstyle',
\ 'executable': {b -> ale#Var(b, 'chef_cookstyle_executable')},
\ 'command': function('ale_linters#chef#cookstyle#GetCommand'),
\ 'callback': 'ale_linters#chef#cookstyle#Handle',
\})
================================================
FILE: ale_linters/chef/foodcritic.vim
================================================
" Author: Edward Larkey
" Author: Jose Junior
" Author: w0rp
" Description: This file adds the foodcritic linter for Chef files.
call ale#Set('chef_foodcritic_executable', 'foodcritic')
call ale#Set('chef_foodcritic_options', '')
function! ale_linters#chef#foodcritic#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'chef_foodcritic_options')
return '%e' . ale#Pad(escape(l:options, '~')) . ' %s'
endfunction
function! ale_linters#chef#foodcritic#Handle(buffer, lines) abort
" Matches patterns line the following:
"
" FC002: Avoid string interpolation where not required: httpd.rb:13
let l:pattern = '\v([^:]+): (.+): ([a-zA-Z]?:?[^:]+):(\d+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'code': l:match[1],
\ 'text': l:match[2],
\ 'filename': l:match[3],
\ 'lnum': l:match[4] + 0,
\ 'type': 'W',
\})
endfor
return l:output
endfunction
call ale#linter#Define('chef', {
\ 'name': 'foodcritic',
\ 'executable': {b -> ale#Var(b, 'chef_foodcritic_executable')},
\ 'command': function('ale_linters#chef#foodcritic#GetCommand'),
\ 'callback': 'ale_linters#chef#foodcritic#Handle',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/clojure/clj_kondo.vim
================================================
" Author: Masashi Iizuka
" Description: linter for clojure using clj-kondo https://github.com/borkdude/clj-kondo
call ale#Set('clojure_clj_kondo_options', '--cache')
function! ale_linters#clojure#clj_kondo#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'clojure_clj_kondo_options')
let l:command = 'clj-kondo'
\ . ale#Pad(l:options)
\ . ' --lint -'
\ . ' --filename %s'
return l:command
endfunction
function! ale_linters#clojure#clj_kondo#HandleCljKondoFormat(buffer, lines) abort
" output format
" ::: :
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+)?:(\d+)?:? ((Exception|error|warning): ?(.+))$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:type = 'E'
if l:match[4] is? 'warning'
let l:type = 'W'
endif
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'text': l:match[3],
\ 'type': l:type,
\})
endfor
return l:output
endfunction
call ale#linter#Define('clojure', {
\ 'name': 'clj-kondo',
\ 'output_stream': 'stdout',
\ 'executable': 'clj-kondo',
\ 'command': function('ale_linters#clojure#clj_kondo#GetCommand'),
\ 'callback': 'ale_linters#clojure#clj_kondo#HandleCljKondoFormat',
\})
================================================
FILE: ale_linters/clojure/joker.vim
================================================
" Author: Nic West
" Description: linter for clojure using joker https://github.com/candid82/joker
function! ale_linters#clojure#joker#HandleJokerFormat(buffer, lines) abort
" output format
" ::: :
let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):(\d+):? ((Read error|Parse error|Parse warning|Exception): ?(.+))$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:type = 'E'
if l:match[4] is? 'Parse warning'
let l:type = 'W'
endif
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'text': l:match[3],
\ 'type': l:type,
\})
endfor
return l:output
endfunction
call ale#linter#Define('clojure', {
\ 'name': 'joker',
\ 'output_stream': 'stderr',
\ 'executable': 'joker',
\ 'command': 'joker --working-dir %s --lint %t',
\ 'callback': 'ale_linters#clojure#joker#HandleJokerFormat',
\})
================================================
FILE: ale_linters/cloudformation/cfn_python_lint.vim
================================================
" Author: Yasuhiro Kiyota
" Description: Support cfn-python-lint for AWS Cloudformation template file
function! ale_linters#cloudformation#cfn_python_lint#Handle(buffer, lines) abort
" Matches patterns line the following:
"
" sample.template.yaml:96:7:96:15:E3012:Property Resources/Sample/Properties/FromPort should be of type Integer
let l:pattern = '\v^(.*):(\d+):(\d+):(\d+):(\d+):([[:alnum:]]+):(.*)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:code = l:match[6]
if ale#path#IsBufferPath(a:buffer, l:match[1])
call add(l:output, {
\ 'lnum': l:match[2],
\ 'col': l:match[3],
\ 'end_lnum': l:match[4],
\ 'end_col': l:match[5],
\ 'code': l:code,
\ 'type': l:code[:0] is# 'E' ? 'E' : 'W',
\ 'text': l:match[7]
\})
endif
endfor
return l:output
endfunction
call ale#linter#Define('cloudformation', {
\ 'name': 'cloudformation',
\ 'aliases': ['cfn-lint'],
\ 'executable': 'cfn-lint',
\ 'command': 'cfn-lint --template %t --format parseable',
\ 'callback': 'ale_linters#cloudformation#cfn_python_lint#Handle',
\})
================================================
FILE: ale_linters/cloudformation/checkov.vim
================================================
" Author: J. Handsel , Thyme-87
" 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',
\})
================================================
FILE: ale_linters/cmake/cmake_lint.vim
================================================
" Author: Carl Smedstad
" Description: cmake-lint for cmake files
let g:ale_cmake_cmake_lint_executable =
\ get(g:, 'ale_cmake_cmake_lint_executable', 'cmake-lint')
let g:ale_cmake_cmake_lint_options =
\ get(g:, 'ale_cmake_cmake_lint_options', '')
function! ale_linters#cmake#cmake_lint#Executable(buffer) abort
return ale#Var(a:buffer, 'cmake_cmake_lint_executable')
endfunction
function! ale_linters#cmake#cmake_lint#Command(buffer) abort
let l:executable = ale_linters#cmake#cmake_lint#Executable(a:buffer)
let l:options = ale#Var(a:buffer, 'cmake_cmake_lint_options')
return ale#Escape(l:executable) . ' ' . l:options . ' %s'
endfunction
function! ale_linters#cmake#cmake_lint#Handle(buffer, lines) abort
let l:pattern = '\v^[^:]+:(\d+),?(\d+)?:\s\[([A-Z]\d+)\]\s(.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'type': 'W',
\ 'code': l:match[3],
\ 'text': l:match[4],
\})
endfor
return l:output
endfunction
call ale#linter#Define('cmake', {
\ 'name': 'cmake_lint',
\ 'executable': function('ale_linters#cmake#cmake_lint#Executable'),
\ 'command': function('ale_linters#cmake#cmake_lint#Command'),
\ 'callback': 'ale_linters#cmake#cmake_lint#Handle',
\})
================================================
FILE: ale_linters/cmake/cmakelint.vim
================================================
" Author: Kenneth Benzie
" Description: cmakelint for cmake files
let g:ale_cmake_cmakelint_executable =
\ get(g:, 'ale_cmake_cmakelint_executable', 'cmakelint')
let g:ale_cmake_cmakelint_options =
\ get(g:, 'ale_cmake_cmakelint_options', '')
function! ale_linters#cmake#cmakelint#Executable(buffer) abort
return ale#Var(a:buffer, 'cmake_cmakelint_executable')
endfunction
function! ale_linters#cmake#cmakelint#Command(buffer) abort
return ale_linters#cmake#cmakelint#Executable(a:buffer)
\ . ' ' . ale#Var(a:buffer, 'cmake_cmakelint_options') . ' %t'
endfunction
call ale#linter#Define('cmake', {
\ 'name': 'cmakelint',
\ 'executable': function('ale_linters#cmake#cmakelint#Executable'),
\ 'command': function('ale_linters#cmake#cmakelint#Command'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
\})
================================================
FILE: ale_linters/coffee/coffee.vim
================================================
" Author: KabbAmine - https://github.com/KabbAmine
" Description: Coffee for checking coffee files
function! ale_linters#coffee#coffee#GetExecutable(buffer) abort
return ale#path#ResolveLocalPath(
\ a:buffer,
\ 'node_modules/.bin/coffee',
\ 'coffee'
\)
endfunction
function! ale_linters#coffee#coffee#GetCommand(buffer) abort
return ale_linters#coffee#coffee#GetExecutable(a:buffer)
\ . ' -cp -s'
endfunction
call ale#linter#Define('coffee', {
\ 'name': 'coffee',
\ 'executable': function('ale_linters#coffee#coffee#GetExecutable'),
\ 'command': function('ale_linters#coffee#coffee#GetCommand'),
\ 'output_stream': 'stderr',
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
\})
================================================
FILE: ale_linters/coffee/coffeelint.vim
================================================
" Author: Prashanth Chandra https://github.com/prashcr
" Description: coffeelint linter for coffeescript files
function! ale_linters#coffee#coffeelint#GetExecutable(buffer) abort
return ale#path#ResolveLocalPath(
\ a:buffer,
\ 'node_modules/.bin/coffeelint',
\ 'coffeelint'
\)
endfunction
function! ale_linters#coffee#coffeelint#GetCommand(buffer) abort
return ale_linters#coffee#coffeelint#GetExecutable(a:buffer)
\ . ' --stdin --reporter csv'
endfunction
function! ale_linters#coffee#coffeelint#Handle(buffer, lines) abort
" Matches patterns like the following:
"
" path,lineNumber,lineNumberEnd,level,message
" stdin,14,,error,Throwing strings is forbidden
"
" Note that we currently ignore lineNumberEnd for multiline errors
let l:pattern = 'stdin,\(\d\+\),\(\d*\),\(.\{-1,}\),\(.\+\)'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': str2nr(l:match[1]),
\ 'type': l:match[3] is# 'error' ? 'E' : 'W',
\ 'text': l:match[4],
\})
endfor
return l:output
endfunction
call ale#linter#Define('coffee', {
\ 'name': 'coffeelint',
\ 'executable': function('ale_linters#coffee#coffeelint#GetExecutable'),
\ 'command': function('ale_linters#coffee#coffeelint#GetCommand'),
\ 'callback': 'ale_linters#coffee#coffeelint#Handle',
\})
================================================
FILE: ale_linters/cpp/cc.vim
================================================
" Author: w0rp
" Description: A C++ compiler linter for C++ files with gcc/clang, etc.
call ale#Set('cpp_cc_executable', '')
call ale#Set('cpp_cc_options', '-std=c++14 -Wall')
call ale#Set('cpp_cc_use_header_lang_flag', -1)
call ale#Set('cpp_cc_header_exts', ['h', 'hpp'])
function! ale_linters#cpp#cc#GetExecutable(buffer) abort
let l:executable = ale#Var(a:buffer, 'cpp_cc_executable')
" Default to either clang++ or gcc.
if l:executable is# ''
if ale#engine#IsExecutable(a:buffer, 'clang++')
let l:executable = 'clang++'
else
let l:executable = 'gcc'
endif
endif
return l:executable
endfunction
function! ale_linters#cpp#cc#GetCommand(buffer, output) abort
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
let l:ale_flags = ale#Var(a:buffer, 'cpp_cc_options')
if l:cflags =~# '-std='
let l:ale_flags = substitute(
\ l:ale_flags,
\ '-std=\(c\|gnu\)++[0-9]\{2\}',
\ '',
\ 'g')
endif
" Select the correct language flag depending on the executable, options
" and file extension
let l:executable = ale_linters#cpp#cc#GetExecutable(a:buffer)
let l:use_header_lang_flag = ale#Var(a:buffer, 'cpp_cc_use_header_lang_flag')
let l:header_exts = ale#Var(a:buffer, 'cpp_cc_header_exts')
let l:lang_flag = ale#c#GetLanguageFlag(
\ a:buffer,
\ l:executable,
\ l:use_header_lang_flag,
\ l:header_exts,
\ 'c++')
" -iquote with the directory the file is in makes #include work for
" headers in the same directory.
"
" `-o /dev/null` or `-o null` is needed to catch all errors,
" -fsyntax-only doesn't catch everything.
return '%e -S -x ' . l:lang_flag
\ . ' -o ' . g:ale#util#nul_file
\ . ' -iquote %s:h'
\ . ale#Pad(l:cflags)
\ . ale#Pad(l:ale_flags) . ' -'
endfunction
call ale#linter#Define('cpp', {
\ 'name': 'cc',
\ 'aliases': ['gcc', 'clang', 'g++', 'clang++'],
\ 'output_stream': 'stderr',
\ 'executable': function('ale_linters#cpp#cc#GetExecutable'),
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#cpp#cc#GetCommand'))},
\ 'callback': 'ale#handlers#gcc#HandleGCCFormatWithIncludes',
\})
================================================
FILE: ale_linters/cpp/ccls.vim
================================================
" Author: Ye Jingchen , Ben Falconer , jtalowell
" Description: A language server for C++
call ale#Set('cpp_ccls_executable', 'ccls')
call ale#Set('cpp_ccls_init_options', {})
call ale#Set('c_build_dir', '')
call ale#linter#Define('cpp', {
\ 'name': 'ccls',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'cpp_ccls_executable')},
\ 'command': '%e',
\ 'project_root': function('ale#handlers#ccls#GetProjectRoot'),
\ 'initialization_options': {b -> ale#handlers#ccls#GetInitOpts(b, 'cpp_ccls_init_options')},
\})
================================================
FILE: ale_linters/cpp/clangcheck.vim
================================================
" Author: gagbo
" Description: clang-check linter for cpp files
call ale#Set('cpp_clangcheck_executable', 'clang-check')
call ale#Set('cpp_clangcheck_options', '')
call ale#Set('c_build_dir', '')
function! ale_linters#cpp#clangcheck#GetCommand(buffer) abort
let l:user_options = ale#Var(a:buffer, 'cpp_clangcheck_options')
" Try to find compilation database to link automatically
let l:build_dir = ale#Var(a:buffer, 'c_build_dir')
if empty(l:build_dir)
let [l:root, l:json_file] = ale#c#FindCompileCommands(a:buffer)
let l:build_dir = ale#path#Dirname(l:json_file)
endif
" The extra arguments in the command are used to prevent .plist files from
" being generated. These are only added if no build directory can be
" detected.
return '%e -analyze %s'
\ . (empty(l:build_dir) ? ' --extra-arg=-Xclang --extra-arg=-analyzer-output=text --extra-arg=-fno-color-diagnostics': '')
\ . ale#Pad(l:user_options)
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
endfunction
call ale#linter#Define('cpp', {
\ 'name': 'clangcheck',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'cpp_clangcheck_executable')},
\ 'command': function('ale_linters#cpp#clangcheck#GetCommand'),
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/cpp/clangd.vim
================================================
" Author: Andrey Melentyev
" Description: Clangd language server
call ale#Set('cpp_clangd_executable', 'clangd')
call ale#Set('cpp_clangd_options', '')
call ale#Set('c_build_dir', '')
function! ale_linters#cpp#clangd#GetCommand(buffer) abort
let l:build_dir = ale#c#GetBuildDirectory(a:buffer)
return '%e'
\ . ale#Pad(ale#Var(a:buffer, 'cpp_clangd_options'))
\ . (!empty(l:build_dir) ? ' -compile-commands-dir=' . ale#Escape(l:build_dir) : '')
endfunction
call ale#linter#Define('cpp', {
\ 'name': 'clangd',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'cpp_clangd_executable')},
\ 'command': function('ale_linters#cpp#clangd#GetCommand'),
\ 'project_root': function('ale#c#FindProjectRoot'),
\})
================================================
FILE: ale_linters/cpp/clangtidy.vim
================================================
" Author: vdeurzen , w0rp ,
" gagbo
" Description: clang-tidy linter for cpp files
call ale#Set('cpp_clangtidy_executable', 'clang-tidy')
" Set this option to check the checks clang-tidy will apply.
call ale#Set('cpp_clangtidy_checks', [])
" Set this option to manually set some options for clang-tidy to use as compile
" flags.
" This will disable compile_commands.json detection.
call ale#Set('cpp_clangtidy_options', '')
" Set this option to manually set options for clang-tidy directly.
call ale#Set('cpp_clangtidy_extra_options', '')
call ale#Set('c_build_dir', '')
function! ale_linters#cpp#clangtidy#GetCommand(buffer, output) abort
let l:checks = join(ale#Var(a:buffer, 'cpp_clangtidy_checks'), ',')
let l:build_dir = ale#c#GetBuildDirectory(a:buffer)
let l:options = ''
" Get the extra options if we couldn't find a build directory.
if empty(l:build_dir)
let l:options = ale#Var(a:buffer, 'cpp_clangtidy_options')
let l:cflags = ale#c#GetCFlags(a:buffer, a:output)
let l:options .= !empty(l:options) ? ale#Pad(l:cflags) : l:cflags
" Tell clang-tidy a .h header with a C++ filetype in Vim is a C++ file
" only when compile-commands.json file is not there. Adding these
" flags makes clang-tidy completely ignore compile commands.
if expand('#' . a:buffer) =~# '\.h$'
let l:options .= !empty(l:options) ? ' -x c++' : '-x c++'
endif
endif
" Get the options to pass directly to clang-tidy
let l:extra_options = ale#Var(a:buffer, 'cpp_clangtidy_extra_options')
return '%e'
\ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
\ . (!empty(l:extra_options) ? ' ' . ale#Escape(l:extra_options) : '')
\ . ' %s'
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
\ . (!empty(l:options) ? ' -- ' . l:options : '')
endfunction
call ale#linter#Define('cpp', {
\ 'name': 'clangtidy',
\ 'output_stream': 'stdout',
\ 'executable': {b -> ale#Var(b, 'cpp_clangtidy_executable')},
\ 'command': {b -> ale#c#RunMakeCommand(b, function('ale_linters#cpp#clangtidy#GetCommand'))},
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/cpp/clazy.vim
================================================
" Description: clazy linter for cpp files (clang-based and Qt-oriented)
call ale#Set('cpp_clazy_executable', 'clazy-standalone')
" Set this option to check the checks clazy will apply.
call ale#Set('cpp_clazy_checks', ['level1'])
" Set this option to manually set some options for clazy.
" This will disable compile_commands.json detection.
call ale#Set('cpp_clazy_options', '')
call ale#Set('c_build_dir', '')
function! ale_linters#cpp#clazy#GetCommand(buffer) abort
let l:checks = join(ale#Var(a:buffer, 'cpp_clazy_checks'), ',')
let l:build_dir = ale#c#GetBuildDirectory(a:buffer)
" Get the extra options if we couldn't find a build directory.
let l:options = ale#Var(a:buffer, 'cpp_clazy_options')
return '%e'
\ . (!empty(l:checks) ? ' -checks=' . ale#Escape(l:checks) : '')
\ . (!empty(l:build_dir) ? ' -p ' . ale#Escape(l:build_dir) : '')
\ . ale#Pad(l:options)
\ . ' %s'
endfunction
call ale#linter#Define('cpp', {
\ 'name': 'clazy',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'cpp_clazy_executable')},
\ 'command': function('ale_linters#cpp#clazy#GetCommand'),
\ 'callback': 'ale#handlers#gcc#HandleGCCFormat',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/cpp/cppcheck.vim
================================================
" Author: Bart Libert
" Description: cppcheck linter for cpp files
call ale#Set('cpp_cppcheck_executable', 'cppcheck')
call ale#Set('cpp_cppcheck_options', '--enable=style')
function! ale_linters#cpp#cppcheck#GetCommand(buffer) abort
let l:compile_commands_option = ale#handlers#cppcheck#GetCompileCommandsOptions(a:buffer)
let l:buffer_path_include = empty(l:compile_commands_option)
\ ? ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
\ : ''
let l:template = ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
" 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
endfunction
call ale#linter#Define('cpp', {
\ 'name': 'cppcheck',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#Var(b, 'cpp_cppcheck_executable')},
\ 'cwd': function('ale#handlers#cppcheck#GetCwd'),
\ 'command': function('ale_linters#cpp#cppcheck#GetCommand'),
\ 'callback': 'ale#handlers#cppcheck#HandleCppCheckFormat',
\})
================================================
FILE: ale_linters/cpp/cpplint.vim
================================================
" Author: Dawid Kurek https://github.com/dawikur
" Description: cpplint for cpp files
call ale#Set('cpp_cpplint_executable', 'cpplint')
call ale#Set('cpp_cpplint_options', '')
function! ale_linters#cpp#cpplint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'cpp_cpplint_options')
return '%e' . ale#Pad(l:options) . ' %s'
endfunction
call ale#linter#Define('cpp', {
\ 'name': 'cpplint',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'cpp_cpplint_executable')},
\ 'command': function('ale_linters#cpp#cpplint#GetCommand'),
\ 'callback': 'ale#handlers#cpplint#HandleCppLintFormat',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/cpp/cquery.vim
================================================
" Author: Ben Falconer
" Description: A language server for C++
call ale#Set('cpp_cquery_executable', 'cquery')
call ale#Set('cpp_cquery_cache_directory', expand('~/.cache/cquery'))
function! ale_linters#cpp#cquery#GetProjectRoot(buffer) abort
" Try to find cquery configuration files first.
let l:config = ale#path#FindNearestFile(a:buffer, '.cquery')
if !empty(l:config)
return fnamemodify(l:config, ':h')
endif
" Fall back on default project root detection.
return ale#c#FindProjectRoot(a:buffer)
endfunction
function! ale_linters#cpp#cquery#GetInitializationOptions(buffer) abort
return {'cacheDirectory': ale#Var(a:buffer, 'cpp_cquery_cache_directory')}
endfunction
call ale#linter#Define('cpp', {
\ 'name': 'cquery',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'cpp_cquery_executable')},
\ 'command': '%e',
\ 'project_root': function('ale_linters#cpp#cquery#GetProjectRoot'),
\ 'initialization_options': function('ale_linters#cpp#cquery#GetInitializationOptions'),
\})
================================================
FILE: ale_linters/cpp/cspell.vim
================================================
scriptencoding utf-8
" Author: David Houston
" Description: cspell support for C++ files.
call ale#handlers#cspell#DefineLinter('cpp')
================================================
FILE: ale_linters/cpp/flawfinder.vim
================================================
" Author: Christian Gibbons
" Description: flawfinder linter for c++ files
call ale#Set('cpp_flawfinder_executable', 'flawfinder')
call ale#Set('cpp_flawfinder_options', '')
call ale#Set('cpp_flawfinder_minlevel', 1)
call ale#Set('c_flawfinder_error_severity', 6)
function! ale_linters#cpp#flawfinder#GetCommand(buffer) abort
" Set the minimum vulnerability level for flawfinder to bother with
let l:minlevel = ' --minlevel=' . ale#Var(a:buffer, 'cpp_flawfinder_minlevel')
return '%e -CDQS'
\ . ale#Var(a:buffer, 'cpp_flawfinder_options')
\ . l:minlevel
\ . ' %t'
endfunction
call ale#linter#Define('cpp', {
\ 'name': 'flawfinder',
\ 'output_stream': 'stdout',
\ 'executable': {b -> ale#Var(b, 'cpp_flawfinder_executable')},
\ 'command': function('ale_linters#cpp#flawfinder#GetCommand'),
\ 'callback': 'ale#handlers#flawfinder#HandleFlawfinderFormat',
\})
================================================
FILE: ale_linters/crystal/ameba.vim
================================================
" Author: Harrison Bachrach - https://github.com/HarrisonB
" Description: Ameba, a linter for crystal files
call ale#Set('crystal_ameba_executable', 'bin/ameba')
function! ale_linters#crystal#ameba#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'crystal_ameba_executable')
return ale#Escape(l:executable)
\ . ' --format json '
\ . ale#Escape(expand('#' . a:buffer . ':p'))
endfunction
" Handle output from ameba
function! ale_linters#crystal#ameba#HandleAmebaOutput(buffer, lines) abort
if len(a:lines) == 0
return []
endif
let l:errors = ale#util#FuzzyJSONDecode(a:lines[0], {})
if !has_key(l:errors, 'summary')
\|| l:errors['summary']['issues_count'] == 0
\|| empty(l:errors['sources'])
return []
endif
let l:output = []
for l:error in l:errors['sources'][0]['issues']
let l:start_col = str2nr(l:error['location']['column'])
let l:end_col = str2nr(l:error['end_location']['column'])
if !l:end_col
let l:end_col = l:start_col + 1
endif
call add(l:output, {
\ 'lnum': str2nr(l:error['location']['line']),
\ 'col': l:start_col,
\ 'end_col': l:end_col,
\ 'code': l:error['rule_name'],
\ 'text': l:error['message'],
\ 'type': 'W',
\})
endfor
return l:output
endfunction
call ale#linter#Define('crystal', {
\ 'name': 'ameba',
\ 'executable': {b -> ale#Var(b, 'crystal_ameba_executable')},
\ 'command': function('ale_linters#crystal#ameba#GetCommand'),
\ 'callback': 'ale_linters#crystal#ameba#HandleAmebaOutput',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/crystal/crystal.vim
================================================
" Author: Jordan Andree , David Alexander
" Description: This file adds support for checking Crystal with crystal build
function! ale_linters#crystal#crystal#Handle(buffer, lines) abort
let l:output = []
for l:error in ale#util#FuzzyJSONDecode(a:lines, [])
if !has_key(l:error, 'file')
continue
endif
call add(l:output, {
\ 'lnum': l:error.line + 0,
\ 'col': l:error.column + 0,
\ 'text': l:error.message,
\})
endfor
return l:output
endfunction
function! ale_linters#crystal#crystal#GetCommand(buffer) abort
return 'crystal build -f json --no-codegen --no-color -o '
\ . ale#Escape(g:ale#util#nul_file)
\ . ' %s'
endfunction
call ale#linter#Define('crystal', {
\ 'name': 'crystal',
\ 'executable': 'crystal',
\ 'output_stream': 'both',
\ 'lint_file': 1,
\ 'command': function('ale_linters#crystal#crystal#GetCommand'),
\ 'callback': 'ale_linters#crystal#crystal#Handle',
\})
================================================
FILE: ale_linters/cs/csc.vim
================================================
call ale#Set('cs_csc_options', '')
call ale#Set('cs_csc_source', '')
call ale#Set('cs_csc_assembly_path', [])
call ale#Set('cs_csc_assemblies', [])
function! ale_linters#cs#csc#GetCwd(buffer) abort
let l:cwd = ale#Var(a:buffer, 'cs_csc_source')
return !empty(l:cwd) ? l:cwd : expand('#' . a:buffer . ':p:h')
endfunction
function! ale_linters#cs#csc#GetCommand(buffer) abort
" Pass assembly paths via the -lib: parameter.
let l:path_list = ale#Var(a:buffer, 'cs_csc_assembly_path')
let l:lib_option = !empty(l:path_list)
\ ? '/lib:' . join(map(copy(l:path_list), 'ale#Escape(v:val)'), ',')
\ : ''
" Pass paths to DLL files via the -r: parameter.
let l:assembly_list = ale#Var(a:buffer, 'cs_csc_assemblies')
let l:r_option = !empty(l:assembly_list)
\ ? '/r:' . join(map(copy(l:assembly_list), 'ale#Escape(v:val)'), ',')
\ : ''
" register temporary module target file with ale
" register temporary module target file with ALE.
let l:out = ale#command#CreateFile(a:buffer)
" The code is compiled as a module and the output is redirected to a
" temporary file.
return 'csc /unsafe'
\ . ale#Pad(ale#Var(a:buffer, 'cs_csc_options'))
\ . ale#Pad(l:lib_option)
\ . ale#Pad(l:r_option)
\ . ' /out:' . l:out
\ . ' /t:module'
\ . ' /recurse:' . ale#Escape('*.cs')
endfunction
function! ale_linters#cs#csc#Handle(buffer, lines) abort
" Look for lines like the following.
"
" Tests.cs(12,29): error CSXXXX: ; expected
"
" NOTE: pattern also captures file name as linter compiles all
" files within the source tree rooted at the specified source
" path and not just the file loaded in the buffer
let l:patterns = [
\ '^\v(.+\.cs)\((\d+),(\d+)\)\:\s+([^ ]+)\s+([cC][sS][^ ]+):\s(.+)$',
\ '^\v([^ ]+)\s+([Cc][sS][^ ]+):\s+(.+)$',
\]
let l:output = []
let l:dir = ale_linters#cs#csc#GetCwd(a:buffer)
for l:match in ale#util#GetMatches(a:lines, l:patterns)
if len(l:match) > 6 && strlen(l:match[5]) > 2 && l:match[5][:1] is? 'CS'
call add(l:output, {
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'type': l:match[4] is# 'error' ? 'E' : 'W',
\ 'code': l:match[5],
\ 'text': l:match[6] ,
\})
elseif strlen(l:match[2]) > 2 && l:match[2][:1] is? 'CS'
call add(l:output, {
\ 'filename':'',
\ 'lnum': -1,
\ 'col': -1,
\ 'type': l:match[1] is# 'error' ? 'E' : 'W',
\ 'code': l:match[2],
\ 'text': l:match[3],
\})
endif
endfor
return l:output
endfunction
call ale#linter#Define('cs',{
\ 'name': 'csc',
\ 'output_stream': 'stdout',
\ 'executable': 'csc',
\ 'cwd': function('ale_linters#cs#csc#GetCwd'),
\ 'command': function('ale_linters#cs#csc#GetCommand'),
\ 'callback': 'ale_linters#cs#csc#Handle',
\ 'lint_file': 1
\})
================================================
FILE: ale_linters/cs/cspell.vim
================================================
scriptencoding utf-8
" Author: David Houston
" Description: cspell support for C# files.
call ale#handlers#cspell#DefineLinter('cs')
================================================
FILE: ale_linters/cs/mcs.vim
================================================
let g:ale_cs_mcs_options = get(g:, 'ale_cs_mcs_options', '')
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)
\ . ' %t'
endfunction
function! ale_linters#cs#mcs#Handle(buffer, lines) abort
" Look for lines like the following.
"
" Tests.cs(12,29): error CSXXXX: ; expected
let l:pattern = '^\v(.+\.cs)\((\d+),(\d+)\)\: ([^ ]+) ([^ ]+): (.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'type': l:match[4] is# 'error' ? 'E' : 'W',
\ 'code': l:match[5],
\ 'text': l:match[6],
\})
endfor
return l:output
endfunction
call ale#linter#Define('cs',{
\ 'name': 'mcs',
\ 'output_stream': 'stderr',
\ 'executable': 'mcs',
\ 'command': function('ale_linters#cs#mcs#GetCommand'),
\ 'callback': 'ale_linters#cs#mcs#Handle',
\})
================================================
FILE: ale_linters/cs/mcsc.vim
================================================
call ale#Set('cs_mcsc_options', '')
call ale#Set('cs_mcsc_source', '')
call ale#Set('cs_mcsc_assembly_path', [])
call ale#Set('cs_mcsc_assemblies', [])
function! ale_linters#cs#mcsc#GetCwd(buffer) abort
let l:cwd = ale#Var(a:buffer, 'cs_mcsc_source')
return !empty(l:cwd) ? l:cwd : expand('#' . a:buffer . ':p:h')
endfunction
function! ale_linters#cs#mcsc#GetCommand(buffer) abort
" Pass assembly paths via the -lib: parameter.
let l:path_list = ale#Var(a:buffer, 'cs_mcsc_assembly_path')
let l:lib_option = !empty(l:path_list)
\ ? '-lib:' . join(map(copy(l:path_list), 'ale#Escape(v:val)'), ',')
\ : ''
" Pass paths to DLL files via the -r: parameter.
let l:assembly_list = ale#Var(a:buffer, 'cs_mcsc_assemblies')
let l:r_option = !empty(l:assembly_list)
\ ? '-r:' . join(map(copy(l:assembly_list), 'ale#Escape(v:val)'), ',')
\ : ''
" register temporary module target file with ale
" register temporary module target file with ALE.
let l:out = ale#command#CreateFile(a:buffer)
" The code is compiled as a module and the output is redirected to a
" temporary file.
return 'mcs -unsafe'
\ . ale#Pad(ale#Var(a:buffer, 'cs_mcsc_options'))
\ . ale#Pad(l:lib_option)
\ . ale#Pad(l:r_option)
\ . ' -out:' . l:out
\ . ' -t:module'
\ . ' -recurse:' . ale#Escape('*.cs')
endfunction
function! ale_linters#cs#mcsc#Handle(buffer, lines) abort
" Look for lines like the following.
"
" Tests.cs(12,29): error CSXXXX: ; expected
"
" NOTE: pattern also captures file name as linter compiles all
" files within the source tree rooted at the specified source
" path and not just the file loaded in the buffer
let l:patterns = [
\ '^\v(.+\.cs)\((\d+),(\d+)\)\:\s+([^ ]+)\s+([cC][sS][^ ]+):\s(.+)$',
\ '^\v([^ ]+)\s+([Cc][sS][^ ]+):\s+(.+)$',
\]
let l:output = []
let l:dir = ale_linters#cs#mcsc#GetCwd(a:buffer)
for l:match in ale#util#GetMatches(a:lines, l:patterns)
if len(l:match) > 6 && strlen(l:match[5]) > 2 && l:match[5][:1] is? 'CS'
call add(l:output, {
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'type': l:match[4] is# 'error' ? 'E' : 'W',
\ 'code': l:match[5],
\ 'text': l:match[6] ,
\})
elseif strlen(l:match[2]) > 2 && l:match[2][:1] is? 'CS'
call add(l:output, {
\ 'filename':'',
\ 'lnum': -1,
\ 'col': -1,
\ 'type': l:match[1] is# 'error' ? 'E' : 'W',
\ 'code': l:match[2],
\ 'text': l:match[3],
\})
endif
endfor
return l:output
endfunction
call ale#linter#Define('cs',{
\ 'name': 'mcsc',
\ 'output_stream': 'stderr',
\ 'executable': 'mcs',
\ 'cwd': function('ale_linters#cs#mcsc#GetCwd'),
\ 'command': function('ale_linters#cs#mcsc#GetCommand'),
\ 'callback': 'ale_linters#cs#mcsc#Handle',
\ 'lint_file': 1
\})
================================================
FILE: ale_linters/css/cspell.vim
================================================
scriptencoding utf-8
" Author: David Houston
" Description: cspell support for CSS files.
call ale#handlers#cspell#DefineLinter('css')
================================================
FILE: ale_linters/css/csslint.vim
================================================
" Author: w0rp
" Description: This file adds support for checking CSS code with csslint.
function! ale_linters#css#csslint#GetCommand(buffer) abort
let l:csslintrc = ale#path#FindNearestFile(a:buffer, '.csslintrc')
let l:config_option = !empty(l:csslintrc)
\ ? '--config=' . ale#Escape(l:csslintrc)
\ : ''
return 'csslint --format=compact ' . l:config_option . ' %t'
endfunction
call ale#linter#Define('css', {
\ 'name': 'csslint',
\ 'executable': 'csslint',
\ 'command': function('ale_linters#css#csslint#GetCommand'),
\ 'callback': 'ale#handlers#css#HandleCSSLintFormat',
\})
================================================
FILE: ale_linters/css/fecs.vim
================================================
" Author: harttle
" Description: fecs for CSS files
call ale#linter#Define('css', {
\ 'name': 'fecs',
\ 'executable': function('ale#handlers#fecs#GetExecutable'),
\ 'command': function('ale#handlers#fecs#GetCommand'),
\ 'callback': 'ale#handlers#fecs#Handle',
\})
================================================
FILE: ale_linters/css/stylelint.vim
================================================
" Author: diartyz
call ale#Set('css_stylelint_executable', 'stylelint')
call ale#Set('css_stylelint_options', '')
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'
endfunction
call ale#linter#Define('css', {
\ 'name': 'stylelint',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#path#FindExecutable(b, 'css_stylelint', [
\ 'node_modules/.bin/stylelint',
\ ])},
\ 'command': function('ale_linters#css#stylelint#GetCommand'),
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
\})
================================================
FILE: ale_linters/css/vscodecss.vim
================================================
" Author: Dalius Dobravolskas
" Description: VSCode css language server
function! ale_linters#css#vscodecss#GetProjectRoot(buffer) abort
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
endfunction
call ale#linter#Define('css', {
\ 'name': 'vscodecss',
\ 'lsp': 'stdio',
\ 'executable': 'vscode-css-language-server',
\ 'command': '%e --stdio',
\ 'project_root': function('ale_linters#css#vscodecss#GetProjectRoot'),
\})
================================================
FILE: ale_linters/cucumber/cucumber.vim
================================================
" Author: Eddie Lebow https://github.com/elebow
" Description: Cucumber, a BDD test tool
function! ale_linters#cucumber#cucumber#GetCommand(buffer) abort
let l:features_dir = ale#path#FindNearestDirectory(a:buffer, 'features')
if !empty(l:features_dir)
let l:features_arg = '-r ' . ale#Escape(l:features_dir)
else
let l:features_arg = ''
endif
return 'cucumber --dry-run --quiet --strict --format=json '
\ . l:features_arg . ' %t'
endfunction
function! ale_linters#cucumber#cucumber#Handle(buffer, lines) abort
try
let l:json = ale#util#FuzzyJSONDecode(a:lines, {})[0]
catch
return []
endtry
let l:output = []
for l:element in get(l:json, 'elements', [])
for l:step in l:element['steps']
if l:step['result']['status'] is# 'undefined'
call add(l:output, {
\ 'lnum': l:step['line'],
\ 'code': 'E',
\ 'text': 'Undefined step'
\})
endif
endfor
endfor
return l:output
endfunction
call ale#linter#Define('cucumber', {
\ 'name': 'cucumber',
\ 'executable': 'cucumber',
\ 'command': function('ale_linters#cucumber#cucumber#GetCommand'),
\ 'callback': 'ale_linters#cucumber#cucumber#Handle'
\})
================================================
FILE: ale_linters/cuda/clangd.vim
================================================
" Author: Tommy Chiang
" Description: Clangd language server for CUDA (modified from Andrey
" Melentyev's implementation for C++)
call ale#Set('cuda_clangd_executable', 'clangd')
call ale#Set('cuda_clangd_options', '')
call ale#Set('c_build_dir', '')
function! ale_linters#cuda#clangd#GetCommand(buffer) abort
let l:build_dir = ale#c#GetBuildDirectory(a:buffer)
return '%e'
\ . ale#Pad(ale#Var(a:buffer, 'cuda_clangd_options'))
\ . (!empty(l:build_dir) ? ' -compile-commands-dir=' . ale#Escape(l:build_dir) : '')
endfunction
call ale#linter#Define('cuda', {
\ 'name': 'clangd',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'cuda_clangd_executable')},
\ 'command': function('ale_linters#cuda#clangd#GetCommand'),
\ 'project_root': function('ale#c#FindProjectRoot'),
\})
================================================
FILE: ale_linters/cuda/nvcc.vim
================================================
" Author: blahgeek
" Description: NVCC linter for cuda files
call ale#Set('cuda_nvcc_executable', 'nvcc')
call ale#Set('cuda_nvcc_options', '-std=c++11')
function! ale_linters#cuda#nvcc#GetCommand(buffer) abort
return '%e -cuda'
\ . ale#Pad(ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer)))
\ . ale#Pad(ale#Var(a:buffer, 'cuda_nvcc_options'))
\ . ' %s -o ' . g:ale#util#nul_file
endfunction
function! ale_linters#cuda#nvcc#HandleNVCCFormat(buffer, lines) abort
" Look for lines like the following.
"
" test.cu(8): error: argument of type "void *" is incompatible with parameter of type "int *"
let l:pattern = '\v^([^:\(\)]+):?\(?(\d+)\)?:(\d+)?:?\s*\w*\s*(error|warning): (.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:item = {
\ 'lnum': str2nr(l:match[2]),
\ 'type': l:match[4] =~# 'error' ? 'E' : 'W',
\ 'text': l:match[5],
\ 'filename': fnamemodify(l:match[1], ':p'),
\}
if !empty(l:match[3])
let l:item.col = str2nr(l:match[3])
endif
call add(l:output, l:item)
endfor
return l:output
endfunction
call ale#linter#Define('cuda', {
\ 'name': 'nvcc',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'cuda_nvcc_executable')},
\ 'command': function('ale_linters#cuda#nvcc#GetCommand'),
\ 'callback': 'ale_linters#cuda#nvcc#HandleNVCCFormat',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/cypher/cypher_lint.vim
================================================
" Author: Francisco Lopes
" Description: Linting for Neo4j's Cypher
function! ale_linters#cypher#cypher_lint#Handle(buffer, lines) abort
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+): (.*)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'text': l:match[4],
\ 'type': 'E',
\})
endfor
return l:output
endfunction
call ale#linter#Define('cypher', {
\ 'name': 'cypher_lint',
\ 'executable': 'cypher-lint',
\ 'command': 'cypher-lint',
\ 'output_stream': 'stderr',
\ 'callback': 'ale_linters#cypher#cypher_lint#Handle',
\})
================================================
FILE: ale_linters/d/dls.vim
================================================
" Author: aurieh
" Description: A Language Server implementation for D
call ale#Set('d_dls_executable', 'dls')
function! ale_linters#d#dls#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'd_dls_executable')
endfunction
function! ale_linters#d#dls#FindProjectRoot(buffer) abort
" Note: this will return . if dub config is empty
" dls can run outside DUB projects just fine
return fnamemodify(ale#d#FindDUBConfig(a:buffer), ':h')
endfunction
call ale#linter#Define('d', {
\ 'name': 'dls',
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#d#dls#GetExecutable'),
\ 'command': function('ale_linters#d#dls#GetExecutable'),
\ 'project_root': function('ale_linters#d#dls#FindProjectRoot'),
\})
================================================
FILE: ale_linters/d/dmd.vim
================================================
" Author: w0rp
" Description: "dmd for D files"
function! s:GetDUBCommand(buffer) abort
" If we can't run dub, then skip this command.
if executable('dub')
" Returning an empty string skips to the DMD command.
let l:config = ale#d#FindDUBConfig(a:buffer)
" To support older dub versions, we just change the directory to the
" directory where we found the dub config, and then run `dub describe`
" from that directory.
if !empty(l:config)
return [fnamemodify(l:config, ':h'), 'dub describe --data-list
\ --data=import-paths
\ --data=string-import-paths
\ --data=versions
\ --data=debug-versions
\']
endif
endif
return ['', '']
endfunction
function! ale_linters#d#dmd#RunDUBCommand(buffer) abort
let [l:cwd, l:command] = s:GetDUBCommand(a:buffer)
if empty(l:command)
" If we can't run DUB, just run DMD.
return ale_linters#d#dmd#DMDCommand(a:buffer, [], {})
endif
return ale#command#Run(
\ a:buffer,
\ l:command,
\ function('ale_linters#d#dmd#DMDCommand'),
\ {'cwd': l:cwd},
\)
endfunction
function! ale_linters#d#dmd#DMDCommand(buffer, dub_output, meta) abort
let l:import_list = []
let l:str_import_list = []
let l:versions_list = []
let l:deb_versions_list = []
let l:list_ind = 1
let l:seen_line = 0
" Build a list of options generated from DUB, if available.
" DUB output each path or version on a single line.
" Each list is separated by a blank line.
" Empty list are represented by a blank line (followed and/or
" preceded by a separation blank line)
for l:line in a:dub_output
" line still has end of line char on windows
let l:line = substitute(l:line, '[\r\n]*$', '', '')
if !empty(l:line)
if l:list_ind == 1
call add(l:import_list, '-I' . ale#Escape(l:line))
elseif l:list_ind == 2
call add(l:str_import_list, '-J' . ale#Escape(l:line))
elseif l:list_ind == 3
call add(l:versions_list, '-version=' . ale#Escape(l:line))
elseif l:list_ind == 4
call add(l:deb_versions_list, '-debug=' . ale#Escape(l:line))
endif
let l:seen_line = 1
elseif !l:seen_line
" if list is empty must skip one empty line
let l:seen_line = 1
else
let l:seen_line = 0
let l:list_ind += 1
endif
endfor
return 'dmd ' . join(l:import_list) . ' ' .
\ join(l:str_import_list) . ' ' .
\ join(l:versions_list) . ' ' .
\ join(l:deb_versions_list) . ' -o- -wi -vcolumns -c %t'
endfunction
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
let l:pattern = '\v^(\f+)\((\d+)(,(\d+))?\): (\w+): (.+)$'
let l:output = []
let l:dir = expand('#' . a:buffer . ':p:h')
for l:match in ale#util#GetMatches(a:lines, l:pattern)
" If dmd was invoked with relative path, match[1] is relative, otherwise it is absolute.
" As we invoke dmd with the buffer path (in /tmp), this will generally be absolute already
let l:fname = ale#path#GetAbsPath(l:dir, l:match[1])
call add(l:output, {
\ 'filename': l:fname,
\ 'lnum': l:match[2],
\ 'col': l:match[4],
\ 'type': l:match[5] is# 'Warning' || l:match[5] is# 'Deprecation' ? 'W' : 'E',
\ 'text': l:match[6],
\})
endfor
return l:output
endfunction
call ale#linter#Define('d', {
\ 'name': 'dmd',
\ 'executable': 'dmd',
\ 'command': function('ale_linters#d#dmd#RunDUBCommand'),
\ 'callback': 'ale_linters#d#dmd#Handle',
\ 'output_stream': 'stderr',
\})
================================================
FILE: ale_linters/dafny/dafny.vim
================================================
" Author: Taylor Blau
call ale#Set('dafny_dafny_timelimit', 10)
function! ale_linters#dafny#dafny#Handle(buffer, lines) abort
let l:pattern = '\v(.*)\((\d+),(\d+)\): (.*): (.*)'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'filename': l:match[1],
\ 'col': l:match[3] + 0,
\ 'lnum': l:match[2] + 0,
\ 'text': l:match[5],
\ 'type': l:match[4] =~# '^Error' ? 'E' : 'W'
\ })
endfor
for l:match in ale#util#GetMatches(a:lines, '\v(.*)\((\d+),(\d+)\): (Verification of .{-} timed out after \d+ seconds)')
call add(l:output, {
\ 'filename': l:match[1],
\ 'col': l:match[3] + 0,
\ 'lnum': l:match[2] + 0,
\ 'text': l:match[4],
\ 'type': 'E',
\ })
endfor
return l:output
endfunction
function! ale_linters#dafny#dafny#GetCommand(buffer) abort
return printf('dafny %%s /compile:0 /timeLimit:%d', ale#Var(a:buffer, 'dafny_dafny_timelimit'))
endfunction
call ale#linter#Define('dafny', {
\ 'name': 'dafny',
\ 'executable': 'dafny',
\ 'command': function('ale_linters#dafny#dafny#GetCommand'),
\ 'callback': 'ale_linters#dafny#dafny#Handle',
\ 'lint_file': 1,
\ })
================================================
FILE: ale_linters/dart/analysis_server.vim
================================================
" Author: Nelson Yeung
" Description: Check Dart files with dart analysis server LSP
call ale#Set('dart_analysis_server_enable_language_server', 1)
call ale#Set('dart_analysis_server_executable', 'dart')
function! ale_linters#dart#analysis_server#GetProjectRoot(buffer) abort
" Note: pub only looks for pubspec.yaml, there's no point in adding
" support for pubspec.yml
let l:pubspec = ale#path#FindNearestFile(a:buffer, 'pubspec.yaml')
return !empty(l:pubspec) ? fnamemodify(l:pubspec, ':h:h') : '.'
endfunction
function! ale_linters#dart#analysis_server#GetCommand(buffer) abort
let l:language_server = ale#Var(a:buffer, 'dart_analysis_server_enable_language_server')
let l:executable = ale#Var(a:buffer, 'dart_analysis_server_executable')
let l:dart = resolve(exepath(l:executable))
let l:output = '%e '
\ . fnamemodify(l:dart, ':h') . '/snapshots/analysis_server.dart.snapshot'
\ . ' --lsp'
" Enable new language-server command
if l:language_server == 1
let l:output = '%e language-server --protocol=lsp'
endif
return l:output
endfunction
call ale#linter#Define('dart', {
\ 'name': 'analysis_server',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'dart_analysis_server_executable')},
\ 'command': function('ale_linters#dart#analysis_server#GetCommand'),
\ 'project_root': function('ale_linters#dart#analysis_server#GetProjectRoot'),
\})
================================================
FILE: ale_linters/dart/dart_analyze.vim
================================================
" Author: ghsang
" Description: Check Dart files with dart analyze
call ale#Set('dart_analyze_executable', 'dart')
function! ale_linters#dart#dart_analyze#Handle(buffer, lines) abort
let l:pattern = '\v([a-z]+) - (.+):(\d+):(\d+) - (.+) - (.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let [l:type, l:filename, l:lnum, l:col, l:message, l:code] = l:match[1:6]
call add(l:output, {
\ 'type': l:type is# 'error' ? 'E' : l:type is# 'info' ? 'I' : 'W',
\ 'text': l:code . ': ' . l:message,
\ 'lnum': str2nr(l:lnum),
\ 'col': str2nr(l:col),
\})
endfor
return l:output
endfunction
call ale#linter#Define('dart', {
\ 'name': 'dart_analyze',
\ 'executable': {b -> ale#Var(b, 'dart_analyze_executable')},
\ 'command': '%e analyze --fatal-infos %s',
\ 'callback': 'ale_linters#dart#dart_analyze#Handle',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/dart/language_server.vim
================================================
" Author: aurieh
" Description: A language server for dart
call ale#Set('dart_language_server_executable', 'dart_language_server')
function! ale_linters#dart#language_server#GetProjectRoot(buffer) abort
" Note: pub only looks for pubspec.yaml, there's no point in adding
" support for pubspec.yml
let l:pubspec = ale#path#FindNearestFile(a:buffer, 'pubspec.yaml')
return !empty(l:pubspec) ? fnamemodify(l:pubspec, ':h:h') : ''
endfunction
call ale#linter#Define('dart', {
\ 'name': 'language_server',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'dart_language_server_executable')},
\ 'command': '%e',
\ 'project_root': function('ale_linters#dart#language_server#GetProjectRoot'),
\})
================================================
FILE: ale_linters/desktop/desktop_file_validate.vim
================================================
call ale#Set('desktop_desktop_file_validate_options', '')
" Example matches for pattern:
"
" foo.desktop: warning: key "TerminalOptions" in group ...
" foo.desktop: error: action "new-private-window" is defined, ...
let s:pattern = '\v^(.+): ([a-z]+): (.+)$'
function! ale_linters#desktop#desktop_file_validate#Handle(buffer, lines) abort
" The error format doesn't specify lines, so we can just put all of the
" errors on line 1.
return ale#util#MapMatches(a:lines, s:pattern, {match -> {
\ 'lnum': 1,
\ 'col': 1,
\ 'type': match[2] is? 'error' ? 'E' : 'W',
\ 'text': match[3],
\}})
endfunction
call ale#linter#Define('desktop', {
\ 'name': 'desktop_file_validate',
\ 'aliases': ['desktop-file-validate'],
\ 'executable': 'desktop-file-validate',
\ 'command': {b ->
\ '%e'
\ . ale#Pad(ale#Var(b, 'desktop_desktop_file_validate_options'))
\ . ' %t'
\ },
\ 'callback': 'ale_linters#desktop#desktop_file_validate#Handle',
\ 'output_stream': 'both',
\})
================================================
FILE: ale_linters/dockerfile/dockerfile_lint.vim
================================================
" Author: Alexander Olofsson
call ale#Set('dockerfile_dockerfile_lint_executable', 'dockerfile_lint')
call ale#Set('dockerfile_dockerfile_lint_options', '')
function! ale_linters#dockerfile#dockerfile_lint#GetType(type) abort
if a:type is? 'error'
return 'E'
elseif a:type is? 'warn'
return 'W'
endif
return 'I'
endfunction
function! ale_linters#dockerfile#dockerfile_lint#Handle(buffer, lines) abort
try
let l:data = json_decode(join(a:lines, ''))
catch
return []
endtry
if empty(l:data)
" Should never happen, but it's better to be on the safe side
return []
endif
let l:messages = []
for l:type in ['error', 'warn', 'info']
for l:object in l:data[l:type]['data']
let l:line = get(l:object, 'line', -1)
let l:message = l:object['message']
let l:link = get(l:object, 'reference_url', '')
if type(l:link) == v:t_list
" Somehow, reference_url is returned as two-part list.
" Anchor markers in that list are sometimes duplicated.
" See https://github.com/projectatomic/dockerfile_lint/issues/134
let l:link = join(l:link, '')
let l:link = substitute(l:link, '##', '#', '')
endif
let l:detail = l:message
if get(l:object, 'description', 'None') isnot# 'None'
let l:detail .= "\n\n" . l:object['description']
endif
let l:detail .= "\n\n" . l:link
call add(l:messages, {
\ 'lnum': l:line,
\ 'text': l:message,
\ 'type': ale_linters#dockerfile#dockerfile_lint#GetType(l:type),
\ 'detail': l:detail,
\})
endfor
endfor
return l:messages
endfunction
function! ale_linters#dockerfile#dockerfile_lint#GetCommand(buffer) abort
return '%e' . ale#Pad(ale#Var(a:buffer, 'dockerfile_dockerfile_lint_options'))
\ . ' -p -j -f'
\ . ' %t'
endfunction
call ale#linter#Define('dockerfile', {
\ 'name': 'dockerfile_lint',
\ 'executable': {b -> ale#Var(b, 'dockerfile_dockerfile_lint_executable')},
\ 'command': function('ale_linters#dockerfile#dockerfile_lint#GetCommand'),
\ 'callback': 'ale_linters#dockerfile#dockerfile_lint#Handle',
\})
================================================
FILE: ale_linters/dockerfile/dockerlinter.vim
================================================
" Author: Shad
" Description: dockerlinter linter for dockerfile
call ale#Set('dockerfile_dockerlinter_executable', 'dockerlinter')
call ale#Set('dockerfile_dockerlinter_options', '')
function! ale_linters#dockerfile#dockerlinter#GetType(type) abort
if a:type is? 'error'
return 'E'
elseif a:type is? 'warning'
return 'W'
endif
return 'I'
endfunction
function! ale_linters#dockerfile#dockerlinter#Handle(buffer, lines) abort
try
let l:data = json_decode(join(a:lines, ''))
catch
return []
endtry
if empty(l:data)
" Should never happen, but it's better to be on the safe side
return []
endif
let l:messages = []
for l:object in l:data
let l:line = get(l:object, 'lineNumber', -1)
let l:message = l:object['message']
let l:type = l:object['level']
let l:detail = l:message
let l:code = l:object['code']
if l:code =~# '^SC'
let l:link = 'https://www.shellcheck.net/wiki/' . l:code
else
let l:link = 'https://github.com/buddy-works/dockerfile-linter/blob/master/Rules.md#' . l:code
endif
let l:detail = l:message . "\n\n" . l:link
call add(l:messages, {
\ 'lnum': l:line,
\ 'code': l:code,
\ 'text': l:message,
\ 'type': ale_linters#dockerfile#dockerlinter#GetType(l:type),
\ 'detail': l:detail,
\})
endfor
return l:messages
endfunction
function! ale_linters#dockerfile#dockerlinter#GetCommand(buffer) abort
return '%e' . ale#Pad(ale#Var(a:buffer, 'dockerfile_dockerlinter_options'))
\ . ' -j -f'
\ . ' %t'
endfunction
call ale#linter#Define('dockerfile', {
\ 'name': 'dockerlinter',
\ 'executable': {b -> ale#Var(b, 'dockerfile_dockerlinter_executable')},
\ 'command': function('ale_linters#dockerfile#dockerlinter#GetCommand'),
\ 'callback': 'ale_linters#dockerfile#dockerlinter#Handle',
\})
================================================
FILE: ale_linters/dockerfile/hadolint.vim
================================================
" Author: hauleth - https://github.com/hauleth
" always, yes, never
call ale#Set('dockerfile_hadolint_use_docker', 'never')
call ale#Set('dockerfile_hadolint_docker_image', 'hadolint/hadolint')
call ale#Set('dockerfile_hadolint_options', '')
function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
" Matches patterns line the following:
"
" -:19 DL3001 warning: Pipe chain should start with a raw value.
" /dev/stdin:19:3 unexpected thing
let l:pattern = '\v^%(/dev/stdin|-):(\d+):?(\d+)? ((DL|SC)(\d+) )?((.+)?: )?(.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:lnum = 0
let l:colnum = 0
if l:match[1] isnot# ''
let l:lnum = l:match[1] + 0
endif
if l:match[2] isnot# ''
let l:colnum = l:match[2] + 0
endif
" Shellcheck knows a 'style' severity - pin it to info level as well.
if l:match[7] is# 'style'
let l:type = 'I'
elseif l:match[7] is# 'info'
let l:type = 'I'
elseif l:match[7] is# 'warning'
let l:type = 'W'
else
let l:type = 'E'
endif
let l:text = l:match[8]
let l:detail = l:match[8]
let l:domain = 'https://github.com/hadolint/hadolint/wiki/'
let l:code = ''
let l:link = ''
if l:match[4] is# 'SC'
let l:domain = 'https://github.com/koalaman/shellcheck/wiki/'
endif
if l:match[5] isnot# ''
let l:code = l:match[4] . l:match[5]
let l:link = ' ( ' . l:domain . l:code . ' )'
let l:detail = l:code . l:link . "\n\n" . l:detail
else
let l:type = 'E'
let l:detail = 'hadolint could not parse the file because of a syntax error.'
endif
let l:line_output = {
\ 'lnum': l:lnum,
\ 'col': l:colnum,
\ 'type': l:type,
\ 'text': l:text,
\ 'detail': l:detail
\}
if l:code isnot# ''
let l:line_output['code'] = l:code
endif
call add(l:output, l:line_output)
endfor
return l:output
endfunction
" This is a little different than the typical 'executable' callback. We want
" to afford the user the chance to say always use docker, never use docker,
" and use docker if the hadolint executable is not present on the system.
"
" In the case of neither docker nor hadolint executables being present, it
" really doesn't matter which we return -- either will have the effect of
" 'nope, can't use this linter!'.
function! ale_linters#dockerfile#hadolint#GetExecutable(buffer) abort
let l:use_docker = ale#Var(a:buffer, 'dockerfile_hadolint_use_docker')
" check for mandatory directives
if l:use_docker is# 'never'
return 'hadolint'
elseif l:use_docker is# 'always'
return 'docker'
endif
" if we reach here, we want to use 'hadolint' if present...
if executable('hadolint')
return 'hadolint'
endif
"... and 'docker' as a fallback.
return 'docker'
endfunction
function! ale_linters#dockerfile#hadolint#GetCommand(buffer) abort
let l:command = ale_linters#dockerfile#hadolint#GetExecutable(a:buffer)
let l:opts = ale#Var(a:buffer, 'dockerfile_hadolint_options') . ' --no-color -'
if l:command is# 'docker'
return printf('docker run --rm -i %s hadolint %s',
\ ale#Var(a:buffer, 'dockerfile_hadolint_docker_image'),
\ l:opts)
endif
return 'hadolint ' . l:opts
endfunction
call ale#linter#Define('dockerfile', {
\ 'name': 'hadolint',
\ 'executable': function('ale_linters#dockerfile#hadolint#GetExecutable'),
\ 'command': function('ale_linters#dockerfile#hadolint#GetCommand'),
\ 'callback': 'ale_linters#dockerfile#hadolint#Handle',
\})
================================================
FILE: ale_linters/elixir/credo.vim
================================================
" Author: hauleth - https://github.com/hauleth
function! ale_linters#elixir#credo#Handle(buffer, lines) abort
" Matches patterns line the following:
"
" lib/filename.ex:19:7: F: Pipe chain should start with a raw value.
let l:pattern = '\v:(\d+):?(\d+)?: (.): (.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:type = l:match[3]
let l:text = l:match[4]
" Refactoring opportunities
if l:type is# 'F'
let l:type = 'W'
" Consistency
elseif l:type is# 'C'
let l:type = 'W'
" Software Design
elseif l:type is# 'D'
let l:type = 'I'
" Code Readability
elseif l:type is# 'R'
let l:type = 'I'
endif
call add(l:output, {
\ 'bufnr': a:buffer,
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'type': l:type,
\ 'text': l:text,
\})
endfor
return l:output
endfunction
function! ale_linters#elixir#credo#GetMode() abort
if get(g:, 'ale_elixir_credo_strict', 0)
return '--strict'
else
return 'suggest'
endif
endfunction
function! ale_linters#elixir#credo#GetConfigFile() abort
let l:config_file = get(g:, 'ale_elixir_credo_config_file', '')
if empty(l:config_file)
return ''
endif
return ' --config-file ' . l:config_file
endfunction
function! ale_linters#elixir#credo#GetCommand(buffer) abort
return 'mix help credo && '
\ . 'mix credo ' . ale_linters#elixir#credo#GetMode()
\ . ale_linters#elixir#credo#GetConfigFile()
\ . ' --format=flycheck --read-from-stdin %s'
endfunction
call ale#linter#Define('elixir', {
\ 'name': 'credo',
\ 'executable': 'mix',
\ 'cwd': function('ale#handlers#elixir#FindMixUmbrellaRoot'),
\ 'command': function('ale_linters#elixir#credo#GetCommand'),
\ 'callback': 'ale_linters#elixir#credo#Handle',
\})
================================================
FILE: ale_linters/elixir/cspell.vim
================================================
scriptencoding utf-8
" Author: David Houston
" Description: cspell support for Elixir files.
call ale#handlers#cspell#DefineLinter('elixir')
================================================
FILE: ale_linters/elixir/dialyxir.vim
================================================
" Author: Fran C. - https://github.com/franciscoj
" Description: Add dialyzer support for elixir through dialyxir
" https://github.com/jeremyjh/dialyxir
function! ale_linters#elixir#dialyxir#Handle(buffer, lines) abort
" Matches patterns line the following:
"
" lib/filename.ex:19: Function fname/1 has no local return
let l:pattern = '\v(.+):(\d+): (.+)$'
let l:output = []
let l:type = 'W'
for l:match in ale#util#GetMatches(a:lines, l:pattern)
if bufname(a:buffer) == l:match[1]
call add(l:output, {
\ 'bufnr': a:buffer,
\ 'lnum': l:match[2] + 0,
\ 'col': 0,
\ 'type': l:type,
\ 'text': l:match[3],
\})
endif
endfor
return l:output
endfunction
call ale#linter#Define('elixir', {
\ 'name': 'dialyxir',
\ 'executable': 'mix',
\ 'cwd': function('ale#handlers#elixir#FindMixProjectRoot'),
\ 'command': 'mix help dialyzer && mix dialyzer',
\ 'callback': 'ale_linters#elixir#dialyxir#Handle',
\})
================================================
FILE: ale_linters/elixir/dogma.vim
================================================
" Author: archseer - https://github.com/archSeer
function! ale_linters#elixir#dogma#Handle(buffer, lines) abort
" Matches patterns line the following:
"
" lib/filename.ex:19:7: F: Pipe chain should start with a raw value.
let l:pattern = '\v:(\d+):?(\d+)?: (.): (.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:type = l:match[3]
let l:text = l:match[4]
if l:type is# 'C'
let l:type = 'E'
elseif l:type is# 'R'
let l:type = 'W'
endif
call add(l:output, {
\ 'bufnr': a:buffer,
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'type': l:type,
\ 'text': l:text,
\})
endfor
return l:output
endfunction
call ale#linter#Define('elixir', {
\ 'name': 'dogma',
\ 'executable': 'mix',
\ 'cwd': function('ale#handlers#elixir#FindMixProjectRoot'),
\ 'command': 'mix help dogma && mix dogma %s --format=flycheck',
\ 'lint_file': 1,
\ 'callback': 'ale_linters#elixir#dogma#Handle',
\})
================================================
FILE: ale_linters/elixir/elixir_ls.vim
================================================
" Author: Jon Parise
" Description: ElixirLS integration (https://github.com/elixir-lsp/elixir-ls)
call ale#Set('elixir_elixir_ls_release', 'elixir-ls')
call ale#Set('elixir_elixir_ls_config', {})
function! ale_linters#elixir#elixir_ls#GetExecutable(buffer) abort
let l:dir = ale#path#Simplify(ale#Var(a:buffer, 'elixir_elixir_ls_release'))
let l:cmd = has('win32') ? '\language_server.bat' : '/language_server.sh'
return l:dir . l:cmd
endfunction
call ale#linter#Define('elixir', {
\ 'name': 'elixir_ls',
\ 'aliases': ['elixir-ls', 'elixirls'],
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#elixir#elixir_ls#GetExecutable'),
\ 'command': function('ale_linters#elixir#elixir_ls#GetExecutable'),
\ 'project_root': function('ale#handlers#elixir#FindMixUmbrellaRoot'),
\ 'lsp_config': {b -> ale#Var(b, 'elixir_elixir_ls_config')},
\})
================================================
FILE: ale_linters/elixir/expert.vim
================================================
" Author: Paul Monson
" 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',
\ 'project_root': function('ale#handlers#elixir#FindMixUmbrellaRoot'),
\})
================================================
FILE: ale_linters/elixir/lexical.vim
================================================
" Author: Axel Clark
" Description: Lexical integration (https://github.com/lexical-lsp/lexical)
call ale#Set('elixir_lexical_release', 'lexical')
function! ale_linters#elixir#lexical#GetExecutable(buffer) abort
let l:dir = ale#path#Simplify(ale#Var(a:buffer, 'elixir_lexical_release'))
let l:cmd = has('win32') ? '\start_lexical.bat' : '/start_lexical.sh'
return l:dir . l:cmd
endfunction
call ale#linter#Define('elixir', {
\ 'name': 'lexical',
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#elixir#lexical#GetExecutable'),
\ 'command': function('ale_linters#elixir#lexical#GetExecutable'),
\ 'project_root': function('ale#handlers#elixir#FindMixUmbrellaRoot'),
\})
================================================
FILE: ale_linters/elixir/mix.vim
================================================
" Author: evnu - https://github.com/evnu
" Author: colbydehart - https://github.com/colbydehart
" Description: Mix compile checking for Elixir files
function! ale_linters#elixir#mix#Handle(buffer, lines) abort
" Matches patterns like the following:
"
" Error format
" ** (CompileError) apps/sim/lib/sim/server.ex:87: undefined function update_in/4
"
" TODO: Warning format
" warning: variable "foobar" does not exist and is being expanded to "foobar()", please use parentheses to remove the ambiguity or change the variable name
let l:pattern = '\v\(([^\)]+Error)\) ([^:]+):([^:]+): (.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:type = 'E'
let l:text = l:match[4]
call add(l:output, {
\ 'bufnr': a:buffer,
\ 'lnum': l:match[3] + 0,
\ 'col': 0,
\ 'type': l:type,
\ 'text': l:text,
\})
endfor
return l:output
endfunction
function! ale_linters#elixir#mix#GetCommand(buffer) abort
let l:temp_dir = ale#command#CreateDirectory(a:buffer)
return ale#Env('MIX_BUILD_PATH', l:temp_dir) . 'mix compile %s'
endfunction
call ale#linter#Define('elixir', {
\ 'name': 'mix',
\ 'executable': 'mix',
\ 'cwd': function('ale#handlers#elixir#FindMixProjectRoot'),
\ 'command': function('ale_linters#elixir#mix#GetCommand'),
\ 'callback': 'ale_linters#elixir#mix#Handle',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/elm/ls.vim
================================================
" Author: antew - https://github.com/antew
" Description: elm-language-server integration for elm (diagnostics, formatting, and more)
call ale#Set('elm_ls_executable', 'elm-language-server')
call ale#Set('elm_ls_use_global', get(g:, 'ale_use_global_executables', 1))
" elm-language-server will search for local and global binaries, if empty
call ale#Set('elm_ls_elm_path', '')
call ale#Set('elm_ls_elm_format_path', '')
call ale#Set('elm_ls_elm_test_path', '')
call ale#Set('elm_ls_elm_analyse_trigger', 'change')
function! ale_linters#elm#ls#GetProjectRoot(buffer) abort
let l:elm_json = ale#path#FindNearestFile(a:buffer, 'elm.json')
return !empty(l:elm_json) ? fnamemodify(l:elm_json, ':p:h') : ''
endfunction
function! ale_linters#elm#ls#GetInitializationOptions(buffer) abort
return {
\ 'elmPath': ale#Var(a:buffer, 'elm_ls_elm_path'),
\ 'elmFormatPath': ale#Var(a:buffer, 'elm_ls_elm_format_path'),
\ 'elmTestPath': ale#Var(a:buffer, 'elm_ls_elm_test_path'),
\ 'elmAnalyseTrigger': ale#Var(a:buffer, 'elm_ls_elm_analyse_trigger'),
\}
endfunction
call ale#linter#Define('elm', {
\ 'name': 'ls',
\ 'aliases': ['elm_ls'],
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#path#FindExecutable(b, 'elm_ls', [
\ 'node_modules/.bin/elm-language-server',
\ 'node_modules/.bin/elm-lsp',
\ 'elm-lsp'
\ ])},
\ 'command': '%e --stdio',
\ 'project_root': function('ale_linters#elm#ls#GetProjectRoot'),
\ 'language': 'elm',
\ 'initialization_options': function('ale_linters#elm#ls#GetInitializationOptions')
\})
================================================
FILE: ale_linters/elm/make.vim
================================================
" Author: buffalocoder - https://github.com/buffalocoder, soywod - https://github.com/soywod, hecrj - https://github.com/hecrj
" Description: Elm linting in Ale. Closely follows the Syntastic checker in https://github.com/ElmCast/elm-vim.
call ale#Set('elm_make_executable', 'elm')
call ale#Set('elm_make_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#elm#make#Handle(buffer, lines) abort
let l:output = []
let l:unparsed_lines = []
for l:line in a:lines
if l:line[0] is# '{'
" Elm 0.19
call ale_linters#elm#make#HandleElm019Line(l:line, l:output)
elseif l:line[0] is# '['
" Elm 0.18
call ale_linters#elm#make#HandleElm018Line(l:line, l:output)
elseif l:line isnot# 'Successfully generated /dev/null'
call add(l:unparsed_lines, l:line)
endif
endfor
if len(l:unparsed_lines) > 0
call add(l:output, {
\ 'lnum': 1,
\ 'type': 'E',
\ 'text': l:unparsed_lines[0],
\ 'detail': join(l:unparsed_lines, "\n")
\})
endif
return l:output
endfunction
function! ale_linters#elm#make#HandleElm019Line(line, output) abort
let l:report = json_decode(a:line)
if l:report.type is? 'error'
" General problem
let l:details = ale_linters#elm#make#ParseMessage(l:report.message)
if empty(l:report.path)
let l:report.path = 'Elm'
endif
if ale_linters#elm#make#FileIsBuffer(l:report.path)
call add(a:output, {
\ 'lnum': 1,
\ 'type': 'E',
\ 'text': l:details,
\})
else
call add(a:output, {
\ 'lnum': 1,
\ 'type': 'E',
\ 'text': l:report.path .' - '. l:details,
\ 'detail': l:report.path ." ----------\n\n". l:details,
\})
endif
else
" Compilation errors
for l:error in l:report.errors
let l:file_is_buffer = ale_linters#elm#make#FileIsBuffer(l:error.path)
for l:problem in l:error.problems
let l:details = ale_linters#elm#make#ParseMessage(l:problem.message)
if l:file_is_buffer
" Buffer module has problems
call add(a:output, {
\ 'lnum': l:problem.region.start.line,
\ 'col': l:problem.region.start.column,
\ 'end_lnum': l:problem.region.end.line,
\ 'end_col': l:problem.region.end.column,
\ 'type': 'E',
\ 'text': l:details,
\})
else
" Imported module has problems
let l:location = l:error.path .':'. l:problem.region.start.line
call add(a:output, {
\ 'lnum': 1,
\ 'type': 'E',
\ 'text': l:location .' - '. l:details,
\ 'detail': l:location ." ----------\n\n". l:details,
\})
endif
endfor
endfor
endif
endfunction
function! ale_linters#elm#make#HandleElm018Line(line, output) abort
let l:errors = json_decode(a:line)
for l:error in l:errors
let l:file_is_buffer = ale_linters#elm#make#FileIsBuffer(l:error.file)
if l:file_is_buffer
" Current buffer has problems
call add(a:output, {
\ 'lnum': l:error.region.start.line,
\ 'col': l:error.region.start.column,
\ 'end_lnum': l:error.region.end.line,
\ 'end_col': l:error.region.end.column,
\ 'type': (l:error.type is? 'error') ? 'E' : 'W',
\ 'text': l:error.overview,
\ 'detail': l:error.overview . "\n\n" . l:error.details
\})
elseif l:error.type is? 'error'
" Imported module has errors
let l:location = l:error.file .':'. l:error.region.start.line
call add(a:output, {
\ 'lnum': 1,
\ 'type': 'E',
\ 'text': l:location .' - '. l:error.overview,
\ 'detail': l:location ." ----------\n\n". l:error.overview . "\n\n" . l:error.details
\})
endif
endfor
endfunction
function! ale_linters#elm#make#FileIsBuffer(path) abort
return ale#path#IsTempName(a:path)
endfunction
function! ale_linters#elm#make#ParseMessage(message) abort
return join(map(copy(a:message), 'ale_linters#elm#make#ParseMessageItem(v:val)'), '')
endfunction
function! ale_linters#elm#make#ParseMessageItem(item) abort
if type(a:item) is v:t_string
return a:item
else
return a:item.string
endif
endfunction
function! ale_linters#elm#make#GetPackageFile(buffer) abort
let l:elm_json = ale#path#FindNearestFile(a:buffer, 'elm.json')
if empty(l:elm_json)
" Fallback to Elm 0.18
let l:elm_json = ale#path#FindNearestFile(a:buffer, 'elm-package.json')
endif
return l:elm_json
endfunction
function! ale_linters#elm#make#IsVersionGte19(buffer) abort
let l:elm_json = ale_linters#elm#make#GetPackageFile(a:buffer)
if l:elm_json =~# '-package'
return 0
else
return 1
endif
endfunction
function! ale_linters#elm#make#GetRootDir(buffer) abort
let l:elm_json = ale_linters#elm#make#GetPackageFile(a:buffer)
if empty(l:elm_json)
return ''
else
return fnamemodify(l:elm_json, ':p:h')
endif
endfunction
function! ale_linters#elm#make#IsTest(buffer) abort
let l:root_dir = ale_linters#elm#make#GetRootDir(a:buffer)
if empty(l:root_dir)
return 0
endif
let l:tests_dir = join([l:root_dir, 'tests', ''], has('win32') ? '\' : '/')
let l:buffer_path = fnamemodify(bufname(a:buffer), ':p')
if stridx(l:buffer_path, l:tests_dir) == 0
return 1
else
return 0
endif
endfunction
function! ale_linters#elm#make#GetCwd(buffer) abort
let l:root_dir = ale_linters#elm#make#GetRootDir(a:buffer)
return !empty(l:root_dir) ? l:root_dir : ''
endfunction
" Return the command to execute the linter in the projects directory.
" If it doesn't, then this will fail when imports are needed.
function! ale_linters#elm#make#GetCommand(buffer) abort
let l:executable = ale_linters#elm#make#GetExecutable(a:buffer)
let l:is_v19 = ale_linters#elm#make#IsVersionGte19(a:buffer)
let l:is_using_elm_test = l:executable =~# 'elm-test$'
" elm-test needs to know the path of elm-make if elm isn't installed globally.
" https://github.com/rtfeldman/node-test-runner/blob/57728f10668f2d2ab3179e7e3208bcfa9a1f19aa/README.md#--compiler
if l:is_v19 && l:is_using_elm_test
let l:elm_make_executable = ale#path#FindExecutable(a:buffer, 'elm_make', ['node_modules/.bin/elm'])
let l:elm_test_compiler_flag = ' --compiler ' . l:elm_make_executable . ' '
else
let l:elm_test_compiler_flag = ' '
endif
" The elm compiler, at the time of this writing, uses '/dev/null' as
" a sort of flag to tell the compiler not to generate an output file,
" which is why this is hard coded here.
" Source: https://github.com/elm-lang/elm-compiler/blob/19d5a769b30ec0b2fc4475985abb4cd94cd1d6c3/builder/src/Generate/Output.hs#L253
return '%e make --report=json --output=/dev/null'
\ . l:elm_test_compiler_flag
\ . '%t'
endfunction
function! ale_linters#elm#make#GetExecutable(buffer) abort
let l:is_test = ale_linters#elm#make#IsTest(a:buffer)
let l:is_v19 = ale_linters#elm#make#IsVersionGte19(a:buffer)
if l:is_test && l:is_v19
return ale#path#FindExecutable(
\ a:buffer,
\ 'elm_make',
\ ['node_modules/.bin/elm-test', 'node_modules/.bin/elm']
\)
else
return ale#path#FindExecutable(a:buffer, 'elm_make', ['node_modules/.bin/elm'])
endif
endfunction
call ale#linter#Define('elm', {
\ 'name': 'make',
\ 'executable': function('ale_linters#elm#make#GetExecutable'),
\ 'output_stream': 'both',
\ 'cwd': function('ale_linters#elm#make#GetCwd'),
\ 'command': function('ale_linters#elm#make#GetCommand'),
\ 'callback': 'ale_linters#elm#make#Handle'
\})
================================================
FILE: ale_linters/erlang/dialyzer.vim
================================================
" Author: Autoine Gagne - https://github.com/AntoineGagne
" Description: Define a checker that runs dialyzer on Erlang files.
let g:ale_erlang_dialyzer_executable =
\ get(g:, 'ale_erlang_dialyzer_executable', 'dialyzer')
let g:ale_erlang_dialyzer_options =
\ get(g:, 'ale_erlang_dialyzer_options', '-Wunmatched_returns'
\ . ' -Werror_handling'
\ . ' -Wrace_conditions'
\ . ' -Wunderspecs')
let g:ale_erlang_dialyzer_plt_file =
\ get(g:, 'ale_erlang_dialyzer_plt_file', '')
let g:ale_erlang_dialyzer_rebar3_profile =
\ get(g:, 'ale_erlang_dialyzer_rebar3_profile', 'default')
function! ale_linters#erlang#dialyzer#GetRebar3Profile(buffer) abort
return ale#Var(a:buffer, 'erlang_dialyzer_rebar3_profile')
endfunction
function! ale_linters#erlang#dialyzer#FindPlt(buffer) abort
let l:plt_file = ''
let l:rebar3_profile = ale_linters#erlang#dialyzer#GetRebar3Profile(a:buffer)
let l:plt_file_directory = ale#path#FindNearestDirectory(a:buffer, '_build/' . l:rebar3_profile)
if !empty(l:plt_file_directory)
let l:plt_file = globpath(l:plt_file_directory, '*_plt', 0, 1)
endif
if !empty(l:plt_file)
return l:plt_file[0]
endif
if !empty($REBAR_PLT_DIR)
return expand('$REBAR_PLT_DIR/dialyzer/plt')
endif
return expand('$HOME/.dialyzer_plt')
endfunction
function! ale_linters#erlang#dialyzer#GetPlt(buffer) abort
let l:plt_file = ale#Var(a:buffer, 'erlang_dialyzer_plt_file')
if !empty(l:plt_file)
return l:plt_file
endif
return ale_linters#erlang#dialyzer#FindPlt(a:buffer)
endfunction
function! ale_linters#erlang#dialyzer#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'erlang_dialyzer_executable')
endfunction
function! ale_linters#erlang#dialyzer#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'erlang_dialyzer_options')
let l:command = ale#Escape(ale_linters#erlang#dialyzer#GetExecutable(a:buffer))
\ . ' -n'
\ . ' --plt ' . ale#Escape(ale_linters#erlang#dialyzer#GetPlt(a:buffer))
\ . ' ' . l:options
\ . ' %s'
return l:command
endfunction
function! ale_linters#erlang#dialyzer#Handle(buffer, lines) abort
" Match patterns like the following:
"
" erl_tidy_prv_fmt.erl:3: Callback info about the provider behaviour is not available
let l:pattern = '^\S\+:\(\d\+\): \(.\+\)$'
let l:output = []
for l:line in a:lines
let l:match = matchlist(l:line, l:pattern)
if len(l:match) != 0
let l:code = l:match[2]
call add(l:output, {
\ 'lnum': str2nr(l:match[1]),
\ 'lcol': 0,
\ 'text': l:code,
\ 'type': 'W'
\})
endif
endfor
return l:output
endfunction
call ale#linter#Define('erlang', {
\ 'name': 'dialyzer',
\ 'executable': function('ale_linters#erlang#dialyzer#GetExecutable'),
\ 'command': function('ale_linters#erlang#dialyzer#GetCommand'),
\ 'callback': function('ale_linters#erlang#dialyzer#Handle'),
\ 'lint_file': 1
\})
================================================
FILE: ale_linters/erlang/elvis.vim
================================================
" Author: Dmitri Vereshchagin
" Description: Elvis linter for Erlang files
call ale#Set('erlang_elvis_executable', 'elvis')
function! ale_linters#erlang#elvis#Handle(buffer, lines) abort
let l:pattern = '\v:(\d+):[^:]+:(.+)'
let l:loclist = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:loclist, {
\ 'lnum': str2nr(l:match[1]),
\ 'text': s:AbbreviateMessage(l:match[2]),
\ 'type': 'W',
\ 'sub_type': 'style',
\})
endfor
return l:loclist
endfunction
function! s:AbbreviateMessage(text) abort
let l:pattern = '\v\c^(line \d+ is too long):.*$'
return substitute(a:text, l:pattern, '\1.', '')
endfunction
function! s:GetCommand(buffer) abort
let l:cwd = s:GetCwd(a:buffer)
let l:file = !empty(l:cwd)
\ ? expand('#' . a:buffer . ':p')[len(l:cwd) + 1:]
\ : expand('#' . a:buffer . ':.')
return '%e rock --output-format=parsable ' . ale#Escape(l:file)
endfunction
function! s:GetCwd(buffer) abort
let l:markers = ['elvis.config', 'rebar.lock', 'erlang.mk']
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
for l:marker in l:markers
if filereadable(l:path . '/' . l:marker)
return l:path
endif
endfor
endfor
return ''
endfunction
call ale#linter#Define('erlang', {
\ 'name': 'elvis',
\ 'callback': 'ale_linters#erlang#elvis#Handle',
\ 'executable': {b -> ale#Var(b, 'erlang_elvis_executable')},
\ 'command': function('s:GetCommand'),
\ 'cwd': function('s:GetCwd'),
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/erlang/erlang_ls.vim
================================================
" Author: Dmitri Vereshchagin
" Description: LSP linter for Erlang files
call ale#Set('erlang_erlang_ls_executable', 'erlang_ls')
call ale#Set('erlang_erlang_ls_log_dir', '')
call ale#Set('erlang_erlang_ls_log_level', 'info')
function! s:GetCommand(buffer) abort
let l:log_dir = ale#Var(a:buffer, 'erlang_erlang_ls_log_dir')
let l:log_level = ale#Var(a:buffer, 'erlang_erlang_ls_log_level')
let l:command = '%e'
if !empty(l:log_dir)
let l:command .= ' --log-dir=' . ale#Escape(l:log_dir)
endif
let l:command .= ' --log-level=' . ale#Escape(l:log_level)
return l:command
endfunction
function! s:FindProjectRoot(buffer) abort
let l:markers = [
\ '_checkouts/',
\ '_build/',
\ 'deps/',
\ 'erlang_ls.config',
\ 'rebar.lock',
\ 'erlang.mk',
\]
" This is a way to find Erlang/OTP root (the one that is managed
" by kerl or asdf). Useful if :ALEGoToDefinition takes us there.
let l:markers += ['.kerl_config']
for l:marker in l:markers
let l:path = l:marker[-1:] is# '/'
\ ? ale#path#FindNearestDirectory(a:buffer, l:marker)
\ : ale#path#FindNearestFile(a:buffer, l:marker)
if !empty(l:path)
return ale#path#Dirname(l:path)
endif
endfor
return ''
endfunction
call ale#linter#Define('erlang', {
\ 'name': 'erlang_ls',
\ 'executable': {b -> ale#Var(b, 'erlang_erlang_ls_executable')},
\ 'command': function('s:GetCommand'),
\ 'lsp': 'stdio',
\ 'project_root': function('s:FindProjectRoot'),
\ 'aliases': ['erlang-ls'],
\})
================================================
FILE: ale_linters/erlang/erlc.vim
================================================
" Author: Magnus Ottenklinger - https://github.com/evnu
let g:ale_erlang_erlc_executable = get(g:, 'ale_erlang_erlc_executable', 'erlc')
let g:ale_erlang_erlc_options = get(g:, 'ale_erlang_erlc_options', '')
function! ale_linters#erlang#erlc#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'erlang_erlc_executable')
endfunction
function! ale_linters#erlang#erlc#GetCommand(buffer) abort
let l:output_file = ale#util#Tempname()
call ale#command#ManageFile(a:buffer, l:output_file)
let l:command = ale#Escape(ale_linters#erlang#erlc#GetExecutable(a:buffer))
\ . ' -o ' . ale#Escape(l:output_file)
\ . ' ' . ale#Var(a:buffer, 'erlang_erlc_options')
\ . ' %t'
return l:command
endfunction
function! ale_linters#erlang#erlc#Handle(buffer, lines) abort
" Matches patterns like the following:
"
" error.erl:4: variable 'B' is unbound
" error.erl:3: Warning: function main/0 is unused
" error.erl:4: Warning: variable 'A' is unused
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+:)? (Warning: )?(.+)$'
" parse_transforms are a special case. The error message does not indicate a location:
" error.erl: undefined parse transform 'some_parse_transform'
let l:pattern_parse_transform = '\v(undefined parse transform .*)$'
let l:output = []
let l:pattern_no_module_definition = '\v(no module definition)$'
let l:pattern_unused = '\v(.* is unused)$'
let l:is_hrl = fnamemodify(bufname(a:buffer), ':e') is# 'hrl'
for l:line in a:lines
let l:match = matchlist(l:line, l:pattern)
" Determine if the output indicates an error. We distinguish between two cases:
"
" 1) normal errors match l:pattern
" 2) parse_transform errors match l:pattern_parse_transform
"
" If none of the patterns above match, the line can be ignored
if len(l:match) == 0 " not a 'normal' warning or error
let l:match_parse_transform = matchlist(l:line, l:pattern_parse_transform)
if len(l:match_parse_transform) == 0 " also not a parse_transform error
continue
endif
call add(l:output, {
\ 'bufnr': a:buffer,
\ 'lnum': 0,
\ 'col': 0,
\ 'type': 'E',
\ 'text': l:match_parse_transform[0],
\})
continue
endif
let l:line = l:match[2]
let l:warning_or_text = l:match[4]
let l:text = l:match[5]
" If this file is a header .hrl, ignore the following expected messages:
" - 'no module definition'
" - 'X is unused'
if l:is_hrl && (
\ match(l:text, l:pattern_no_module_definition) != -1
\ || match(l:text, l:pattern_unused) != -1
\)
continue
endif
if !empty(l:warning_or_text)
let l:type = 'W'
else
let l:type = 'E'
endif
call add(l:output, {
\ 'bufnr': a:buffer,
\ 'lnum': l:line,
\ 'col': 0,
\ 'type': l:type,
\ 'text': l:text,
\})
endfor
return l:output
endfunction
call ale#linter#Define('erlang', {
\ 'name': 'erlc',
\ 'executable': function('ale_linters#erlang#erlc#GetExecutable'),
\ 'command': function('ale_linters#erlang#erlc#GetCommand'),
\ 'callback': 'ale_linters#erlang#erlc#Handle',
\})
================================================
FILE: ale_linters/erlang/syntaxerl.vim
================================================
" Author: Dmitri Vereshchagin
" Description: SyntaxErl linter for Erlang files
call ale#Set('erlang_syntaxerl_executable', 'syntaxerl')
function! ale_linters#erlang#syntaxerl#Handle(buffer, lines) abort
let l:pattern = '\v\C:(\d+):( warning:)? (.+)'
let l:loclist = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:loclist, {
\ 'lnum': str2nr(l:match[1]),
\ 'text': l:match[3],
\ 'type': empty(l:match[2]) ? 'E' : 'W',
\})
endfor
return l:loclist
endfunction
function! s:GetExecutable(buffer) abort
return ale#Var(a:buffer, 'erlang_syntaxerl_executable')
endfunction
function! s:GetCommand(buffer) abort
let l:Callback = function('s:GetCommandFromHelpOutput')
return ale#command#Run(a:buffer, '%e -h', l:Callback, {
\ 'executable': s:GetExecutable(a:buffer),
\})
endfunction
function! s:GetCommandFromHelpOutput(buffer, output, metadata) abort
let l:has_b_option = match(a:output, '\V\C-b, --base\>') > -1
return l:has_b_option ? '%e -b %s %t' : '%e %t'
endfunction
call ale#linter#Define('erlang', {
\ 'name': 'syntaxerl',
\ 'callback': 'ale_linters#erlang#syntaxerl#Handle',
\ 'executable': function('s:GetExecutable'),
\ 'command': function('s:GetCommand'),
\})
================================================
FILE: ale_linters/eruby/erb.vim
================================================
" Author: Matthias Guenther - https://wikimatze.de, Eddie Lebow https://github.com/elebow
" Description: ERB from the Ruby standard library, for eruby/erb files
function! ale_linters#eruby#erb#GetCommand(buffer) abort
let l:rails_root = ale#ruby#FindRailsRoot(a:buffer)
if empty(l:rails_root)
return 'erb -P -T - -x %t | ruby -c'
endif
" Rails-flavored eRuby does not comply with the standard as understood by
" ERB, so we'll have to do some substitution. This does not reduce the
" effectiveness of the linter—the translated code is still evaluated.
return 'ruby -r erb -e ' . ale#Escape('puts ERB.new($stdin.read.gsub(%{<%=},%{<%}), trim_mode: %{-}).src') . '< %t | ruby -c'
endfunction
call ale#linter#Define('eruby', {
\ 'name': 'erb',
\ 'aliases': ['erubylint'],
\ 'executable': 'erb',
\ 'output_stream': 'stderr',
\ 'command': function('ale_linters#eruby#erb#GetCommand'),
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
\})
================================================
FILE: ale_linters/eruby/erblint.vim
================================================
" Author: Roeland Moors - https://github.com/roelandmoors
" based on the ale ruumba and robocop linters
" Description: ERB Lint, support for https://github.com/Shopify/erb-lint
call ale#Set('eruby_erblint_executable', 'erblint')
call ale#Set('eruby_erblint_options', '')
function! ale_linters#eruby#erblint#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'eruby_erblint_executable')
return ale#ruby#EscapeExecutable(l:executable, 'erblint')
\ . ' --format json '
\ . ale#Var(a:buffer, 'eruby_erblint_options')
\ . ' --stdin %s'
endfunction
function! ale_linters#eruby#erblint#Handle(buffer, lines) abort
if empty(a:lines)
return []
endif
let l:errors = ale#util#FuzzyJSONDecode(a:lines[0], [])
if !has_key(l:errors, 'summary')
\|| l:errors['summary']['offenses'] == 0
\|| empty(l:errors['files'])
return []
endif
let l:output = []
for l:error in l:errors['files'][0]['offenses']
call add(l:output, {
\ 'lnum': l:error['location']['start_line'] + 0,
\ 'col': l:error['location']['start_column'] + 0,
\ 'end_col': l:error['location']['last_column'] + 0,
\ 'code': l:error['linter'],
\ 'text': l:error['message'],
\ 'type': 'W',
\})
endfor
return l:output
endfunction
call ale#linter#Define('eruby', {
\ 'name': 'erblint',
\ 'executable': {b -> ale#Var(b, 'eruby_erblint_executable')},
\ 'command': function('ale_linters#eruby#erblint#GetCommand'),
\ 'callback': 'ale_linters#eruby#erblint#Handle',
\})
================================================
FILE: ale_linters/eruby/erubi.vim
================================================
" Author: Eddie Lebow https://github.com/elebow
" Description: eruby checker using `erubi`
function! ale_linters#eruby#erubi#GetCommand(buffer, output, meta) abort
let l:rails_root = ale#ruby#FindRailsRoot(a:buffer)
if !empty(a:output)
" The empty command in CheckErubi returns nothing if erubi runs and
" emits an error if erubi is not present
return ''
endif
if empty(l:rails_root)
return 'ruby -r erubi/capture_end -e ' . ale#Escape('puts Erubi::CaptureEndEngine.new($stdin.read).src') . '< %t | ruby -c'
endif
" Rails-flavored eRuby does not comply with the standard as understood by
" Erubi, so we'll have to do some substitution. This does not reduce the
" effectiveness of the linter---the translated code is still evaluated.
return 'ruby -r erubi/capture_end -e ' . ale#Escape('puts Erubi::CaptureEndEngine.new($stdin.read.gsub(%{<%=},%{<%}), nil, %{-}).src') . '< %t | ruby -c'
endfunction
call ale#linter#Define('eruby', {
\ 'name': 'erubi',
\ 'executable': 'ruby',
\ 'command': {buffer -> ale#command#Run(
\ buffer,
\ 'ruby -r erubi/capture_end -e ' . ale#Escape('""'),
\ function('ale_linters#eruby#erubi#GetCommand'),
\ )},
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
\})
================================================
FILE: ale_linters/eruby/erubis.vim
================================================
" Author: Jake Zimmerman , Eddie Lebow https://github.com/elebow
" Description: eruby checker using `erubis`, instead of `erb`
function! ale_linters#eruby#erubis#GetCommand(buffer) abort
let l:rails_root = ale#ruby#FindRailsRoot(a:buffer)
if empty(l:rails_root)
return 'erubis -x %t | ruby -c'
endif
" Rails-flavored eRuby does not comply with the standard as understood by
" Erubis, so we'll have to do some substitution. This does not reduce the
" effectiveness of the linter - the translated code is still evaluated.
return 'ruby -r erubis -e ' . ale#Escape('puts Erubis::Eruby.new($stdin.read.gsub(%{<%=},%{<%})).src') . '< %t | ruby -c'
endfunction
call ale#linter#Define('eruby', {
\ 'name': 'erubis',
\ 'executable': 'erubis',
\ 'output_stream': 'stderr',
\ 'command': function('ale_linters#eruby#erubis#GetCommand'),
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
\})
================================================
FILE: ale_linters/eruby/ruumba.vim
================================================
" Author: aclemons - https://github.com/aclemons
" based on the ale rubocop linter
" Description: Ruumba, RuboCop linting for ERB templates.
call ale#Set('eruby_ruumba_executable', 'ruumba')
call ale#Set('eruby_ruumba_options', '')
function! ale_linters#eruby#ruumba#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'eruby_ruumba_executable')
return ale#ruby#EscapeExecutable(l:executable, 'ruumba')
\ . ' --format json --force-exclusion '
\ . ale#Var(a:buffer, 'eruby_ruumba_options')
\ . ' --stdin %s'
endfunction
function! ale_linters#eruby#ruumba#Handle(buffer, lines) abort
try
let l:errors = json_decode(a:lines[0])
catch
return []
endtry
if !has_key(l:errors, 'summary')
\|| l:errors['summary']['offense_count'] == 0
\|| empty(l:errors['files'])
return []
endif
let l:output = []
for l:error in l:errors['files'][0]['offenses']
let l:start_col = l:error['location']['column'] + 0
call add(l:output, {
\ 'lnum': l:error['location']['line'] + 0,
\ 'col': l:start_col,
\ 'end_col': l:start_col + l:error['location']['length'] - 1,
\ 'code': l:error['cop_name'],
\ 'text': l:error['message'],
\ 'type': ale_linters#eruby#ruumba#GetType(l:error['severity']),
\})
endfor
return l:output
endfunction
function! ale_linters#eruby#ruumba#GetType(severity) abort
if a:severity is? 'convention'
\|| a:severity is? 'warning'
\|| a:severity is? 'refactor'
return 'W'
endif
return 'E'
endfunction
call ale#linter#Define('eruby', {
\ 'name': 'ruumba',
\ 'executable': {b -> ale#Var(b, 'eruby_ruumba_executable')},
\ 'command': function('ale_linters#eruby#ruumba#GetCommand'),
\ 'callback': 'ale_linters#eruby#ruumba#Handle',
\})
================================================
FILE: ale_linters/fish/fish.vim
================================================
" Author: Niraj Thapaliya - https://github.com/nthapaliya
" Description: Lints fish files using fish -n
function! ale_linters#fish#fish#Handle(buffer, lines) abort
" Matches patterns such as:
"
" home/.config/fish/functions/foo.fish (line 1): Missing end to balance this function definition
" function foo
" ^
"
" OR, patterns such as:
"
" Unsupported use of '||'. In fish, please use 'COMMAND; or COMMAND'.
" /tmp/vLz620o/258/test.fish (line 2): if set -q SSH_CLIENT || set -q SSH_TTY
" ^
"
" fish -n can return errors in either format.
let l:pattern = '^\(.* (line \(\d\+\)): \)\(.*\)$'
let l:column_pattern = '^ *\^'
let l:output = []
let l:column_offset = 0
let l:last_line_with_message = ''
for l:line in a:lines
" Look for error lines first.
let l:match = matchlist(l:line, l:pattern)
if !empty(l:match)
if !empty(l:last_line_with_message)
let l:text = l:last_line_with_message
else
let l:text = l:match[3]
endif
let l:column_offset = len(l:match[1])
let l:last_line_with_message = ''
call add(l:output, {
\ 'col': 0,
\ 'lnum': str2nr(l:match[2]),
\ 'text': l:text,
\})
else
" Look for column markers like ' ^' second.
" The column index will be set according to how long the line is.
let l:column_match = matchstr(l:line, l:column_pattern)
if !empty(l:column_match) && !empty(l:output)
let l:output[-1].col = len(l:column_match) - l:column_offset
let l:last_line_with_message = ''
else
let l:last_line_with_message = l:line
let l:column_offset = 0
endif
endif
endfor
return l:output
endfunction
call ale#linter#Define('fish', {
\ 'name': 'fish',
\ 'output_stream': 'stderr',
\ 'executable': 'fish',
\ 'command': 'fish -n %t',
\ 'callback': 'ale_linters#fish#fish#Handle',
\})
================================================
FILE: ale_linters/fortran/fortitude.vim
================================================
" 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,
\})
================================================
FILE: ale_linters/fortran/gcc.vim
================================================
" Author: w0rp
" Description: gcc for Fortran files
" This option can be set to 0 to use -ffixed-form
call ale#Set('fortran_gcc_use_free_form', 1)
call ale#Set('fortran_gcc_executable', 'gcc')
" Set this option to change the GCC options for warnings for Fortran.
call ale#Set('fortran_gcc_options', '-Wall')
function! ale_linters#fortran#gcc#Handle(buffer, lines) abort
" We have to match a starting line and a later ending line together,
" like so.
"
" :21.34:
" Error: Expected comma in I/O list at (1)
let l:line_marker_pattern = ':\(\d\+\)[.:]\=\(\d\+\)\=:\=$'
let l:message_pattern = '^\(Error\|Warning\): \(.\+\)$'
let l:looking_for_message = 0
let l:last_loclist_obj = {}
let l:output = []
for l:line in a:lines
if l:looking_for_message
let l:match = matchlist(l:line, l:message_pattern)
else
let l:match = matchlist(l:line, l:line_marker_pattern)
endif
if len(l:match) == 0
continue
endif
if l:looking_for_message
let l:looking_for_message = 0
" Now we have the text, we can set it and add the error.
let l:last_loclist_obj.text = l:match[2]
let l:last_loclist_obj.type = l:match[1] is# 'Warning' ? 'W' : 'E'
call add(l:output, l:last_loclist_obj)
else
let l:last_loclist_obj = {
\ 'bufnr': a:buffer,
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\}
" Start looking for the message and error type.
let l:looking_for_message = 1
endif
endfor
return l:output
endfunction
function! ale_linters#fortran#gcc#GetCommand(buffer) abort
let l:layout_option = ale#Var(a:buffer, 'fortran_gcc_use_free_form')
\ ? '-ffree-form'
\ : '-ffixed-form'
return '%e -S -x f95 -fsyntax-only ' . l:layout_option
\ . ale#Pad(ale#Var(a:buffer, 'fortran_gcc_options'))
\ . ' -'
endfunction
call ale#linter#Define('fortran', {
\ 'name': 'gcc',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'fortran_gcc_executable')},
\ 'command': function('ale_linters#fortran#gcc#GetCommand'),
\ 'callback': 'ale_linters#fortran#gcc#Handle',
\})
================================================
FILE: ale_linters/fortran/language_server.vim
================================================
" Author: unpairedbracket ben.spiers22@gmail.com
" Description: A language server for fortran
call ale#Set('fortran_language_server_executable', 'fortls')
call ale#Set('fortran_language_server_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#fortran#language_server#GetProjectRoot(buffer) abort
let l:fortls_file = ale#path#FindNearestFile(a:buffer, '.fortls')
return !empty(l:fortls_file) ? fnamemodify(l:fortls_file, ':h') : ''
endfunction
call ale#linter#Define('fortran', {
\ 'name': 'language_server',
\ 'aliases': ['fortls'],
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'fortran_language_server_executable')},
\ 'command': '%e',
\ 'project_root': function('ale_linters#fortran#language_server#GetProjectRoot'),
\})
================================================
FILE: ale_linters/fountain/proselint.vim
================================================
" 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',
\})
================================================
FILE: ale_linters/fuse/fusionlint.vim
================================================
" Author: RyanSquared
" Description: `fusion-lint` linter for FusionScript files
call ale#Set('fuse_fusionlint_executable', 'fusion-lint')
call ale#Set('fuse_fusionlint_options', '')
function! ale_linters#fuse#fusionlint#GetCommand(buffer) abort
return '%e' . ale#Pad(ale#Var(a:buffer, 'fuse_fusionlint_options'))
\ . ' --filename %s -i'
endfunction
function! ale_linters#fuse#fusionlint#Handle(buffer, lines) abort
let l:pattern = '^.*:\(\d\+\):\(\d\+\): (\([WE]\)\d\+) \(.\+\)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'text': l:match[4],
\ 'type': l:match[3],
\})
endfor
return l:output
endfunction
call ale#linter#Define('fuse', {
\ 'name': 'fusionlint',
\ 'executable': {b -> ale#Var(b, 'fuse_fusionlint_executable')},
\ 'command': function('ale_linters#fuse#fusionlint#GetCommand'),
\ 'callback': 'ale_linters#fuse#fusionlint#Handle',
\})
================================================
FILE: ale_linters/gitcommit/gitlint.vim
================================================
" Author: Nick Yamane
" Description: gitlint for git commit message files
call ale#Set('gitcommit_gitlint_executable', 'gitlint')
call ale#Set('gitcommit_gitlint_options', '')
call ale#Set('gitcommit_gitlint_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#gitcommit#gitlint#GetExecutable(buffer) abort
return ale#python#FindExecutable(a:buffer, 'gitcommit_gitlint', ['gitlint'])
endfunction
function! ale_linters#gitcommit#gitlint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'gitcommit_gitlint_options')
return '%e' . ale#Pad(l:options) . ' lint'
endfunction
function! ale_linters#gitcommit#gitlint#Handle(buffer, lines) abort
" Matches patterns line the following:
let l:pattern = '\v^(\d+): (\w+) (.*)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:code = l:match[2]
if !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
if l:code is# 'T2' || l:code is# 'B2'
continue
endif
endif
let l:item = {
\ 'lnum': l:match[1] + 0,
\ 'text': l:match[3],
\ 'code': l:code,
\ 'type': 'E',
\}
call add(l:output, l:item)
endfor
return l:output
endfunction
call ale#linter#Define('gitcommit', {
\ 'name': 'gitlint',
\ 'output_stream': 'stderr',
\ 'executable': function('ale_linters#gitcommit#gitlint#GetExecutable'),
\ 'command': function('ale_linters#gitcommit#gitlint#GetCommand'),
\ 'callback': 'ale_linters#gitcommit#gitlint#Handle',
\})
================================================
FILE: ale_linters/gleam/gleamlsp.vim
================================================
" Author: Jonathan Palardt https://github.com/jpalardy
" Description: Support for Gleam Language Server
call ale#Set('gleam_gleamlsp_executable', 'gleam')
function! ale_linters#gleam#gleamlsp#GetProjectRoot(buffer) abort
let l:gleam_toml = ale#path#FindNearestFile(a:buffer, 'gleam.toml')
return !empty(l:gleam_toml) ? fnamemodify(l:gleam_toml, ':p:h') : ''
endfunction
call ale#linter#Define('gleam', {
\ 'name': 'gleamlsp',
\ 'lsp': 'stdio',
\ 'executable': {buffer -> ale#Var(buffer, 'gleam_gleamlsp_executable')},
\ 'command': '%e lsp',
\ 'project_root': function('ale_linters#gleam#gleamlsp#GetProjectRoot'),
\})
================================================
FILE: ale_linters/glimmer/embertemplatelint.vim
================================================
" Author: Sam Saffron
" Description: Ember-template-lint for checking GJS (Glimmer JS) files
scriptencoding utf-8
call ale#handlers#embertemplatelint#DefineLinter('glimmer')
================================================
FILE: ale_linters/glsl/glslang.vim
================================================
" Author: Sven-Hendrik Haase
" Description: glslang-based linter for glsl files
"
" TODO: Once https://github.com/KhronosGroup/glslang/pull/1047 is accepted,
" we can use stdin.
call ale#Set('glsl_glslang_executable', 'glslangValidator')
call ale#Set('glsl_glslang_options', '')
function! ale_linters#glsl#glslang#GetCommand(buffer) abort
return '%e'
\ . ale#Pad(ale#Var(a:buffer, 'glsl_glslang_options'))
\ . ' -C %t'
endfunction
function! ale_linters#glsl#glslang#Handle(buffer, lines) abort
" Matches patterns like the following:
"
" ERROR: 0:5: 'foo' : undeclared identifier
" or when using options like -V or -G or --target-env
" ERROR: filename:5: 'foo' : undeclared identifier
let l:pattern = '^\(.\+\): \(.\+\):\(\d\+\): \(.\+\)'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': str2nr(l:match[3]),
\ 'col' : 0,
\ 'text': l:match[4],
\ 'type': l:match[1] is# 'ERROR' ? 'E' : 'W',
\})
endfor
return l:output
endfunction
call ale#linter#Define('glsl', {
\ 'name': 'glslang',
\ 'executable': {b -> ale#Var(b, 'glsl_glslang_executable')},
\ 'command': function('ale_linters#glsl#glslang#GetCommand'),
\ 'callback': 'ale_linters#glsl#glslang#Handle',
\})
================================================
FILE: ale_linters/glsl/glslls.vim
================================================
" Author: Sven-Hendrik Haase
" Description: A language server for glsl
call ale#Set('glsl_glslls_executable', 'glslls')
call ale#Set('glsl_glslls_logfile', '')
function! ale_linters#glsl#glslls#GetCommand(buffer) abort
let l:logfile = ale#Var(a:buffer, 'glsl_glslls_logfile')
let l:logfile_args = ''
if l:logfile isnot# ''
let l:logfile_args = ' --verbose -l ' . l:logfile
endif
return '%e' . l:logfile_args . ' --stdin'
endfunction
function! ale_linters#glsl#glslls#GetProjectRoot(buffer) abort
let l:project_root = ale#c#FindProjectRoot(a:buffer)
return !empty(l:project_root) ? fnamemodify(l:project_root, ':h:h') : ''
endfunction
call ale#linter#Define('glsl', {
\ 'name': 'glslls',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'glsl_glslls_executable')},
\ 'command': function('ale_linters#glsl#glslls#GetCommand'),
\ 'project_root': function('ale_linters#glsl#glslls#GetProjectRoot'),
\})
================================================
FILE: ale_linters/go/bingo.vim
================================================
" Author: Jerko Steiner
" Description: https://github.com/saibing/bingo
call ale#Set('go_bingo_executable', 'bingo')
call ale#Set('go_bingo_options', '--mode stdio')
function! ale_linters#go#bingo#GetCommand(buffer) abort
return ale#go#EnvString(a:buffer) . '%e' . ale#Pad(ale#Var(a:buffer, 'go_bingo_options'))
endfunction
function! ale_linters#go#bingo#FindProjectRoot(buffer) abort
let l:go_modules_off = ale#Var(a:buffer, 'go_go111module') is# 'off'
let l:project_root = l:go_modules_off ?
\ '' : ale#path#FindNearestFile(a:buffer, 'go.mod')
let l:mods = ':h'
if empty(l:project_root)
let l:project_root = ale#path#FindNearestDirectory(a:buffer, '.git')
let l:mods = ':h:h'
endif
return !empty(l:project_root) ? fnamemodify(l:project_root, l:mods) : ''
endfunction
call ale#linter#Define('go', {
\ 'name': 'bingo',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'go_bingo_executable')},
\ 'command': function('ale_linters#go#bingo#GetCommand'),
\ 'project_root': function('ale_linters#go#bingo#FindProjectRoot'),
\})
================================================
FILE: ale_linters/go/cspell.vim
================================================
scriptencoding utf-8
" Author: David Houston
" Description: cspell support for Go files.
call ale#handlers#cspell#DefineLinter('go')
================================================
FILE: ale_linters/go/gobuild.vim
================================================
" Author: Joshua Rubin , Ben Reedy ,
" Jeff Willette
" Description: go build for Go files
" inspired by work from dzhou121
call ale#Set('go_go_executable', 'go')
call ale#Set('go_gobuild_options', '')
function! ale_linters#go#gobuild#GetMatches(lines) abort
" Matches patterns like the following:
"
" file.go:27: missing argument for Printf("%s"): format reads arg 2, have only 1 args
" file.go:53:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
" file.go:5:2: expected declaration, found 'STRING' "log"
" go test returns relative paths so use tail of filename as part of pattern matcher
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:? (.+)$'
return ale#util#GetMatches(a:lines, l:pattern)
endfunction
function! ale_linters#go#gobuild#Handler(buffer, lines) abort
let l:dir = expand('#' . a:buffer . ':p:h')
let l:output = []
for l:match in ale_linters#go#gobuild#GetMatches(a:lines)
call add(l:output, {
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'text': l:match[4],
\ 'type': 'E',
\})
endfor
return l:output
endfunction
call ale#linter#Define('go', {
\ 'name': 'gobuild',
\ 'aliases': ['go build'],
\ 'executable': {b -> ale#Var(b, 'go_go_executable')},
\ 'cwd': '%s:h',
\ 'command': {b ->
\ ale#go#EnvString(b)
\ . ale#Escape(ale#Var(b, 'go_go_executable')) . ' test'
\ . ale#Pad(ale#Var(b, 'go_gobuild_options'))
\ . ' -c -o /dev/null ./'
\ },
\ 'output_stream': 'stderr',
\ 'callback': 'ale_linters#go#gobuild#Handler',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/go/gofmt.vim
================================================
" Author: neersighted
" Description: gofmt for Go files
function! ale_linters#go#gofmt#GetCommand(buffer) abort
return ale#go#EnvString(a:buffer)
\ . '%e -e %t'
endfunction
call ale#linter#Define('go', {
\ 'name': 'gofmt',
\ 'output_stream': 'stderr',
\ 'executable': 'gofmt',
\ 'command': function('ale_linters#go#gofmt#GetCommand'),
\ 'callback': 'ale#handlers#unix#HandleAsError',
\})
================================================
FILE: ale_linters/go/golangci_lint.vim
================================================
" Author: Sascha Grunert
" Description: Adds support of golangci-lint
call ale#Set('go_golangci_lint_options', '')
call ale#Set('go_golangci_lint_executable', 'golangci-lint')
call ale#Set('go_golangci_lint_package', 1)
function! ale_linters#go#golangci_lint#GetExecutable(buffer) abort
let l:executable = ale#Var(a:buffer, 'go_golangci_lint_executable')
return l:executable
endfunction
function! ale_linters#go#golangci_lint#GetCommand(buffer, version) abort
let l:filename = expand('#' . a:buffer . ':t')
let l:options = ale#Var(a:buffer, 'go_golangci_lint_options')
let l:lint_package = ale#Var(a:buffer, 'go_golangci_lint_package')
if ale#semver#GTE(a:version, [2, 0, 0])
let l:options = l:options
\ . ' --output.json.path stdout'
\ . ' --output.text.path stderr'
\ . ' --show-stats=0'
else
let l:options = l:options
\ . ' --out-format=json'
\ . ' --show-stats=0'
endif
if l:lint_package
return ale#go#EnvString(a:buffer)
\ . '%e run '
\ . l:options
endif
return ale#go#EnvString(a:buffer)
\ . '%e run '
\ . ale#Escape(l:filename)
\ . ' ' . l:options
endfunction
function! ale_linters#go#golangci_lint#Handler(buffer, lines) abort
let l:dir = expand('#' . a:buffer . ':p:h')
let l:output = []
let l:matches = ale#util#FuzzyJSONDecode(a:lines, [])
if empty(l:matches)
return []
endif
for l:match in l:matches['Issues']
if l:match['FromLinter'] is# 'typecheck'
let l:msg_type = 'E'
else
let l:msg_type = 'W'
endif
call add(l:output, {
\ 'filename': ale#path#GetAbsPath(l:dir, fnamemodify(l:match['Pos']['Filename'], ':t')),
\ 'lnum': l:match['Pos']['Line'] + 0,
\ 'col': l:match['Pos']['Column'] + 0,
\ 'type': l:msg_type,
\ 'text': match['FromLinter'] . ' - ' . l:match['Text'],
\})
endfor
return l:output
endfunction
call ale#linter#Define('go', {
\ 'name': 'golangci-lint',
\ 'executable': function('ale_linters#go#golangci_lint#GetExecutable'),
\ 'cwd': '%s:h',
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
\ buffer,
\ ale_linters#go#golangci_lint#GetExecutable(buffer),
\ '%e --version',
\ function('ale_linters#go#golangci_lint#GetCommand'),
\ )},
\ 'callback': 'ale_linters#go#golangci_lint#Handler',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/go/gopls.vim
================================================
" Author: w0rp
" Author: Jerko Steiner
" Description: https://github.com/saibing/gopls
call ale#Set('go_gopls_executable', 'gopls')
call ale#Set('go_gopls_options', '--mode stdio')
call ale#Set('go_gopls_init_options', {})
call ale#Set('go_gopls_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#go#gopls#GetCommand(buffer) abort
return ale#go#EnvString(a:buffer)
\ . '%e'
\ . ale#Pad(ale#Var(a:buffer, 'go_gopls_options'))
endfunction
function! ale_linters#go#gopls#FindProjectRoot(buffer) abort
let l:go_modules_off = ale#Var(a:buffer, 'go_go111module') is# 'off'
let l:project_root = l:go_modules_off ?
\ '' : ale#path#FindNearestFile(a:buffer, 'go.mod')
let l:mods = ':h'
if empty(l:project_root)
let l:project_root = ale#path#FindNearestDirectory(a:buffer, '.git')
let l:mods = ':h:h'
endif
return !empty(l:project_root) ? fnamemodify(l:project_root, l:mods) : ''
endfunction
call ale#linter#Define('go', {
\ 'name': 'gopls',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#path#FindExecutable(b, 'go_gopls', [
\ ale#go#GetGoPathExecutable('bin/gopls'),
\ ])},
\ 'command': function('ale_linters#go#gopls#GetCommand'),
\ 'project_root': function('ale_linters#go#gopls#FindProjectRoot'),
\ 'initialization_options': {b -> ale#Var(b, 'go_gopls_init_options')},
\})
================================================
FILE: ale_linters/go/gosimple.vim
================================================
" Author: Ben Reedy
" Description: gosimple for Go files
call ale#linter#Define('go', {
\ 'name': 'gosimple',
\ 'executable': 'gosimple',
\ 'cwd': '%s:h',
\ 'command': {b -> ale#go#EnvString(b) . 'gosimple .'},
\ 'callback': 'ale#handlers#go#Handler',
\ 'output_stream': 'both',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/go/gotype.vim
================================================
" Author: Jelte Fennema
" Description: gotype for Go files
function! ale_linters#go#gotype#GetExecutable(buffer) abort
if expand('#' . a:buffer . ':p') =~# '_test\.go$'
return ''
endif
return 'gotype'
endfunction
function! ale_linters#go#gotype#GetCommand(buffer) abort
return ale#go#EnvString(a:buffer) . 'gotype -e .'
endfunction
call ale#linter#Define('go', {
\ 'name': 'gotype',
\ 'output_stream': 'stderr',
\ 'executable': function('ale_linters#go#gotype#GetExecutable'),
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#go#gotype#GetCommand'),
\ 'callback': 'ale#handlers#go#Handler',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/go/govet.vim
================================================
" Author: neersighted , John Eikenberry
" Description: go vet for Go files
call ale#Set('go_go_executable', 'go')
call ale#Set('go_govet_options', '')
call ale#linter#Define('go', {
\ 'name': 'govet',
\ 'aliases': ['go vet'],
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'go_go_executable')},
\ 'cwd': '%s:h',
\ 'command': {b ->
\ ale#go#EnvString(b)
\ . '%e vet'
\ . ale#Pad(ale#Var(b, 'go_govet_options'))
\ . ' .'
\ },
\ 'callback': 'ale#handlers#go#Handler',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/go/langserver.vim
================================================
" Author: Horacio Sanson
" Description: Support for go-langserver https://github.com/sourcegraph/go-langserver
call ale#Set('go_langserver_executable', 'go-langserver')
call ale#Set('go_langserver_options', '')
function! ale_linters#go#langserver#GetCommand(buffer) abort
let l:executable = [ale#Escape(ale#Var(a:buffer, 'go_langserver_executable'))]
let l:options = ale#Var(a:buffer, 'go_langserver_options')
let l:options = substitute(l:options, '-gocodecompletion', '', 'g')
let l:options = filter(split(l:options, ' '), 'empty(v:val) != 1')
if ale#Var(a:buffer, 'completion_enabled')
call add(l:options, '-gocodecompletion')
endif
let l:options = uniq(sort(l:options))
let l:env = ale#go#EnvString(a:buffer)
return l:env . join(extend(l:executable, l:options), ' ')
endfunction
call ale#linter#Define('go', {
\ 'name': 'golangserver',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'go_langserver_executable')},
\ 'command': function('ale_linters#go#langserver#GetCommand'),
\ 'project_root': function('ale#go#FindProjectRoot'),
\})
================================================
FILE: ale_linters/go/revive.vim
================================================
" Author: Penghui Liao
" Description: Adds support for revive
call ale#Set('go_revive_executable', 'revive')
call ale#Set('go_revive_options', '')
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)
\ . ' %t'
endfunction
call ale#linter#Define('go', {
\ 'name': 'revive',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#Var(b, 'go_revive_executable')},
\ 'command': function('ale_linters#go#revive#GetCommand'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
\})
================================================
FILE: ale_linters/go/staticcheck.vim
================================================
" Author: Ben Reedy
" Description: staticcheck for Go files
call ale#Set('go_staticcheck_executable', 'staticcheck')
call ale#Set('go_staticcheck_options', '')
call ale#Set('go_staticcheck_lint_package', 1)
call ale#Set('go_staticcheck_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#go#staticcheck#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'go_staticcheck_options')
let l:lint_package = ale#Var(a:buffer, 'go_staticcheck_lint_package')
let l:env = ale#go#EnvString(a:buffer)
if l:lint_package
return l:env . '%e'
\ . ale#Pad(l:options) . ' .'
endif
return l:env . '%e'
\ . ale#Pad(l:options)
\ . ' %s:t'
endfunction
call ale#linter#Define('go', {
\ 'name': 'staticcheck',
\ 'executable': {b -> ale#path#FindExecutable(b, 'go_staticcheck', [
\ ale#go#GetGoPathExecutable('bin/staticcheck'),
\ ])},
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#go#staticcheck#GetCommand'),
\ 'callback': 'ale#handlers#go#Handler',
\ 'output_stream': 'both',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/gohtmltmpl/djlint.vim
================================================
" Author: Adrian Vollmer
" Description: djlint for Django HTML template files
call ale#Set('html_djlint_executable', 'djlint')
call ale#Set('html_djlint_options', '')
call ale#linter#Define('gohtmltmpl', {
\ 'name': 'djlint',
\ 'executable': function('ale#handlers#djlint#GetExecutable'),
\ 'command': function('ale#handlers#djlint#GetCommand'),
\ 'callback': 'ale#handlers#djlint#Handle',
\})
================================================
FILE: ale_linters/graphql/eslint.vim
================================================
" Author: Benjie Gillam
" Description: eslint for GraphQL files
call ale#linter#Define('graphql', {
\ 'name': 'eslint',
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
\ 'cwd': function('ale#handlers#eslint#GetCwd'),
\ 'command': function('ale#handlers#eslint#GetCommand'),
\ 'callback': 'ale#handlers#eslint#HandleJSON',
\})
================================================
FILE: ale_linters/graphql/gqlint.vim
================================================
" Author: Michiel Westerbeek
" Description: Linter for GraphQL Schemas
call ale#linter#Define('graphql', {
\ 'name': 'gqlint',
\ 'executable': 'gqlint',
\ 'cwd': '%s:h',
\ 'command': 'gqlint --reporter=simple %t',
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
\})
================================================
FILE: ale_linters/groovy/npmgroovylint.vim
================================================
" Author: lucas-str
" Description: Integration of npm-groovy-lint for Groovy files.
call ale#Set('groovy_npmgroovylint_executable', 'npm-groovy-lint')
call ale#Set('groovy_npmgroovylint_options', '--loglevel warning')
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)
\ . ' %t'
endfunction
function! ale_linters#groovy#npmgroovylint#Handle(buffer, lines) abort
let l:output = []
let l:json = ale#util#FuzzyJSONDecode(a:lines, {})
for [l:filename, l:file] in items(get(l:json, 'files', {}))
for l:error in get(l:file, 'errors', [])
let l:output_line = {
\ 'filename': l:filename,
\ 'lnum': l:error.line,
\ 'text': l:error.msg,
\ 'type': toupper(l:error.severity[0]),
\}
if has_key(l:error, 'range')
let l:output_line.col = l:error.range.start.character
let l:output_line.end_col = l:error.range.end.character
let l:output_line.end_lnum = l:error.range.end.line
endif
call add(l:output, l:output_line)
endfor
endfor
return l:output
endfunction
call ale#linter#Define('groovy', {
\ 'name': 'npm-groovy-lint',
\ 'executable': {b -> ale#Var(b, 'groovy_npmgroovylint_executable')},
\ 'command': function('ale_linters#groovy#npmgroovylint#GetCommand'),
\ 'callback': 'ale_linters#groovy#npmgroovylint#Handle',
\})
================================================
FILE: ale_linters/hack/hack.vim
================================================
" Author: Fred Emmott
" Description: Hack support via `hack lsp`
call ale#Set('hack_hack_executable', 'hh_client')
function! ale_linters#hack#hack#GetProjectRoot(buffer) abort
let l:hhconfig = ale#path#FindNearestFile(a:buffer, '.hhconfig')
return !empty(l:hhconfig) ? fnamemodify(l:hhconfig, ':h') : ''
endfunction
function! ale_linters#hack#hack#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'hack_hack_executable')
endfunction
call ale#linter#Define('hack', {
\ 'name': 'hack',
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#hack#hack#GetExecutable'),
\ 'command': '%e lsp --from vim-ale',
\ 'project_root': function('ale_linters#hack#hack#GetProjectRoot'),
\})
================================================
FILE: ale_linters/hack/hhast.vim
================================================
" Author: Fred Emmott
" Description: Hack support via `hhast lsp`
call ale#Set('hack_hhast_executable', 'vendor/bin/hhast-lint')
function! ale_linters#hack#hhast#GetProjectRoot(buffer) abort
" Find the hack root, then figure out if it's also an HHAST root.
" Don't try to use lint configurations from vendor/foo/bar/hhast-lint.json
let l:hhconfig = ale#path#FindNearestFile(a:buffer, '.hhconfig')
if empty(l:hhconfig)
return ''
endif
let l:root = fnamemodify(l:hhconfig, ':h')
let l:hhast_config = findfile('hhast-lint.json', l:root)
return !empty(l:hhast_config) ? l:root : ''
endfunction
function! ale_linters#hack#hhast#GetExecutable(buffer) abort
let l:root = ale_linters#hack#hhast#GetProjectRoot(a:buffer)
let l:relative = ale#Var(a:buffer, 'hack_hhast_executable')
let l:absolute = findfile(l:relative, l:root)
return !empty(l:absolute) ? l:absolute : ''
endfunction
function! ale_linters#hack#hhast#GetInitializationOptions(buffer) abort
return {'lintMode': 'open-files'}
endfunction
call ale#linter#Define('hack', {
\ 'name': 'hhast',
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#hack#hhast#GetExecutable'),
\ 'command': '%e --mode lsp --from vim-ale',
\ 'project_root': function('ale_linters#hack#hhast#GetProjectRoot'),
\ 'initialization_options': function('ale_linters#hack#hhast#GetInitializationOptions'),
\})
================================================
FILE: ale_linters/haml/hamllint.vim
================================================
" Author: Patrick Lewis - https://github.com/patricklewis, thenoseman - https://github.com/thenoseman
" Description: haml-lint for Haml files
call ale#Set('haml_hamllint_executable', 'haml-lint')
function! ale_linters#haml#hamllint#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'haml_hamllint_executable')
endfunction
function! ale_linters#haml#hamllint#GetCommand(buffer) abort
let l:prefix = ''
let l:rubocop_config_file_path = ale#path#FindNearestFile(a:buffer, '.rubocop.yml')
let l:hamllint_config_file_path = ale#path#FindNearestFile(a:buffer, '.haml-lint.yml')
" Set HAML_LINT_RUBOCOP_CONF variable as it is needed for haml-lint to
" pick up the rubocop config.
"
" See https://github.com/brigade/haml-lint/blob/master/lib/haml_lint/linter/rubocop.rb#L89
" HamlLint::Linter::RuboCop#rubocop_flags
if !empty(l:rubocop_config_file_path)
if has('win32')
let l:prefix = 'set HAML_LINT_RUBOCOP_CONF=' . ale#Escape(l:rubocop_config_file_path) . ' &&'
else
let l:prefix = 'HAML_LINT_RUBOCOP_CONF=' . ale#Escape(l:rubocop_config_file_path)
endif
endif
return (!empty(l:prefix) ? l:prefix . ' ' : '')
\ . ale_linters#haml#hamllint#GetExecutable(a:buffer)
\ . (!empty(l:hamllint_config_file_path) ? ' --config ' . ale#Escape(l:hamllint_config_file_path) : '')
\ . ' %t'
endfunction
function! ale_linters#haml#hamllint#Handle(buffer, lines) abort
" Matches patterns like the following:
" :51 [W] RuboCop: Use the new Ruby 1.9 hash syntax.
let l:pattern = '\v^.*:(\d+) \[([EW])\] (.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'type': l:match[2],
\ 'text': l:match[3]
\})
endfor
return l:output
endfunction
call ale#linter#Define('haml', {
\ 'name': 'hamllint',
\ 'executable': function('ale_linters#haml#hamllint#GetExecutable'),
\ 'command': function('ale_linters#haml#hamllint#GetCommand'),
\ 'callback': 'ale_linters#haml#hamllint#Handle'
\})
================================================
FILE: ale_linters/handlebars/djlint.vim
================================================
" Author: Adrian Vollmer
" Description: djlint for Django HTML template files
call ale#Set('html_djlint_executable', 'djlint')
call ale#Set('html_djlint_options', '')
call ale#linter#Define('handlebars', {
\ 'name': 'djlint',
\ 'executable': function('ale#handlers#djlint#GetExecutable'),
\ 'command': function('ale#handlers#djlint#GetCommand'),
\ 'callback': 'ale#handlers#djlint#Handle',
\})
================================================
FILE: ale_linters/handlebars/embertemplatelint.vim
================================================
" Author: Adrian Zalewski
" Description: Ember-template-lint for checking Handlebars files
scriptencoding utf-8
call ale#handlers#embertemplatelint#DefineLinter('handlebars')
================================================
FILE: ale_linters/haskell/cabal_ghc.vim
================================================
" Author: Eric Wolf
" Description: ghc for Haskell files called with cabal exec
call ale#Set('haskell_cabal_ghc_options', '-fno-code -v0')
function! ale_linters#haskell#cabal_ghc#GetCommand(buffer) abort
return 'cabal exec -- ghc '
\ . ale#Var(a:buffer, 'haskell_cabal_ghc_options')
\ . ' %t'
endfunction
call ale#linter#Define('haskell', {
\ 'name': 'cabal_ghc',
\ 'aliases': ['cabal-ghc'],
\ 'output_stream': 'stderr',
\ 'executable': 'cabal',
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#haskell#cabal_ghc#GetCommand'),
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
\})
================================================
FILE: ale_linters/haskell/cspell.vim
================================================
scriptencoding utf-8
" Author: David Houston
" Description: cspell support for Haskell files.
call ale#handlers#cspell#DefineLinter('haskell')
================================================
FILE: ale_linters/haskell/ghc.vim
================================================
" Author: w0rp
" Description: ghc for Haskell files
call ale#Set('haskell_ghc_options', '-fno-code -v0')
function! ale_linters#haskell#ghc#GetCommand(buffer) abort
return 'ghc '
\ . ale#Var(a:buffer, 'haskell_ghc_options')
\ . ' %t'
endfunction
call ale#linter#Define('haskell', {
\ 'name': 'ghc',
\ 'output_stream': 'stderr',
\ 'executable': 'ghc',
\ 'command': function('ale_linters#haskell#ghc#GetCommand'),
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
\})
================================================
FILE: ale_linters/haskell/ghc_mod.vim
================================================
" Author: wizzup
" Description: ghc-mod for Haskell files
call ale#Set('haskell_ghc_mod_executable', 'ghc-mod')
function! ale_linters#haskell#ghc_mod#GetCommand (buffer) abort
let l:executable = ale#Var(a:buffer, 'haskell_ghc_mod_executable')
return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'ghc-mod')
\ . ' --map-file %s=%t check %s'
endfunction
call ale#linter#Define('haskell', {
\ 'name': 'ghc_mod',
\ 'aliases': ['ghc-mod'],
\ 'executable': {b -> ale#Var(b, 'haskell_ghc_mod_executable')},
\ 'command': function('ale_linters#haskell#ghc_mod#GetCommand'),
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
\})
================================================
FILE: ale_linters/haskell/hdevtools.vim
================================================
" Author: rob-b, Takano Akio
" Description: hdevtools for Haskell files
call ale#Set('haskell_hdevtools_executable', 'hdevtools')
call ale#Set('haskell_hdevtools_options', get(g:, 'hdevtools_options', '-g -Wall'))
function! ale_linters#haskell#hdevtools#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'haskell_hdevtools_executable')
return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'hdevtools')
\ . ' check' . ale#Pad(ale#Var(a:buffer, 'haskell_hdevtools_options'))
\ . ' -p %s %t'
endfunction
call ale#linter#Define('haskell', {
\ 'name': 'hdevtools',
\ 'executable': {b -> ale#Var(b, 'haskell_hdevtools_executable')},
\ 'command': function('ale_linters#haskell#hdevtools#GetCommand'),
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
\})
================================================
FILE: ale_linters/haskell/hie.vim
================================================
" Author: Luxed
" Description: A language server for Haskell
call ale#Set('haskell_hie_executable', 'hie')
function! ale_linters#haskell#hie#GetProjectRoot(buffer) abort
" Search for the stack file first
let l:project_file = ale#path#FindNearestFile(a:buffer, 'stack.yaml')
" If it's empty, search for the cabal file
if empty(l:project_file)
" Search all of the paths except for the root filesystem path.
let l:paths = join(
\ ale#path#Upwards(expand('#' . a:buffer . ':p:h'))[:-2],
\ ','
\)
let l:project_file = globpath(l:paths, '*.cabal')
endif
" If we still can't find one, use the current file.
if empty(l:project_file)
let l:project_file = expand('#' . a:buffer . ':p')
endif
return fnamemodify(l:project_file, ':h')
endfunction
function! ale_linters#haskell#hie#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'haskell_hie_executable')
return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'hie')
\ . ' --lsp'
endfunction
call ale#linter#Define('haskell', {
\ 'name': 'hie',
\ 'lsp': 'stdio',
\ 'command': function('ale_linters#haskell#hie#GetCommand'),
\ 'executable': {b -> ale#Var(b, 'haskell_hie_executable')},
\ 'project_root': function('ale_linters#haskell#hie#GetProjectRoot'),
\})
================================================
FILE: ale_linters/haskell/hlint.vim
================================================
" Author: jparoz
" Description: hlint for Haskell files
call ale#Set('haskell_hlint_executable', 'hlint')
call ale#Set('haskell_hlint_options', get(g:, 'hlint_options', ''))
function! ale_linters#haskell#hlint#Handle(buffer, lines) abort
let l:output = []
for l:error in ale#util#FuzzyJSONDecode(a:lines, [])
if l:error.severity is# 'Error'
let l:type = 'E'
elseif l:error.severity is# 'Suggestion'
let l:type = 'I'
else
let l:type = 'W'
endif
call add(l:output, {
\ 'lnum': str2nr(l:error.startLine),
\ 'col': str2nr(l:error.startColumn),
\ 'end_lnum': str2nr(l:error.endLine),
\ 'end_col': str2nr(l:error.endColumn),
\ 'text': l:error.severity . ': ' . l:error.hint . '. Found: ' . l:error.from . ' Why not: ' . l:error.to,
\ 'type': l:type,
\})
endfor
return l:output
endfunction
function! ale_linters#haskell#hlint#GetCommand(buffer) abort
let l:hlintopts = '--color=never --json'
return ale#handlers#hlint#GetExecutable(a:buffer)
\ . ' ' . ale#Var(a:buffer, 'haskell_hlint_options')
\ . ' ' . l:hlintopts
\ . ' -'
endfunction
call ale#linter#Define('haskell', {
\ 'name': 'hlint',
\ 'executable': {b -> ale#Var(b, 'haskell_hlint_executable')},
\ 'command': function('ale_linters#haskell#hlint#GetCommand') ,
\ 'callback': 'ale_linters#haskell#hlint#Handle',
\})
================================================
FILE: ale_linters/haskell/hls.vim
================================================
" Author: Yen3
" Description: A language server for haskell
" The file is based on hie.vim (author: Luxed
" ). It search more project root files.
"
call ale#Set('haskell_hls_executable', 'haskell-language-server-wrapper')
call ale#Set('haskell_hls_config', {})
function! ale_linters#haskell#hls#FindRootFile(buffer) abort
let l:serach_root_files = [
\ 'stack.yaml',
\ 'cabal.project',
\ 'package.yaml',
\ 'hie.yaml'
\ ]
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
for l:root_file in l:serach_root_files
if filereadable(l:path . '/' . l:root_file)
" Add on / so fnamemodify(..., ':h') below keeps the path.
return l:path . '/'
endif
endfor
endfor
return ''
endfunction
function! ale_linters#haskell#hls#GetProjectRoot(buffer) abort
" Search for the project file first
let l:project_file = ale_linters#haskell#hls#FindRootFile(a:buffer)
" If it's empty, search for the cabal file
if empty(l:project_file)
" Search all of the paths except for the root filesystem path.
let l:paths = join(
\ ale#path#Upwards(expand('#' . a:buffer . ':p:h'))[:-2],
\ ','
\)
let l:project_file = globpath(l:paths, '*.cabal')
endif
" If we still can't find one, use the current file.
if empty(l:project_file)
let l:project_file = expand('#' . a:buffer . ':p')
endif
return fnamemodify(l:project_file, ':h')
endfunction
function! ale_linters#haskell#hls#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'haskell_hls_executable')
return ale#handlers#haskell_stack#EscapeExecutable(l:executable,
\ 'haskell-language-server-wrapper')
\ . ' --lsp'
endfunction
call ale#linter#Define('haskell', {
\ 'name': 'hls',
\ 'lsp': 'stdio',
\ 'command': function('ale_linters#haskell#hls#GetCommand'),
\ 'executable': {b -> ale#Var(b, 'haskell_hls_executable')},
\ 'project_root': function('ale_linters#haskell#hls#GetProjectRoot'),
\ 'lsp_config': {b -> ale#Var(b, 'haskell_hls_config')},
\})
================================================
FILE: ale_linters/haskell/stack_build.vim
================================================
" Author: Jake Zimmerman
" Description: Like stack-ghc, but for entire projects
"
" Note: Ideally, this would *only* typecheck. Right now, it also does codegen.
" See .
call ale#Set('haskell_stack_build_options', '--fast')
function! ale_linters#haskell#stack_build#GetCommand(buffer) abort
let l:flags = ale#Var(a:buffer, 'haskell_stack_build_options')
return 'stack build ' . l:flags
endfunction
call ale#linter#Define('haskell', {
\ 'name': 'stack_build',
\ 'aliases': ['stack-build'],
\ 'output_stream': 'stderr',
\ 'executable': function('ale#handlers#haskell#GetStackExecutable'),
\ 'command': function('ale_linters#haskell#stack_build#GetCommand'),
\ 'lint_file': 1,
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
\})
================================================
FILE: ale_linters/haskell/stack_ghc.vim
================================================
" Author: w0rp
" Description: ghc for Haskell files, using Stack
call ale#Set('haskell_stack_ghc_options', '-fno-code -v0')
function! ale_linters#haskell#stack_ghc#GetCommand(buffer) abort
return ale#handlers#haskell#GetStackExecutable(a:buffer)
\ . ' ghc -- '
\ . ale#Var(a:buffer, 'haskell_stack_ghc_options')
\ . ' %t'
endfunction
call ale#linter#Define('haskell', {
\ 'name': 'stack_ghc',
\ 'aliases': ['stack-ghc'],
\ 'output_stream': 'stderr',
\ 'executable': function('ale#handlers#haskell#GetStackExecutable'),
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#haskell#stack_ghc#GetCommand'),
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
\})
================================================
FILE: ale_linters/help/alex.vim
================================================
" Author: Johannes Wienke
" Description: alex for help files
call ale#handlers#alex#DefineLinter('help', '--text')
================================================
FILE: ale_linters/help/cspell.vim
================================================
scriptencoding utf-8
" Author: David Houston
" Description: cspell support for help files.
call ale#handlers#cspell#DefineLinter('help')
================================================
FILE: ale_linters/help/proselint.vim
================================================
" 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'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
\})
================================================
FILE: ale_linters/help/writegood.vim
================================================
" Author: Sumner Evans
" Description: write-good for vim Help files
call ale#handlers#writegood#DefineLinter('help')
================================================
FILE: ale_linters/html/alex.vim
================================================
" Author: Johannes Wienke
" Description: alex for HTML files
call ale#handlers#alex#DefineLinter('html', '--html')
================================================
FILE: ale_linters/html/angular.vim
================================================
" Author: w0rp
" Description: tsserver integration for ALE
call ale#Set('html_angular_executable', 'ngserver')
call ale#Set('html_angular_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#html#angular#GetProjectRoot(buffer) abort
return ale#path#Dirname(
\ ale#path#FindNearestDirectory(a:buffer, 'node_modules')
\)
endfunction
function! ale_linters#html#angular#GetExecutable(buffer) abort
return 'node'
endfunction
function! ale_linters#html#angular#GetCommand(buffer) abort
let l:language_service_dir = ale#path#Simplify(
\ ale#path#FindNearestDirectory(
\ a:buffer,
\ 'node_modules/@angular/language-service'
\ )
\)
if empty(l:language_service_dir)
return ''
endif
let l:language_service_dir = fnamemodify(l:language_service_dir, ':h')
let l:typescript_dir = ale#path#Simplify(
\ fnamemodify(l:language_service_dir, ':h:h')
\ . '/typescript'
\)
let l:script = ale#path#FindExecutable(a:buffer, 'html_angular', [
\ 'node_modules/@angular/language-server/bin/ngserver',
\ 'node_modules/@angular/language-server/index.js',
\])
if !filereadable(l:script)
return ''
endif
return ale#Escape('node') . ' ' . ale#Escape(l:script)
\ . ' --ngProbeLocations ' . ale#Escape(l:language_service_dir)
\ . ' --tsProbeLocations ' . ale#Escape(l:typescript_dir)
\ . ' --stdio'
endfunction
call ale#linter#Define('html', {
\ 'name': 'angular',
\ 'aliases': ['angular-language-server', 'angularls'],
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#html#angular#GetExecutable'),
\ 'command': function('ale_linters#html#angular#GetCommand'),
\ 'project_root': function('ale_linters#html#angular#GetProjectRoot'),
\})
================================================
FILE: ale_linters/html/cspell.vim
================================================
scriptencoding utf-8
" Author: David Houston
" Description: cspell support for HTML files.
call ale#handlers#cspell#DefineLinter('html')
================================================
FILE: ale_linters/html/djlint.vim
================================================
" Author: Vivian De Smedt
" Description: Adds support for djlint
call ale#Set('html_djlint_executable', 'djlint')
call ale#Set('html_djlint_options', '')
call ale#linter#Define('html', {
\ 'name': 'djlint',
\ 'executable': function('ale#handlers#djlint#GetExecutable'),
\ 'command': function('ale#handlers#djlint#GetCommand'),
\ 'callback': 'ale#handlers#djlint#Handle',
\})
" vim:ts=4:sw=4:et:
================================================
FILE: ale_linters/html/eslint.vim
================================================
" Author: Victor Ananyev
" Description: eslint for js snippets in HTML files
call ale#linter#Define('html', {
\ 'name': 'eslint',
\ 'output_stream': 'both',
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
\ 'cwd': function('ale#handlers#eslint#GetCwd'),
\ 'command': function('ale#handlers#eslint#GetCommand'),
\ 'callback': 'ale#handlers#eslint#HandleJSON',
\ })
================================================
FILE: ale_linters/html/fecs.vim
================================================
" Author: harttle
" Description: fecs for HTMl files
call ale#linter#Define('html', {
\ 'name': 'fecs',
\ 'executable': function('ale#handlers#fecs#GetExecutable'),
\ 'command': function('ale#handlers#fecs#GetCommand'),
\ 'callback': 'ale#handlers#fecs#Handle',
\})
================================================
FILE: ale_linters/html/htmlhint.vim
================================================
" Author: KabbAmine , deathmaz <00maz1987@gmail.com>, diartyz
" Description: HTMLHint for checking html files
call ale#Set('html_htmlhint_options', '')
call ale#Set('html_htmlhint_executable', 'htmlhint')
call ale#Set('html_htmlhint_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#html#htmlhint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'html_htmlhint_options')
let l:config = l:options !~# '--config'
\ ? ale#path#FindNearestFile(a:buffer, '.htmlhintrc')
\ : ''
if !empty(l:config)
let l:options .= ' --config ' . ale#Escape(l:config)
endif
if !empty(l:options)
let l:options = substitute(l:options, '--format=unix', '', '')
endif
return '%e' . ale#Pad(l:options) . ' --format=unix %t'
endfunction
call ale#linter#Define('html', {
\ 'name': 'htmlhint',
\ 'executable': {b -> ale#path#FindExecutable(b, 'html_htmlhint', [
\ 'node_modules/.bin/htmlhint',
\ ])},
\ 'command': function('ale_linters#html#htmlhint#GetCommand'),
\ 'callback': 'ale#handlers#unix#HandleAsError',
\})
================================================
FILE: ale_linters/html/proselint.vim
================================================
" 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'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
\})
================================================
FILE: ale_linters/html/stylelint.vim
================================================
" Author: Filipe Kiss http://github.com/filipekiss
call ale#Set('html_stylelint_executable', 'stylelint')
call ale#Set('html_stylelint_options', '')
call ale#Set('html_stylelint_use_global', 0)
function! ale_linters#html#stylelint#GetExecutable(buffer) abort
return ale#path#FindExecutable(a:buffer, 'html_stylelint', [
\ 'node_modules/.bin/stylelint',
\])
endfunction
function! ale_linters#html#stylelint#GetCommand(buffer) abort
let l:executable = ale_linters#html#stylelint#GetExecutable(a:buffer)
let l:options = ale#Var(a:buffer, 'html_stylelint_options')
return ale#Escape(l:executable)
\ . ale#Pad(l:options)
\ . ' --no-color --stdin-filename %s'
endfunction
call ale#linter#Define('html', {
\ 'name': 'stylelint',
\ 'output_stream': 'both',
\ 'executable': function('ale_linters#html#stylelint#GetExecutable'),
\ 'command': function('ale_linters#html#stylelint#GetCommand'),
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
\})
================================================
FILE: ale_linters/html/superhtml.vim
================================================
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',
\})
================================================
FILE: ale_linters/html/tidy.vim
================================================
" Author: KabbAmine
" Description: This file adds support for checking HTML code with tidy.
let g:ale_html_tidy_executable = get(g:, 'ale_html_tidy_executable', 'tidy')
let g:ale_html_tidy_options = get(g:, 'ale_html_tidy_options', '-q -e -language en')
function! ale_linters#html#tidy#GetCommand(buffer) abort
" Specify file encoding in options
" (Idea taken from https://github.com/scrooloose/syntastic/blob/master/syntax_checkers/html/tidy.vim)
let l:file_encoding = get({
\ 'ascii': '-ascii',
\ 'big5': '-big5',
\ 'cp1252': '-win1252',
\ 'cp850': '-ibm858',
\ 'cp932': '-shiftjis',
\ 'iso-2022-jp': '-iso-2022',
\ 'latin1': '-latin1',
\ 'macroman': '-mac',
\ 'sjis': '-shiftjis',
\ 'utf-16le': '-utf16le',
\ 'utf-16': '-utf16',
\ 'utf-8': '-utf8',
\ }, &fileencoding, '-utf8')
" On macOS, old tidy (released on 31 Oct 2006) is installed. It does not
" consider HTML5 so we should avoid it.
let l:executable = ale#Var(a:buffer, 'html_tidy_executable')
if has('mac') && l:executable is# 'tidy' && exists('*exepath')
\ && exepath(l:executable) is# '/usr/bin/tidy'
return ''
endif
return printf('%s %s %s -',
\ l:executable,
\ ale#Var(a:buffer, 'html_tidy_options'),
\ l:file_encoding
\)
endfunction
function! ale_linters#html#tidy#Handle(buffer, lines) abort
" Matches patterns lines like the following:
" line 7 column 5 - Warning: missing before
let l:pattern = '^line \(\d\+\) column \(\d\+\) - \(Warning\|Error\): \(.\+\)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:line = l:match[1] + 0
let l:col = l:match[2] + 0
let l:type = l:match[3] is# 'Error' ? 'E' : 'W'
let l:text = l:match[4]
call add(l:output, {
\ 'lnum': l:line,
\ 'col': l:col,
\ 'text': l:text,
\ 'type': l:type,
\})
endfor
return l:output
endfunction
call ale#linter#Define('html', {
\ 'name': 'tidy',
\ 'executable': {b -> ale#Var(b, 'html_tidy_executable')},
\ 'output_stream': 'stderr',
\ 'command': function('ale_linters#html#tidy#GetCommand'),
\ 'callback': 'ale_linters#html#tidy#Handle',
\ })
================================================
FILE: ale_linters/html/vscodehtml.vim
================================================
" Author: Dalius Dobravolskas
" Description: VSCode html language server
function! ale_linters#html#vscodehtml#GetProjectRoot(buffer) abort
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
endfunction
call ale#linter#Define('html', {
\ 'name': 'vscodehtml',
\ 'lsp': 'stdio',
\ 'executable': 'vscode-html-language-server',
\ 'command': '%e --stdio',
\ 'project_root': function('ale_linters#html#vscodehtml#GetProjectRoot'),
\})
================================================
FILE: ale_linters/html/writegood.vim
================================================
" Author: Sumner Evans
" Description: write-good for html files
call ale#handlers#writegood#DefineLinter('html')
================================================
FILE: ale_linters/htmlangular/djlint.vim
================================================
" Author: Adrian Vollmer
" Description: djlint for Django HTML template files
call ale#Set('html_djlint_executable', 'djlint')
call ale#Set('html_djlint_options', '')
call ale#linter#Define('htmlangular', {
\ 'name': 'djlint',
\ 'executable': function('ale#handlers#djlint#GetExecutable'),
\ 'command': function('ale#handlers#djlint#GetCommand'),
\ 'callback': 'ale#handlers#djlint#Handle',
\})
================================================
FILE: ale_linters/htmldjango/djlint.vim
================================================
" Author: Adrian Vollmer
" Description: djlint for Django HTML template files
call ale#Set('html_djlint_executable', 'djlint')
call ale#Set('html_djlint_options', '')
call ale#linter#Define('htmldjango', {
\ 'name': 'djlint',
\ 'executable': function('ale#handlers#djlint#GetExecutable'),
\ 'command': function('ale#handlers#djlint#GetCommand'),
\ 'callback': 'ale#handlers#djlint#Handle',
\})
================================================
FILE: ale_linters/hurl/hurlfmt.vim
================================================
" Description: Hurl linter using hurlfmt --check.
" https://hurl.dev/
call ale#Set('hurl_hurlfmt_executable', 'hurlfmt')
function! ale_linters#hurl#hurlfmt#GetCommand(buffer) abort
return '%e'
\ . ' --check --no-color '
endfunction
function! ale_linters#hurl#hurlfmt#HandleOutput(buffer, lines) abort
" Matches patterns:
"
" error: Parsing space
" --> test.hurl:11:48
" |
" 8 | header "Content-Type"= "application/json; charset=utf-8"
" | ^ expecting a space
" |
"
" error: Parsing URL
" --> test.hurl:11:48
" |
" 11 | PUT https://jsonplaceholder.typicode.com/posts/{post_id}}
" | ^ illegal character <{>
" |
"
" Note: hurlfmt seems to report always the first error only so we assume
" there is only one error to make parsing easier.
let l:output = []
if empty(a:lines)
return l:output
endif
let l:pattern = '\v(error|warning): (.+) --\> (.+):(\d+):(\d+) .+ \^ (.+) |'
let l:lines = join(a:lines, ' ')
for l:match in ale#util#GetMatches(l:lines, l:pattern)
call add(l:output, {
\ 'bufnr': a:buffer,
\ 'lnum': match[4] + 0,
\ 'col': match[5] + 0,
\ 'end_col': match[5] + 0,
\ 'text': match[2] . ' : ' . match[6],
\ 'type': (match[1] is# 'error') ? 'E' : 'W'
\})
endfor
return l:output
endfunction
function! ale_linters#hurl#hurlfmt#GetType(severity) abort
if a:severity is? 'convention'
\|| a:severity is? 'warning'
\|| a:severity is? 'refactor'
return 'W'
endif
return 'E'
endfunction
call ale#linter#Define('hurl', {
\ 'name': 'hurlfmt',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'hurl_hurlfmt_executable')},
\ 'command': function('ale_linters#hurl#hurlfmt#GetCommand'),
\ 'callback': 'ale_linters#hurl#hurlfmt#HandleOutput',
\})
================================================
FILE: ale_linters/idris/idris.vim
================================================
" Author: Scott Bonds
" Description: default Idris compiler
call ale#Set('idris_idris_executable', 'idris')
call ale#Set('idris_idris_options', '--total --warnpartial --warnreach --warnipkg')
function! ale_linters#idris#idris#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'idris_idris_options')
return '%e' . ale#Pad(l:options) . ' --check %s'
endfunction
function! ale_linters#idris#idris#Handle(buffer, lines) abort
" This was copied almost verbatim from ale#handlers#haskell#HandleGHCFormat
"
" Look for lines like the following:
" foo.idr:2:6:When checking right hand side of main with expected type
" bar.idr:11:11-13:
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+)(-\d+)?:(.*)?$'
let l:output = []
let l:corrected_lines = []
for l:line in a:lines
if len(matchlist(l:line, l:pattern)) > 0
call add(l:corrected_lines, l:line)
elseif len(l:corrected_lines) > 0
if l:line is# ''
let l:corrected_lines[-1] .= ' ' " turn a blank line into a space
else
let l:corrected_lines[-1] .= l:line
endif
let l:corrected_lines[-1] = substitute(l:corrected_lines[-1], '\s\+', ' ', 'g')
endif
endfor
for l:line in l:corrected_lines
let l:match = matchlist(l:line, l:pattern)
if len(l:match) == 0
continue
endif
if !ale#path#IsBufferPath(a:buffer, l:match[1])
continue
endif
let l:errors = matchlist(l:match[5], '\v([wW]arning|[eE]rror) - ?(.*)')
if len(l:errors) > 0
let l:ghc_type = l:errors[1]
let l:text = l:errors[2]
else
let l:ghc_type = ''
let l:text = l:match[5][:0] is# ' ' ? l:match[5][1:] : l:match[5]
endif
if l:ghc_type is? 'Warning'
let l:type = 'W'
else
let l:type = 'E'
endif
call add(l:output, {
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'text': l:text,
\ 'type': l:type,
\})
endfor
return l:output
endfunction
call ale#linter#Define('idris', {
\ 'name': 'idris',
\ 'executable': {b -> ale#Var(b, 'idris_idris_executable')},
\ 'command': function('ale_linters#idris#idris#GetCommand'),
\ 'callback': 'ale_linters#idris#idris#Handle',
\})
================================================
FILE: ale_linters/ink/ls.vim
================================================
" Author: Andreww Hayworth
" Description: Integrate ALE with ink-language-server
call ale#Set('ink_ls_executable', 'ink-language-server')
call ale#Set('ink_ls_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('ink_ls_initialization_options', {})
function! ale_linters#ink#ls#GetExecutable(buffer) abort
return ale#path#FindExecutable(a:buffer, 'ink_ls', [
\ 'ink-language-server',
\ 'node_modules/.bin/ink-language-server',
\])
endfunction
function! ale_linters#ink#ls#GetCommand(buffer) abort
let l:executable = ale_linters#ink#ls#GetExecutable(a:buffer)
return ale#Escape(l:executable) . ' --stdio'
endfunction
function! ale_linters#ink#ls#FindProjectRoot(buffer) abort
let l:main_file = get(ale#Var(a:buffer, 'ink_ls_initialization_options'), 'mainStoryPath', 'main.ink')
let l:config = ale#path#ResolveLocalPath(a:buffer, l:main_file, expand('#' . a:buffer . ':p'))
return ale#path#Dirname(l:config)
endfunction
call ale#linter#Define('ink', {
\ 'name': 'ink-language-server',
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#ink#ls#GetExecutable'),
\ 'command': function('ale_linters#ink#ls#GetCommand'),
\ 'project_root': function('ale_linters#ink#ls#FindProjectRoot'),
\ 'initialization_options': {b -> ale#Var(b, 'ink_ls_initialization_options')},
\})
================================================
FILE: ale_linters/inko/inko.vim
================================================
" Author: Yorick Peterse
" Description: linting of Inko source code using the Inko compiler
call ale#Set('inko_inko_executable', 'inko')
function! ale_linters#inko#inko#GetCommand(buffer) abort
let l:include = ''
" Include the tests source directory, but only for test files.
if expand('#' . a:buffer . ':p') =~? '\vtests[/\\]test[/\\]'
let l:test_dir = ale#path#FindNearestDirectory(a:buffer, 'tests')
if isdirectory(l:test_dir)
let l:include = '--include ' . ale#Escape(l:test_dir)
endif
endif
" We use %s instead of %t so the compiler determines the correct module
" names for the file being edited. Not doing so may lead to errors in
" certain cases.
return '%e build --check --format=json'
\ . ale#Pad(l:include)
\ . ' %s'
endfunction
call ale#linter#Define('inko', {
\ 'name': 'inko',
\ 'executable': {b -> ale#Var(b, 'inko_inko_executable')},
\ 'command': function('ale_linters#inko#inko#GetCommand'),
\ 'callback': 'ale#handlers#inko#Handle',
\ 'output_stream': 'stderr',
\ 'lint_file': 1
\})
================================================
FILE: ale_linters/ispc/ispc.vim
================================================
" Author: Martino Pilia
" Description: Lint ispc files with the Intel(R) SPMD Program Compiler
call ale#Set('ispc_ispc_executable', 'ispc')
call ale#Set('ispc_ispc_options', '')
function! ale_linters#ispc#ispc#GetCommand(buffer) abort
" --nowrap: do not wrap message lines
return '%e --nowrap'
\ . ale#Pad(ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer)))
\ . ale#Pad(ale#Var(a:buffer, 'ispc_ispc_options'))
\ . ' %s'
endfunction
" Note that we ignore the two warnings in the beginning of the compiler output
" ('no output file specified' and 'no --target specified'), since they have
" nothing to do with linting.
function! ale_linters#ispc#ispc#Handle(buffer, lines) abort
" Message format: :: :
" As far as I know, can be any of:
" 'error', 'Error', 'fatal error', 'Warning', 'Performance Warning'
let l:re = '\v.+:([0-9]+):([0-9]+):\s+([^:]+):\s+(.+)'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:re)
call add(l:output, {
\ 'bufnr': a:buffer,
\ 'lnum': str2nr(l:match[1]),
\ 'col': str2nr(l:match[2]),
\ 'type': l:match[3] =~? 'error' ? 'E' : 'W',
\ 'text': l:match[4],
\})
endfor
return l:output
endfunction
call ale#linter#Define('ispc', {
\ 'name': 'ispc',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'ispc_ispc_executable')},
\ 'command': function('ale_linters#ispc#ispc#GetCommand'),
\ 'callback': 'ale_linters#ispc#ispc#Handle',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/java/checkstyle.vim
================================================
" Author: Devon Meunier
" Description: checkstyle for Java files
call ale#Set('java_checkstyle_executable', 'checkstyle')
call ale#Set('java_checkstyle_config', '/google_checks.xml')
call ale#Set('java_checkstyle_options', '')
function! ale_linters#java#checkstyle#Handle(buffer, lines) abort
let l:output = []
" modern checkstyle versions
let l:pattern = '\v\[(WARN|ERROR)\] [a-zA-Z]?:?[^:]+:(\d+):(\d+)?:? (.*) \[(.+)\]'
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'type': l:match[1] is? 'WARN' ? 'W' : 'E',
\ 'sub_type': 'style',
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'text': l:match[4],
\ 'code': l:match[5],
\})
endfor
if !empty(l:output)
return l:output
endif
" old checkstyle versions
let l:pattern = '\v(.+):(\d+): ([^:]+): (.+)$'
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'type': l:match[3] is? 'warning' ? 'W' : 'E',
\ 'sub_type': 'style',
\ 'lnum': l:match[2] + 0,
\ 'text': l:match[4],
\})
endfor
return l:output
endfunction
function! s:GetConfig(buffer, config) abort
if ale#path#IsAbsolute(a:config)
return a:config
endif
let s:file = ale#path#FindNearestFile(a:buffer, a:config)
return !empty(s:file) ? s:file : a:config
endfunction
function! ale_linters#java#checkstyle#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'java_checkstyle_options')
let l:config_option = ale#Var(a:buffer, 'java_checkstyle_config')
let l:config = l:options !~# '\v(^| )-c ' && !empty(l:config_option)
\ ? s:GetConfig(a:buffer, l:config_option)
\ : ''
return '%e'
\ . ale#Pad(l:options)
\ . (!empty(l:config) ? ' -c ' . ale#Escape(l:config) : '')
\ . ' %s'
endfunction
call ale#linter#Define('java', {
\ 'name': 'checkstyle',
\ 'executable': {b -> ale#Var(b, 'java_checkstyle_executable')},
\ 'command': function('ale_linters#java#checkstyle#GetCommand'),
\ 'callback': 'ale_linters#java#checkstyle#Handle',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/java/cspell.vim
================================================
scriptencoding utf-8
" Author: David Houston
" Description: cspell support for Java files.
call ale#handlers#cspell#DefineLinter('java')
================================================
FILE: ale_linters/java/eclipselsp.vim
================================================
" Author: Horacio Sanson
" Description: Support for the Eclipse language server https://github.com/eclipse/eclipse.jdt.ls
let s:version_cache = {}
call ale#Set('java_eclipselsp_path', ale#path#Simplify($HOME . '/eclipse.jdt.ls'))
call ale#Set('java_eclipselsp_config_path', '')
call ale#Set('java_eclipselsp_workspace_path', '')
call ale#Set('java_eclipselsp_executable', 'java')
call ale#Set('java_eclipselsp_javaagent', '')
function! ale_linters#java#eclipselsp#Executable(buffer) abort
return ale#Var(a:buffer, 'java_eclipselsp_executable')
endfunction
function! ale_linters#java#eclipselsp#TargetPath(buffer) abort
return ale#Var(a:buffer, 'java_eclipselsp_path')
endfunction
function! ale_linters#java#eclipselsp#JarPath(buffer) abort
let l:path = ale_linters#java#eclipselsp#TargetPath(a:buffer)
if has('win32')
let l:platform = 'win32'
elseif has('macunix')
let l:platform = 'macosx'
else
let l:platform = 'linux'
endif
" Search jar file within repository path when manually built using mvn
let l:files = globpath(l:path, '**/'.l:platform.'/**/plugins/org.eclipse.equinox.launcher_*\.jar', 1, 1)
if len(l:files) >= 1
return l:files[0]
endif
" Search jar file within VSCode extensions folder.
let l:files = globpath(l:path, '**/'.l:platform.'/plugins/org.eclipse.equinox.launcher_*\.jar', 1, 1)
if len(l:files) >= 1
return l:files[0]
endif
" Search jar file within unzipped tar.gz file
let l:files = globpath(l:path, 'plugins/org.eclipse.equinox.launcher_*\.jar', 1, 1)
if len(l:files) >= 1
return l:files[0]
endif
" Search jar file within system package path
let l:files = globpath('/usr/share/java/jdtls/plugins', 'org.eclipse.equinox.launcher_*\.jar', 1, 1)
if len(l:files) >= 1
return l:files[0]
endif
return ''
endfunction
function! ale_linters#java#eclipselsp#ConfigurationPath(buffer) abort
let l:path = fnamemodify(ale_linters#java#eclipselsp#JarPath(a:buffer), ':p:h:h')
let l:config_path = ale#Var(a:buffer, 'java_eclipselsp_config_path')
if !empty(l:config_path)
return ale#path#Simplify(l:config_path)
endif
if has('win32')
let l:path = l:path . '/config_win'
elseif has('macunix')
let l:path = l:path . '/config_mac'
else
let l:path = l:path . '/config_linux'
endif
return ale#path#Simplify(l:path)
endfunction
function! ale_linters#java#eclipselsp#VersionCheck(version_lines) abort
return s:GetVersion('', a:version_lines)
endfunction
function! s:GetVersion(executable, version_lines) abort
let l:version = []
for l:line in a:version_lines
let l:match = matchlist(l:line, '\(\d\+\)\.\(\d\+\)\.\(\d\+\)')
if !empty(l:match)
let l:version = [l:match[1] + 0, l:match[2] + 0, l:match[3] + 0]
let s:version_cache[a:executable] = l:version
break
endif
endfor
return l:version
endfunction
function! ale_linters#java#eclipselsp#CommandWithVersion(buffer, version_lines, meta) abort
let l:executable = ale_linters#java#eclipselsp#Executable(a:buffer)
let l:version = s:GetVersion(l:executable, a:version_lines)
return ale_linters#java#eclipselsp#Command(a:buffer, l:version)
endfunction
function! ale_linters#java#eclipselsp#WorkspacePath(buffer) abort
let l:wspath = ale#Var(a:buffer, 'java_eclipselsp_workspace_path')
if !empty(l:wspath)
return l:wspath
endif
return ale#path#Dirname(ale#java#FindProjectRoot(a:buffer))
endfunction
function! ale_linters#java#eclipselsp#Javaagent(buffer) abort
let l:rets = []
let l:raw = ale#Var(a:buffer, 'java_eclipselsp_javaagent')
if empty(l:raw)
return ''
endif
let l:jars = split(l:raw)
for l:jar in l:jars
call add(l:rets, ale#Escape('-javaagent:' . l:jar))
endfor
return join(l:rets, ' ')
endfunction
function! ale_linters#java#eclipselsp#Command(buffer, version) abort
let l:path = ale#Var(a:buffer, 'java_eclipselsp_path')
let l:executable = ale_linters#java#eclipselsp#Executable(a:buffer)
let l:cmd = [ ale#Escape(l:executable),
\ ale_linters#java#eclipselsp#Javaagent(a:buffer),
\ '-Declipse.application=org.eclipse.jdt.ls.core.id1',
\ '-Dosgi.bundles.defaultStartLevel=4',
\ '-Declipse.product=org.eclipse.jdt.ls.core.product',
\ '-Dlog.level=ALL',
\ '-noverify',
\ '-Xmx1G',
\ '-jar',
\ ale#Escape(ale_linters#java#eclipselsp#JarPath(a:buffer)),
\ '-configuration',
\ ale#Escape(ale_linters#java#eclipselsp#ConfigurationPath(a:buffer)),
\ '-data',
\ ale#Escape(ale_linters#java#eclipselsp#WorkspacePath(a:buffer))
\ ]
if ale#semver#GTE(a:version, [1, 9])
call add(l:cmd, '--add-modules=ALL-SYSTEM')
call add(l:cmd, '--add-opens java.base/java.util=ALL-UNNAMED')
call add(l:cmd, '--add-opens java.base/java.lang=ALL-UNNAMED')
endif
return join(l:cmd, ' ')
endfunction
function! ale_linters#java#eclipselsp#RunWithVersionCheck(buffer) abort
let l:executable = ale_linters#java#eclipselsp#Executable(a:buffer)
if empty(l:executable)
return ''
endif
let l:cache = s:version_cache
if has_key(s:version_cache, l:executable)
return ale_linters#java#eclipselsp#Command(a:buffer, s:version_cache[l:executable])
endif
let l:command = ale#Escape(l:executable) . ' -version'
return ale#command#Run(
\ a:buffer,
\ l:command,
\ function('ale_linters#java#eclipselsp#CommandWithVersion'),
\ { 'output_stream': 'both' }
\)
endfunction
call ale#linter#Define('java', {
\ 'name': 'eclipselsp',
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#java#eclipselsp#Executable'),
\ 'command': function('ale_linters#java#eclipselsp#RunWithVersionCheck'),
\ 'language': 'java',
\ 'project_root': function('ale#java#FindProjectRoot'),
\ 'initialization_options': {
\ 'extendedClientCapabilities': {
\ 'classFileContentsSupport': v:true
\ }
\ }
\})
================================================
FILE: ale_linters/java/javac.vim
================================================
" Author: farenjihn , w0rp
" Description: Lints java files using javac
let s:classpath_sep = has('unix') ? ':' : ';'
call ale#Set('java_javac_executable', 'javac')
call ale#Set('java_javac_options', '')
call ale#Set('java_javac_classpath', '')
call ale#Set('java_javac_sourcepath', '')
function! ale_linters#java#javac#RunWithImportPaths(buffer) abort
let [l:cwd, l:command] = ale#maven#BuildClasspathCommand(a:buffer)
" Try to use Gradle if Maven isn't available.
if empty(l:command)
let [l:cwd, l:command] = ale#gradle#BuildClasspathCommand(a:buffer)
endif
" Try to use Ant if Gradle and Maven aren't available
if empty(l:command)
let [l:cwd, l:command] = ale#ant#BuildClasspathCommand(a:buffer)
endif
if empty(l:command)
return ale_linters#java#javac#GetCommand(a:buffer, [], {})
endif
return ale#command#Run(
\ a:buffer,
\ l:command,
\ function('ale_linters#java#javac#GetCommand'),
\ {'cwd': l:cwd},
\)
endfunction
function! s:BuildClassPathOption(buffer, import_paths) abort
" Filter out lines like [INFO], etc.
let l:class_paths = filter(a:import_paths[:], 'v:val !~# ''[''')
let l:cls_path = ale#Var(a:buffer, 'java_javac_classpath')
if !empty(l:cls_path) && type(l:cls_path) is v:t_string
call extend(l:class_paths, split(l:cls_path, s:classpath_sep))
endif
if !empty(l:cls_path) && type(l:cls_path) is v:t_list
call extend(l:class_paths, l:cls_path)
endif
return !empty(l:class_paths)
\ ? '-cp ' . ale#Escape(join(l:class_paths, s:classpath_sep))
\ : ''
endfunction
function! ale_linters#java#javac#GetCommand(buffer, import_paths, meta) abort
let l:cp_option = s:BuildClassPathOption(a:buffer, a:import_paths)
let l:sp_option = ''
" Find the src directory, for files in this project.
let l:src_dir = ale#path#FindNearestDirectory(a:buffer, 'src/main/java')
let l:sp_dirs = []
if !empty(l:src_dir)
call add(l:sp_dirs, l:src_dir)
" Automatically include the jaxb directory too, if it's there.
let l:jaxb_dir = fnamemodify(l:src_dir, ':h:h')
\ . (has('win32') ? '\jaxb\' : '/jaxb/')
if isdirectory(l:jaxb_dir)
call add(l:sp_dirs, l:jaxb_dir)
endif
endif
" Automatically include the test directory, but only for test code.
if expand('#' . a:buffer . ':p') =~? '\vsrc[/\\]test[/\\]java'
let l:test_dir = ale#path#FindNearestDirectory(a:buffer, 'src/test/java')
if isdirectory(l:test_dir)
call add(l:sp_dirs, l:test_dir)
endif
endif
let l:source_paths = []
let l:source_path = ale#Var(a:buffer, 'java_javac_sourcepath')
if !empty(l:source_path) && type(l:source_path) is v:t_string
let l:source_paths = split(l:source_path, s:classpath_sep)
endif
if !empty(l:source_path) && type(l:source_path) is v:t_list
let l:source_paths = l:source_path
endif
if !empty(l:source_paths)
for l:path in l:source_paths
let l:sp_path = ale#path#FindNearestDirectory(a:buffer, l:path)
if !empty(l:sp_path)
call add(l:sp_dirs, l:sp_path)
endif
endfor
endif
if !empty(l:sp_dirs)
let l:sp_option = '-sourcepath '
\ . ale#Escape(join(l:sp_dirs, s:classpath_sep))
endif
" Create .class files in a temporary directory, which we will delete later.
let l:class_file_directory = ale#command#CreateDirectory(a:buffer)
" Always run javac from the directory the file is in, so we can resolve
" relative paths correctly.
return '%e -Xlint'
\ . ale#Pad(l:cp_option)
\ . ale#Pad(l:sp_option)
\ . ' -d ' . ale#Escape(l:class_file_directory)
\ . ale#Pad(ale#Var(a:buffer, 'java_javac_options'))
\ . ' %t'
endfunction
function! ale_linters#java#javac#Handle(buffer, lines) abort
" Look for lines like the following.
"
" Main.java:13: warning: [deprecation] donaught() in Testclass has been deprecated
" Main.java:16: error: ';' expected
let l:directory = expand('#' . a:buffer . ':p:h')
let l:pattern = '\v^(.*):(\d+): (.{-1,}):(.+)$'
let l:col_pattern = '\v^(\s*\^)$'
let l:symbol_pattern = '\v^ +symbol: *(class|method) +([^ ]+)'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, [l:pattern, l:col_pattern, l:symbol_pattern])
if empty(l:match[2]) && empty(l:match[3])
if !empty(l:match[1]) && !empty(l:output)
let l:output[-1].col = len(l:match[1])
endif
elseif empty(l:match[3])
" Add symbols to 'cannot find symbol' errors.
if l:output[-1].text is# 'error: cannot find symbol'
let l:output[-1].text .= ': ' . l:match[2]
endif
else
call add(l:output, {
\ 'filename': ale#path#GetAbsPath(l:directory, l:match[1]),
\ 'lnum': l:match[2] + 0,
\ 'text': l:match[3] . ':' . l:match[4],
\ 'type': l:match[3] is# 'error' ? 'E' : 'W',
\})
endif
endfor
return l:output
endfunction
call ale#linter#Define('java', {
\ 'name': 'javac',
\ 'executable': {b -> ale#Var(b, 'java_javac_executable')},
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#java#javac#RunWithImportPaths'),
\ 'output_stream': 'stderr',
\ 'callback': 'ale_linters#java#javac#Handle',
\})
================================================
FILE: ale_linters/java/javalsp.vim
================================================
" Author: Horacio Sanson
" Description: Support for the Java language server https://github.com/georgewfraser/vscode-javac
call ale#Set('java_javalsp_executable', '')
call ale#Set('java_javalsp_config', {})
function! ale_linters#java#javalsp#Executable(buffer) abort
return ale#Var(a:buffer, 'java_javalsp_executable')
endfunction
function! ale_linters#java#javalsp#Config(buffer) abort
let l:defaults = { 'java': { 'classPath': [], 'externalDependencies': [] } }
let l:config = ale#Var(a:buffer, 'java_javalsp_config')
" Ensure the config dictionary contains both classPath and
" externalDependencies keys to avoid a NPE crash on Java Language Server.
call extend(l:config, l:defaults, 'keep')
call extend(l:config['java'], l:defaults['java'], 'keep')
return l:config
endfunction
function! ale_linters#java#javalsp#Command(buffer) abort
let l:executable = ale_linters#java#javalsp#Executable(a:buffer)
if fnamemodify(l:executable, ':t') is# 'java'
" For backward compatibility.
let l:cmd = [
\ ale#Escape(l:executable),
\ '--add-exports jdk.compiler/com.sun.tools.javac.api=javacs',
\ '--add-exports jdk.compiler/com.sun.tools.javac.code=javacs',
\ '--add-exports jdk.compiler/com.sun.tools.javac.comp=javacs',
\ '--add-exports jdk.compiler/com.sun.tools.javac.main=javacs',
\ '--add-exports jdk.compiler/com.sun.tools.javac.tree=javacs',
\ '--add-exports jdk.compiler/com.sun.tools.javac.model=javacs',
\ '--add-exports jdk.compiler/com.sun.tools.javac.util=javacs',
\ '--add-opens jdk.compiler/com.sun.tools.javac.api=javacs',
\ '-m javacs/org.javacs.Main',
\]
return join(l:cmd, ' ')
else
return ale#Escape(l:executable)
endif
endfunction
call ale#linter#Define('java', {
\ 'name': 'javalsp',
\ 'aliases': ['java_language_server'],
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#java#javalsp#Executable'),
\ 'command': function('ale_linters#java#javalsp#Command'),
\ 'language': 'java',
\ 'project_root': function('ale#java#FindProjectRoot'),
\ 'lsp_config': function('ale_linters#java#javalsp#Config')
\})
================================================
FILE: ale_linters/java/pmd.vim
================================================
" Author: Johannes Wienke
" Description: PMD for Java files
function! ale_linters#java#pmd#Handle(buffer, lines) abort
let l:pattern = '"\(\d\+\)",".*","\(.\+\)","\(\d\+\)","\(\d\+\)","\(.\+\)","\(.\+\)","\(.\+\)"$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'type': 'W',
\ 'lnum': l:match[4] + 0,
\ 'text': l:match[5],
\ 'code': l:match[6] . ' - ' . l:match[7],
\})
endfor
return l:output
endfunction
function! ale_linters#java#pmd#GetCommand(buffer) abort
return 'pmd '
\ . ale#Var(a:buffer, 'java_pmd_options')
\ . ' -f csv'
\ . ' -d %t'
endfunction
if !exists('g:ale_java_pmd_options')
let g:ale_java_pmd_options = '-R category/java/bestpractices.xml'
endif
call ale#linter#Define('java', {
\ 'name': 'pmd',
\ 'executable': 'pmd',
\ 'command': function('ale_linters#java#pmd#GetCommand'),
\ 'callback': 'ale_linters#java#pmd#Handle',
\})
================================================
FILE: ale_linters/javascript/biome.vim
================================================
" Author: Filip Gospodinov
" Description: biome for JavaScript files
call ale#linter#Define('javascript', {
\ 'name': 'biome',
\ 'lsp': 'stdio',
\ 'language': function('ale#handlers#biome#GetLanguage'),
\ 'executable': function('ale#handlers#biome#GetExecutable'),
\ 'command': '%e lsp-proxy',
\ 'project_root': function('ale#handlers#biome#GetProjectRoot'),
\})
================================================
FILE: ale_linters/javascript/cspell.vim
================================================
scriptencoding utf-8
" Author: David Houston
" Description: cspell support for JavaScript files.
call ale#handlers#cspell#DefineLinter('javascript')
================================================
FILE: ale_linters/javascript/deno.vim
================================================
" Author: Arnold Chand
" Description: Deno lsp linter for JavaScript files.
call ale#linter#Define('javascript', {
\ 'name': 'deno',
\ 'lsp': 'stdio',
\ 'executable': function('ale#handlers#deno#GetExecutable'),
\ 'command': '%e lsp',
\ 'project_root': function('ale#handlers#deno#GetProjectRoot'),
\ 'initialization_options': function('ale#handlers#deno#GetInitializationOptions'),
\})
================================================
FILE: ale_linters/javascript/eslint.vim
================================================
" Author: w0rp
" Description: eslint for JavaScript files
call ale#linter#Define('javascript', {
\ 'name': 'eslint',
\ 'output_stream': 'both',
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
\ 'cwd': function('ale#handlers#eslint#GetCwd'),
\ 'command': function('ale#handlers#eslint#GetCommand'),
\ 'callback': 'ale#handlers#eslint#HandleJSON',
\})
================================================
FILE: ale_linters/javascript/fecs.vim
================================================
" Author: harttle
" Description: fecs for JavaScript files
call ale#linter#Define('javascript', {
\ 'name': 'fecs',
\ 'executable': function('ale#handlers#fecs#GetExecutable'),
\ 'command': function('ale#handlers#fecs#GetCommand'),
\ 'read_buffer': 0,
\ 'callback': 'ale#handlers#fecs#Handle',
\})
================================================
FILE: ale_linters/javascript/flow.vim
================================================
" Author: Zach Perrault -- @zperrault
" Author: Florian Beeres
" Description: FlowType checking for JavaScript files
call ale#Set('javascript_flow_executable', 'flow')
call ale#Set('javascript_flow_use_home_config', 0)
call ale#Set('javascript_flow_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('javascript_flow_use_respect_pragma', 1)
function! ale_linters#javascript#flow#GetExecutable(buffer) abort
let l:flow_config = ale#path#FindNearestFile(a:buffer, '.flowconfig')
if empty(l:flow_config)
" Don't run Flow if we can't find a .flowconfig file.
return ''
endif
" Don't run Flow with a configuration file from the home directory by
" default, which can eat all of your RAM.
if fnamemodify(l:flow_config, ':h') is? $HOME
\&& !ale#Var(a:buffer, 'javascript_flow_use_home_config')
return ''
endif
return ale#path#FindExecutable(a:buffer, 'javascript_flow', [
\ 'node_modules/.bin/flow',
\])
endfunction
function! ale_linters#javascript#flow#GetCommand(buffer, version) abort
" If we can parse the version number, then only use --respect-pragma
" if the version is >= 0.36.0, which added the argument.
let l:use_respect_pragma = ale#Var(a:buffer, 'javascript_flow_use_respect_pragma')
\ && (empty(a:version) || ale#semver#GTE(a:version, [0, 36]))
return '%e check-contents'
\ . (l:use_respect_pragma ? ' --respect-pragma': '')
\ . ' --json --from ale %s < %t'
\ . (!has('win32') ? '; echo' : '')
endfunction
" Filter lines of flow output until we find the first line where the JSON
" output starts.
function! s:GetJSONLines(lines) abort
let l:start_index = 0
for l:line in a:lines
if l:line[:0] is# '{'
break
endif
let l:start_index += 1
endfor
return a:lines[l:start_index :]
endfunction
function! s:ExtraErrorMsg(current, new) abort
let l:newMsg = ''
if a:current is# ''
" extra messages appear to already have a :
let l:newMsg = a:new
else
let l:newMsg = a:current . ' ' . a:new
endif
return l:newMsg
endfunction
function! s:GetDetails(error) abort
let l:detail = ''
for l:extra_error in a:error.extra
if has_key(l:extra_error, 'message')
for l:extra_message in l:extra_error.message
let l:detail = s:ExtraErrorMsg(l:detail, l:extra_message.descr)
endfor
endif
if has_key(l:extra_error, 'children')
for l:child in l:extra_error.children
for l:child_message in l:child.message
let l:detail = l:detail . ' ' . l:child_message.descr
endfor
endfor
endif
endfor
return l:detail
endfunction
function! ale_linters#javascript#flow#Handle(buffer, lines) abort
let l:str = join(s:GetJSONLines(a:lines), '')
if empty(l:str)
return []
endif
let l:flow_output = json_decode(l:str)
let l:output = []
for l:error in get(l:flow_output, 'errors', [])
" Each error is broken up into parts
let l:text = ''
let l:line = 0
let l:col = 0
for l:message in l:error.message
" Comments have no line of column information, so we skip them.
" In certain cases, `l:message.loc.source` points to a different path
" than the buffer one, thus we skip this loc information too.
if has_key(l:message, 'loc')
\&& l:line is# 0
\&& ale#path#IsBufferPath(a:buffer, l:message.loc.source)
let l:line = l:message.loc.start.line + 0
let l:col = l:message.loc.start.column + 0
endif
if l:text is# ''
let l:text = l:message.descr . ':'
else
let l:text = l:text . ' ' . l:message.descr
endif
endfor
if has_key(l:error, 'operation')
let l:text = l:text . ' See also: ' . l:error.operation.descr
endif
let l:errorToAdd = {
\ 'lnum': l:line,
\ 'col': l:col,
\ 'text': l:text,
\ 'type': has_key(l:error, 'level') && l:error.level is# 'error' ? 'E' : 'W',
\}
if has_key(l:error, 'extra')
let l:errorToAdd.detail = l:errorToAdd.text
\ . "\n" . s:GetDetails(l:error)
endif
call add(l:output, l:errorToAdd)
endfor
return l:output
endfunction
call ale#linter#Define('javascript', {
\ 'name': 'flow',
\ 'executable': function('ale_linters#javascript#flow#GetExecutable'),
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
\ buffer,
\ ale_linters#javascript#flow#GetExecutable(buffer),
\ '%e --version',
\ function('ale_linters#javascript#flow#GetCommand'),
\ )},
\ 'callback': 'ale_linters#javascript#flow#Handle',
\ 'read_buffer': 0,
\})
================================================
FILE: ale_linters/javascript/flow_ls.vim
================================================
" Author: t_t
" Description: Integrate ALE with flow-language-server.
call ale#Set('javascript_flow_ls_executable', 'flow')
call ale#Set('javascript_flow_ls_use_global',
\ get(g:, 'ale_use_global_executables', 0)
\)
function! ale_linters#javascript#flow_ls#FindProjectRoot(buffer) abort
let l:flow_config = ale#path#FindNearestFile(a:buffer, '.flowconfig')
if !empty(l:flow_config)
return fnamemodify(l:flow_config, ':h')
endif
return ''
endfunction
call ale#linter#Define('javascript', {
\ 'name': 'flow_ls',
\ 'aliaes': ['flow-language-server'],
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#path#FindExecutable(b, 'javascript_flow_ls', [
\ 'node_modules/.bin/flow',
\ ])},
\ 'command': '%e lsp --from ale-lsp',
\ 'project_root': function('ale_linters#javascript#flow_ls#FindProjectRoot'),
\ 'language': 'javascript',
\})
================================================
FILE: ale_linters/javascript/jscs.vim
================================================
" Author: Chris Kyrouac - https://github.com/fijshion
" Description: jscs for JavaScript files
call ale#Set('javascript_jscs_executable', 'jscs')
call ale#Set('javascript_jscs_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#javascript#jscs#GetCommand(buffer) abort
" Search for a local JShint config locaation, and default to a global one.
let l:jscs_config = ale#path#ResolveLocalPath(
\ a:buffer,
\ '.jscsrc',
\ get(g:, 'ale_jscs_config_loc', '')
\)
let l:command = '%e --reporter inline --no-colors'
if !empty(l:jscs_config)
let l:command .= ' --config ' . ale#Escape(l:jscs_config)
endif
let l:command .= ' -'
return l:command
endfunction
function! ale_linters#javascript#jscs#Handle(buffer, lines) abort
" Matches patterns looking like the following
"
" foobar.js: line 2, col 1, Expected indentation of 1 characters
"
let l:pattern = '\v^.*:\s+line (\d+),\s+col\s+(\d+),\s+(.*)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:obj = {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'text': l:match[3]
\}
let l:code_match = matchlist(l:match[3], '\v([^ :]+): (.+)$')
if !empty(l:code_match)
let l:obj.code = l:code_match[1]
let l:obj.text = l:code_match[2]
endif
call add(l:output, l:obj)
endfor
return l:output
endfunction
call ale#linter#Define('javascript', {
\ 'name': 'jscs',
\ 'executable': {b -> ale#path#FindExecutable(b, 'javascript_jscs', [
\ 'node_modules/.bin/jscs',
\ ])},
\ 'command': function('ale_linters#javascript#jscs#GetCommand'),
\ 'callback': 'ale_linters#javascript#jscs#Handle',
\})
================================================
FILE: ale_linters/javascript/jshint.vim
================================================
" Author: Chris Kyrouac - https://github.com/fijshion
" Description: JSHint for Javascript files
call ale#Set('javascript_jshint_executable', 'jshint')
call ale#Set('javascript_jshint_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#javascript#jshint#GetCommand(buffer) abort
" Search for a local JShint config locaation, and default to a global one.
let l:jshint_config = ale#path#ResolveLocalPath(
\ a:buffer,
\ '.jshintrc',
\ get(g:, 'ale_jshint_config_loc', '')
\)
let l:command = '%e --reporter unix --extract auto'
if !empty(l:jshint_config)
let l:command .= ' --config ' . ale#Escape(l:jshint_config)
endif
let l:command .= ' --filename %s -'
return l:command
endfunction
call ale#linter#Define('javascript', {
\ 'name': 'jshint',
\ 'executable': {b -> ale#path#FindExecutable(b, 'javascript_jshint', [
\ 'node_modules/.bin/jshint',
\ ])},
\ 'command': function('ale_linters#javascript#jshint#GetCommand'),
\ 'callback': 'ale#handlers#unix#HandleAsError',
\})
================================================
FILE: ale_linters/javascript/standard.vim
================================================
" Author: Ahmed El Gabri <@ahmedelgabri>
" Description: standardjs for JavaScript files
call ale#Set('javascript_standard_executable', 'standard')
call ale#Set('javascript_standard_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('javascript_standard_options', '')
function! ale_linters#javascript#standard#GetExecutable(buffer) abort
return ale#path#FindExecutable(a:buffer, 'javascript_standard', [
\ 'node_modules/standardx/bin/cmd.js',
\ 'node_modules/standard/bin/cmd.js',
\ 'node_modules/semistandard/bin/cmd.js',
\ 'node_modules/.bin/standard',
\])
endfunction
function! ale_linters#javascript#standard#GetCommand(buffer) abort
let l:executable = ale_linters#javascript#standard#GetExecutable(a:buffer)
let l:options = ale#Var(a:buffer, 'javascript_standard_options')
return ale#node#Executable(a:buffer, l:executable)
\ . ale#Pad(l:options)
\ . ' --stdin %s'
endfunction
" standard uses eslint and the output format is the same
call ale#linter#Define('javascript', {
\ 'name': 'standard',
\ 'executable': function('ale_linters#javascript#standard#GetExecutable'),
\ 'command': function('ale_linters#javascript#standard#GetCommand'),
\ 'callback': 'ale#handlers#eslint#Handle',
\})
================================================
FILE: ale_linters/javascript/tsserver.vim
================================================
" Author: Chaucerbao, w0rp
" Description: tsserver integration for ALE
call ale#Set('javascript_tsserver_executable', 'tsserver')
call ale#Set('javascript_tsserver_config_path', '')
call ale#Set('javascript_tsserver_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#linter#Define('javascript', {
\ 'name': 'tsserver',
\ 'lsp': 'tsserver',
\ 'executable': {b -> ale#path#FindExecutable(b, 'javascript_tsserver', [
\ 'node_modules/.bin/tsserver',
\ ])},
\ 'command': '%e',
\ 'project_root': function('ale#handlers#tsserver#GetProjectRoot'),
\ 'language': '',
\})
================================================
FILE: ale_linters/javascript/xo.vim
================================================
" Author: Daniel Lupu
" Description: xo for JavaScript files
call ale#linter#Define('javascript', {
\ 'name': 'xo',
\ 'executable': function('ale#handlers#xo#GetExecutable'),
\ 'command': function('ale#handlers#xo#GetLintCommand'),
\ 'callback': 'ale#handlers#xo#HandleJSON',
\})
================================================
FILE: ale_linters/jinja/djlint.vim
================================================
" Author: Adrian Vollmer
" Description: djlint for Django HTML template files
call ale#Set('html_djlint_executable', 'djlint')
call ale#Set('html_djlint_options', '')
call ale#linter#Define('jinja', {
\ 'name': 'djlint',
\ 'executable': function('ale#handlers#djlint#GetExecutable'),
\ 'command': function('ale#handlers#djlint#GetCommand'),
\ 'callback': 'ale#handlers#djlint#Handle',
\})
================================================
FILE: ale_linters/jinja/j2lint.vim
================================================
" 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',
\})
================================================
FILE: ale_linters/json/biome.vim
================================================
" Description: biome for json files
call ale#linter#Define('json', {
\ 'name': 'biome',
\ 'lsp': 'stdio',
\ 'language': function('ale#handlers#biome#GetLanguage'),
\ 'executable': function('ale#handlers#biome#GetExecutable'),
\ 'command': '%e lsp-proxy',
\ 'project_root': function('ale#handlers#biome#GetProjectRoot'),
\})
================================================
FILE: ale_linters/json/cspell.vim
================================================
scriptencoding utf-8
" Author: David Houston
" Description: cspell support for JSON files.
call ale#handlers#cspell#DefineLinter('json')
================================================
FILE: ale_linters/json/eslint.vim
================================================
" Author: João Pesce
" Description: eslint for JSON files.
"
" Requires eslint-plugin-jsonc or a similar plugin to work
"
" Uses the same funtcions as ale_linters/javascript/eslint.vim by w0rp
"
call ale#linter#Define('json', {
\ 'name': 'eslint',
\ 'output_stream': 'both',
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
\ 'cwd': function('ale#handlers#eslint#GetCwd'),
\ 'command': function('ale#handlers#eslint#GetCommand'),
\ 'callback': 'ale#handlers#eslint#HandleJSON',
\})
================================================
FILE: ale_linters/json/jq.vim
================================================
" Author: jD91mZM2
call ale#Set('json_jq_executable', 'jq')
call ale#Set('json_jq_options', '')
call ale#Set('json_jq_filters', '.')
" Matches patterns like the following:
" parse error: Expected another key-value pair at line 4, column 3
let s:pattern = 'parse error: \(.\+\) at line \(\d\+\), column \(\d\+\)$'
function! ale_linters#json#jq#Handle(buffer, lines) abort
return ale#util#MapMatches(a:lines, s:pattern, {match -> {
\ 'text': match[1],
\ 'lnum': match[2] + 0,
\ 'col': match[3] + 0,
\}})
endfunction
call ale#linter#Define('json', {
\ 'name': 'jq',
\ 'executable': {b -> ale#Var(b, 'json_jq_executable')},
\ 'output_stream': 'stderr',
\ 'command': '%e',
\ 'callback': 'ale_linters#json#jq#Handle',
\})
================================================
FILE: ale_linters/json/jsonlint.vim
================================================
" Author: KabbAmine , David Sierra
call ale#Set('json_jsonlint_executable', 'jsonlint')
call ale#Set('json_jsonlint_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#json#jsonlint#GetExecutable(buffer) abort
return ale#path#FindExecutable(a:buffer, 'json_jsonlint', [
\ 'node_modules/.bin/jsonlint',
\ 'node_modules/jsonlint/lib/cli.js',
\])
endfunction
function! ale_linters#json#jsonlint#GetCommand(buffer) abort
let l:executable = ale_linters#json#jsonlint#GetExecutable(a:buffer)
return ale#node#Executable(a:buffer, l:executable)
\ . ' --compact -'
endfunction
function! ale_linters#json#jsonlint#Handle(buffer, lines) abort
" Matches patterns like the following:
" line 2, col 15, found: 'STRING' - expected: 'EOF', '}', ',', ']'.
let l:pattern = '^line \(\d\+\), col \(\d*\), \(.\+\)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'text': l:match[3],
\})
endfor
return l:output
endfunction
call ale#linter#Define('json', {
\ 'name': 'jsonlint',
\ 'executable': function('ale_linters#json#jsonlint#GetExecutable'),
\ 'output_stream': 'stderr',
\ 'command': function('ale_linters#json#jsonlint#GetCommand'),
\ 'callback': 'ale_linters#json#jsonlint#Handle',
\})
================================================
FILE: ale_linters/json/spectral.vim
================================================
" Author: t2h5
" Description: Integration of Stoplight Spectral CLI with ALE.
call ale#Set('json_spectral_executable', 'spectral')
call ale#Set('json_spectral_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#linter#Define('json', {
\ 'name': 'spectral',
\ 'executable': {b -> ale#path#FindExecutable(b, 'json_spectral', [
\ 'node_modules/.bin/spectral',
\ ])},
\ 'command': '%e lint --ignore-unknown-format -q -f text %t',
\ 'callback': 'ale#handlers#spectral#HandleSpectralOutput'
\})
================================================
FILE: ale_linters/json/vscodejson.vim
================================================
" Author: Dalius Dobravolskas
" Description: VSCode json language server
call ale#Set('json_vscodejson_executable', '')
function! ale_linters#json#vscodejson#GetExecutable(buffer) abort
let l:executable = ale#Var(a:buffer, 'json_vscodejson_executable')
if l:executable is# ''
if ale#engine#IsExecutable(a:buffer, 'vscode-json-languageserver')
let l:executable = 'vscode-json-languageserver'
else
let l:executable = 'vscode-json-language-server'
endif
endif
return l:executable
endfunction
function! ale_linters#json#vscodejson#GetProjectRoot(buffer) abort
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''
endfunction
call ale#linter#Define('json', {
\ 'name': 'vscodejson',
\ 'lsp': 'stdio',
\ 'executable': function('ale_linters#json#vscodejson#GetExecutable'),
\ 'command': '%e --stdio',
\ 'project_root': function('ale_linters#json#vscodejson#GetProjectRoot'),
\})
================================================
FILE: ale_linters/json5/eslint.vim
================================================
" Author: João Pesce
" Description: eslint for JSON5 files.
"
" Requires eslint-plugin-jsonc or a similar plugin to work
"
" Uses the same funtcions as ale_linters/javascript/eslint.vim by w0rp
"
call ale#linter#Define('json5', {
\ 'name': 'eslint',
\ 'output_stream': 'both',
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
\ 'cwd': function('ale#handlers#eslint#GetCwd'),
\ 'command': function('ale#handlers#eslint#GetCommand'),
\ 'callback': 'ale#handlers#eslint#HandleJSON',
\})
================================================
FILE: ale_linters/jsonc/biome.vim
================================================
" Description: biome for jsonc files
call ale#linter#Define('jsonc', {
\ 'name': 'biome',
\ 'lsp': 'stdio',
\ 'language': function('ale#handlers#biome#GetLanguage'),
\ 'executable': function('ale#handlers#biome#GetExecutable'),
\ 'command': '%e lsp-proxy',
\ 'project_root': function('ale#handlers#biome#GetProjectRoot'),
\})
================================================
FILE: ale_linters/jsonc/eslint.vim
================================================
" Author: João Pesce
" Description: eslint for JSONC files.
"
" Requires eslint-plugin-jsonc or a similar plugin to work
"
" Uses the same funtcions as ale_linters/javascript/eslint.vim by w0rp
"
call ale#linter#Define('jsonc', {
\ 'name': 'eslint',
\ 'output_stream': 'both',
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
\ 'cwd': function('ale#handlers#eslint#GetCwd'),
\ 'command': function('ale#handlers#eslint#GetCommand'),
\ 'callback': 'ale#handlers#eslint#HandleJSON',
\})
================================================
FILE: ale_linters/jsonnet/jsonnet_lint.vim
================================================
" Author: Trevor Whitney
" Description: jsonnet-lint for jsonnet files
call ale#Set('jsonnet_jsonnet_lint_executable', 'jsonnet-lint')
call ale#Set('jsonnet_jsonnet_lint_options', '')
function! ale_linters#jsonnet#jsonnet_lint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'jsonnet_jsonnet_lint_options')
return '%e'
\ . ale#Pad(l:options)
\ . ' %t'
endfunction
function! ale_linters#jsonnet#jsonnet_lint#Handle(buffer, lines) abort
" Matches patterns line the following:
"
" ERROR: foo.jsonnet:22:3-12 expected token OPERATOR but got (IDENTIFIER, "bar")
" ERROR: hoge.jsonnet:20:3 unexpected: "}" while parsing terminal
" ERROR: main.jsonnet:212:1-14 Expected , or ; but got (IDENTIFIER, "older_cluster")
let l:pattern = '^ERROR: [^:]*:\(\d\+\):\(\d\+\)\(-\d\+\)* \(.*\)'
let l:output = []
for l:line in a:lines
let l:match = matchlist(l:line, l:pattern)
if len(l:match) == 0
continue
endif
let line_number = l:match[1] + 0
let column = l:match[2] + 0
" l:match[3] has optional -14, when linter is showing a range
let text = l:match[4]
" vcol is Needed to indicate that the column is a character.
call add(l:output, {
\ 'bufnr': a:buffer,
\ 'lnum': line_number,
\ 'vcol': 0,
\ 'col': column,
\ 'text': text,
\ 'type': 'E',
\ 'nr': -1,
\})
endfor
return l:output
endfunction
call ale#linter#Define('jsonnet', {
\ 'name': 'jsonnet_lint',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'jsonnet_jsonnet_lint_executable')},
\ 'command': function('ale_linters#jsonnet#jsonnet_lint#GetCommand'),
\ 'callback': 'ale_linters#jsonnet#jsonnet_lint#Handle',
\})
================================================
FILE: ale_linters/jsonnet/jsonnetfmt.vim
================================================
" Authors: Trevor Whitney and Takuya Kosugiyama
" Description: jsonnetfmt for jsonnet files
call ale#Set('jsonnet_jsonnetfmt_executable', 'jsonnetfmt')
call ale#Set('jsonnet_jsonnetfmt_options', '')
function! ale_linters#jsonnet#jsonnetfmt#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'jsonnet_jsonnetfmt_options')
return '%e'
\ . ale#Pad(l:options)
\ . ' %t'
endfunction
function! ale_linters#jsonnet#jsonnetfmt#Handle(buffer, lines) abort
" Matches patterns line the following:
"
" STATIC ERROR: foo.jsonnet:22:3-12: expected token OPERATOR but got (IDENTIFIER, "bar")
" STATIC ERROR: hoge.jsonnet:20:3: unexpected: "}" while parsing terminal
let l:pattern = '^STATIC ERROR:[^:]*:\(\d\+\):\(\d\+\):*\(-\d\+\)* \(.*\)'
let l:output = []
for l:line in a:lines
let l:match = matchlist(l:line, l:pattern)
if len(l:match) == 0
continue
endif
" vcol is Needed to indicate that the column is a character.
call add(l:output, {
\ 'bufnr': a:buffer,
\ 'lnum': l:match[1] + 0,
\ 'vcol': 0,
\ 'col': l:match[2] + 0,
\ 'text': l:match[4],
\ 'type': 'E',
\ 'nr': -1,
\})
endfor
return l:output
endfunction
call ale#linter#Define('jsonnet', {
\ 'name': 'jsonnetfmt',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'jsonnet_jsonnetfmt_executable')},
\ 'command': function('ale_linters#jsonnet#jsonnetfmt#GetCommand'),
\ 'callback': 'ale_linters#jsonnet#jsonnetfmt#Handle',
\})
================================================
FILE: ale_linters/julia/languageserver.vim
================================================
" Author: Bartolomeo Stellato
" Description: A language server for Julia
" Set julia executable variable
call ale#Set('julia_executable', 'julia')
function! ale_linters#julia#languageserver#GetCommand(buffer) abort
let l:julia_executable = ale#Var(a:buffer, 'julia_executable')
let l:cmd_string = 'using LanguageServer; using Pkg; import StaticLint; import SymbolServer; server = LanguageServer.LanguageServerInstance(isdefined(Base, :stdin) ? stdin : STDIN, isdefined(Base, :stdout) ? stdout : STDOUT, dirname(Pkg.Types.Context().env.project_file)); server.runlinter = true; run(server);'
return ale#Escape(l:julia_executable) . ' --project=@. --startup-file=no --history-file=no -e ' . ale#Escape(l:cmd_string)
endfunction
call ale#linter#Define('julia', {
\ 'name': 'languageserver',
\ 'aliases': ['julials'],
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'julia_executable')},
\ 'command': function('ale_linters#julia#languageserver#GetCommand'),
\ 'language': 'julia',
\ 'project_root': function('ale#julia#FindProjectRoot'),
\})
================================================
FILE: ale_linters/kotlin/kotlinc.vim
================================================
" Author: Francis Agyapong
" Description: A linter for the Kotlin programming language that uses kotlinc
let g:ale_kotlin_kotlinc_options = get(g:, 'ale_kotlin_kotlinc_options', '')
let g:ale_kotlin_kotlinc_enable_config = get(g:, 'ale_kotlin_kotlinc_enable_config', 0)
let g:ale_kotlin_kotlinc_config_file = get(g:, 'ale_kotlin_kotlinc_config_file', '.ale_kotlinc_config')
let g:ale_kotlin_kotlinc_classpath = get(g:, 'ale_kotlin_kotlinc_classpath', '')
let g:ale_kotlin_kotlinc_sourcepath = get(g:, 'ale_kotlin_kotlinc_sourcepath', '')
let g:ale_kotlin_kotlinc_use_module_file = get(g:, 'ale_kotlin_kotlinc_use_module_file', 0)
let g:ale_kotlin_kotlinc_module_filename = get(g:, 'ale_kotlin_kotlinc_module_filename', 'module.xml')
let s:classpath_sep = has('unix') ? ':' : ';'
function! ale_linters#kotlin#kotlinc#RunWithImportPaths(buffer) abort
let l:command = ''
" exec maven/gradle only if classpath is not set
if !empty(ale#Var(a:buffer, 'kotlin_kotlinc_classpath'))
return ale_linters#kotlin#kotlinc#GetCommand(a:buffer, [], {})
endif
let [l:cwd, l:command] = ale#maven#BuildClasspathCommand(a:buffer)
" Try to use Gradle if Maven isn't available.
if empty(l:command)
let [l:cwd, l:command] = ale#gradle#BuildClasspathCommand(a:buffer)
endif
if empty(l:command)
return ale_linters#kotlin#kotlinc#GetCommand(a:buffer, [], {})
endif
return ale#command#Run(
\ a:buffer,
\ l:command,
\ function('ale_linters#kotlin#kotlinc#GetCommand'),
\ {'cwd': l:cwd},
\)
endfunction
function! s:BuildClassPathOption(buffer, import_paths) abort
" Filter out lines like [INFO], etc.
let l:class_paths = filter(a:import_paths[:], 'v:val !~# ''[''')
call extend(
\ l:class_paths,
\ split(ale#Var(a:buffer, 'kotlin_kotlinc_classpath'), s:classpath_sep),
\)
return !empty(l:class_paths)
\ ? ' -cp ' . ale#Escape(join(l:class_paths, s:classpath_sep))
\ : ''
endfunction
function! ale_linters#kotlin#kotlinc#GetCommand(buffer, import_paths, meta) abort
let l:kotlinc_opts = ale#Var(a:buffer, 'kotlin_kotlinc_options')
let l:command = 'kotlinc '
" If the config file is enabled and readable, source it
if ale#Var(a:buffer, 'kotlin_kotlinc_enable_config')
let l:conf = expand(ale#Var(a:buffer, 'kotlin_kotlinc_config_file'), 1)
if filereadable(l:conf)
execute 'source ' . fnameescape(l:conf)
endif
endif
" If use module and module file is readable use that and return
if ale#Var(a:buffer, 'kotlin_kotlinc_use_module_file')
let l:module_filename = ale#Escape(expand(ale#Var(a:buffer, 'kotlin_kotlinc_module_filename'), 1))
if filereadable(l:module_filename)
let l:kotlinc_opts .= ' -module ' . l:module_filename
let l:command .= 'kotlinc ' . l:kotlinc_opts
return l:command
endif
endif
" We only get here if not using module or the module file not readable
if ale#Var(a:buffer, 'kotlin_kotlinc_classpath') isnot# ''
let l:kotlinc_opts .= ' -cp ' . ale#Var(a:buffer, 'kotlin_kotlinc_classpath')
else
" get classpath from maven/gradle
let l:kotlinc_opts .= s:BuildClassPathOption(a:buffer, a:import_paths)
endif
let l:fname = ''
if ale#Var(a:buffer, 'kotlin_kotlinc_sourcepath') isnot# ''
let l:fname .= expand(ale#Var(a:buffer, 'kotlin_kotlinc_sourcepath'), 1) . ' '
else
" Find the src directory for files in this project.
let l:project_root = ale#gradle#FindProjectRoot(a:buffer)
if !empty(l:project_root)
let l:src_dir = l:project_root
else
let l:src_dir = ale#path#FindNearestDirectory(a:buffer, 'src/main/java')
\ . ' ' . ale#path#FindNearestDirectory(a:buffer, 'src/main/kotlin')
endif
let l:fname .= expand(l:src_dir, 1) . ' '
endif
let l:fname .= ale#Escape(expand('#' . a:buffer . ':p'))
let l:command .= l:kotlinc_opts . ' ' . l:fname
return l:command
endfunction
function! ale_linters#kotlin#kotlinc#Handle(buffer, lines) abort
let l:code_pattern = '^\(.*\):\([0-9]\+\):\([0-9]\+\):\s\+\(error\|warning\):\s\+\(.*\)'
let l:general_pattern = '^\(warning\|error\|info\):\s*\(.*\)'
let l:output = []
for l:line in a:lines
let l:match = matchlist(l:line, l:code_pattern)
if len(l:match) == 0
continue
endif
let l:file = l:match[1]
let l:line = l:match[2] + 0
let l:column = l:match[3] + 0
let l:type = l:match[4]
let l:text = l:match[5]
let l:buf_abspath = fnamemodify(l:file, ':p')
let l:curbuf_abspath = expand('#' . a:buffer . ':p')
" Skip if file is not loaded
if l:buf_abspath isnot# l:curbuf_abspath
continue
endif
let l:type_marker_str = l:type is# 'warning' ? 'W' : 'E'
call add(l:output, {
\ 'lnum': l:line,
\ 'col': l:column,
\ 'text': l:text,
\ 'type': l:type_marker_str,
\})
endfor
" Non-code related messages
for l:line in a:lines
let l:match = matchlist(l:line, l:general_pattern)
if len(l:match) == 0
continue
endif
let l:type = l:match[1]
let l:text = l:match[2]
let l:type_marker_str = l:type is# 'warning' || l:type is# 'info' ? 'W' : 'E'
call add(l:output, {
\ 'lnum': 1,
\ 'text': l:text,
\ 'type': l:type_marker_str,
\})
endfor
return l:output
endfunction
call ale#linter#Define('kotlin', {
\ 'name': 'kotlinc',
\ 'executable': 'kotlinc',
\ 'output_stream': 'stderr',
\ 'command': function('ale_linters#kotlin#kotlinc#RunWithImportPaths'),
\ 'callback': 'ale_linters#kotlin#kotlinc#Handle',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/kotlin/ktlint.vim
================================================
" Author: Francis Agyapong
" Description: Lint kotlin files using ktlint
call ale#linter#Define('kotlin', {
\ 'name': 'ktlint',
\ 'executable': 'ktlint',
\ 'command': function('ale#handlers#ktlint#GetCommand'),
\ 'callback': 'ale#handlers#ktlint#Handle',
\ 'output_stream': 'stderr'
\})
================================================
FILE: ale_linters/kotlin/languageserver.vim
================================================
" Author: MTDL9
" Description: Support for the Kotlin language server https://github.com/fwcd/KotlinLanguageServer
call ale#Set('kotlin_languageserver_executable', 'kotlin-language-server')
function! ale_linters#kotlin#languageserver#GetProjectRoot(buffer) abort
let l:gradle_root = ale#gradle#FindProjectRoot(a:buffer)
if !empty(l:gradle_root)
return l:gradle_root
endif
let l:maven_pom_file = ale#path#FindNearestFile(a:buffer, 'pom.xml')
if !empty(l:maven_pom_file)
return fnamemodify(l:maven_pom_file, ':h')
endif
return ''
endfunction
call ale#linter#Define('kotlin', {
\ 'name': 'languageserver',
\ 'aliaes': ['kotlin_language_server'],
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'kotlin_languageserver_executable')},
\ 'command': '%e',
\ 'language': 'kotlin',
\ 'project_root': function('ale_linters#kotlin#languageserver#GetProjectRoot'),
\})
================================================
FILE: ale_linters/lean/lake.vim
================================================
" Author: Benjamin Block
" Description: A language server for Lean 4.
function! ale_linters#lean#lake#GetProjectRoot(buffer) abort
let l:lakefile_toml = ale#path#FindNearestFile(a:buffer, 'lakefile.toml')
let l:lakefile_lean = ale#path#FindNearestFile(a:buffer, 'lakefile.lean')
if !empty(l:lakefile_toml)
return fnamemodify(l:lakefile_toml, ':p:h')
elseif !empty(l:lakefile_lean)
return fnamemodify(l:lakefile_lean, ':p:h')
else
return fnamemodify('', ':h')
endif
endfunction
call ale#Set('lean_lake_executable', 'lake')
call ale#Set('lean_lake_config', {})
call ale#linter#Define('lean', {
\ 'name': 'lake',
\ 'lsp': 'stdio',
\ 'language': 'lean',
\ 'lsp_config': {b -> ale#Var(b, 'lean_lake_config')},
\ 'executable': {b -> ale#Var(b, 'lean_lake_executable')},
\ 'command': '%e serve',
\ 'project_root': function('ale_linters#lean#lake#GetProjectRoot'),
\})
================================================
FILE: ale_linters/less/lessc.vim
================================================
" Author: zanona , w0rp
" Description: This file adds support for checking Less code with lessc.
call ale#Set('less_lessc_executable', 'lessc')
call ale#Set('less_lessc_options', '')
call ale#Set('less_lessc_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#less#lessc#GetCommand(buffer) abort
return '%e --no-color --lint'
\ . ' --include-path=' . ale#Escape(expand('#' . a:buffer . ':p:h'))
\ . ale#Pad(ale#Var(a:buffer, 'less_lessc_options'))
\ . ' -'
endfunction
function! ale_linters#less#lessc#Handle(buffer, lines) abort
let l:dir = expand('#' . a:buffer . ':p:h')
" Matches patterns like the following:
let l:pattern = '^\(\w\+\): \(.\{-}\) in \(.\{-}\) on line \(\d\+\), column \(\d\+\):$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:item = {
\ 'lnum': l:match[4] + 0,
\ 'col': l:match[5] + 0,
\ 'text': l:match[2],
\ 'type': 'E',
\}
if l:match[3] isnot# '-'
let l:item.filename = ale#path#GetAbsPath(l:dir, l:match[3])
endif
call add(l:output, l:item)
endfor
return l:output
endfunction
call ale#linter#Define('less', {
\ 'name': 'lessc',
\ 'executable': {b -> ale#path#FindExecutable(b, 'less_lessc', [
\ 'node_modules/.bin/lessc',
\ ])},
\ 'command': function('ale_linters#less#lessc#GetCommand'),
\ 'callback': 'ale_linters#less#lessc#Handle',
\ 'output_stream': 'stderr',
\})
================================================
FILE: ale_linters/less/stylelint.vim
================================================
" Author: diartyz , w0rp
call ale#Set('less_stylelint_executable', 'stylelint')
call ale#Set('less_stylelint_options', '')
call ale#Set('less_stylelint_use_global', get(g:, 'ale_use_global_executables', 0))
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'
endfunction
call ale#linter#Define('less', {
\ 'name': 'stylelint',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#path#FindExecutable(b, 'less_stylelint', [
\ 'node_modules/.bin/stylelint',
\ ])},
\ 'command': function('ale_linters#less#stylelint#GetCommand'),
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
\})
================================================
FILE: ale_linters/llvm/llc.vim
================================================
" Author: rhysd
" Description: Support for checking LLVM IR with llc
call ale#Set('llvm_llc_executable', 'llc')
function! ale_linters#llvm#llc#HandleErrors(buffer, lines) abort
" Handle '{path}: {file}:{line}:{col}: error: {message}' format
let l:pattern = '\v^[a-zA-Z]?:?[^:]+: [^:]+:(\d+):(\d+): (.+)$'
return map(ale#util#GetMatches(a:lines, l:pattern), "{
\ 'lnum': str2nr(v:val[1]),
\ 'col': str2nr(v:val[2]),
\ 'text': v:val[3],
\ 'type': 'E',
\}")
endfunction
call ale#linter#Define('llvm', {
\ 'name': 'llc',
\ 'executable': {b -> ale#Var(b, 'llvm_llc_executable')},
\ 'output_stream': 'stderr',
\ 'command': {-> '%e -filetype=null -o=' . g:ale#util#nul_file},
\ 'callback': 'ale_linters#llvm#llc#HandleErrors',
\})
================================================
FILE: ale_linters/lua/cspell.vim
================================================
scriptencoding utf-8
" Author: David Houston
" Description: cspell support for Lua files.
call ale#handlers#cspell#DefineLinter('lua')
================================================
FILE: ale_linters/lua/lua_language_server.vim
================================================
" Author: w0rp
" Description: lua-language-server integration (https://github.com/LuaLS/lua-language-server)
call ale#Set('lua_language_server_executable', 'lua-language-server')
call ale#Set('lua_language_server_config', {})
call ale#linter#Define('lua', {
\ 'name': 'lua_language_server',
\ 'aliases': ['lua-language-server', 'lua_ls'],
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'lua_language_server_executable')},
\ 'command': '%e',
\ 'project_root': function('ale#lua#FindProjectRoot'),
\ 'lsp_config': {b -> ale#Var(b, 'lua_language_server_config')},
\})
================================================
FILE: ale_linters/lua/luac.vim
================================================
" Author: Jon Xie https://github.com/xiejiangzhi
" Description: luac linter for lua files
call ale#Set('lua_luac_executable', 'luac')
function! ale_linters#lua#luac#Handle(buffer, lines) abort
" Matches patterns line the following:
"
" luac: stdin:5: '=' expected near ')'
" luac: stdin:8: ')' expected (to close '(' at line 6) near '123'
let l:pattern = '\v^.*:(\d+): (.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'type': 'E',
\ 'text': l:match[2],
\})
endfor
return l:output
endfunction
call ale#linter#Define('lua', {
\ 'name': 'luac',
\ 'executable': {b -> ale#Var(b, 'lua_luac_executable')},
\ 'command': '%e -p -',
\ 'output_stream': 'stderr',
\ 'callback': 'ale_linters#lua#luac#Handle',
\})
================================================
FILE: ale_linters/lua/luacheck.vim
================================================
" Author: Sol Bekic https://github.com/s-ol
" Description: luacheck linter for lua files
call ale#Set('lua_luacheck_executable', 'luacheck')
call ale#Set('lua_luacheck_options', '')
function! s:IsInRuntimepath(buffer) abort
let l:runtimepath_dirs = split(&runtimepath, ',')
for l:dir in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
for l:runtime_dir in l:runtimepath_dirs
if l:dir is# l:runtime_dir
return 1
endif
endfor
endfor
return 0
endfunction
function! ale_linters#lua#luacheck#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'lua_luacheck_options')
" Add `--globals vim` by default if the file is in runtimepath.
if l:options !~# '--globals'
let l:in_runtime = getbufvar(a:buffer, 'ale_in_runtimepath', v:null)
if l:in_runtime is v:null
let l:in_runtime = s:IsInRuntimepath(a:buffer)
" Save the result of check this buffer so we only check once.
call setbufvar(a:buffer, 'ale_in_runtimepath', l:in_runtime)
endif
if l:in_runtime
if !empty(l:options)
let l:options .= ' '
endif
let l:options .= '--globals vim'
endif
endif
return '%e' . ale#Pad(l:options)
\ . ' --formatter plain --codes --filename %s -'
endfunction
function! ale_linters#lua#luacheck#Handle(buffer, lines) abort
" Matches patterns line the following:
"
" artal.lua:159:17: (W111) shadowing definition of loop variable 'i' on line 106
" artal.lua:182:7: (W213) unused loop variable 'i'
let l:pattern = '^.*:\(\d\+\):\(\d\+\): (\([WE]\)\(\d\+\)) \(.\+\)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
if !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
\ && l:match[3] is# 'W'
\ && index(range(611, 614), str2nr(l:match[4])) >= 0
continue
endif
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'type': l:match[3],
\ 'code': l:match[3] . l:match[4],
\ 'text': l:match[5],
\})
endfor
return l:output
endfunction
call ale#linter#Define('lua', {
\ 'name': 'luacheck',
\ 'executable': {b -> ale#Var(b, 'lua_luacheck_executable')},
\ 'command': function('ale_linters#lua#luacheck#GetCommand'),
\ 'callback': 'ale_linters#lua#luacheck#Handle',
\})
================================================
FILE: ale_linters/lua/selene.vim
================================================
call ale#Set('lua_selene_executable', 'selene')
call ale#Set('lua_selene_options', '')
function! ale_linters#lua#selene#GetCommand(buffer) abort
return '%e' . ale#Pad(ale#Var(a:buffer, 'lua_selene_options'))
\ . ' --display-style=json -'
endfunction
function! ale_linters#lua#selene#Handle(buffer, lines) abort
let l:output = []
for l:line in a:lines
" as of version 0.17.0, selene has no way to suppress summary
" information when outputting json, so stop processing when we hit it
" (PR for this here: https://github.com/Kampfkarren/selene/pull/356)
if l:line is# 'Results:'
break
endif
let l:json = json_decode(l:line)
let l:lint = {
\ 'lnum': l:json.primary_label.span.start_line + 1,
\ 'end_lnum': l:json.primary_label.span.end_line + 1,
\ 'col': l:json.primary_label.span.start_column + 1,
\ 'end_col': l:json.primary_label.span.end_column,
\ 'text': l:json.message,
\ 'code': l:json.code,
\ 'type': l:json.severity is# 'Warning' ? 'W' : 'E',
\}
if has_key(l:json, 'notes') && len(l:json.notes) > 0
let l:lint.detail = l:lint.text . "\n\n" . join(l:json.notes, "\n")
endif
call add(l:output, l:lint)
endfor
return l:output
endfunction
call ale#linter#Define('lua', {
\ 'name': 'selene',
\ 'executable': {b -> ale#Var(b, 'lua_selene_executable')},
\ 'command': function('ale_linters#lua#selene#GetCommand'),
\ 'callback': 'ale_linters#lua#selene#Handle',
\})
================================================
FILE: ale_linters/mail/alex.vim
================================================
" Author: Johannes Wienke
" Description: alex for mail files
call ale#handlers#alex#DefineLinter('mail', '--text')
================================================
FILE: ale_linters/mail/languagetool.vim
================================================
" Author: Vincent (wahrwolf [at] wolfpit.net)
" Description: languagetool for mails
call ale#handlers#languagetool#DefineLinter('mail')
================================================
FILE: ale_linters/mail/proselint.vim
================================================
" 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'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
\})
================================================
FILE: ale_linters/mail/vale.vim
================================================
" Author: chew-z https://github.com/chew-z
" Description: vale for Markdown files
call ale#linter#Define('mail', {
\ 'name': 'vale',
\ 'executable': 'vale',
\ 'command': 'vale --output=JSON %t',
\ 'callback': 'ale#handlers#vale#Handle',
\})
================================================
FILE: ale_linters/make/checkmake.vim
================================================
" Author: aurieh - https://github.com/aurieh
call ale#Set('make_checkmake_config', '')
function! ale_linters#make#checkmake#Handle(buffer, lines) abort
let l:pattern = '\v^(\d+):(.+):(.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'bufnr': a:buffer,
\ 'lnum': l:match[1] + 0,
\ 'type': 'E',
\ 'code': l:match[2],
\ 'text': l:match[3],
\})
endfor
return l:output
endfunction
function! ale_linters#make#checkmake#GetCommand(buffer) abort
let l:config = ale#Var(a:buffer, 'make_checkmake_config')
let l:cmd = 'checkmake'
\ . ' --format="{{.LineNumber}}:{{.Rule}}:{{.Violation}}{{\"\r\n\"}}"'
\ . (!empty(l:config) ? ' --config="' . l:config . '"' : '')
\ . ' %s'
return l:cmd
endfunction
call ale#linter#Define('make', {
\ 'name': 'checkmake',
\ 'executable': 'checkmake',
\ 'command': function('ale_linters#make#checkmake#GetCommand'),
\ 'callback': 'ale_linters#make#checkmake#Handle',
\})
================================================
FILE: ale_linters/markdown/alex.vim
================================================
" Author: Johannes Wienke
" Description: alex for markdown files
call ale#handlers#alex#DefineLinter('markdown', '')
================================================
FILE: ale_linters/markdown/cspell.vim
================================================
scriptencoding utf-8
" Author: David Houston
" Description: cspell support for Markdown files.
call ale#handlers#cspell#DefineLinter('markdown')
================================================
FILE: ale_linters/markdown/languagetool.vim
================================================
" Author: Vincent (wahrwolf [at] wolfpit.net)
" Description: languagetool for markdown files
call ale#handlers#languagetool#DefineLinter('markdown')
================================================
FILE: ale_linters/markdown/markdownlint.vim
================================================
" Author: Ty-Lucas Kelley
" Description: Adds support for markdownlint
call ale#Set('markdown_markdownlint_executable', 'markdownlint')
call ale#Set('markdown_markdownlint_options', '')
function! ale_linters#markdown#markdownlint#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'markdown_markdownlint_executable')
endfunction
function! ale_linters#markdown#markdownlint#GetCommand(buffer) abort
let l:executable = ale_linters#markdown#markdownlint#GetExecutable(a:buffer)
let l:options = ale#Var(a:buffer, 'markdown_markdownlint_options')
return ale#Escape(l:executable)
\ . ale#Pad(l:options) . ' %s'
endfunction
call ale#linter#Define('markdown', {
\ 'name': 'markdownlint',
\ 'executable': function('ale_linters#markdown#markdownlint#GetExecutable'),
\ 'lint_file': 1,
\ 'output_stream': 'both',
\ 'command': function('ale_linters#markdown#markdownlint#GetCommand'),
\ 'callback': 'ale#handlers#markdownlint#Handle'
\})
================================================
FILE: ale_linters/markdown/marksman.vim
================================================
" Author: Peter Benjamin
" Description: Write Markdown with code assist and intelligence in the comfort of your favourite editor.
call ale#Set('markdown_marksman_executable', 'marksman')
function! ale_linters#markdown#marksman#GetCommand(buffer) abort
return '%e server'
endfunction
function! ale_linters#markdown#marksman#GetProjectRoot(buffer) abort
" Find nearest .marksman.toml
let l:marksman_toml = ale#path#FindNearestFile(a:buffer, '.marksman.toml')
if !empty(l:marksman_toml)
return fnamemodify(l:marksman_toml, ':h')
endif
" Find nearest .git/ directory
let l:project_root = finddir('.git/..', expand('#' . a:buffer . '...').';')
if !empty(l:project_root)
return l:project_root
endif
return ''
endfunction
call ale#linter#Define('markdown', {
\ 'name': 'marksman',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'markdown_marksman_executable')},
\ 'command': function('ale_linters#markdown#marksman#GetCommand'),
\ 'project_root': function('ale_linters#markdown#marksman#GetProjectRoot'),
\ 'initialization_options': {},
\})
================================================
FILE: ale_linters/markdown/mdl.vim
================================================
" Author: Steve Dignam , Josh Leeb-du Toit
" Description: Support for mdl, a markdown linter.
call ale#Set('markdown_mdl_executable', 'mdl')
call ale#Set('markdown_mdl_options', '')
function! ale_linters#markdown#mdl#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'markdown_mdl_executable')
endfunction
function! ale_linters#markdown#mdl#GetCommand(buffer) abort
let l:executable = ale_linters#markdown#mdl#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'bundle$'
\ ? ' exec mdl'
\ : ''
let l:options = ale#Var(a:buffer, 'markdown_mdl_options')
return ale#Escape(l:executable) . l:exec_args
\ . ' -j' . ale#Pad(l:options)
endfunction
function! ale_linters#markdown#mdl#Handle(buffer, lines) abort
let l:output = []
for l:error in ale#util#FuzzyJSONDecode(a:lines, [])
call add(l:output, {
\ 'lnum': l:error['line'],
\ 'code': l:error['rule'] . '/' . join(l:error['aliases'], '/'),
\ 'text': l:error['description'],
\ 'type': 'W',
\})
endfor
return l:output
endfunction
call ale#linter#Define('markdown', {
\ 'name': 'mdl',
\ 'executable': function('ale_linters#markdown#mdl#GetExecutable'),
\ 'command': function('ale_linters#markdown#mdl#GetCommand'),
\ 'callback': 'ale_linters#markdown#mdl#Handle'
\})
================================================
FILE: ale_linters/markdown/proselint.vim
================================================
" 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'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
\})
================================================
FILE: ale_linters/markdown/pymarkdown.vim
================================================
call ale#Set('markdown_pymarkdown_executable', 'pymarkdown')
call ale#Set('markdown_pymarkdown_options', '')
call ale#Set('markdown_pymarkdown_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('markdown_pymarkdown_auto_pipenv', 0)
call ale#Set('markdown_pymarkdown_auto_poetry', 0)
call ale#Set('markdown_pymarkdown_auto_uv', 0)
function! ale_linters#markdown#pymarkdown#GetExecutable(buffer) abort
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'markdown_pymarkdown_auto_pipenv'))
\ && ale#python#PipenvPresent(a:buffer)
return 'pipenv'
endif
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'markdown_pymarkdown_auto_poetry'))
\ && ale#python#PoetryPresent(a:buffer)
return 'poetry'
endif
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'markdown_pymarkdown_auto_uv'))
\ && ale#python#UvPresent(a:buffer)
return 'uv'
endif
return ale#python#FindExecutable(a:buffer, 'markdown_pymarkdown', ['pymarkdown'])
endfunction
function! ale_linters#markdown#pymarkdown#GetCommand(buffer) abort
let l:executable = ale_linters#markdown#pymarkdown#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
\ ? ' run pymarkdown'
\ : ''
return ale#Escape(l:executable) . l:exec_args
\ . ale#Pad(ale#Var(a:buffer, 'markdown_pymarkdown_options'))
\ . ' scan-stdin'
endfunction
function! ale_linters#markdown#pymarkdown#Handle(buffer, lines) abort
let l:pattern = '\v^(\S*):(\d+):(\d+): ([A-Z]+\d+): (.*)$'
let l:output = []
" lines are formatted as follows:
" sample.md:1:1: MD022: Headings should be surrounded by blank lines. [Expected: 1; Actual: 0; Below] (blanks-around-headings,blanks-around-headers)
for l:match in ale#util#GetMatches(a:lines, l:pattern)
if(l:match[4] is# 'MD009')
\&& !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
" Skip warnings for trailing whitespace if the option is off.
continue
endif
let l:item = {
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'type': l:match[4][0],
\ 'text': l:match[5],
\ 'code': l:match[4],
\}
call add(l:output, l:item)
endfor
return l:output
endfunction
call ale#linter#Define('markdown', {
\ 'name': 'pymarkdown',
\ 'executable': function('ale_linters#markdown#pymarkdown#GetExecutable'),
\ 'command': function('ale_linters#markdown#pymarkdown#GetCommand'),
\ 'callback': 'ale_linters#markdown#pymarkdown#Handle',
\})
================================================
FILE: ale_linters/markdown/redpen.vim
================================================
" Author: rhysd https://rhysd.github.io
" Description: Redpen, a proofreading tool (http://redpen.cc)
call ale#handlers#redpen#DefineLinter('markdown')
================================================
FILE: ale_linters/markdown/remark_lint.vim
================================================
scriptencoding utf-8
" Author rhysd https://rhysd.github.io/, Dirk Roorda (dirkroorda), Adrián González Rus (@adrigzr)
" Description: remark-lint for Markdown files
call ale#Set('markdown_remark_lint_executable', 'remark')
call ale#Set('markdown_remark_lint_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('markdown_remark_lint_options', '')
function! ale_linters#markdown#remark_lint#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'markdown_remark_lint_options')
return '%e' . ale#Pad(l:options) . ' --no-stdout --no-color'
endfunction
function! ale_linters#markdown#remark_lint#Handle(buffer, lines) abort
" matches: ' 1:4 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint'
" matches: ' 18:71-19:1 error Missing new line after list item list-item-spacing remark-lint',
let l:pattern = '^ \+\(\d\+\):\(\d\+\)\(-\(\d\+\):\(\d\+\)\)\? \(warning\|error\) \(.\+\)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:item = {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
\ 'type': l:match[6] is# 'error' ? 'E' : 'W',
\ 'text': l:match[7],
\}
if l:match[3] isnot# ''
let l:item.end_lnum = l:match[4] + 0
let l:item.end_col = l:match[5] + 0
endif
call add(l:output, l:item)
endfor
return l:output
endfunction
call ale#linter#Define('markdown', {
\ 'name': 'remark_lint',
\ 'aliases': ['remark-lint'],
\ 'executable': {b -> ale#path#FindExecutable(b, 'markdown_remark_lint', [
\ 'node_modules/.bin/remark',
\ ])},
\ 'command': function('ale_linters#markdown#remark_lint#GetCommand'),
\ 'callback': 'ale_linters#markdown#remark_lint#Handle',
\ 'output_stream': 'stderr',
\})
================================================
FILE: ale_linters/markdown/textlint.vim
================================================
" Author: tokida https://rouger.info, Yasuhiro Kiyota
" Description: textlint, a proofreading tool (https://textlint.github.io/)
call ale#linter#Define('markdown', {
\ 'name': 'textlint',
\ 'executable': function('ale#handlers#textlint#GetExecutable'),
\ 'command': function('ale#handlers#textlint#GetCommand'),
\ 'callback': 'ale#handlers#textlint#HandleTextlintOutput',
\})
================================================
FILE: ale_linters/markdown/vale.vim
================================================
" Author: chew-z https://github.com/chew-z
" Description: vale for Markdown files
call ale#Set('markdown_vale_executable', 'vale')
call ale#Set('markdown_vale_input_file', '%t')
call ale#Set('markdown_vale_options', '')
function! ale_linters#markdown#vale#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'markdown_vale_executable')
let l:input_file = ale#Var(a:buffer, 'markdown_vale_input_file')
" Defaults to `vale --output=JSON %t`
return ale#Escape(l:executable)
\ . ' --output=JSON '
\ . ale#Var(a:buffer, 'markdown_vale_options')
\ . ' ' . l:input_file
endfunction
call ale#linter#Define('markdown', {
\ 'name': 'vale',
\ 'executable': {b -> ale#Var(b, 'markdown_vale_executable')},
\ 'command': function('ale_linters#markdown#vale#GetCommand'),
\ 'callback': 'ale#handlers#vale#Handle',
\})
================================================
FILE: ale_linters/markdown/writegood.vim
================================================
" Author: Sumner Evans
" Description: write-good for Markdown files
call ale#handlers#writegood#DefineLinter('markdown')
================================================
FILE: ale_linters/matlab/mlint.vim
================================================
" Author: awlayton
" Description: mlint for MATLAB files
call ale#Set('matlab_mlint_executable', 'mlint')
function! ale_linters#matlab#mlint#Handle(buffer, lines) abort
" Matches patterns like the following:
"
" L 27 (C 1): FNDEF: Terminate statement with semicolon to suppress output.
" L 30 (C 13-15): FNDEF: A quoted string is unterminated.
let l:pattern = '^L \(\d\+\) (C \([0-9-]\+\)): \([A-Z]\+\): \(.\+\)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
let l:lnum = l:match[1] + 0
let l:col = l:match[2] + 0
let l:code = l:match[3]
let l:text = l:match[4]
" Suppress erroneous warning about filename
" TODO: Enable this error when copying filename is supported
if l:code is# 'FNDEF'
continue
endif
call add(l:output, {
\ 'bufnr': a:buffer,
\ 'lnum': l:lnum,
\ 'col': l:col,
\ 'text': l:text,
\ 'type': 'W',
\})
endfor
return l:output
endfunction
call ale#linter#Define('matlab', {
\ 'name': 'mlint',
\ 'executable': {b -> ale#Var(b, 'matlab_mlint_executable')},
\ 'command': '%e -id %t',
\ 'output_stream': 'stderr',
\ 'callback': 'ale_linters#matlab#mlint#Handle',
\})
================================================
FILE: ale_linters/mercury/mmc.vim
================================================
" Author: stewy33
" Description: Lints mercury files using mmc
call ale#Set('mercury_mmc_executable', 'mmc')
call ale#Set('mercury_mmc_options', '--make --output-compile-error-lines 100')
function! ale_linters#mercury#mmc#GetCommand(buffer) abort
return '%e --errorcheck-only '
\ . ale#Var(a:buffer, 'mercury_mmc_options')
\ . ' %s:t:r'
endfunction
function! ale_linters#mercury#mmc#Handle(buffer, lines) abort
" output format
" :: :
let l:pattern = '\v^\w+\.m:(\d+):\s+([W|w]arning|.*[E|e]rror.*): (.*)'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': substitute(l:match[1], '\v^0*', '', '') + 0,
\ 'type': l:match[2][0] =~? 'W' ? 'W' : 'E',
\ 'text': l:match[2] . ': ' . l:match[3]
\})
endfor
return l:output
endfunction
call ale#linter#Define('mercury', {
\ 'name': 'mmc',
\ 'output_stream': 'stderr',
\ 'executable': {b -> ale#Var(b, 'mercury_mmc_executable')},
\ 'cwd': '%s:h',
\ 'command': function('ale_linters#mercury#mmc#GetCommand'),
\ 'callback': 'ale_linters#mercury#mmc#Handle',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/nasm/nasm.vim
================================================
" Author: Oyvind Ingvaldsen
" Description: NASM linter for asmsyntax nasm.
call ale#Set('nasm_nasm_executable', 'nasm')
call ale#Set('nasm_nasm_options', '')
function! ale_linters#nasm#nasm#GetCommand(buffer) abort
" Note that NASM requires a trailing slash for the -I option.
let l:separator = has('win32') ? '\' : '/'
let l:output_null = has('win32') ? 'NUL' : '/dev/null'
return '%e -X gnu -I %s:h' . l:separator
\ . ale#Pad(ale#Var(a:buffer, 'nasm_nasm_options'))
\ . ' %s'
\ . ' -o ' . l:output_null
endfunction
function! ale_linters#nasm#nasm#Handle(buffer, lines) abort
" Note that we treat 'fatal' as errors.
let l:pattern = '^.\+:\(\d\+\): \([^:]\+\): \(.\+\)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'type': l:match[2] =~? 'error\|fatal' ? 'E' : 'W',
\ 'text': l:match[3],
\})
endfor
return l:output
endfunction
call ale#linter#Define('nasm', {
\ 'name': 'nasm',
\ 'output_stream': 'stderr',
\ 'lint_file': 1,
\ 'executable': {b -> ale#Var(b, 'nasm_nasm_executable')},
\ 'command': function('ale_linters#nasm#nasm#GetCommand'),
\ 'callback': 'ale_linters#nasm#nasm#Handle',
\})
================================================
FILE: ale_linters/nim/nimcheck.vim
================================================
" Author: Baabelfish
" Description: Typechecking for nim files
let s:end_col_patterns = [
\ '\v''([^'']+)'' is declared but not used.*',
\ '\videntifier expected, but found ''([^'']+)''',
\ '\vimported and not used: ''([^'']+)''.*',
\ '\vundeclared identifier: ''([^'']+)''',
\ '\v''([^'']+)'' cannot be assigned to',
\ '\vredefinition of ''([^'']+)'';',
\]
function! ale_linters#nim#nimcheck#Handle(buffer, lines) abort
let l:buffer_filename = fnamemodify(bufname(a:buffer), ':p:t')
let l:pattern = '^\(.\+\.nim\)(\(\d\+\), \(\d\+\)) \(.\+\)'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
" Only show errors of the current buffer
" NOTE: Checking filename only is OK because nim enforces unique
" module names.
let l:temp_buffer_filename = fnamemodify(l:match[1], ':p:t')
if l:buffer_filename isnot# '' && l:temp_buffer_filename isnot# l:buffer_filename
continue
endif
let l:item = {
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'text': l:match[4],
\ 'type': 'W',
\}
" Extract error type from message of type 'Error: Some error message'
let l:error_match = matchlist(l:item.text, '^\(.\{-}\): \(.\+\)$')
if !empty(l:error_match)
if l:error_match[1] is# 'Error'
let l:item.type = 'E'
let l:item.text = l:error_match[2]
elseif l:error_match[1] is# 'Warning'
\|| l:error_match[1] is# 'Hint'
let l:item.text = l:error_match[2]
endif
endif
let l:code_match = matchlist(l:item.text, '\v^(.+) \[([^ \[]+)\]$')
if !empty(l:code_match)
let l:item.text = l:code_match[1]
let l:item.code = l:code_match[2]
endif
" Find position end_col.
for l:col_match in ale#util#GetMatches(l:item.text, s:end_col_patterns)
let l:item.end_col = l:item.col + len(l:col_match[1]) - 1
endfor
call add(l:output, l:item)
endfor
return l:output
endfunction
function! ale_linters#nim#nimcheck#GetCommand(buffer) abort
return 'nim check --verbosity:0 --colors:off --listFullPaths %s'
endfunction
call ale#linter#Define('nim', {
\ 'name': 'nimcheck',
\ 'executable': 'nim',
\ 'output_stream': 'both',
\ 'command': function('ale_linters#nim#nimcheck#GetCommand'),
\ 'callback': 'ale_linters#nim#nimcheck#Handle',
\ 'lint_file': 1,
\})
================================================
FILE: ale_linters/nim/nimlsp.vim
================================================
" Author: jeremija
" Description: Support for nimlsp (language server for nim)
call ale#Set('nim_nimlsp_nim_sources', '')
function! ale_linters#nim#nimlsp#GetProjectRoot(buffer) abort
let l:project_root = ale#path#FindNearestDirectory(a:buffer, '.git')
if !empty(l:project_root)
return fnamemodify(l:project_root, ':h:h')
endif
return ''
endfunction
function! ale_linters#nim#nimlsp#GetCommand(buffer) abort
let l:nim_sources = ale#Var(a:buffer, 'nim_nimlsp_nim_sources')
if !empty(l:nim_sources)
let l:nim_sources = ale#Escape(l:nim_sources)
endif
return '%e' . ale#Pad(l:nim_sources)
endfunction
call ale#linter#Define('nim', {
\ 'name': 'nimlsp',
\ 'lsp': 'stdio',
\ 'executable': 'nimlsp',
\ 'command': function('ale_linters#nim#nimlsp#GetCommand'),
\ 'language': 'nim',
\ 'project_root': function('ale_linters#nim#nimlsp#GetProjectRoot'),
\})
================================================
FILE: ale_linters/nix/deadnix.vim
================================================
call ale#Set('nix_deadnix_executable', 'deadnix')
call ale#Set('nix_deadnix_options', '')
function! ale_linters#nix#deadnix#GetCommand(buffer) abort
return '%e -o json' . ale#Pad(ale#Var(a:buffer, 'nix_deadnix_options')) . ' -- %t'
endfunction
call ale#linter#Define('nix', {
\ 'name': 'deadnix',
\ 'executable': {b -> ale#Var(b, 'nix_deadnix_executable')},
\ 'command': function('ale_linters#nix#deadnix#GetCommand'),
\ 'callback': 'ale#handlers#deadnix#Handle',
\})
================================================
FILE: ale_linters/nix/nix.vim
================================================
" Author: Alistair Bill <@alibabzo>
" Author: Maximilian Bosch