Sygaldry
|
Copyright 2023 Travis J. West, Input Devices and Music Interaction Laboratory (IDMIL), Centre for Interdisciplinary Research in Music Media and Technology (CIRMMT), McGill University, Montréal, Canada, and Univ. Lille, Inria, CNRS, Centrale Lille, UMR 9189 CRIStAL, F-59000 Lille, France
SPDX-License-Identifier: MIT
This is currently a work in progress–not so much a guide as a disorganized dumping ground where I note things that contributors should probably be aware of, as well as a record of conventions I aim to follow myself.
Contributors must mark all non-trivial new documents added to the project with an appropriate copyright notice, which should include the word "Copyright", the current year, the name of the author, and the affiliations of the author who may have a stake in the copyright of their contribution, as well as an SPDX license identifier. Contributors are free to select a license according to their preferences, legal obligations, and the requirements of the components they contribute. The MIT license is recommended for new components without copyleft dependencies, except for hardware components for which one of the CERN open hardware licenses is advised. As well as marking the main literate source file, every individual file tangled from it should also be marked with a copyright and license notice. Exceptions may be made for trivial documents to which copyright arguably does not apply, e.g. a single add_subdirectory
call in a CMakeLists.txt
file.
If contributions are made to an existing file, the contributor should update the list of authors and years accordingly, e.g. adding their name as an author and adding the current year if no modifications have previously been made to the file in the current year.
There are four kinds of documentation, and this project aims to provide them all. Documentation is extremely important.
Currently, tutorials and guides remain as future work. However, the literate sources provide explanation, and the doxygen annotations provide reference. Please include this level of documentation with anything you add to the project.
The literate sources should provide context for the design rationale and implementation details of the source code, especially why a certain design and implementation is used, any alternatives that may have been considered or previously used, the opinions of the authors, and any other information about the design and implementation that is not communicated by the source code itself. This type of documentation is rarely provided; its inclusion is a deliberate and important facet of the aims of the project.
See also Literate Programming with lili.
The doxygen annotations are meant to serve as a technical reference. It should describe the code as clearly and accurately as possible, avoiding "explanation, discussion, instruction, speculation, and opinion," which belong in the literate source, tutorials, and guides.
See also Literate Programming with Doxygen.
Components are identifiable functional modules that group together a characteristic functionality or group of functionalities that the component provides when used. Examples include sensors, protocol bindings, and sound synthesis modules. Components are intended to be fairly modular and independent, so that more complex functionalities can be built up by combining several components together in an assembly.
Rules for component implementations:
inputs
void init(...)
, and a main subroutine void main(...)
cmake
library target (add_library(fully-qualified-component_name, ...)
)target_include_directories(name PUBLIC .)
)target_sources(name PRIVATE name.cpp
)add_executable(name-test name.test.cpp)
target_link_libraries(name-test PRIVATE name)
sygxx-component_name(.hpp|.impl.hpp|.cpp|.test.cpp)
doxygen
page identifier in the literate source for that component (prefixed page-
), and the doxygen
documentation module group used with \defgroup
cmake
will take care of making sure the compiler gets all the -I flags it needs as long as we use target_link_libraries
appropriately, and follow the physical design rules so that this is possiblesygxx-component.lili.md
doc/sygxx-component.tutorial.md
TODOdoc/sygxx-component.guide.md
TODOsygxx-component.meta.yaml
TODOsygxx-component.hpp
sygxx-component.impl.hpp
sygxx-component.cpp
sygxx-component.test.cpp
CMakeLists.txt
hpp
and a cpp
.CMakeLists.txt
in the same directory as an hpp
is a strong enough signal that the directory contains a self-contained component.hpp
) and implementation (.impl.hpp
)UpperCamelCase
for typenames and conceptslower_snake_case
for variables, functions, methods, and type metafunctions"quotes"
for includes within the project, <angle brackets>
for 3rd party and platform dependenciestarget_sources
, target_include_directories
, target_link_libraries
, and similar commands with more than on argument should have each argument on a line of its own, double indented wrt to command, and with the closing paren on its own line e.g.: target_sources
, then target_include_directories
, then target_link_libraries
, in that order, at most one invocation each as necessary.