diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2020-01-20 16:59:13 +0100 |
---|---|---|
committer | Marc Glisse <marc.glisse@inria.fr> | 2020-01-20 16:59:13 +0100 |
commit | 463043e08e9c8938af96d7220a6d5bb77fc064d8 (patch) | |
tree | 2b150676eeb8cfa2a0dc3f2a7a1344c1501f87b0 /code_conventions.md | |
parent | a7f3167ffb465bd6d1e3b9e40bc6f1c35daf87fc (diff) | |
parent | 653b8ff129a9676d1bc69ee5231cf12f9aadd7e9 (diff) |
Merge remote-tracking branch 'origin/master' into ext
Diffstat (limited to 'code_conventions.md')
-rw-r--r-- | code_conventions.md | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/code_conventions.md b/code_conventions.md new file mode 100644 index 00000000..5882f78e --- /dev/null +++ b/code_conventions.md @@ -0,0 +1,26 @@ +# Naming conventions + +## C++ + +### In the code: +* The classes and functions of a package should be in a sub-namespace of the `Gudhi` namespace. The sub-namespace names are in lowercase and use underscore separators. E.g. `Gudhi::package_name::` +* Concepts are named with camel case starting with uppercase. E.g. `PersistentHomology` for the concept of Persitence homology. +* Classes start with an uppercase letter and use underscore separators. E.g. `Skeleton_blocker_contractor`. +* Member functions and free functions are in lowercase and use underscore separators. E.g. `int num_vertices()`. +* Constants and macros are in uppercase. +* Macros should begin with the prefix `GUDHI_`. + +### File names: +* All headers are named *.h and all sources are named *.cpp. +* If a single class or function is provided in a file, its name (with the same letter case) should be used for the file name. +* If a file does not contain a single class, its name should not begin with a capital letter. +* Test files should be called `test_[what_is_tested].cpp`. E.g. `test_sparsify_point_set.cpp` +* Example files should be called `example_[what_it_is].cpp`. E.g. `example_sparsify_point_set.cpp` + +### In CMakeLists.txt files: +* The name of the "project" should be in this form: `Package_[tests|examples|…]`. E.g. `project(Simplex_tree_examples)`. +* The name if each "target" (first parameter of add_executable) should be in this form: `Package_{name of the cpp file without extension}`. E.g `add_executable(Subsampling_test_sparsify_point_set test_sparsify_point_set.cpp)`. + +## Python + +In progress...
\ No newline at end of file |