Skip to content

Commit

Permalink
Aligned user documentation with #293.
Browse files Browse the repository at this point in the history
  • Loading branch information
fvgh committed Sep 4, 2018
1 parent 360ef42 commit d12dcce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions plugin-gradle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,21 +290,27 @@ spotless {
}
```

<a name="cpp-cdt"></a>
<a name="cpp"></a>

## Applying [CDT](https://www.eclipse.org/cdt/) to C/C++ sources
## Applying to C/C++ sources

```gradle
spotless {
cpp {
target '**/*.CPP' // Change file filter. By default files with 'c', 'h', 'C', 'cpp', 'cxx', 'cc', 'c++', 'h', 'hpp', 'hh', 'hxx' and 'inc' extension are supported
eclipse().configFile 'spotless.eclipseformat.xml' // XML file dumped out by the Eclipse formatter
// If you have Eclipse preference or property files, you can use them too.
// eclipse('4.7.1') to specify a specific version of Eclipse,
// available versions are: https://github.com/diffplug/spotless/tree/master/lib-extra/src/main/resources/com/diffplug/spotless/extra/config/eclipse_cdt_formatter
licenseHeader '// Licensed under Apache' // License header
licenseHeaderFile './license.txt' // License header file
}
}
```
Use the Eclipse code-style editor to [export](https://eclipsebook.in/c-cpp-development/editing-code/code-style/) your configuration as XML file.

### Eclipse [CDT](https://www.eclipse.org/cdt/) formatter

Use the Eclipse to define the *Code Style preferences* (see [Eclipse documentation](https://www.eclipse.org/documentation/)). Within the preferences *Edit...* dialog, you can export your configuration as XML file, which can be used as a `configFile`. If no `configFile` is provided, the CDT default configuration is used.

<a name="license-header"></a>

Expand Down
2 changes: 1 addition & 1 deletion plugin-maven/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ By default, all files matching `src/main/cpp/**/*.<ext>` and `src/test/cpp/**/*.
</cpp>
</configuration>
```
Use the Eclipse code-style editor to [export](https://eclipsebook.in/c-cpp-development/editing-code/code-style/) your configuration as XML file.
Use the Eclipse to define the *Code Style preferences* (see [Eclipse documentation](https://www.eclipse.org/documentation/)). Within the preferences *Edit...* dialog, you can export your configuration as XML file, which can be used as a `configFile`. If no `configFile` is provided, the CDT default configuration is used.

<a name="format"></a>

Expand Down

0 comments on commit d12dcce

Please sign in to comment.