Skip to content

Commit

Permalink
docs: Import 'yamllint.config' rather than 'yamllint'
Browse files Browse the repository at this point in the history
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 #698
  • Loading branch information
adrienverge committed Nov 20, 2024
1 parent 95e17b3 commit 8513d9b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 8513d9b

Please sign in to comment.