Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ORG81 Add automatic formatting/linting github checks #31

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/cpp-linter.yaml
Original file line number Diff line number Diff line change
@@ -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
42 changes: 21 additions & 21 deletions sipnet.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SiPnET: Simplified PnET

Check notice on line 1 in sipnet.c

View workflow job for this annotation

GitHub Actions / cpp-linter

Run clang-format on sipnet.c

File sipnet.c does not conform to Custom style guidelines. (lines 12, 28, 30, 35, 36, 39, 40, 43, 46, 50, 51, 52, 55, 56, 57, 73, 74, 75, 79, 88, 89, 92, 111, 112, 131, 138, 139, 145, 149, 153, 158, 160, 161, 162, 163, 177, 178, 179, 180, 181, 182, 183, 184, 185, 187, 189, 190, 191, 192, 194, 195, 198, 203, 209, 215, 216, 217, 219, 220, 226, 227, 228, 229, 230, 232, 240, 241, 242, 243, 244, 246, 247, 251, 252, 253, 254, 257, 258, 259, 263, 264, 265, 267, 268, 269, 270, 272, 273, 274, 279, 280, 283, 284, 285, 286, 290, 292, 293, 294, 295, 297, 298, 299, 301, 303, 305, 306, 307, 310, 311, 312, 316, 323, 327, 328, 329, 330, 331, 334, 337, 338, 339, 340, 341, 342, 345, 346, 347, 348, 349, 350, 353, 354, 355, 356, 358, 362, 367, 369, 370, 371, 372, 373, 374, 379, 380, 390, 391, 392, 393, 395, 396, 397, 398, 399, 400, 401, 403, 404, 405, 406, 407, 408, 409, 411, 412, 413, 414, 415, 416, 419, 420, 422, 423, 424, 426, 427, 429, 430, 435, 436, 437, 438, 439, 440, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 459, 460, 462, 463, 464, 465, 467, 470, 471, 472, 473, 474, 475, 482, 491, 492, 493, 497, 505, 507, 509, 510, 514, 515, 516, 517, 519, 532, 544, 555, 558, 561, 573, 574, 579, 582, 584, 586, 590, 595, 605, 608, 609, 610, 611, 612, 613, 614, 615, 617, 618, 619, 620, 622, 624, 625, 626, 627, 628, 629, 630, 631, 634, 635, 637, 645, 651, 652, 653, 655, 657, 658, 659, 660, 662, 670, 676, 678, 680, 682, 683, 687, 691, 692, 693, 694, 697, 698, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 711, 712, 713, 714, 715, 716, 720, 721, 722, 726, 727, 728, 730, 731, 732, 733, 734, 737, 738, 739, 741, 742, 743, 744, 745, 746, 747, 748, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 761, 762, 763, 764, 773, 779, 781, 784, 785, 787, 788, 790, 791, 792, 793, 795, 796, 797, 799, 802, 807, 810, 813, 814, 816, 817, 818, 819, 823, 824, 825, 829, 831, 833, 834, 835, 836, 838, 840, 845, 846, 848, 849, 850, 851, 852, 854, 855, 856, 858, 866, 874, 875, 878, 882, 883, 889, 892, 900, 901, 905, 906, 907, 909, 914, 915, 919, 920, 932, 934, 938, 939, 948, 949, 950, 951, 955, 957, 959, 964, 969, 971, 972, 974, 978, 981, 982, 983, 985, 986, 989, 990, 992, 993, 994, 995, 996, 997, 1000, 1002, 1006, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1025, 1035, 1037, 1041, 1042, 1046, 1047, 1048, 1049, 1050, 1051, 1053, 1056, 1058, 1059, 1061, 1062, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1081, 1082, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1094, 1095, 1096, 1097, 1105, 1106, 1107, 1108, 1110, 1112, 1113, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1127, 1133, 1134, 1135, 1136, 1137, 1139, 1140, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153, 1156, 1157, 1158, 1159, 1160, 1161, 1174, 1177, 1178, 1179, 1180, 1185, 1189, 1190, 1191, 1192, 1194, 1196, 1197, 1201, 1206, 1207, 1212, 1213, 1217, 1218, 1219, 1222, 1223, 1224, 1229, 1233, 1234, 1235, 1236, 1238, 1240, 1244, 1249, 1250, 1256, 1263, 1267, 1268, 1275, 1276, 1277, 1281, 1282, 1287, 1289, 1292, 1296, 1300, 1305, 1311, 1315, 1322, 1323, 1324, 1325, 1326, 1330, 1331, 1332, 1333, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 1344, 1348, 1349, 1355, 1361, 1368, 1372, 1379, 1384, 1385, 1386, 1387, 1389, 1390, 1392, 1393, 1395, 1396, 1397, 1399, 1400, 1408, 1411, 1412, 1413, 1415, 1428, 1429, 1440, 1445, 1454, 1457, 1458, 1460, 1461, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473, 1474, 1475, 1478, 1479, 1480, 1482, 1483, 1484, 1485, 1496, 1504, 1505, 1506, 1516, 1518, 1523, 1524, 1527, 1529, 1538, 1539, 1543, 1544, 1548, 1551, 1554, 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1565, 1568, 1570, 1571, 1572, 1574, 1580, 1583, 1584, 1586, 1588, 1590, 1593, 1594, 1595, 1596, 1599, 1603, 1604, 1605, 1606, 1608, 1610, 1611, 1620, 1621, 1623, 1625, 1626, 1628, 1629, 1631, 1632, 1633, 1634, 1637, 1640, 1641, 1643, 1644, 1646, 1647, 1648, 1649, 1652, 1654, 1655, 1656, 1657, 1658, 1659, 1660, 1662, 1663, 1664, 1665, 1669, 1670, 1672, 1674, 1677, 1680, 1681, 1682, 1683, 1684, 1690, 1691, 1693, 1694, 1696,

Author: Bill Sacks wsacks@wisc.edu
modified by...
Expand Down Expand Up @@ -2456,13 +2456,13 @@

// 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:
Expand All @@ -2479,49 +2479,49 @@
#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;
envi.litter = params.litterInit;


// 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 <NUMBER_SOIL_CARBON_POOLS; counter++) {
for( counter=0; counter <NUMBER_SOIL_CARBON_POOLS; counter++) {

envi.soil[counter]=params.soilInit/NUMBER_SOIL_CARBON_POOLS;
envi.soil[counter]=params.soilInit/NUMBER_SOIL_CARBON_POOLS;

}
trackers.totSoilC=params.soilInit;
#else
envi.soil = params.soilInit;
}
trackers.totSoilC=params.soilInit;
#else
envi.soil = params.soilInit;

