diff --git a/.github/workflows/cpp-linter.yaml b/.github/workflows/cpp-linter.yaml new file mode 100644 index 0000000..bfb964d --- /dev/null +++ b/.github/workflows/cpp-linter.yaml @@ -0,0 +1,28 @@ +name: cpp-linter + +on: + pull_request: + # This is overkill, but why not + paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '**CMakeLists.txt', 'meson.build', '**.cmake'] + +jobs: + cpp-linter: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: actions/checkout@v4 + - uses: cpp-linter/cpp-linter-action@v2 + id: linter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + style: 'file' # Use .clang-format config file + tidy-checks: '' # Use .clang-tidy config file + # only 'update' a single comment in a pull request thread. + thread-comments: ${{ github.event_name == 'pull_request' && 'update' }} + - name: Fail fast + if: steps.linter.outputs.checks-failed > 0 + run: | + echo "Some linter checks failed. ${{ steps.linter.outputs.checks-failed }}" | + exit 1 diff --git a/sipnet.c b/sipnet.c index 70a942d..56c66b1 100644 --- a/sipnet.c +++ b/sipnet.c @@ -2456,13 +2456,13 @@ void setupModel(SpatialParams *spatialParams, int loc) { // ensure that all the allocation parameters sum up to something less than one: #if ROOTS - ensureAllocation(); + ensureAllocation(); #endif // If we aren't explicitly modeling microbe pool, then do not have a pulse to microbes, // exudates go directly to the soil #if !MICROBES - params.microbePulseEff=0; + params.microbePulseEff=0; #endif // change units of parameters: @@ -2479,7 +2479,7 @@ void setupModel(SpatialParams *spatialParams, int loc) { #if ROOTS envi.plantWoodC = (1-params.coarseRootFrac-params.fineRootFrac)*params.plantWoodInit; #else - envi.plantWoodC = params.plantWoodInit; + envi.plantWoodC = params.plantWoodInit; #endif envi.plantLeafC = params.laiInit * params.leafCSpWt; @@ -2487,41 +2487,41 @@ void setupModel(SpatialParams *spatialParams, int loc) { // If SOIL_QUALITY, split initial soilCarbon equally among all the pools - #if SOIL_MULTIPOOL - int counter; + #if SOIL_MULTIPOOL + int counter; - for( counter=0; counter