<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/107218>107218</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format: `BasedOnStyle: Chromium` not respecting `InsertNewlineAtEOF: true`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
thernstig
</td>
</tr>
</table>
<pre>
```c
// main.c
#include <stdio.h>
/**
* @brief Some info
*
* @param argc - The main `arg`
* @param argv - The not main arg
* @return int
*/
int main(int argc, char const* argv[]) {
printf("Foo mains\n");
return 0;
}
```
```yaml
# .clang-format
BasedOnStyle: Chromium
```
Note how `main.c` is missing a newline at the end of file. If i invoke the following it **does not** add a new line at the EOF (End Of File):
```sh
> clang-format -i src/main.c
```
If I change `.clang-format` to the following it **does** add a new line at EOF:
```yaml
BasedOnStyle: Chromium
InsertNewlineAtEOF: true
```
I cannot understand why, as Chromium has this set: https://chromium.googlesource.com/chromium/src/+/HEAD/.clang-format#13. Is this a bug?
**Version**
```sh
> clang-format --version
Ubuntu clang-format version 20.0.0 (++20240828064146+c43190f99445-1~exp1~20240828184310.1138)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVM9vqzgQ_msml1GQGRMSDhxIG7S5vB7e7t4dMOBdsCPbpNvL-9tXBtoGqY2eZAlsf_Prm88jnFOtljKH3RF2zxsx-s7Y3HfSaudVu7mY-i2HlM2rAvYMrAAqgUochNLRxxFXuurHWiLwJ-drZaIO-Gm5_TQrwpq2CFQgJOxilWzwpxkkKt2Yz8s17CqsGFDYtsIt_tnJKTxCyoRtQ3Zfg28LWBs_GwT0CmqlH61Gpf1dZCrnjdKzGdAh_IboQE9YdcJiZbTzwUkIM_MHlCHsj4ujq1XaN0AHICqNmRw52D1pIALKgL8DccmBfRzB_nn5ead-ReT74ZsY-g_-Map6odttY-wglmKOws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