Kea issueshttps://gitlab.isc.org/isc-projects/kea/-/issues2022-07-01T17:31:12Zhttps://gitlab.isc.org/isc-projects/kea/-/issues/2470fix formatting tools to work on premium or even other repos2022-07-01T17:31:12ZAndrei Pavelandrei@isc.orgfix formatting tools to work on premium or even other repos`./tools/clang-format.sh` and `./tools/uncrustify.sh` don't currently work if you give `premium` or any other directory. There is a simple fix that can be applied to those scripts. The current directory has to be restored after each file...`./tools/clang-format.sh` and `./tools/uncrustify.sh` don't currently work if you give `premium` or any other directory. There is a simple fix that can be applied to those scripts. The current directory has to be restored after each file gets fixed.kea2.2.0 - a new stable branchAndrei Pavelandrei@isc.orgAndrei Pavelandrei@isc.orghttps://gitlab.isc.org/isc-projects/kea/-/issues/1455Automating code formatting2021-01-24T15:25:46ZAndrei Pavelandrei@isc.orgAutomating code formattingI've attempted this [once before](https://github.com/isc-projects/kea/pull/46). I'm ghost, for the shame of being rejected I had deleted my account. Kidding. But trying this one more time.
Essentially this means a `.clang-format` file d...I've attempted this [once before](https://github.com/isc-projects/kea/pull/46). I'm ghost, for the shame of being rejected I had deleted my account. Kidding. But trying this one more time.
Essentially this means a `.clang-format` file describing how code should be formatted placed at the root of the Kea repository.
The file needs to be in the root of the repository so that editors can pick up on it. vim, vscode, sublime, clion, eclipse all know to look there for it by default or with the right plugin installed. Select the code you contributed -> Format Selection. Furthermore, this is a project-specific set of settings, if you work on other projects you might not want them formatted the same way which is why it is not suited as a global set of settings. If this were to be placed in a separate repository, it would have to be copied to Kea each time. Personally, I have two practices which make this too laborius.
One - I clean my git repository very often `git clean -dffx .`, usually before each new build.
Two - I clone a separate directory for each issue, having to copy the `.clang-format` each time.
`clang-format` is de facto accepted as the best code formatter for C++.
This [.clang-format](/uploads/ff468ff6c120b060e35b055e16d3b179/.clang-format) is by design very close to [the coding guidelines](https://gitlab.isc.org/isc-projects/kea/-/wikis/Processes/coding-guidelines). It takes away the worry of having to know the coding guidelines by heart.
I noticed that [libockless](https://gitlab.isc.org/isc-projects/libockless) has one too.
What are your thoughts?kea1.9.4Andrei Pavelandrei@isc.orgAndrei Pavelandrei@isc.org