BlueBrain / hpc-coding-conventions

Apache License 2.0
7 stars 5 forks source link

Formatting utility does not work correctly for submodules #156

Open olupton opened 1 year ago

olupton commented 1 year ago

This code: https://github.com/BlueBrain/hpc-coding-conventions/blob/c539260e20d94033ce2eaa69e0aab1c78451d4d6/cpp/lib.py#L59-L91

does not return the expected result when run inside a submodule.

Given a parent project /path/to/parent with a submodule /path/to/parent/external/child the above code returns /path/to/parent/.git/modules/external when run in /path/to/parent/external/child.

olupton@ewaewa child % pwd
/path/to/parent/external/child
olupton@ewaewa child % git rev-parse --git-dir
/path/to/parent/.git/modules/external/child

This means that the formatting utility fails to find /path/to/parent/external/child/.bbp-project.yaml and formatting the child project fails.

(Example: NMODL as a submodule of NEURON)