Getting started
Installation
Python 3.7 or higher is required. lintquarto itself has only one required package: toml.
You can install lintquarto with pip (from PyPI) or conda (from conda-forge).
Install with pip
Install lintquarto with:
pip install lintquartoLinters are installed separately. For example, to use pylint and flake8, run:
pip install pylint flake8If you want to install lintquarto along with all supported linters, use:
pip install lintquarto[all]You can verify your installation with:
lintquarto --versionInstall with conda
conda install conda-forge::lintquarto
With conda, only the main lintquarto tool is installed. If you want to use any linters or type checkers, you must install them separately (either with conda or pip, depending on availability).
Basic usage
Usage:
lintquarto -l LINTER [LINTER ...] -p PATH [PATH ...] [-e EXCLUDE [EXCLUDE ...]] [-k]
Options:
-l, --linters LINTER [LINTER ...]- linters to run.-p, --paths PATH [PATH ...]- quarto files and/or directories to include.-e, --exclude EXCLUDE [EXCLUDE ...]- optional, files and/or directories to exclude.-k, --keep-temp- optional, keep temporary.pyfiles created during linting (for debugging).
Passing extra arguments directly to linters is not supported. Only .qmd files are processed.
Examples
The linter used is interchangeable in these examples.
Lint all .qmd files in the current directory (using pylint):
lintquarto -l pylint -p .Lint several specific files (using pylint and flake8):
lintquarto -l pylint flake8 -p file1.qmd file2.qmdKeep temporary .py files after linting (with pylint)
lintquarto -l pylint -p . -kLint all files in current directory (using ruff):
- Excluding folders
examples/andignore/, or- - Excluding a specific file
analysis/test.qmd.
lintquarto -l ruff -p . -e examples,ignorelintquarto -l ruff -p . -e analysis/test.qmd