Linter

The sdr library uses pylint for static analysis and code formatting.

Install

First, pylint needs to be installed on your system. Easily install it by installing the development dependencies.

$ python3 -m pip install -r requirements-dev.txt

Configuration

Various nuisance pylint warnings are added to an ignore list in pyproject.toml.

pyproject.toml
[tool.pylint]
ignore-paths = [
    "src/sdr/_version.py",
]
disable = [
    "comparison-with-callable",  # pylint doesn't understand metaclass properties
    "fixme",
    "global-statement",
    "invalid-name",
    "missing-function-docstring",
    "protected-access",
    "too-many-ancestors",
    "too-many-arguments",
    "too-many-branches",
    "too-many-instance-attributes",
    "too-many-lines",
    "too-many-locals",
    "too-many-public-methods",
    "unneeded-not",
]
min-similarity-lines = 100
max-line-length = 120

Run from the command line

Run the linter manually from the command line.

$ python3 -m pylint src/sdr/

Run from VS Code

Included is a VS Code configuration file .vscode/settings.json. This instructs VS Code about how to invoke pylint. VS Code will run the linter as you view and edit files.


Last update: Aug 06, 2023