mirror of
https://github.com/adrienverge/yamllint.git
synced 2024-11-21 23:27:22 -06:00
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:
parent
b9e1fd18c1
commit
06db2af9b0
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user