From 8513d9b97da3b32453b3fccb221f4ab134a028d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Verg=C3=A9?= Date: Sat, 16 Nov 2024 17:55:08 +0100 Subject: [PATCH] docs: Import 'yamllint.config' rather than 'yamllint' Since yamllint version 0.5.2 (in 2016, just after yamllint was created) this example in documentation doesn't work. Indeed, commit dbbecb5 (which aimed to solve another problem) removed the ability to import yamllint submodules directly. This commit makes it clearer inside documentation. Fixes https://github.com/adrienverge/yamllint/issues/698 --- docs/development.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/development.rst b/docs/development.rst index b179de27..edc1f61a 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -8,7 +8,8 @@ Basic example of running the linter from Python: .. code-block:: python - import yamllint + import yamllint.config + import yamllint.linter yaml_config = yamllint.config.YamlLintConfig("extends: default") for p in yamllint.linter.run(open("example.yaml", "r"), yaml_config):