From b3bd147a06b013efca688ef5dafdfa732a036346 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Tue, 11 Feb 2020 17:50:50 +0100 Subject: Add code style tools and modify python copyright with 120 characters [skip ci] --- for_dev/code_conventions.md | 17 ++++++++++++++++- for_dev/copyright_template.py | 6 ++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/for_dev/code_conventions.md b/for_dev/code_conventions.md index 5882f78e..7f9f7471 100644 --- a/for_dev/code_conventions.md +++ b/for_dev/code_conventions.md @@ -21,6 +21,21 @@ * 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)`. +### Code style +We are using [google c++ style guide](https://google.github.io/styleguide/cppguide.html) recommendations with 120 characters per line of code. +[clang-format](https://clang.llvm.org/docs/ClangFormat.html) can be used to format automatically your code: +```bash +cd src # there is a .clang-format file with these specifications +clang-format -style=file -i Simplex_tree/include/gudhi/Simplex_tree.h # -i means in place, your file will be modified +``` + ## Python -In progress... \ No newline at end of file +In progress... + +### Code style +We are using [PEP8 Python style guide](https://www.python.org/dev/peps/pep-0008/) recommendations with 120 characters per line of code. +[black](https://black.readthedocs.io/en/stable/) can be used to format automatically your code: +```bash +black -l 120 src/python/example/bottleneck_basic_example.py +``` diff --git a/for_dev/copyright_template.py b/for_dev/copyright_template.py index 19de05e2..667f985d 100644 --- a/for_dev/copyright_template.py +++ b/for_dev/copyright_template.py @@ -1,7 +1,5 @@ -# This file is part of the Gudhi Library - https://gudhi.inria.fr/ - -# which is released under MIT. -# See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license -# details. +# This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT. +# See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details. # Author(s): [AUTHOR NAME] # # Copyright (C) [YEAR] [COPYRIGHT] -- cgit v1.2.3