Skip to content

Commit

Permalink
docs: Fix misleading Python API example
Browse files Browse the repository at this point in the history
`yamllint.linter.run("example.yaml", yaml_config)` example seems
`yamllint.linter.run` opens a given file.
It's misleading.
  • Loading branch information
okue committed Jan 30, 2023
1 parent b9e1fd1 commit 06db2af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 06db2af

Please sign in to comment.