precommit icon indicating copy to clipboard operation
precommit copied to clipboard

simple pkgdown check

Open gravesti opened this issue 3 years ago • 1 comments
trafficstars

First attempt to implement quick checks for {pkgdown}. Fixes #378

gravesti avatar May 05 '22 14:05 gravesti

@gravesti thanks for your work. This works now in principle. Only practical problem are the heavly dependencies, in particular in a CI setting. So, it may work best if you use {pkgdown} already locally and have all the system dependencies. {pkgdown} has many dependencies and system dependencies that are required to make loading the package not error, but not required for our functionality...

Probably, these checks would just be skipped in CI then.

Coming from the problem use case: {pkgdown} builds are only triggered on default branches, so even if a PR succeeds, we don't know if the pkgdown build will succeed. Hence, instead (or as a complement) of a pre-commit hook, the GitHub Action for pkgdown could also build the page and not deploy it. Should I file an issue in r-lib/actions for this?

lorenzwalthert avatar May 07 '22 18:05 lorenzwalthert

I thought about it again and I think we should merge the hook, but use system as a language, r. Hence, we'd fallback on the system installation of {pkgdown} and all dev dependencies of a package, which will anyways be installed if you use the hook. In CI setting, using the hook makes no sense. Also, the lastet version of the {pkgdown} action in r-lib/actions already builds PRs as if the were merged in main, so I guess that is also an improvement.

lorenzwalthert avatar Nov 12 '22 15:11 lorenzwalthert

I note that in the mean time pkgdown implemented a check_pkgdown() which could be used within the hook

gravesti avatar Nov 14 '22 16:11 gravesti

Thanks @gravesti. I spend at least 5h working on this PR (and some related issues that came up due to it) over the last 3 days. -.- I see that you mentioned that you opened an issue in {pkgdown}, can you please link it next time? Would have saved me a lot of time I think.

lorenzwalthert avatar Nov 14 '22 16:11 lorenzwalthert

@gravesti this will be available when there is a new release (i.e. new tag on main). Or if you use a hash pointing to HEAD (e.g. 59981a7) instead of a git tag.

lorenzwalthert avatar Nov 15 '22 14:11 lorenzwalthert