From 59745780e3c747493c20dc2e62dd768f64e52808 Mon Sep 17 00:00:00 2001 From: Ivan Yordanov Date: Wed, 25 Oct 2023 11:42:35 +0300 Subject: [PATCH] docs(dev): python code style --- docs/docs/developer/formatting.md | 12 ------------ docs/docs/developer/style.md | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 12 deletions(-) delete mode 100644 docs/docs/developer/formatting.md create mode 100644 docs/docs/developer/style.md diff --git a/docs/docs/developer/formatting.md b/docs/docs/developer/formatting.md deleted file mode 100644 index 54ea1b6d9..000000000 --- a/docs/docs/developer/formatting.md +++ /dev/null @@ -1,12 +0,0 @@ -# Formatting - -## Markdown - -To ensure a consistent markdown style, we use [dprint](https://dprint.dev) to check and reformat. - -```shell -dprint fmt -``` - -Use the [official documentation](https://dprint.dev/setup/) to set up dprint. -The configuration can be found [here](https://github.com/bakdata/kpops/blob/main/dprint.json). diff --git a/docs/docs/developer/style.md b/docs/docs/developer/style.md new file mode 100644 index 000000000..ef08e5ad3 --- /dev/null +++ b/docs/docs/developer/style.md @@ -0,0 +1,27 @@ +# Style + +## Python + +To ensure a consistent Python code style, we use [Ruff](https://docs.astral.sh/ruff/) for both linting and formatting. + +### Configuration + +Our configuration can be found in [KPOps](https://github.com/bakdata/kpops)' top-level `pyproject.toml`. + +### Editor integration + +Below are listed existing Ruff plugins/extensions for some of the most popular python IDEs. If you cannot find your Editor of choices or you want something more custom, [`ruff-lsp`](https://github.com/astral-sh/ruff-lsp) enables Ruff to be used in any editor that supports the LSP + +- [VSCode](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff) +- [PyCharm](https://plugins.jetbrains.com/plugin/20574-ruff) + +## Markdown + +To ensure a consistent markdown style, we use [dprint](https://dprint.dev) to check and reformat. + +```shell +dprint fmt +``` + +Use the [official documentation](https://dprint.dev/setup/) to set up dprint. +The configuration can be found [here](https://github.com/bakdata/kpops/blob/main/dprint.json).