ea4k / klog

KLog is a multiplatform free hamradio logger. It runs natively on Linux, macOS and Windows.
https://www.klog.xyz
GNU General Public License v3.0
68 stars 25 forks source link

Code style is missing (src/README-DEVEL) #643

Open ikbenkous opened 7 months ago

ikbenkous commented 7 months ago

I suppose the code style describing brackets/spaces/tabs/etc was either never there or was deleted. See here: https://github.com/ea4k/klog/blob/d308f9862ddb2f3895f3c6f7452f2327f94ea83e/src/README-DEVEL#L133-L134

Suggestions:

  1. Move README-DEVEL and any other text files out of /src/ and into / (or maybe /docs/ or /txt/)
  2. Regarding the code style:
    • See if the code style was ever present, restore it and update it to reflect modern C++ features/recommendations
    • Maybe just write a new code style altogether from scratch
  3. Maybe add a make lint target to run a linter (should be a separate issue)
ikbenkous commented 1 week ago

I believe there are recommendations for header include order. The recommended way being: First the most specific header, then library headers, then standard libraries. klog does the exact opposite, which is a common coding style even in other C++ projects.

I can't find the exact Core C++ guideline, but it may be in there. Or maybe it's bad advice. Please let me know. But if it's good advice, put it in the klog coding style I guess?

Here's at least someone's blog post about it: https://blog.knatten.org/2010/07/01/the-order-of-include-directives-matter/