Skip to content
Snippets Groups Projects
Select Git revision
  • 35908346b20b524d4d2d9f8f6220800c27595413
  • develop default protected
  • feature/gmsh-reader
  • feature/reconstruction
  • save_clemence
  • origin/stage/bouguettaia
  • feature/kinetic-schemes
  • feature/local-dt-fsi
  • feature/composite-scheme-sources
  • feature/composite-scheme-other-fluxes
  • feature/serraille
  • feature/variational-hydro
  • feature/composite-scheme
  • hyperplastic
  • feature/polynomials
  • feature/gks
  • feature/implicit-solver-o2
  • feature/coupling_module
  • feature/implicit-solver
  • feature/merge-local-dt-fsi
  • master protected
  • v0.5.0 protected
  • v0.4.1 protected
  • v0.4.0 protected
  • v0.3.0 protected
  • v0.2.0 protected
  • v0.1.0 protected
  • Kidder
  • v0.0.4 protected
  • v0.0.3 protected
  • v0.0.2 protected
  • v0 protected
  • v0.0.1 protected
33 results

CONTRIBUTING.md

Blame
  • Stephane Del Pino's avatar
    Stéphane Del Pino authored
    The CMake change is now explicit. It was implicitly required by later
    versions of Kokkos.
    
    clang-9 was failing to build the code for quite a while since it did
    not compile some proper C++17 code.
    099e62b0
    History
    After you've reviewed these contribution guidelines, you'll be all set to contribute to this project.

    Contributing to pugs


    Branches

    develop and master branches are protected. This means that one cannot push on them, so before to do any code change one has to create a working branch. The following conventions are greatly encouraged:

    • feature/my_outstanding_feature
    • issue/issue-number (if no number is related to the issue please consider opening an issue and assign it to yourself)

    Tests and coverage

    Running tests

    Tests are built automatically and are run typing

    make; make test

    all tests should be running correctly before any merge request

    Unit tests

    Unit tests are defined in the tests directory. New unit tests should be written or updated when needed.

    Coverage

    Preferably, one should install gcovr and build pugs specifying the Coverage build type > cmake -DCMAKE_BUILD_TYPE=Coverage [...]

    However coverage is computed at each push by the gitlab-ci.


    Up to date build environment using Docker

    This is the easiest way to keep your environment up to date in order to build pugs.

    Running the docker-pugs.sh script creates the image and runs it in interactive mode. The image will runs the user's permissions and his home directory is mounted.

    keep in mind that the produced executable will only run inside docker


    Coding

    packages directory

    Do not make any change in the packages directory. This directory contains third party libraries that are are mandatory to minimal builds or pugs.

    For any changes in this directory (bug report, suggestion of new library, library upgrades or downgrades) open an issue.

    Warnings

    Try to avoid publishing sources that generates compilation warnings.

    Also, avoid the use of #warning directives and prefer opening an issue.

    C++ [[deprecated]] directive should also be avoid as much as possible.

    Comments

    Do not comment deprecated code. It is git's job to keep track of old versions.

    Avoid commenting functions bodies:

    • comments are likely to be deprecates
    • if the code is not clear by itself comments will not help

    Doxygen is to be used to comment functions in the header.

    Code formatting

    clang-format is used in pugs, so install it and run

    make clang-format before any commit

    A better solution is to configure your favored editor to perform formatting automatically. For instance emacs users should copy-past the following code to their .emacs.el init file.

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;; Clang-format
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;; clang-format can be triggered using C-c C-f
    ;; Create clang-format file using google style
    ;; clang-format -style=google -dump-config > .clang-format
    (use-package clang-format
      :ensure t
      :bind (("C-c C-f" . clang-format-region))
      )
    ;; sets clang-format to be used instead of emacs indentation
    (defun clang-format-c-mode-common-hook ()
      (fset 'c-indent-region 'clang-format-region)
      (define-key c-mode-base-map (kbd "<tab>") 'clang-format-region)
      )
    (add-hook 'c-mode-common-hook 'clang-format-c-mode-common-hook)
    ;; sets clang-format to be run on save for the whole file
    (defun clang-format-buffer-on-save ()
      "Add auto-save hook for clang-format-buffer-smart."
      (add-hook 'before-save-hook 'clang-format-buffer nil t))
    (add-hook 'c-mode-common-hook 'clang-format-buffer-on-save)