Previous Post | Top | Next Post |
TOC
Revisit syntax checkers and beyond
Let me revisit recent situation over static syntax checkers mentioned in Re-learning Vim (2).
Under NeoVim (>0.7) with Lua, LSP ecosystem around
nvim-lspconfig can be used to
access local syntax checkers and code style formatter using null-ls.nvim
.
- upstream: null-ls.nvim.
Many required packages for this seem to be compiled and installed by
- currently:
nvim-lsp-installer
(upstream: https://github.com/williamboman/nvim-lsp-installer) - Next:
mason.nvim
(upstream: https://github.com/williamboman/mason.nvim)
Shell with LS
- static syntax checker package:
shellcheck
(deb) - upstream: shellcheck
- use configuration file:
~/.shellcheckrc
. See its section in manpage for shellcheck
# SC2006: Use $(...) notation instead of legacy backticked `...`.
disable=SC2006
Python
My old ways
- static syntax checker package:
flake8
(deb) - upstream: flake8
- use configuration files to set them quiet to avoid excessive noise.
~/.pycodestyle
[pycodestyle]
count = False
ignore = E203,E226,E302,E41
max-line-length = 160
statistics = True
- static syntax checker packages:
pylint
(deb) - upstream: pylint
- configuration:
~/.plintrc
;pylintrc
orproject.toml
(cwd)
My new ways with LS
- install backend python tool with
pip install pyright
- install language server with
npm i -g pyright
- Static type checker for Python
- upstream: Pyright
Independent reformatter
I also use an independent code re-formatter package: black
.
- upstream: black
- configuration file (command line tool):
[tool.black]
section inpyproject.toml
- Adjust other tools to
max-line-length = 88
One more tool is isort
for import
.
- upstream: isort
Lua with LS
- rust cargo package / Node.js npm package
- upstream: StyLua
- configuration file:
.stylua.toml
(project root)
column_width = 120
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferDouble"
no_call_parentheses = true
collapse_simple_statement = "Always"
Others with LS
It seems there are supports not only on HTML but also markdown etc.
External linter of interest
For Perl, perltidy
looks interesting. See how Debian devscripts
source uses it.
Previous Post | Top | Next Post |