Skip to content

Automatically apply air formatting#873

Merged
cristinamullin merged 28 commits intodevelopfrom
air-formatting
Mar 31, 2026
Merged

Automatically apply air formatting#873
cristinamullin merged 28 commits intodevelopfrom
air-formatting

Conversation

@cristinamullin
Copy link
Copy Markdown
Collaborator

@cristinamullin cristinamullin commented Mar 4, 2026

Implements using a pre-commit hook to commit format changes before a PR goes to other checks as suggested here:

#822

@cristinamullin
Copy link
Copy Markdown
Collaborator Author

I tested this on my fork and it is running successfully: cristinamullin#4

@cristinamullin cristinamullin requested a review from jbousquin March 4, 2026 16:43
remove concurrency
@cristinamullin cristinamullin marked this pull request as draft March 4, 2026 17:01
@cristinamullin
Copy link
Copy Markdown
Collaborator Author

@jbousquin After closer look, all the workflows are stuck in queued status after the formatting commit is applied. It seems like there is no trigger to start running them on the new commit. Looking into that now.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 4, 2026

coverage-report

File Coverage Missing
All files 48%
R/ATTAINSCrosswalks.R 24% 32-868 1074-1089 1093-1097 1102-1107 1112 1118-1131 1137-1140 1145-1166 1177-1192 1413-1469 1476-1739 1923-1935 1939-1942 1947 1975-1978 1990-1993 2001-2005 2021-2025 2041-2047 2055-2070 2075 2081-2094 2262-2271 2276-2286 2446-2719 2915-3443 3597-3616 3620-3623 3631-3636 3642-3662 3670-3674 3687-3691 3722-3832 3884-4040 4045-4048 4055-4198
R/autoClean.R 89% 152-153 248-254 397-398 403 413-417
R/autoFilter.R 57% 31-228 403-406 412 414 429 439 491-504 532 623-626
R/CensoredDataSuite.R 97% 126-127 143 311 642-643 648 651
R/CriteriaComparison.R 87% 173-177 182 191-193 240-265
R/CriteriaMethods.R 15% 227-238 242-244 261-263 268-270 275 287-300 308-335 509-513 529-533 639-965 983-1162 1167-1168 1196-1245 1279-1839 1857-2173
R/DataDiscoveryRetrieval.R 32% 199 210-213 230-233 246-249 255 259 276-751 765-767 775 777 782-789 797 803 805 809 811 817 821 823 833 835 839 845 847 851 853 858 860 864 871-878 886 898-916 927-933 962-980 994-1012 1033 1130-1161 1266-1273 1371-1407 1500-1503 1572-1750
R/DepthProfile.R 0% 102-2033
R/Figures.R 0% 64-1524
R/GeospatialFunctions.R 50% 66-70 198-202 278-280 308-310 334-336 488 567-572 576 634-636 642-645 712-716 727-732 738-743 749-754 761-765 812-813 820-825 829 837-1007 1149-1155 1162-1444 1548-1551 1556-1579 1624-1627 1694-1702 1826-1829 1874-1878 1931-1962 2177-2187 2234-2244 2279-2281 2347 2351 2380-2382 2386 2390-2415 2507-2595 2743-2772 2899 2920-3504
R/GeospatialUtilities.R 74% 108 132 189 194 290-299 304-352 357-381 470 499-510 517-528 567-577 658-687 692 701-703 710-724 747-750 801 872-878 885 913-928 1042-1048 1106 1276 1310-1319 1331-1334 1446-1448 1453-1460 1498-1500 1545-1547 1597-1599 1651-1656 1739-1748 1808-1810 1846
R/MaintenanceScheduled.R 0% 42-474
R/Maps.R 80% 128-129 131 138 182-189 298-302 382-395 416-418 472-592 752
R/RequiredCols.R 30% 405-648
R/ResultFlagsDependent.R 55% 60-62 67 110-119 125-129 144-151 254 291-295 317-320 327-330 346-362 423 446-448 454-455 461 509-520 526-533 596-599 611 623-634 656-658 671-677 748-875 972-975 994 1012-1018 1027 1047-1061 1149-1157 1164-1171 1181-1183
R/ResultFlagsIndependent.R 70% 70-72 78 115-119 129-157 265-267 272 276 280 290 388-391 403-435 525-527 532-534 543 671-681 696-721 810-812 817-819 828 956-966 981-1168 1213 1235-1254 1267-1272 1412 1416 1474-1489 1498-1505 1569-1570 1665-1681 1753-1758 1879-1893
R/Tables.R 86% 18-29 110-117 125-127
R/TADAGeospatialRefLayers.R 0% 8-13
R/TADARefTables.R 91% 75-78 207-214 322-324 386-399 410 882-894 955 965-967 972-974 997-1013 1027 1157-1161 1373-1381
R/Transformations.R 60% 71-72 77-79 110 139 153 176-178 196-198 271-280 302 307 449-450 458-461 466-469 474-477 482-485 499-502 569 683-873 984-985 1007-1009 1040-1051 1056-1080 1084-1092
R/UnitConversions.R 82% 147 421 428 435 442-444 451 458-460 469-472 482-484 634-716 738-784 807 855 868-882 1115-1119 1199 1276-1279 1321
R/Utilities.R 64% 511 629-630 634 639-641 736 748-777 865-876 1020-1022 1090-1091 1145-1149 1259-1260 1264-1265 1275-1279 1284-1289 1331-1456 1597 1664 1670-1690 1716-1717 1730-1733 1829-1832 1859-2174 2201-2205 2214-2218 2435 2488 2494-2497 2501 2512 2531-2532 2534-2549 2551 2553 2555-2556 2558-2559 2561-2564 2566 2568 2571 2586 2592 2600 2605 2613-2618 2623-2628 2647 2657-2658
R/WQPWQXATTAINSCSTRefs.R 67% 33 43 102 118 124 166 168-172 174 176-178 180 192 201-202 204 207-208 210 213 219-257 270-275 289-295 297 317-391 417-420 425 431 436 443 452-454 505-516 539 554 556 559-563 580 587-590 617-621 696-700 746 769-789 1175-1178 1189 1208-1210 1230 1260-1302 1325-1329 1352-1361 1374 1437 1448 1477-1490 1517 1540-1549 1574 1601-1610 1632-1639 1660-1669 1688 1691-1695 1714 1729-1738 2066-2070 2093-2102 2149 2178-2181 2183-2219 2223 2232 2238 2252 2254 2265 2270-2271 2273 2292 2295 2313 2318-2331 2344-2353 2397-2403 2408-2424 2437-2660 2692 2706 2743 2748 2764-2831 2842 2850-2853 2874 2888-2914 2930 2966 2970 2974 2980-2990 2995-3000 3028 3031 3039 3046 3059 3064 3090 3149 3200 3233 3251

