// plugins

clang-format Plugin

Formats C, C++, and Objective-C code via a Wasm port of clang-format.

Formats .c, .cc, .cpp, .cxx, .h, .hh, .hpp, .hxx, .m, and .mm files.

Install and Setup

In your project's directory with a dprint.json file, run:

dprint add sargunv/dprint-clang-format

This will update your config file to have an entry for the plugin. Then optionally specify a "clangFormat" property to add configuration:

{
  "clangFormat": {
    // clangFormat config goes here
  },
  "plugins": [
    "https://plugins.dprint.dev/sargunv/dprint-clang-format-x.x.x.wasm"
  ]
}

Configuration

Configuration uses clang-format's own option names represented as JSON. See the plugin documentation and the clang-format style options.