From 06db2af9b08555be1d0956bec490068c519e25c9 Mon Sep 17 00:00:00 2001 From: Okue Date: Tue, 31 Jan 2023 02:04:51 +0900 Subject: [PATCH] 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. --- docs/development.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/development.rst b/docs/development.rst index a706836..b179de2 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -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