On 5/28/21 3:13 PM, Denis Kenzior wrote:
>> All applied. I did have to massage the formatting in patch 2 to fit
>> into 80 columns.
> Thanks. And sorry about the formatting...
Generally checkpatch.pl from linux kernel would catch most of these. We
do not allow mixed tabs and spaces, but my vim syntax highlighting
usually catches most of these...
> I think it would be worth adding a .clang-format file to the project -
> what do you think? As a starting point, the kernel's .clang-format seems
Hmm, you might have to educate me here. Do note that we do not compile
with clang right now due to _auto_ fu in useful.h.
Despite the name, clang-format is just a code formatting tool. Or
something like a glorified .editor-config. It reads a .clang-format
configuration file and takes a .c/.h/etc. file as an input. It outputs
the same file, reformatted according to the configuration. Most editors
like Emacs/vim/etc. have support for it, maybe via plugins. Here's
something for vim: https://github.com/rhysd/vim-clang-format
Just something to consider. But like I said, I could not figure out how
to make it not use mixed tabs and spaces.
> pretty close already. The main difference seems to be that it uses
> spaces after tabs to align parameters across multiple lines. I tried
> unsuccessfully to persuade it not to use any spaces for alignment, but
> I'm no expert.
Right. We have a few more house rules documented in doc/coding-style.txt.