koreader-base icon indicating copy to clipboard operation
koreader-base copied to clipboard

Makefile and CMake style

Open Frenzie opened this issue 6 years ago • 5 comments

I want to get rid of uppercase commands in the CMake files. It's currently a bit of a hodgepodge with a majority lowercase and I think it negatively affects maintainability (i.e., it takes me more time to scan than I think it should). Cf. https://community.kde.org/Policies/CMake_Coding_Style#Upper.2Flower_casing

Enforcement isn't completely self-evident but cmake-lint would probably do the job for some basic checks, also see https://gitlab.kitware.com/cmake/cmake/issues/17441

On a related note, https://github.com/mrtazz/checkmake exists to do similar things for Makefiles. There's also https://github.com/softprops/mint but at a glance that doesn't seem to do much other than checking if all targets exist.

Frenzie avatar Mar 19 '19 11:03 Frenzie

First-pass added in https://github.com/koreader/koreader-base/pull/872.

Frenzie avatar Mar 21 '19 07:03 Frenzie

Is this still relevant?

benoit-pierre avatar May 29 '24 19:05 benoit-pierre

I wouldn't mind having an autoformatter and/or linter for CMake like https://github.com/yamadapc/cmakefmt in place to keep things consistent.

Its output isn't dissimilar to how you reformatted things. But I'm also fine without.

Frenzie avatar May 29 '24 19:05 Frenzie

This might be more useful: https://github.com/cmake-lint/cmake-lint.

benoit-pierre avatar May 29 '24 19:05 benoit-pierre

Yes, but I wasn't aware it had been forked and continued. :-)

Frenzie avatar May 29 '24 19:05 Frenzie