# my docstring
# Parameters:
# target: The target
function(my_add_executable target)
add_executable(${target})
endfunction()
works just fine, using CMakes block comment feature like this
#[[
my docstring
Parameters:
target: The target
]]
function(my_add_executable target)
add_executable(${target})
endfunction()
will cause a linter error:
cmake/test.cmake:07,00: [C0112] Empty docstring on function or macro declaration
It would be a nice feature if the linter understands block comments as docstrings, especially if you have rather long docstrings. It's funny that the markdown code parser doesn't understand it either (as you can see above) since it isn't such a new CMakeFeature as you can see in this rather old (edited 2018) Stackoverflow answer
Here is an example:
While this
works just fine, using CMakes block comment feature like this
will cause a linter error:
It would be a nice feature if the linter understands block comments as docstrings, especially if you have rather long docstrings. It's funny that the markdown code parser doesn't understand it either (as you can see above) since it isn't such a new CMakeFeature as you can see in this rather old (edited 2018) Stackoverflow answer