Skip to main content

Lint tool for Vim script Language

Project description

logo

Development Status Latest Version Supported Python versions Supported Python implementations Build Status

Vint is a Vim script Language Lint. The goal to reach for Vint is:

  • Highly extensible

  • Highly customizable

  • High performance

But now, Vint is under development. We hope you develop a policy to help us.

Quick start

You can install with pip.

$ pip install vim-vint

You can use Vint with scrooloose/syntastic:

let g:syntastic_vim_checkers = ['vint']

Configure

Vint will read config files on the following priority order:

  • User config:

  • e.g. ~/.vintrc.yaml (the filename can be .vintrc.yml or .vintrc)

  • Project config:

  • e.g. path/to/proj/.vintrc.yaml (the filename can be .vintrc.yml or .vintrc)

  • Command line config:

  • e.g. $ vint --error, $ vint --max-violations 10

  • Comment config (highest priority):

  • e.g. " vint: -ProhibitAbbreviationOption +ProhibitSetNoCompatible

You can see all options on Wiki.

The default configuration is defined in default_config.yaml.

User config

You can configure global Vint config by ~/.vintrc.yaml as following:

cmdargs:
  # Checking more strictly
  severity: style_problem

  # Enable coloring
  color: true

  # Enable Neovim syntax
  env:
    neovim: true

policies:
  # Disable a violation
  ProhibitSomethingEvil:
    enabled: false

  # Enable a violation
  ProhibitSomethingBad:
    enabled: true

You can see all policy names on Vint linting policy summary.

Project config

You can configure project local Vint config by .vintrc.yaml as following:

cmdargs:
  # Checking more strictly
  severity: style_problem

  # Enable coloring
  color: true

  # Enable Neovim syntax
  env:
    neovim: true

policies:
  # Disable a violation
  ProhibitSomethingEvil:
    enabled: false

  # Enable a violation
  ProhibitSomethingBad:
    enabled: true

You can see all policy names on Vint linting policy summary.

Command line config

You can configure linting severity, max errors, … as following:

$ vint --color --style ~/.vimrc

And you can see all available options by using –help:

$ vint --help
usage: vint [-h] [-v] [-V] [-e] [-w] [-s] [-m MAX_VIOLATIONS] [-c]
            [--no-color] [-j] [-t] [--enable-neovim] [-f FORMAT]
            [--stdin-display-name STDIN_DISPLAY_NAME]
            [files [files ...]]

Lint Vim script

positional arguments:
  files                 file or directory path to lint

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -V, --verbose         output verbose message
  -e, --error           report only errors
  -w, --warning         report errors and warnings
  -s, --style-problem   report errors, warnings and style problems
  -m MAX_VIOLATIONS, --max-violations MAX_VIOLATIONS
                        limit max violations count
  -c, --color           colorize output when possible
  --no-color            do not colorize output
  -j, --json            output json style
  -t, --stat            output statistic info
  --enable-neovim       enable Neovim syntax
  -f FORMAT, --format FORMAT
                        set output format
  --stdin-display-name STDIN_DISPLAY_NAME
                        specify a file path that is used for reporting when
                        linting standard inputs

Comment config

You can enable/disable linting policies by a comment as following:

" vint: -ProhibitAbbreviationOption

let s:save_cpo = &cpo
set cpo&vim

" vint: +ProhibitAbbreviationOption

" do something...

" vint: -ProhibitAbbreviationOption

let &cpo = s:save_cpo
unlet s:save_cpo

And you can use line config comments. It can enable/disable linting policies in only one line by the postfix comment:

" vint: next-line -ProhibitUnusedVariable
let s:foobar = 'x'
echo s:{'foo' . 'bar'}

This syntax is: “ vint: [next-line] [+-]<PolicyName> [+-]<PolicyName> …. You can see all policy names on Vint linting policy summary.

Code health

Coverage Status Code Health Dependency Status

License

MIT

Acknowledgement

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vim-vint-0.4a3.tar.gz (118.3 kB view details)

Uploaded Source

Built Distribution

vim_vint-0.4a3-py2.py3-none-any.whl (106.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file vim-vint-0.4a3.tar.gz.

File metadata

  • Download URL: vim-vint-0.4a3.tar.gz
  • Upload date:
  • Size: 118.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.7

File hashes

Hashes for vim-vint-0.4a3.tar.gz
Algorithm Hash digest
SHA256 c6c03d9abd1dc21bbe2cf9c2b9945d1c096fb551d4bf5238a14af927ef56aaa2
MD5 fc919c9af705742085db01da4ccfd254
BLAKE2b-256 ba0e9d6e013a67fd251fa905ddade3fd1335b20a6abd5d13f7c3d7c062467829

See more details on using hashes here.

File details

Details for the file vim_vint-0.4a3-py2.py3-none-any.whl.

File metadata

  • Download URL: vim_vint-0.4a3-py2.py3-none-any.whl
  • Upload date:
  • Size: 106.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.7

File hashes

Hashes for vim_vint-0.4a3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b57acc2165b9d0ce81b23623a1073a8bb8c8d0c273b4c6049ef745143a505e0b
MD5 83f86550cccba638a4456c6093bc524f
BLAKE2b-256 f2ccb5f823a3c944eb0abfadc22f02a9a17587197797193f6b26390bcb0269ab

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page