Skip to content

Commit

Permalink
Adding clang-format to pre-commit hooks using Google style guide as a…
Browse files Browse the repository at this point in the history
… starting point. Apply formatting to all .cpp and .h files.
  • Loading branch information
drewoldag committed Mar 13, 2024
1 parent 4716d3e commit 8039d7f
Show file tree
Hide file tree
Showing 50 changed files with 8,915 additions and 7,863 deletions.
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
# reference: https://clang.llvm.org/docs/ClangFormatStyleOptions.html#basedonstyle
BasedOnStyle: Google
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ repos:
description: Compare current template version against latest
verbose: true
# Clear output from jupyter notebooks so that only the input cells are committed.
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.1
hooks:
- id: clang-format
name: clang-format
types_or: [c++, c]
- repo: local
hooks:
- id: jupyter-nb-clear-output
Expand Down
57 changes: 25 additions & 32 deletions src/lib/LFdata.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,42 @@ Class to store the LF non parametric data
*/

// avoid multiple def of the same class
#ifndef LF_H //check that this keyword has been set already
#ifndef LF_H // check that this keyword has been set already
#define LF_H // define the keyword to be checked

class LFdata
{

class LFdata {
private:
double zmoy;

public:
double M,value,errp,errm,z;
double M, value, errp, errm, z;
double nor, norerr;
int bin;

//constructor of the LFdata class
//overload constructor, without the redshift bin
LFdata()
{
M=-999.;
value=-999.;
errp=-999.;
errm=-999.;
z=-999.;
bin=-10;
nor=-999.;
norerr=-999.;
// constructor of the LFdata class
// overload constructor, without the redshift bin
LFdata() {
M = -999.;
value = -999.;
errp = -999.;
errm = -999.;
z = -999.;
bin = -10;
nor = -999.;
norerr = -999.;
}

// keep it in the same file, since really simple
LFdata(double zmoy, int k, double norma, double normaerr)
{
M=-999.;
value=-999.;
errp=-999.;
errm=-999.;
z=zmoy;
bin=k;
nor=norma;
norerr=normaerr;
}


// keep it in the same file, since really simple
LFdata(double zmoy, int k, double norma, double normaerr) {
M = -999.;
value = -999.;
errp = -999.;
errm = -999.;
z = zmoy;
bin = k;
nor = norma;
norerr = normaerr;
}
};


#endif
Loading

0 comments on commit 8039d7f

Please sign in to comment.