diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000000..8ef729d1540 --- /dev/null +++ b/.clang-format @@ -0,0 +1,11 @@ +--- +BasedOnStyle: Google +ColumnLimit: '120' +IndentPPDirectives: None +IndentWidth: '3' +MaxEmptyLinesToKeep: '1' +SpacesInParentheses: 'false' +TabWidth: '3' +UseTab: Never + +... diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml new file mode 100644 index 00000000000..41c40f04b91 --- /dev/null +++ b/.github/workflows/check-format.yml @@ -0,0 +1,19 @@ +name: clang-format Check +on: [push, pull_request] +jobs: + formatting-check: + name: Formatting Check + runs-on: ubuntu-latest + steps: + #this is needed to get sha of central repo + - name: test_Files + uses: actions/checkout@v3 + with: + fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. + - name: Run clang-format style check for C/C++ files. + uses: DanielWielanek/clang-format-action@main + with: + clang-format-version: '13' + check-path: '.' + upstream-branch: upstream/main + upstream-path: https://github.com/star-bnl/star-sw.git diff --git a/StRoot/StHbtMaker/StHbtMaker.h b/StRoot/StHbtMaker/StHbtMaker.h index b56818da713..51756afbbca 100644 --- a/StRoot/StHbtMaker/StHbtMaker.h +++ b/StRoot/StHbtMaker/StHbtMaker.h @@ -61,48 +61,48 @@ typedef int Int_t; #endif #include "StHbtMaker/Infrastructure/StHbtManager.h" -//class StHbtManager; - +// class StHbtManager; class StHbtMaker -#ifdef __ROOT__ -: public StMaker +#ifdef __ROOT__ + : public StMaker #endif { - - private: - StHbtManager* mHbtManager;//! tells cint to skip it - int mDebug; - public: - StHbtMaker(const char* name = "StHbt", const char* title = "StHbtTit"); - virtual ~StHbtMaker(); - virtual void Clear(const char* opt=""); - virtual Int_t Init();//! - virtual Int_t Make(); - virtual Int_t Finish();//! + private: + StHbtManager* mHbtManager; //! tells cint to skip it + + int mDebug; - int Debug() const; - void SetDebug(int); + public: + StHbtMaker(const char* name = "StHbt", const char* title = "StHbtTit"); + virtual ~StHbtMaker(); + virtual void Clear(const char* opt = ""); + virtual Int_t Init(); //! + virtual Int_t Make(); + virtual Int_t Finish(); //! + + int Debug() const; + void SetDebug(int); #ifdef __ROOT__ - StMaker* currentChain; + StMaker* currentChain; #endif - // StHbtManager* HbtManager();//! tells cint to skip that - StHbtManager* HbtManager(); + // StHbtManager* HbtManager();//! tells cint to skip that + StHbtManager* HbtManager(); - - virtual const char *GetCVS() const - {static const char cvs[]="Tag $Name: $ $Id: StHbtMaker.h,v 1.9 2014/08/06 11:43:19 jeromel Exp $ built " __DATE__ " " __TIME__ ; return cvs;} + virtual const char* GetCVS() const { + static const char cvs[] = + "Tag $Name: $ $Id: StHbtMaker.h,v 1.9 2014/08/06 11:43:19 jeromel Exp $ built " __DATE__ " " __TIME__; + return cvs; + } #ifdef __ROOT__ - ClassDef(StHbtMaker,0) + ClassDef(StHbtMaker, 0) #endif }; -inline StHbtManager* StHbtMaker::HbtManager(){return mHbtManager;} -inline int StHbtMaker::Debug() const {return mDebug;} -inline void StHbtMaker::SetDebug(int d){mDebug=d;} - -//this is test comment for testing cvs commit +inline StHbtManager* StHbtMaker::HbtManager() { return mHbtManager; } +inline int StHbtMaker::Debug() const { return mDebug; } +inline void StHbtMaker::SetDebug(int d) { mDebug = d; } #endif