#endif
#endif

#if SOIL_QUALITY
params.maxIngestionRate = params.maxIngestionRate*24*params.microbeInit/1000;
// change from per hour to per day rate, and then multiply by microbial concentration (mg C / g soil).
#if SOIL_QUALITY
params.maxIngestionRate = params.maxIngestionRate*24*params.microbeInit/1000;
// change from per hour to per day rate, and then multiply by microbial concentration (mg C / g soil).

#else
params.maxIngestionRate = params.maxIngestionRate*24; // change from per hour to per day rate
#endif
#else
params.maxIngestionRate = params.maxIngestionRate*24; // change from per hour to per day rate
#endif



envi.microbeC = params.microbeInit*params.soilInit/1000; // convert to gC m-2
envi.microbeC = params.microbeInit*params.soilInit/1000; // convert to gC m-2


params.totNitrogen = params.totNitrogen*params.soilInit; // convert to gC m-2
params.totNitrogen = params.totNitrogen*params.soilInit; // convert to gC m-2

params.fineRootTurnoverRate /= 365.0;
params.coarseRootTurnoverRate /= 365.0;

params.baseCoarseRootResp /= 365.0;
params.baseFineRootResp /= 365.0;
params.baseMicrobeResp = params.baseMicrobeResp*24; // change from per hour to per day rate
params.baseMicrobeResp = params.baseMicrobeResp*24; // change from per hour to per day rate


envi.coarseRootC = params.coarseRootFrac*params.plantWoodInit;
Expand Down
Loading