// plugins

clang-format Plugin

Wrapper plugin that formats C, C++, and Objective-C code via a Wasm build 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 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": {
    // clang-format's config goes here
  },
  "plugins": [
    "npm:@dprint/clang-format@x.x.x"
  ]
}

Configuration

See Configuration

Playground

See Playground

Source

See https://github.com/dprint/dprint-plugin-clang-format