Minimum allowed coverage is 10%

Generated by 🐒 cobertura-action against 44839b7

@cristinamullin
Copy link
Copy Markdown
Collaborator Author

This appears to be working correctly now: cristinamullin#8

@jbousquin
Copy link
Copy Markdown
Collaborator

If all you are trying to do is use a pre-commit hook to commit format changes before a PR goes to other checks I think you can do that in a much simpler way. See this example PR on my fork:
https://github.com/jbousquin/EPATADA-1/pull/3
Note how my commit just has the pre-commit run on it, and then the pre-commit's commit has all the other checks.
All I changed on fork-develop for that was to add the yml:
develop...jbousquin:EPATADA-1:develop
With this approach I'd recommend getting rid of both format workflows like you did on this PR (unless you want to keep batch air update on manual trigger only so it can be run on a branch outside a PR - but that seems superfluous to me).

As an alternative approach there is the pre-commit/action@v3.0.1.

@cristinamullin
Copy link
Copy Markdown
Collaborator Author

It looks like the current workflows in this PR are working: cristinamullin#20

@cristinamullin cristinamullin marked this pull request as ready for review March 12, 2026 13:52
@cristinamullin cristinamullin marked this pull request as draft March 12, 2026 18:28
@cristinamullin
Copy link
Copy Markdown
Collaborator Author

The [pre-commit.ci] auto fixes from pre-commit.com hooks works, but checks are still running on the initial commit and follow up auto-format commit. In this PR, make sure they only run on the follow up auto-format commit (not both commits).

@jbousquin
Copy link
Copy Markdown
Collaborator

checks are still running on the initial commit

Is this being observed on a commit to a new PR or only new commits to an existing PR?

pull_request:
branches: develop
branches: [develop]
types: [opened, reopened, synchronize, ready_for_review]
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can always run - it's fast!

@@ -1,20 +1,26 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report:

  1. consider full coverage report only on pushes to develop branch?
  2. consider additional coverage report only for scope of PR?

@cristinamullin cristinamullin marked this pull request as ready for review March 25, 2026 17:58
@cristinamullin cristinamullin merged commit 8021c69 into develop Mar 31, 2026
8 of 9 checks passed
@cristinamullin cristinamullin deleted the air-formatting branch March 31, 2026 13:29
steps:
- uses: actions/checkout@v6

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added whitespace?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems out of scope for this PR - make sure its not reverting a merge conflict

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a correct updates - but it should have been included in the previous PR merge (needed to run devtools::document() once more there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants