-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
dprint is an awesome Rust-based tool that formats code, markdown, yaml, json, and more. It's faster than prettier and more importantly, exposes more knobs to control the formatting.
Since dprint doesn't support C++, it can call out to an external tool to do the formatting. In this case, we should be able to wire up clang-format.
Example dprint.json:
{
"typescript": {
"arguments.trailingCommas": "never",
"lineWidth": 90,
"parameters.trailingCommas": "never",
"quoteStyle": "preferSingle",
"trailingCommas": "onlyMultiLine",
"useTabs": true
},
"json": {
},
"markdown": {
},
"toml": {
},
"malva": {
},
"markup": {
},
"yaml": {
"quotes": "preferSingle"
},
"excludes": [
"**/node_modules",
"**/*-lock.json"
],
"exec": {
"commands": [
{
"command": "clang-format -i {{file_path}}",
"exts": ["cpp", "cc", "cxx", "h", "hpp"]
}
]
},
"plugins": [
"https://plugins.dprint.dev/typescript-0.95.12.wasm",
"https://plugins.dprint.dev/json-0.21.0.wasm",
"https://plugins.dprint.dev/markdown-0.20.0.wasm",
"https://plugins.dprint.dev/toml-0.7.0.wasm",
"https://plugins.dprint.dev/g-plane/malva-v0.15.0.wasm",
"https://plugins.dprint.dev/g-plane/markup_fmt-v0.24.0.wasm",
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm"
]
}We may also need to specify the includes:
"includes": ["**/*.{cpp,cc,cxx,h,hpp}"]Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request