docs: Fix misleading Python API example

`yamllint.linter.run("example.yaml", yaml_config)` example seems
`yamllint.linter.run` opens a given file.
It's misleading.
This commit is contained in:
Okue 2023-01-31 02:04:51 +09:00 committed by GitHub
parent b9e1fd18c1
commit 06db2af9b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,7 +11,7 @@ Basic example of running the linter from Python:
import yamllint
yaml_config = yamllint.config.YamlLintConfig("extends: default")
for p in yamllint.linter.run("example.yaml", yaml_config):
for p in yamllint.linter.run(open("example.yaml", "r"), yaml_config):
print(p.desc, p.line, p.rule)
.. automodule:: yamllint.linter