Skip to content

Commit

Permalink
Improved autodoc
Browse files Browse the repository at this point in the history
  • Loading branch information
nfx committed Mar 15, 2024
1 parent 83991e1 commit 1601c8c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Checks for common mistakes and issues in Python code specifically in Databricks
* [`spark` checker](#spark-checker)
* [`E9700`: `spark-outside-function`](#e9700-spark-outside-function)
* [`E9701`: `no-spark-argument-in-function`](#e9701-no-spark-argument-in-function)
* [Testing in isolation](#testing-in-isolation)
* [Project Support](#project-support)
<!-- TOC -->

Expand Down Expand Up @@ -178,6 +179,15 @@ Function XXX is missing a 'spark' argument. Function refers to a global spark va

[[back to top](#databricks-labs-pylint-plugin)]

## Testing in isolation
To test this plugin in isolation, you can use the following command:

```bash
pylint --load-plugins=databricks.labs.pylint.all --disable=all --enable=unsupported-runtime,missing-data-security-mode,internal-api,pat-token-leaked,dbutils-notebook-run,dbutils-credentials,dbutils-fs-mount,dbutils-fs-ls,dbutils-fs-head,dbutils-fs-cp,incompatible-with-uc,legacy-cli,notebooks-percent-run,notebooks-too-many-cells,spark-outside-function,no-spark-argument-in-function .
```

[[back to top](#databricks-labs-pylint-plugin)]

<!-- END CHECKS -->

# Project Support
Expand Down
8 changes: 8 additions & 0 deletions scripts/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

def do_something():
out = ["<!-- CHECKS -->\n"]
symbols = []
linter = PyLinter()
for checker in [
AirflowChecker(linter),
Expand All @@ -26,6 +27,13 @@ def do_something():
out.append(f"### `{msg_def.msgid}`: `{msg_def.symbol}`\n")
out.append(f"{msg_def.msg.replace('%s', 'XXX')}. {msg_def.description}")
out.append("\n[[back to top](#databricks-labs-pylint-plugin)]\n")
symbols.append(msg_def.symbol)
out.append("## Testing in isolation")
out.append("To test this plugin in isolation, you can use the following command:\n")
out.append("```bash")
out.append(f"pylint --load-plugins=databricks.labs.pylint.all --disable=all --enable={','.join(symbols)} .")
out.append("```")
out.append("\n[[back to top](#databricks-labs-pylint-plugin)]\n")
out.append("<!-- END CHECKS -->")
checker_docs = "\n".join(out)
readme_file = Path(__file__).parent.parent.joinpath("README.md")
Expand Down

0 comments on commit 1601c8c

Please sign in to comment.