freebsd / atf

Libraries to write tests in C, C++ and shell
Other
133 stars 45 forks source link

Adopt style(9) using clang-format #55

Open fel1x-developer opened 8 months ago

fel1x-developer commented 8 months ago

I find atk's coding style doesn't follow some conventions, such as having space in <> or putting pointer * or reference symbol & with variable types, not variable names.

FreeBSD's coding style style(9) can be applied here. One main exception in style(9) opposed to the "convention" is that style(9) use 8-space indentation while most projects use 4-space indentation. (2-space indentation is predominant in web dev). We can discuss whether or not to use 8-space indentation if needed.

ngie-eign commented 4 months ago

Was this pulled from FreeBSD? If so, it might be better to figure out a way to keep this file in sync, somehow, instead of it drifting too far from upstream (freebsd-src).

fel1x-developer commented 4 months ago

Was this pulled from FreeBSD? If so, it might be better to figure out a way to keep this file in sync, somehow, instead of it drifting too far from upstream (freebsd-src).

For now, automatically tracking updates in the freebse-src upstream is impossible. We can use post-commit hook as an alternative.

By the way, the .clang-format file is not updated quite often. It had only 2 major changes in the last 3 years, so I think updating manually from the upstream would be fine.

ngie-eign commented 3 months ago

Could you please add a comment to the file to note where it came from (FreeBSD; git revision <...>)? Thanks :).