Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add toml formatter to dprint #386

Merged
merged 8 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Install docs dependencies
run: poetry install --with docs

- name: Check markdown formatting
- name: Check markdown, toml formatting
uses: dprint/check@v2.2
if: runner.os == 'Linux'

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ repos:
)$
require_serial: true
- id: dprint
name: dprint
name: dprint
entry: dprint fmt
language: system
types: [markdown]
Expand Down
4 changes: 4 additions & 0 deletions docs/docs/developer/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ Our configuration can be found in [KPOps](https://github.com/bakdata/kpops)' top
### Markdown

To ensure a consistent markdown style, we use [dprint](https://dprint.dev)'s [Markdown code formatter](https://dprint.dev/plugins/markdown/). Our configuration can be found [here](https://github.com/bakdata/kpops/blob/main/dprint.json).

### TOML

To ensure a consistent TOML style, we use [dprint](https://dprint.dev)'s [TOML code formatter](https://dprint.dev/plugins/toml/). Our configuration can be found [here](https://github.com/bakdata/kpops/blob/main/dprint.json).
7 changes: 5 additions & 2 deletions dprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
"$schema": "https://dprint.dev/schemas/v0.json",
"incremental": true,
"markdown": {},
"toml": {},
"includes": [
"**/*.{md}"
"**/*.{md}",
"**/*.{toml}"
],
"excludes": [
".pytest_cache/**",
Expand All @@ -15,6 +17,7 @@
"**/config_env_vars.md"
],
"plugins": [
"https://plugins.dprint.dev/markdown-0.16.0.wasm"
"https://plugins.dprint.dev/markdown-0.16.0.wasm",
"https://plugins.dprint.dev/toml-0.5.4.wasm"
]
}
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ mike = "^1.1.2"

[tool.ruff]
ignore = [
# Rules in conflict with `ruff-format` -- START
# Rules in conflict with `ruff-format` -- START
"W191", # Checks for indentation that uses tabs. Spaces are preferred.
# "E111", # Checks for indentation with a non-multiple of 4 spaces, add when out of nursery
# "E114", # Checks for indentation of comments with a non-multiple of 4 spaces, add when out of nursery
Expand All @@ -83,11 +83,11 @@ ignore = [
"COM819", # Checks for the presence of prohibited trailing commas.
"ISC001", # Checks for implicitly concatenated strings on a single line.
"ISC002", # Checks for implicitly concatenated strings that span multiple lines.
# Rules in conflict with `ruff-format` -- END
# Rules in conflict with `ruff-format` -- END
"D1", # Missing docstring for {} -- Inconvenient to enforce
# The following "D" rules do not correspond to our coding style. We use the pep257 convention, but
# "D212" should not be ignored. In ruff (0.0.291) we cannot select a rule that is excluded by specifying
# a convention, hence our only option is to manually replicate it.
# The following "D" rules do not correspond to our coding style. We use the pep257 convention, but
# "D212" should not be ignored. In ruff (0.0.291) we cannot select a rule that is excluded by specifying
# a convention, hence our only option is to manually replicate it.
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"D214", # Section is over-indented ("{name}")
Expand Down