hoche / splat

SPLAT! is an RF Signal Propagation, Loss, And Terrain analysis tool for the spectrum between 20 MHz and 20 GHz. This is a copy of the code written by John Magliacane, heavily modified to clean up the code and take advantage of multithreading. This incorporates John's antenna height modifications from the as-yet-unreleased SPLAT 1.4.3.
http://www.qsl.net/kd2bd/splat.html
GNU General Public License v2.0
27 stars 6 forks source link

Implement a code style #17

Closed dBitech closed 4 years ago

dBitech commented 4 years ago

Use clang-format tool (part of the LLVM projects) to enforce a consistent style for new and refactored code.

Add a pre-commit hook to ensure style is consistent. The issue was opened to allow for discussion, PR for consideration forthcoming.

watkipet commented 4 years ago

It looks like @hoche is on the way to defining a style in Contributing.md.

It sounds like clang-format would be a nice enforcement tool. However, I know I'm temporarily breaking the coding standard left and right while I work on #6. Once I can get my stuff merged in, I'll start working closer to the coding standard. So perhaps we can implement clang-format after things have settled down a little.

watkipet commented 4 years ago

Speaking of coding standard, I'm a big fan of Doxygen. However, it requires specific comment formats, either: /** or ///. /** is common for Java and C, /// is common for C++. May we standardize on Doxygen comments? If we do, may we pick the /// style? I ask for this style because XCode can automatically generate that style but not the Javadoc (/**) style. As of 2020, I believe Eclipse CDT can automatically generate both styles. CMake can generate projects for both IDEs. I haven't found good Doxygen support in Visual Studio yet, however.

dBitech commented 4 years ago

the .clang-format style I'm proposing is based on the Google C++ style with 4 spaces as per Contributing.md We certainly could get the tooling in place to support linting via clang-format and once happy with its styling look to add the pre-commit hook.

dBitech commented 4 years ago

PR 18

hoche commented 4 years ago

Yeah, I'm ok with requiring clang-format and doxygen. @dBitech Do you already have a .clang-format file? If not I can fiddle a bit and put one together.

I picked the Google style because it's the most complete and many people are familiar with it. I picked 4 spaces because...well, it's what I've been using for 35 years and I think it's a nice compromise between visibility and not taking up two much horizontal space.

That being said, I think my code style here has varied depending on what other things I was working on at the time. I'll try to clean up some of that going forward.

And yeah, it's a little early to start enforcing this stuff at check-in time, but we should probably try to get to that point fairly soon.

Next you guys are going to want me to set up a CI system, huh.

dBitech commented 4 years ago

implemented (to start) in commit/cafab05cf503595a9b690c1ca917ca91af1590db I think this can now be closed.