Open krizhanovsky opened 1 month ago
When we start developing, we need to enable git hooks: https://github.com/tempesta-tech/tempesta/wiki/Development-guidelines#coding-style
There are many existing errors and warnings that we need developers to fix. It is not necessary to do the fixes for all source files at once, the pre-commit hook will only check the modified/added/copied files for the current commit, so it is best to do it gradually.
Most can be fixed automatically with the --fix-inplace
option, others can only be done manually.
@kingluo yeah, I didn't mean to fix coding style around the whole project within this issue.
For now I just want to make all the code authors to validate their own code (i.e. we need to run the tool of patch/diffs, not the .c/.h files) and fix their code and the code around the new code.
This task should get rid of time spending on reviewing coding style issues in PRs.
Motivation
It's too time consuming to comment coding style violations in each pull request.
Scope
The Linux kernel provides checkpatch.pl script, which verifies patches along regular C files. We should either integrate it into git commit hook or github actions to be run on each pull request, that an author can fix all the violation w/o reviewer.
An example:
Adjustments
We still have small changes from the kernel Coding style, which must be changed in the script:
typedef
usage for types https://github.com/tempesta-tech/tempesta/blob/master/CodingStyle#L293