usethis/ 0000755 0001750 0001750 00000000000 14154505162 012073 5 ustar nilesh nilesh usethis/MD5 0000644 0001750 0001750 00000044107 14154505162 012411 0 ustar nilesh nilesh eb256943c93f96b71b437ace28faffdb *DESCRIPTION
764bb5aec2dc3bef4e44f1387ec895b3 *LICENSE
71840033660ef4066d1d220132bcc7d3 *NAMESPACE
eef974dee2289f56e0e4b75e8142be25 *NEWS.md
4efe06b731ed3b39dda06394d21220e3 *R/addin.R
8b4ce5691f66f7326bbe8ec9c76e28f1 *R/badge.R
b4a1c6386b3c72ebc672eb2702b1cba3 *R/block.R
797227a33a3aa505ebedea25cc9ce4fe *R/browse.R
d9de0e80f8872c2a0e2559dfedceb4e6 *R/ci.R
b6fde1f297a1dbf0ea0a0a8e5c4e9959 *R/citation.R
4ff3f40d4f9794eb30d710d0814e3d1b *R/code-of-conduct.R
733061e896d4c1d9d0d13ce06dfc5054 *R/course.R
f242dc51a034c7bf0291a81403049e6e *R/coverage.R
d14ad07401893e4f1ba52052073426dc *R/cpp11.R
e02f77d7596d089e1f52a6fd02b5b310 *R/cran.R
2a9c620e84af889626af03a87db71820 *R/create.R
e81e8d834210a941d1203c42a8f75ead *R/data-table.R
342be5e9acf9848203ef09fa9139298e *R/data.R
96b45b734104aec3cb1df0af5ad6060a *R/description.R
d51fbcd720bbbfc595d7627293183aec *R/directory.R
29fab823d9a1cfa4926cf7ce2580de7c *R/documentation.R
e93d34286be4d6563181272ae163a6aa *R/edit.R
a307e9ae182cb7b9e53db59b421b517f *R/git-default-branch.R
810d6fb0f99cc98a061e81cc5500ce51 *R/git.R
a2e1d2f7d8370e7bc6e45016281d7acb *R/github-actions.R
e10dee2ad78ceb7f5e2ddfc72dca72dc *R/github-labels.R
0d920466e9681a394154f9717b0ea373 *R/github-pages.R
95c289c2c83b88ba0983ec44c7243636 *R/github.R
28258462364272f8d76a54c780e8a354 *R/github_token.R
d4aa482a7782d4954f30089c2921d156 *R/helpers.R
13a7c322ae38929340718e793b2769d6 *R/ignore.R
46d3570da3e491cf7c9b026497a6e4c8 *R/issue.R
97ba2f678e028bcd3ad06c9b27ab0082 *R/jenkins.R
bb88c714b954bde3da54795649e74fd1 *R/latest-dependencies.R
cd77ee49c6dc16826055a4627ad8dc21 *R/license.R
ee466a1d332008bbf16c0cf61f5cfee6 *R/lifecycle.R
5b9f7feee8c08e0fb1b48bedaa04060d *R/line-ending.R
38986ef0aa6ec9258910bfb8c6fa0fa1 *R/logo.R
9c6ec3c1aa124dfb95220bd201d1a46c *R/make.R
42ba7a73157a61c56270bb92a526a163 *R/namespace.R
14f90473929a7f54e2a864945582e914 *R/news.R
39e8c1b75884daa4b4259a2b332bd6e3 *R/package.R
3acc24a6de0cdc4264f46169ca30facd *R/pipe.R
775881b5459975e96949b6263c06bb10 *R/pkgdown.R
76bd769991e644c1b23ea6cd4bf02f4e *R/pr.R
7b68b6d64b8c1435355a7433d0d7fdb2 *R/proj.R
9715b062d1c471d19ca126b1f552a541 *R/r.R
f37870eccfe935e35ee5fff2212bb70d *R/rcpp.R
92935bc7fd990dd3d38d0a6ffc8431fc *R/readme.R
e29ef2d1dc96e58ec0fba61deec4a13b *R/release.R
855bbce379f173b44c7b8ad04a389aca *R/revdep.R
7de9a6985934982fdc6468f007c4cc79 *R/rmarkdown.R
bddbcc94da8d1822d2d09c7bb6d746fe *R/roxygen.R
e1877dc004a8bcf93d9bc2729b8b57c2 *R/rprofile.R
b6d79ebda454f6a89c9e88bb20f5485b *R/rstudio.R
a5f274523f8fb15499e958ae73e7770c *R/sitrep.R
3463aa6083680ff12c9dd3997c864a8f *R/spelling.R
bc2e60b244769dec67e3601f96d1b561 *R/template.R
8afd76509707aa16f0f29eefcc0ff038 *R/test.R
47e45db3fb43107bd688f404fa9ab1aa *R/tibble.R
8d06a133c43fb6b89424305518510d59 *R/tidy-upkeep.R
9a198588312cd81bd5503543bf825c2f *R/tidyverse.R
30bcdb6eafa101bc92df7fd2b9763df3 *R/tutorial.R
8f06d43f7eb2785534ca9f144d33a09d *R/ui.R
7c83cbe758a1e1efecd9c02fb6d000e5 *R/use_github_file.R
50b029d0821c2a2c244569befc220e94 *R/use_import_from.R
29b01438671c5575d597ccee4787e89c *R/usethis-defunct.R
2edd6d56baf6a8489b16003ad9968232 *R/usethis-package.R
ec7e3c2a712363d1c59c88a88f1d23ba *R/utils-gh.R
60013e80fe646a953608a3e742865e3e *R/utils-git.R
dc5c5eacae552865d0d13097bea6d2b2 *R/utils-github.R
ab2402e681c0f52003a3513213217016 *R/utils-glue.R
89f78abb93e6703767941c91a3cc9542 *R/utils-rematch2.R
341ba56cbb85e36afdfccc58547462c1 *R/utils-roxygen.R
5ebca0227bd2a9a64678ac294972ea62 *R/utils-ui.R
2682432d0c2fec38efc3f4812930e6fb *R/utils.R
4c05d828a79a49407ab6f45b45799b88 *R/version.R
0beb3c09b7b223af8b50fde3f8e06a5b *R/vignette.R
9b02d81b79385d2bc9ae8308ae12c6f0 *R/write.R
9154a0e2894baefd5718956f748d446c *README.md
0fb095df64c73cf786382729a5953ea8 *inst/WORDLIST
27c331bd79e9c921454533ddd3699df9 *inst/templates/CODE_OF_CONDUCT.md
3012f896ad62324283af46ec288ca3b5 *inst/templates/Jenkinsfile
1d9471302aec5402576ad12134bcecdc *inst/templates/Makefile
47c71dc87a79d8c52c8964d6b7c0e45c *inst/templates/NEWS.md
2ef78790c51e3159c7e067a9c4565291 *inst/templates/addins.dcf
fd61b39adbd7fe113ffe01719429ebff *inst/templates/appveyor.yml
2fc4bbb9a984818ed8018545119b31a3 *inst/templates/article.Rmd
86f115fb743f9009aeecdac11e0e0b31 *inst/templates/circleci-config.yml
a7ce42a527c5410eb1b40307f4aa78c4 *inst/templates/citation-template.R
3eec90e112c3f1af036433fb8e7b6365 *inst/templates/code-cpp11.cpp
ea9234ef2e8fae457c79094c018603f7 *inst/templates/code.c
2950d8e59ca018b7632ef0a21c00fc23 *inst/templates/code.cpp
3df907b50c4f00bc26ee6d988e0c849f *inst/templates/codecov.yml
37497f21f3011dbabefd9659eeb087c0 *inst/templates/cran-comments.md
44c4b1df8df8ac69891ec238311f299c *inst/templates/gitlab-ci.yml
17b944f7f4423005e7402c2b2a7eead5 *inst/templates/junit-testthat.R
fb01625ef01973490bcf4efb9ade23ae *inst/templates/license-AGPL-3.md
3d82780e8917b360cbee7b9ec3e40734 *inst/templates/license-GPL-2.md
29a9012941a6bcb26bf0fb4382c5dd75 *inst/templates/license-GPL-3.md
8f5107d98757711ecc1b07ac33877564 *inst/templates/license-LGPL-2.1.md
c160dd417c123daff7a62852761d8706 *inst/templates/license-LGPL-3.md
f4eda51018051de136d3b3742e9a7a40 *inst/templates/license-apache-2.md
3bedcaeda57cf8e31f791dd9e127eb0f *inst/templates/license-cc0.md
3e19557ffd5cbc68a1fd63ac8d687a95 *inst/templates/license-ccby-4.md
8c2921a5e3b7594dee4426ce2e641120 *inst/templates/license-mit.md
c6c9f877dd63276ed8f5fb74c6c8356b *inst/templates/license-proprietary.txt
cb1e46f469cfbbbde29c8b5113e1d789 *inst/templates/lifecycle-archived.svg
c0d2e5a54f1fa4ff02bf9533079dd1f7 *inst/templates/lifecycle-defunct.svg
a1b8c987c676c16af790f563f96cbb1f *inst/templates/lifecycle-deprecated.svg
c3978703d8f40f2679795335715e98f4 *inst/templates/lifecycle-experimental.svg
952b59dc07b171b97d5d982924244f61 *inst/templates/lifecycle-maturing.svg
27b879bf3677ea76e3991d56ab324081 *inst/templates/lifecycle-questioning.svg
53b3f893324260b737b3c46ed2a0e643 *inst/templates/lifecycle-stable.svg
1c1fe7a759b86dc6dbcbe7797ab8246c *inst/templates/lifecycle-superseded.svg
9a248a8fb2615a2d07f84a7687cc669d *inst/templates/package-README
263378e6f4f25a1188a90af96673d314 *inst/templates/packagename-data-prep.R
df6cc46bc7fae1a55b713f3d5065b35a *inst/templates/packagename-package.R
b56ff2b193ecba52f9ec7f3b10cca008 *inst/templates/pipe.R
e4537b4d7d40ffe61673372fb3b602c7 *inst/templates/project-README
8c4b3f14fb3d6ffc74a28f361771b9c9 *inst/templates/readme-rmd-pre-commit.sh
34952a5944548ea4fc132a9899f8e6ab *inst/templates/revdep-email.yml
7fa100ac70c48d6f71765ac00943b3cd *inst/templates/rmarkdown-template.Rmd
10d8de4f671a94595a1aacce4ac35620 *inst/templates/rmarkdown-template.yml
74e57aedf4cfb7222415f4ee84b3603e *inst/templates/template.Rproj
225e3812b897786befc574f805c96dc2 *inst/templates/test-example-2.1.R
b112494cb8925006b418b0d4634063be *inst/templates/testthat.R
9283fdd7a5c9593351869fda10dd6175 *inst/templates/tidy-contributing.md
16c46a50d04677a232e20bfd80a51509 *inst/templates/tidy-eval.R
d70637779adf10ee78bcc20a86fe3e45 *inst/templates/tidy-issue.md
0ddc9db5cb12f8881b8e0e6e9e4b918d *inst/templates/tidy-support.md
d0503678f52f9a3046f3417328ce6b73 *inst/templates/tidy-travis.yml
be16f48dbc391aad2794c60f48a0b8d8 *inst/templates/travis.yml
5208572ed77e349e0d80c8d545ecb158 *inst/templates/tutorial-template.Rmd
ed229c502d26f6c2d4de018e0f48ea66 *inst/templates/vignette.Rmd
77639515db0fda8f3b1bffef4cfe3a74 *inst/templates/year-copyright.txt
a73335c5dc9e027c581fa12eadc37be4 *man/badges.Rd
b335bf3bbd5e5c8c1ddb30d4f6698bfa *man/browse-this.Rd
4b3a846fd0a136ffb1382a63c01546c4 *man/ci.Rd
38af3e0ef7658e94e84bfb9cbb8a6ab4 *man/create_from_github.Rd
564384303bc2e4c4b032ade3541833cf *man/create_package.Rd
95262022a9aecaa41b1021d0df6cae05 *man/edit.Rd
00198b1c402fc0a2a8af112e6a8e26d5 *man/edit_file.Rd
cb1e46f469cfbbbde29c8b5113e1d789 *man/figures/lifecycle-archived.svg
c0d2e5a54f1fa4ff02bf9533079dd1f7 *man/figures/lifecycle-defunct.svg
a1b8c987c676c16af790f563f96cbb1f *man/figures/lifecycle-deprecated.svg
c3978703d8f40f2679795335715e98f4 *man/figures/lifecycle-experimental.svg
952b59dc07b171b97d5d982924244f61 *man/figures/lifecycle-maturing.svg
27b879bf3677ea76e3991d56ab324081 *man/figures/lifecycle-questioning.svg
6902bbfaf963fbc4ed98b86bda80caa2 *man/figures/lifecycle-soft-deprecated.svg
53b3f893324260b737b3c46ed2a0e643 *man/figures/lifecycle-stable.svg
1c1fe7a759b86dc6dbcbe7797ab8246c *man/figures/lifecycle-superseded.svg
553f7d586d7d13e1d9a51c6a1ca7d0f2 *man/figures/logo.png
d110c97a7282b95e81713bff0897674d *man/git-default-branch.Rd
cf731932b1745a73cc3206b73e3c6f88 *man/git_credentials.Rd
0ac8cb005cb03c2d3e9e3560b97910d4 *man/git_protocol.Rd
f41d77ca070d07fdfabfeaaf2a1fa2d0 *man/git_sitrep.Rd
8df4786666e3a82e93def049b46816f2 *man/git_vaccinate.Rd
5fab5627366d695da95077ae624baca2 *man/github-token.Rd
b45b5d09e159fdf4cfb76b066fe2952d *man/github_actions.Rd
d479b79514d73f118bef909ad91fc523 *man/issue-this.Rd
a6fd12ccf86c477eefddfaa661249702 *man/licenses.Rd
6f7b59931da730d9ffae7a04b9b2c275 *man/proj_activate.Rd
27251420bd41c4ce26a4ed82580818f1 *man/proj_sitrep.Rd
d8ebf1e980b567127893724ed7302564 *man/proj_utils.Rd
d09b188049afed6f4e915d0633abbdf4 *man/pull-requests.Rd
61aeba01fef6ef237187f73e8243fa89 *man/rename_files.Rd
a4b7550663efd206a22a42414bb776a4 *man/roxygen/templates/double-auth.R
6dbc7476bc0ad0e83ed5590344ce1586 *man/rprofile-helper.Rd
af0cd9c7d68aa60a0e39b0964f30e29d *man/tidyverse.Rd
c47efbc01445d28efa6fd0a9fc4c49eb *man/ui-questions.Rd
b97a06d054b755457bf0e3d6a6489165 *man/ui.Rd
e535458be477c38e6dcf25e94ff4a220 *man/use_addin.Rd
41bc1648c59e65ce8fd2422e5c98fc1b *man/use_blank_slate.Rd
72e280c5a84e0a89d830217b599a9dc6 *man/use_build_ignore.Rd
5e970fc688b95c93593b334347b003b5 *man/use_citation.Rd
32c10cf4abaa4296f48da2b26004851c *man/use_code_of_conduct.Rd
1dbb38c84d007fababd030290ee76ac6 *man/use_course_details.Rd
76d15762ea8ee81790b5b3c5c9324c89 *man/use_coverage.Rd
0526a7a85bd6476a951a8a71deb4f297 *man/use_cpp11.Rd
7e314616b7b579d5e5fe753928899614 *man/use_cran_comments.Rd
b905c1994e9b968bac3977475cf79051 *man/use_data.Rd
2a093de21c0e2c72c05f6e6a9aa8d722 *man/use_data_table.Rd
c58777a8e822855e95bfaea1a1641b3c *man/use_description.Rd
bb84842ca4e3ab9906d17bfe2fe31362 *man/use_directory.Rd
e267716593436e5853dde0d2b1de13a9 *man/use_git.Rd
06e8dba5b8ee86d3d0704b7a6b34afa1 *man/use_git_config.Rd
47ecde4901197ea25b6547b317e44dbf *man/use_git_hook.Rd
be5af7ab82ebce496919b658f96766f4 *man/use_git_ignore.Rd
95591cbb0f6c45521670522e33962939 *man/use_git_remote.Rd
654ecabc1899c4451a05c72f80366f70 *man/use_github.Rd
4240f149e2193cd9bc16842c87ffb48f *man/use_github_file.Rd
9fc4ff26851f5481c283d6e77fb7f7a7 *man/use_github_labels.Rd
ebcbfb93952ed3454795f02e8a43c072 *man/use_github_links.Rd
384741fb3d619a8988d0adbf84ca9e63 *man/use_github_pages.Rd
dd80f9632a0ed37532dc34b40fec1ec5 *man/use_github_release.Rd
38a0b10a146ff3be639459c43a4d7247 *man/use_import_from.Rd
9343e7601d112ff9a44fdf49568f9574 *man/use_jenkins.Rd
cceb642057d6f3405284f982c2dad645 *man/use_latest_dependencies.Rd
3eb05b1cbeb13864410aa0d5f98db898 *man/use_lifecycle.Rd
1fefdf5cb71771db91e7b297788ac281 *man/use_logo.Rd
5f75bb0ea883860456f6755f24e9347d *man/use_make.Rd
0923254f17da4e3a5bf49cbf5a0cbb78 *man/use_namespace.Rd
fcf2f80e22a75d6061e7284c3f89c1c2 *man/use_news_md.Rd
d4ebcb8f6831d682fd1e702020ec88fa *man/use_package.Rd
4226499beb3afaae90843b6548d08356 *man/use_package_doc.Rd
0e0bc7aea94f1f692c40b702dfa572cb *man/use_pipe.Rd
f9bfc6cb263ab7aa3b59eaf7cf71deb8 *man/use_pkgdown.Rd
1e39efad153a64e6959b7ba9fd871ad9 *man/use_r.Rd
b6e93fe722f0fffcb60597b0819e9960 *man/use_rcpp.Rd
c418d7a01ab692e13976ce36c0e3dd2c *man/use_readme_rmd.Rd
4584fd0b30dc32474365bcbaccad73b8 *man/use_release_issue.Rd
28efdcd91c2af1186cb94076232d1c3a *man/use_revdep.Rd
2cb4c5b437beb2e0706f456723f5c915 *man/use_rmarkdown_template.Rd
e4a32847ce22c7883fa1a4b730efa3c6 *man/use_roxygen_md.Rd
be293007105650f3d3eacc9b7796c580 *man/use_rstudio.Rd
ad45bbad2f422897aabbe00b959f94c5 *man/use_spell_check.Rd
68f3cfe12ffea85b6885ac8a0f43f159 *man/use_template.Rd
f14b1635f177828384e44fad3c1e74ba *man/use_testthat.Rd
ea71ceda6a6cf10bf8e766198e3eeaa2 *man/use_tibble.Rd
afe946572105ec9cc3ef9f7b1ea32b62 *man/use_tidy_thanks.Rd
4983290f4a1ca1c82765cabe41a810fd *man/use_tutorial.Rd
84dcd0feebda460bf6725634d866617f *man/use_version.Rd
c7af081a5e433ef916500b915c47f9b6 *man/use_vignette.Rd
1f32563b8f7a6a7990f02a6516bf289b *man/usethis-defunct.Rd
c2fb6695c06916eb7d9dd884a6b50d8c *man/usethis-package.Rd
1322b810e2c864246c236e6cefeab26d *man/write-this.Rd
037e990efac0b1bd7f784ef021b57d45 *man/zip-utils.Rd
d4bbddb01053b52c56f14f47a306e0c1 *tests/spelling.R
3d8bfd8d9e35decfeadde3ffa53fbffd *tests/testthat.R
5fb582ed945cdc471d562e3f1f49cbbb *tests/testthat/_snaps/badge.md
ae834bcc81ba96e4d7beacd173ceba76 *tests/testthat/_snaps/course.md
fc812f53414e1fb5b6480aeb52213ad4 *tests/testthat/_snaps/data-table.md
49a6a898245b398a6feaeac44d231d53 *tests/testthat/_snaps/git-default-branch.md
60247f300ff6a0ef5b6c90ed36940c99 *tests/testthat/_snaps/github-actions.md
f3cd8f6861312c40008f8a29c1d018e7 *tests/testthat/_snaps/lifecycle.md
50e66be87332965890c80ab375268006 *tests/testthat/_snaps/package.md
687109c63e193bdc5c12d45fd778816f *tests/testthat/_snaps/readme.md
c0290b84554aa7b75bcae3d5710df775 *tests/testthat/_snaps/release.md
50e7e174c0403453cf2a0064691feda8 *tests/testthat/_snaps/tibble.md
471147d9696638780039c6261c038941 *tests/testthat/_snaps/tidy-upkeep.md
f07f6d80edaf8672c58eb2c3feda1aa6 *tests/testthat/_snaps/tidyverse.md
340c64762aed4214082fefe2ae546150 *tests/testthat/_snaps/ui.md
141e5d63a9666f1ed131970089178fe1 *tests/testthat/_snaps/use_import_from.md
7e8d07e39e21e39a2681d919ae6e5a09 *tests/testthat/_snaps/utils-github.md
eaa174782b0f6f496bd6c7c1e95bb54a *tests/testthat/_snaps/vignette.md
5e174038e8abe9ca5cda26ad4c00d53c *tests/testthat/helper.R
e6d8bf8f39c02c20c1e38e6d4395370c *tests/testthat/ref/README.Rmd
9a09db58b3c33c9df56c59ab67e93e1e *tests/testthat/ref/README.md
bf89b424b9fbb8d488d29e701d174437 *tests/testthat/ref/foo-loose-dropbox.zip
6ab595f90421218fd607c5a5aff55fc0 *tests/testthat/ref/foo-loose-regular.zip
0e0b018a02ceaaa6a28498d8571aebe1 *tests/testthat/ref/foo-not-loose.zip
44f3b3cab6cbfc399258c007e0a1359f *tests/testthat/ref/foo/file.txt
67f5e8d94d8c417642d28f4ed96adc06 *tests/testthat/ref/yo-loose-dropbox.zip
352346fd102a8e978a35279f93bb077c *tests/testthat/ref/yo-loose-regular.zip
31dfd4a6b6a7233abacb8028e408805d *tests/testthat/ref/yo-not-loose.zip
58a1423de7e870c98b9fb948ea4d9f9c *tests/testthat/ref/yo/subdir1/file1.txt
a783d3efd49413330a902d71111392f8 *tests/testthat/ref/yo/subdir2/file2.txt
d870983cb0f431f89c512abd3e905fac *tests/testthat/setup.R
f773d2b1f06201c96d541ce025e4ab13 *tests/testthat/teardown.R
be3f37f889600d912c941dc32561f7e6 *tests/testthat/test-addin.R
3bcfc46927e78d9722c0dc24912b2e30 *tests/testthat/test-badge.R
b7fb3ef24a5baed105e5a75eb9b95638 *tests/testthat/test-block.R
ea6e987ef40d529799342169061728f2 *tests/testthat/test-browse.R
f85f5b723a19b0bb32ef9b7ecbbc5e6f *tests/testthat/test-ci.R
b279bd713dabebad7aec7a771c1fcb05 *tests/testthat/test-code-of-conduct.R
2d7644744b975e0be2ffe1db1a681d58 *tests/testthat/test-course.R
9d1e916ec07ffc0dd4fe140b80b7f654 *tests/testthat/test-cpp11.R
429fff6097b4739fcf08c5aea867bf66 *tests/testthat/test-cran.R
bcdc244da5e720dea23db8c543a199a8 *tests/testthat/test-create.R
69ac6c7c3a14c4f87872251040cbd336 *tests/testthat/test-data-table.R
4c117430a4f5f1d943c01890d29bf35c *tests/testthat/test-data.R
8b3f7beccfc6ae39448db81d8d140d86 *tests/testthat/test-description.R
27a8b1c514d6b232d30d5d8a45a0487f *tests/testthat/test-directory.R
94089899f583791ac60e4ddff0ea0e44 *tests/testthat/test-documentation.R
e561ace1b857b308d6ff94959235fe38 *tests/testthat/test-edit.R
965edde7df44a944d82e7b2de1024ac0 *tests/testthat/test-git-default-branch.R
a3ea1ffaafec4580f55b1d612beb76dc *tests/testthat/test-git.R
00ffacbe60d7767dbbd69f14e7ec3e94 *tests/testthat/test-github-actions.R
2e21c8b76fc237dc073fbdf0f2df0f94 *tests/testthat/test-github_token.R
2e09ed6855129f05b46d7f07f50812cf *tests/testthat/test-helpers.R
78f6758cbac1d0bcb01ffacac2de48ad *tests/testthat/test-ignore.R
2cbfec6ac278e91cf278c4b201144b84 *tests/testthat/test-jenkins.R
d5ef8a43487ca611f4474f39fc1322d3 *tests/testthat/test-latest-dependencies.R
7d34b0fbb608501c9d2b0f326c22f0ca *tests/testthat/test-license.R
e18130023cafce2e4e12934aa16f8598 *tests/testthat/test-lifecycle.R
31b740bd1cf5746d21abe31de7f33e2f *tests/testthat/test-line-ending.R
2c7149278f85251c71e638a849ad9951 *tests/testthat/test-logo.R
2dbba0b9cb53d8a1257fcd97e4c407e1 *tests/testthat/test-make.R
e27044b978f56042d53d0c45cf5e2caf *tests/testthat/test-package.R
8a627ea69ee72a6794663457f6b475eb *tests/testthat/test-pipe.R
fc025924fdecc2100237850021f53769 *tests/testthat/test-pkgdown.R
7db319b6e7410812a1f5c2fdaebec658 *tests/testthat/test-proj.R
98e8397aa137e7df39378a9539c60e11 *tests/testthat/test-r.R
df4c593202dc4c88d87e3688130e3bca *tests/testthat/test-rcpp.R
9d3d971c53e1db635d7d05cc76c81675 *tests/testthat/test-readme.R
9e1a773ada57b9be29798dad86ca680a *tests/testthat/test-release.R
6f8d83177af60365fa34172bb1a9abb0 *tests/testthat/test-revdep.R
7b2a47558f48da375a38d084477ad781 *tests/testthat/test-rmarkdown.R
4c5e6265d0c6c4fcee7c1fb07635ac76 *tests/testthat/test-roxygen.R
7f90369109b293aa44bdef02cd024340 *tests/testthat/test-rstudio.R
e3c5f3587528c3fe467aa9e111eaecec *tests/testthat/test-template.R
02b6cbe72fab99b5cc68fac1bc61109d *tests/testthat/test-test.R
75cf1321400b8c3a8b100ec422b16fad *tests/testthat/test-testthat.R
c009e37e55002191ec28c51972741479 *tests/testthat/test-tibble.R
d880dd81dcae7f17d142aa4ee7db0004 *tests/testthat/test-tidy-upkeep.R
b93ec556e728da8cb441c16b33781040 *tests/testthat/test-tidyverse.R
6e3d0bc7c596eee67b4ff9646a21cc33 *tests/testthat/test-tutorial.R
ae224e355733662cefea3cfb5d0681bf *tests/testthat/test-ui.R
bb57f3391161b0658c4aa551b2964c20 *tests/testthat/test-use_github_file.R
dda02a9df01a4f2db9bf1346ea628594 *tests/testthat/test-use_import_from.R
2c4de578d2c199d0e3a466cf5c61e992 *tests/testthat/test-utils-git.R
0100c847247f42b9970f6a980581e43f *tests/testthat/test-utils-github.R
2d3170981c90ef8b0ab07df4bef48d82 *tests/testthat/test-utils-glue.R
f035b5c40ad3ffeb4a77745ea91ee09a *tests/testthat/test-utils.R
04fc28f7c2115842d66af7529ebad910 *tests/testthat/test-version.R
4e9f457decc5dd3135eeab7f79f2e6e0 *tests/testthat/test-vignette.R
4e46ce3a7e27221625ba72d5b651281b *tests/testthat/test-write.R
usethis/NEWS.md 0000644 0001750 0001750 00000157006 14154446611 013205 0 ustar nilesh nilesh # usethis 2.1.5
pkgdown-related functions no longer automatically strip a trailing slash from the pkgdown site URL, in order to play more nicely with CRAN's URL checks (#1526).
`edit_pkgdown_config()` is a new function that opens the pkgdown YAML configuration file for the current Project, if such a file exists.
The error thrown when reporting an unsupported GitHub configuration has been fixed for forward compatibility with a future version of rlang, i.e. what is anticipated to be rlang v1.0.0.
Version 2.1.4 was never released. Version was advanced from 2.1.4 to 2.1.5 strictly for CRAN (re-)submission purposes.
# usethis 2.1.3
Modified a test to ensure that intermittent GitHub rate limiting does not lead to ungraceful failure on CRAN.
# usethis 2.1.2
`git_default_branch_rename()` no longer errors on repos where README exists, but has no badge block.
`git_default_branch_rediscover()` prunes the defunct remote ref to the old default branch, e.g. `origin/master`.
# usethis 2.1.0
## Git default branch support
usethis has a more sophisticated understanding of the default branch and gains several functions to support default branch renaming.
* `git_branch_default()` has been renamed to `git_default_branch()`, to place
it logically in the new family of functions. The old name still works, but
that won't be true forever.
* `git_default_branch()` is much more diligent about figuring out the default
branch. Instead of only consulting the local repo, now we integrate local info
with the default branch reported by the `upstream` or `origin` remote, if
applicable.
- This is intended to surface the case where a project has renamed its default
branch and the local repo needs sync up with that.
* `git_default_branch_rediscover()` is a new function that helps contributors
update their local repo (and personal fork, if applicable) when a project/repo
renames its default branch.
* `git_default_branch_rename()` is a new function that helps a repo owner
rename the default branch (both on GitHub and locally).
* `git_default_branch_configure()` is a new function to set the new Git
configuration option `init.defaultBranch`, which controls the name of the
initial branch of new local repos.
* `git_sitrep()` exposes `init.defaultBranch` and surfaces the more
sophisticated analysis of `git_default_branch()`.
## Other GitHub-related changes
* `git_sitrep()` and `gh_token_help()` try even harder to help people get on the
happy path with respect to their GitHub PAT (#1400, #1413, #1488, #1489,
#1497).
* The minimum version of gh has been bumped to help / force more people to
upgrade to the gh version that supports current GitHub PAT formats
(@ijlyttle, #1454).
* `use_github_file()` is a new function related to `use_template()`. Instead of
starting from a local file, `use_github_file()` grabs the contents of an
arbitrary file on GitHub that the user has permission to read. It supports
targeting a specific branch, tag, or commit and can follow a symlink (#1407).
`use_github_file()` now powers `use_github_action()` and friends.
* `use_github_release()` is much more diligent about using any information left
behind by `devtools::submit_cran()` or `devtools::release()`. Specifically,
this applies to determining which SHA is to be tagged in the release. And this
SHA, in turn, determines the consulted versions of DESCRIPTION (for package
version) and NEWS.md (for release notes) (#1380).
* `use_release_issue()` also takes bullets from `release_questions()`,
for compatibility with `devtools::release()`.
* `git_vaccinate()`, `edit_git_ignore()`, and `git_sitrep()` are more careful to
consult, reveal, and set the `core.excludesFile` setting in user's Git
configuration (#1461).
* `use_github_action_check_full()` has been removed. It's overkill for the
majority of R packages, which are better off with `use_github_actions()` or
`use_github_action_check_standard()` (#1490).
* `use_github_pages()` and `use_pkgdown_github_pages()` use a new method for
creating an empty, orphan `gh-pages` branch. This is necessary due to new
GitHub behaviour, where it has become essentially impossible to refer to the
empty tree (#1472).
* `use_github()` can create repositories with `"internal"` visibility, a feature
that exists within GitHub Enterprise products (#1505).
## Package development
* `use_readme_[r]?md()` no longer includes CRAN installation instructions in the
initial template; instead, we only include GitHub-based install instructions
or otherwise prompt the user to update instructions (#1507).
* `use_import_from()` is a new function that puts `@importFrom pkg fun`
directives into a package in a consistent location (@malcolmbarrett, #1377).
* `DESCRIPTION` files generated by usethis no longer include `LazyData` by
default, as per new CRAN checks; instead, `LazyData` is now added the first
time you use `use_data()` (@malcolmbarrett, #1404).
* `use_tidy_eval()` has been updated to reflect current recommendations for
using (and therefore exposing) tidy eval in other packages (@lionel-, #1445).
* `use_pkgdown()` automatically uses Bootstrap 5 if the pkgdown version supports
it (anticipated for pkgdown 2.0.0).
* `use_lifecycle()` now imports `lifecycle::deprecated()` (#1419).
* `use_code_of_conduct()` now requires a `contact` argument to supply contact
details for reporting CoC violations (#1269).
* `use_package()` no longer guides the user on how to use a dependency when no
change was made (@malcolmbarrett, #1384).
### Aimed at the tidyverse team
These functions are exported for anyone to use, but are aimed primarily at the maintainers of tidyverse, r-lib, and tidymodels packages.
* `use_tidy_dependencies()` is a new function that sets up standard dependencies
used by all tidyverse packages, except those that are designed to be
dependency free (#1423).
* `use_tidy_upkeep_issue()` is a new function similar to `use_release_issue()`
that creates a checklist-style issue to prompt various updates (#1416).
* `use_tidy_release_test_env()` has been deleted since we no longer recommend
including test environments in `cran-comments.md`. There's no evidence that
CRAN finds it useful, and it's annoying to keep up-to-date (#1365).
* `use_tidy_github_labels()` is the new name for `use_tidy_labels()` (#1430).
* `use_tidy_github_actions()` takes over for `use_tidy_ci()`, which is now
deprecated.
## User-level configuration
* `"usethis.overwrite"` is a new option. When set to `TRUE`, usethis overwrites
an existing file without asking for user confirmation if the file is inside
a Git repo. The normal Git workflow makes it easy to see and selectively
accept/discard any proposed changes. This behaviour is strictly opt-in
(#1424).
* Functions that provide code to load packages in your `.Rprofile` now use
`rlang::check_installed()` to make sure the package is installed locally
(@malcolmbarrett, #1398).
* `edit_rstudio_prefs()` and `edit_rstudio_snippets()` should work now on
case-sensitive OSes, due to a path fix re: the location of RStudio's config
files (@charliejhadley, #1420).
# usethis 2.0.1
* All functions that require a package now ask you if you'd like to install it.
* Added `edit_template()` for opening and creating files in `inst/templates`
(for use with `use_template()`) (@malcolmbarrett, #1319).
* `use_article()` now creates the file in the `vignettes/articles/` (#548).
* `use_lifecycle()` has been updated for changes in our lifecycle workflow
(#1323).
* `use_tidy_pkgdown()` has been renamed to `use_pkgdown_github_pages()` since
the function is useful for anyone who wants to automatically publish to GitHub
pages, not just the tidyverse team (#1308).
* `use_release_issue()` includes a bunch of minor improvements. Most
importantly, for initial CRAN release we now include a number of common
things that CRAN checks for that aren't in `R CMD check`.
* `use_readme_rmd()`, `use_readme_md()`, `use_tidy_contributing()`, and
`use_tidy_support()` use updated logic for determining the `OWNER/REPO` spec
of the target repo (#1312).
# usethis 2.0.0
## Adoption of gert and changes to Git/GitHub credential handling
Usethis has various functions that help with Git-related tasks, which break down into two categories:
1. Git tasks, such as clone, push, and pull. These are things you could do with
command line Git.
1. GitHub tasks, such as fork, release, and open an issue or pull request. These
are things you could do in the browser or with the GitHub API.
We've switched from git2r to the gert package for Git operations (). We continue to use the gh package for GitHub API work ().
The big news in this area is that these lower-level dependencies are getting better at finding Git credentials, finding the same credentials as command line Git (and, therefore, the same as RStudio), and finding the same credentials as each other. This allows usethis to shed some of the workarounds we have needed in the past, to serve as a remedial "credential valet".
Under the hood, both gert and gh are now consulting your local Git credential store, when they need credentials. At the time of writing, they are using two different even-lower-level packages to do this:
* gert uses the credentials package ()
* gh uses the gitcreds package ()
Even now, gert and gh should discover the same credentials, at least for github.com. In the future, these two packages may merge into one.
Git/GitHub credential management is covered in a new article:
[Managing Git(Hub) Credentials](https://usethis.r-lib.org/articles/articles/git-credentials.html)
The main user-facing changes in usethis are:
* usethis should discover and use the same credentials as command line Git.
* usethis should be able to work with any GitHub deployment. While github.com is the default, GitHub Enterprise deployments are fully supported. The target GitHub host is determined from the current project's configured GitHub remotes, whenever possible.
As a result, several functions are deprecated and several other functions have some deprecated arguments.
* Deprecated functions:
- `use_git_credentials()`
- `git_credentials()`
- `github_token()`
* Functions with (deprecated arguments):
- `create_from_github()` (`auth_token`, `credentials`)
- `use_github()` (`auth_token`, `credentials`)
- `use_github_links()` (`host`, `auth_token`)
- `use_github_labels()` (`repo_spec`, `host`, `auth_token`)
- `use_tidy_labels()` (`repo_spec`, `host`, `auth_token`)
- `use_github_release()` (`host`, `auth_token`)
The switch to gert + credentials should eliminate most credential-finding fiascos. Gert also takes a different approach to wrapping libgit2, the underlying C library that does Git operations. The result is more consistent support for SSH and TLS, across all operating systems, without requiring special effort at install time. More users should enjoy Git remote operations that "just work", for both SSH and HTTPS remotes. There should be fewer "unsupported protocol" errors.
## GitHub remote configuration
Usethis gains a more formal framework for characterizing a GitHub remote configuration. We look at:
* Which GitHub repositories `origin` and `upstream` point to
* Whether you can push to them
* How they relate to each other, e.g. fork-parent relationship
This is an internal matter, but users will notice that usethis is more clear about which configurations are supported by various functions and which are not. The most common configurations are reviewed in a [section of Happy Git](https://happygitwithr.com/common-remote-setups.html).
When working in a fork, there is sometimes a question whether to target the fork or its parent repository. For example, `use_github_links()` adds GitHub links to the URL and BugReports fields of DESCRIPTION. If someone calls `use_github_links()` when working in a fork, they probably want those links to refer to the *parent* or *source* repo, not to their fork, because the user is probably preparing a pull request. Usethis should now have better default behaviour in these situations and, in some cases, will present an interactive choice.
## Default branch
There is increasing interest in making the name of a repo's default branch configurable. Specifically, `main` is emerging as a popular alternative to `master`. Usethis now discovers the current repo's default branch and uses that everywhere that, previously, we had hard-wired `master`.
`git_branch_default()` is a newly exported function that is also what's used internally.
`use_course()`, `use_zip()`, and `create_download_url()` all have some support for forming the URL to download a `.zip` archive of a repo, based on a repo specification (e.g. `OWNER/REPO`) or a browser URL. These helpers now form a URL that targets `HEAD` of the repo, i.e. the default branch.
## Changes to Git/GitHub functionality
The default Git protocol is now "https" and we no longer provide an interactive choice, by default, in interactive sessions. As always, a user can express a preference for "ssh" in individual function calls, for an R session via `use_git_protocol()`, and for all R sessions via the `usethis.protocol` option (#1262).
`pr_resume()` is a new function for resuming work on an existing local PR branch. It can be called argument-less, to select a branch interactively.
`pr_fetch()` can also be called with no arguments, to select a PR interactively.
The `owner` argument is replaced by `target`, with a choice of the source (default) or primary repo.
`pr_forget()` is a new function for abandoning a PR you initiated locally or fetched from GitHub. It only does local clean up and, for example, doesn't delete a remote branch or close a PR (#1263).
`pr_view()` can now be called with no arguments. If the current branch is associated with an open PR, we target that and, otherwise, we offer an interactive selection.
`pr_finish()` deletes the remote PR branch if the PR has been merged and the current user has the power to do so, i.e. an external contributor deleting their own branch or a maintainer deleting a branch associated with an internal PR (#1150). It no longer errors if the PR branch has already been deleted (#1196).
`pr_pull_upstream()` is renamed to `pr_merge_main()` to emphasize that it merges the **main** line of development into the current branch, where the main line of development is taken to mean the default branch, as reported by `git_branch_default()`, of the source repo, which could be either `upstream` or `origin`, depending on the situation.
`create_from_github()` will only create a read-only clone, due to lack of a GitHub personal access token, if explicitly directed to do so via `fork = FALSE`.
`create_from_github()` and `use_tidy_thanks()` accept browser and Git URLs as the `repo_spec` argument, to be friendlier to copy/paste. When a URL is passed, the `host` is also extracted from it.
`create_github_token()` is a new name for the function previously known as `browse_github_token()` and `browse_github_pat()`.
`issue_close_community()` and `issue_reprex_needed()` are two new functions for maintainers who process lots of GitHub issues. They automate canned replies and actions, e.g. labelling or closing (#940).
GitHub Actions is the preferred platform for continuous integration, because that is what the tidyverse team currently uses and maintains. Functions related to Travis-CI and AppVeyor are soft-deprecated to raise awareness about this change and to make it clear that, if substantial maintenance becomes necessary, we may elect to retire the function (#1169).
`browse_github_actions()` is a new function to open the Actions page of the respective repo on GitHub, similar to existing `browse_*()` functions (@pat-s, #1102).
`use_github_pages()` is a new function to activate or reconfigure the GitHub Pages site associated with a repository (#224).
`use_tidy_pkgdown()` implements the complete pkgdown configuration used by the tidyverse team (#224).
`pr_sync()` is defunct and can be replicated by calling `pr_pull()`, `pr_merge_main()`, then `pr_push()`.
## Licensing improvements
All `use_*_license()` functions now work for projects, not just packages.
`use_apl2_license()` (not `use_apache_license()`) and `use_gpl3_license()` no longer modify the license text (#1198).
`use_mit_license()` now sets the default copyright holder to "{package} authors". This makes it more clear that the copyright holders are the contributors to the package; unless you are using a CLA there is no one copyright holder of a package (#1207).
New `use_gpl_license()` and `use_agpl_license()` make it easier to pick specific versions of the GPL and AGPL licenses, and to choose whether or not you include future versions of the license. Both default to version 3 (and above).
New `use_proprietary_license()` allows your package to pass R CMD check while making it clear that your code is not open source (#1163). Thanks to @atheriel for the blog post suggesting the wording: https://unconj.ca/blog/copyright-in-closed-source-r-packages-the-right-way.html
`use_lgpl_license()` now uses version 3 (and above), and gains new `version` and `include_future` argument to control which version is used.
`use_gpl3_license()`, `use_agpl3_license()` and `use_apl2_license()` have been deprecated in favour of the new `version` argument to `use_gpl_license()`, `use_agpl_license()` and `use_apache_license()`.
The `name` argument to `use_mit_license()` has been changed to `copyright_holder` to make the purpose more clear. The `name` argument has been removed from all other license functions because it is not needed; no other license makes an assertion about who the copyright holder is.
## RStudio preferences
usethis is now fully cognizant of the [changes to RStudio preferences](https://www.rstudio.com/blog/rstudio-1-3-preview-configuration/) in RStudio 1.3:
`edit_rstudio_snippets()` looks in the new location, and if you have snippets in the old location, will automatically copy them to the new location (#1204)
New `edit_rstudio_prefs()` opens RStudio preferences file for editing (#1148).
`use_blank_slate()` can now configure your global, i.e. user-level, RStudio preference, in addition to project-level (#1018).
## Other changes
`browse_package()` and `browse_project()` are new functions that let the user choose from a list of URLs derived from local Git remotes and DESCRIPTION (local or possibly on CRAN) (#1113).
The legacy `"devtools.desc"` option is no longer consulted when populating a new DESCRIPTION file. You must use the `"usethis.description"` now (#1069).
`use_dev_package()` gains a `remote` parameter to allow you to specify the remote. The existing behaviour, which adds an `OWNER/REPO` GitHub remote, remains the default (#918, @ijlyttle).
`use_cpp11()` is a new function to set up an R package to use cpp11.
`create_package(roxygen = FALSE)` once again writes a valid NAMESPACE file (and also has no Roxygen* fields in DESCRIPTION) (#1120).
`create_package()`, `create_project()`, `create_from_github()`, and `proj_activate()` work better with relative paths, inside and outside of RStudio (#1122, #954).
`use_testthat()` gains an edition argument to support testthat v3.0.0
(#1185)
`use_version()` now updates `src/version.c` if it exists and contains a line matching `PKG_version = "x.y.z";`.
usethis has been re-licensed as MIT (#1252, #1253).
## Dependency changes
New Imports: gert, jsonlite (was already an indirect dependency), lifecycle, rappdirs
No longer in Imports: git2r, rematch2
# usethis 1.6.3
Patch release to refactor usage of withr in the tests for forward compatibility with an upcoming withr release. All changes are within the usethis tests.
# usethis 1.6.1
Patch release to align some path handling internals with an update coming in the fs package.
* `use_github_links()` is a bit more clever about remotes (e.g. `origin`
vs. `upstream`), which makes it easier to make a PR that adds GitHub links for
a package you've forked.
* `use_pkgdown()` now `.gitignore`s the destination directory and only adds the
destination directory to the config file if it departs from the default
(which is `docs/`).
* `use_tidy_ci()` is now deprecated in favour of `use_tidy_github_actions()`
(#1098).
* `use_github_action_check_standard()` is a new intermediate workflow that
checks on more platforms than `_release`, but is less exhaustive than `_full`
(@jimhester).
* `create_tidy_package()` now uses an MIT license (@topepo, #1096).
# usethis 1.6.0
## GitHub actions
* New `use_github_actions()`, `use_github_action_check_release()`,
`use_github_action_check_full()`, `use_github_action_pr_commands()`,
to set up GitHub Actions for a package (@jimhester).
* We now recommend GitHub Actions instead of Travis-CI or AppVeyor, and strongly
recommend upgrading your packages.
* Fix `use_github_action()` URL parameter to ensure custom URLs are allowed.
(@coatless, #1065).
## Package creation
* `create_package()` gains a `roxygen` argument. If `TRUE` (the default),
it adds a `RoxygenNote` field to the `DESCRIPTION` (which means the first run
of `devtools::check()` will re-document the package, #963), and creates an
empty `NAMESPACE` (which means you'll always need an explicit `@export`
if you want to export functions, #927). It also turns markdown processing
on by default (#911).
* `use_rstudio()` now sets the `LineEndingConversion` to `Posix` so that
packages created using usethis always use LF line endings, regardless of
who contributes to them (#1002).
* In the `usethis.description` option, you can now set `Authors@R = person()`
directly, without having to wrap in additional layer of quotes. If setting
this in your `.Rprofile`, you'll need to use `utils::person()` since the utils
package isn't loaded until after your profile is executed.
## PR helpers
* A new article [Pull request helpers](https://usethis.r-lib.org/articles/articles/pr-functions.html)
demonstrates how to use the `pr_*()` functions (@mine-cetinkaya-rundel, #802).
* `pr_finish()` checks that you don't have any local changes (#805), and can
optionally finish any PR, not just the current (#1040).
* `pr_pause()` and `pr_fetch()` now automatically pull to get latest changes
(#959, #960) and refresh RStudio's git pane (#706).
* `pr_push()` now works for a repository with no open pull requests
(@maurolepore, #990).
* `pr_pull()` gives more information about which files have merge conflicts
and automatically opens conflicted files for editing (#1056).
## Other new features
* New `rename_files()` makes it easy to rename paired `R/` and `test/` files
(#784).
* New `ui_silence()` makes it easier to selectively silence some UI output.
* New `use_agpl3_license()` (@pachamaltese, #870).
* New `use_data_table()` to set up a package for Import-ing `data.table`
(@michaelchirico, #897).
* `use_latest_dependencies()` replaces `use_tidy_version()` as the new name
better reflect its usage (#771).
* New `use_lifecycle()` helper to import the lifecycle badges for functions and
arguments in your package. Learn more at .
* `use_release_issue()` will include additional bullets if your package
includes `release_bullets()` function which returns a character
vector (and the package has been loaded with `load_all()`) (#941).
## Minor improvements and bug fixes
* When writing files, usethis now respects line endings. Default line endings
are taken from the `.Rproj` file (if available), otherwise the `DESCRIPTION`,
otherwise the first file found in `R/`, then all else failing to your
platform default (#767). It should do a better job of preserving UTF-8 files
on windows (#969).
* `browse_github()` now always goes to the canonical GitHub site:
`https://github.com/user/repo`. This is slightly worse than the current
behaviour but makes the function more consistent across packages, and
considerably simplifies the implementation.
* `browse_circle()` opens the project dashboard on Circle CI.
* `create_download_url()` is a new helper for making "ZIP file download"
URLs suitable for use with `use_course()` and `use_zip()`, starting with the
URLs that mere mortals can usually get their hands on in a browser
(@fmichonneau, #406).
* `create_package()` no longer fails partway through if you have a malformed
`usethis.description` option (#961).
* `create_package()` will now create a package in a symlink to a directory
(#794).
* `create_package()` and `use_description()` gain a `check_name` argument to
control whether to check for package names invalid for CRAN (@noamross, #883).
* `edit_file()` and `use_test()` gain an `open` parameter that allows you to
control whether or not the function is opened for editing by the user (#817).
* `edit_rstudio_snippets()` makes it more clear which snippet types are
allowed and that user's snippets mask the built-in snippets (@GegznaV, #885).
* `git_sitrep()` now reports project-specific user name and email, if set
(#837), and email(s) associated with your GitHub account (@dragosmg, #724).
* `ui_yeah()` and `ui_nope()` allow you to override the default "yes" and
"no" strings and to opt-out of shuffling (@rundel, #796).
* `use_circleci()` uses correct delimiters in template (@jdblischak, #835).
* `use_circleci_badge()` is now exported (@pat-s, #920).
* `use_code_of_conduct()` now generates an absolute link to code of conduct on
pkgdown website or original source to avoid R CMD check issues (#772).
* `use_course()` and `use_zip()` are now equipped with some retry capability,
to cope with intermittent failure or the need for a longer connect timeout
(#988).
* `use_data()` automatically bumps R dependency to 2.10 (#962).
* `use_data_raw()` template quotes the dataset name correctly
(#736, @mitchelloharawild).
* `use_description_defaults()` now shows the default fields combined with
any options that you have set.
* `use_dev_package()` now supports packages installed from any remote type,
not just GitHub (@antoine-sachet, #1071).
* `use_git()` will now create initial commit if needed (#852).
* `use_github_release()` no longer fails if you have no news bullets (#1048).
* `use_github_release()` now tags the latest local commit instead of the latest
remote commit on the default branch (@davidchall, #1029).
* `use_gpl3_license()` now completes the license by providing additional
information in a file named LICENSE, just like `use_mit_license()` and
friends (@Cervangirard, #683).
* `use_logo()` now generates the correct href if the pkgdown `url` is set
(@mitchelloharawild, #986).
* `use_make()` gains missing closing parenthesis (@ryapric, #804).
* `use_markdown_template()` no longer uses an unexported function in its
default arguments (@fmichonneau, #761).
* `use_testthat()` and `use_test()` now work in projects, not just packages
(#1017).
* `use_test()` works on Windows when called without arguments (#901).
* `use_tidy_issue_template()` uses current github format (@Maschette, #756).
* `use_travis()`, `use_travis_badge()`, and `browse_travis()`, now default
to `ext = "com"` since travis-ci.com is now recommended it over travis-ci.org
(@riccardoporreca, #1038).
* `use_release_issue()` reminds you to re-generate `README.md`,
if needed (#767).
* `use_r()` and `use_test()` throw a clear error if multiple names are provided
(@strboul, #862).
* `use_rcpp()` and `use_c()` now ensure `src/` contains at least one `.cpp` or
`.c` placeholder file, so that the package can be built (@coatless, #720).
* `usethis.destdir` is a new option that is consulted when deciding where to
put a new folder created by `use_course()` or `create_from_github()`
(@malcolmbarrett, #1015).
* `use_lifecycle()` no longer adds the lifecycle package to the DESCRIPTION
file. With the new roxygen markdown syntax for including badges, lifecycle has
become a build-time dependency.
## Dependency changes
New Imports: cli, rematch2, rlang.
gh minimum version is bumped to v.1.1.0, due to changed behaviour around requests that return nothing.
clisymbols is removed from Imports.
# usethis 1.5.1
This is a patch release with various small features and bug fixes.
## Using the pipe `%>%` or the tidy eval toolkit in your package
* The templates used by `use_pipe()` and `use_tidy_eval()` use a more robust
form of cross-reference links, linking to files rather than topics. This
should silence some warnings seen on Windows at install time
(#730, #731 @jmgirard).
* `use_pipe()` gains a logical `export` argument, so it can do the setup
necessary to use the pipe operator when it is re-exported
(`export = TRUE`, which is the default and preserves the previous behaviour)
and when it is not (`export = FALSE`) (#783).
## Git, GitHub, and pull requests
* `use_github()` removes newline `\n` characters from the description that
can cause the initial push to fail (#493, @muschellij2).
* `git_sitrep()` gives better feedback if we can't validate the GitHub PAT
(#725, @ijlyttle).
* `create_from_github()` sets remote tracking branch of `master` to
`upstream/master`, when it creates (and clones) a fork (#792).
* `pr_pause()` can switch back to master even if there is no remote tracking
branch (#715, @cderv).
## Build tools and continuous integration
* `use_tidy_ci()` is updated for R 3.6, meaning that R 3.2 is the oldest version
of R supported through proactive testing.
* `use_make()` and `use_jenkins()` add a Makefile and Jenkinsfile, respectively
(#501, @ryapric).
* `use_circleci()` creates a `.circleci/config.yaml` config file for CircleCI
(#703, @jdblischak).
## Other
* `use_zip()` is a new variant of `use_course()` that downloads and unpacks a
ZIP file, with less pedantic behaviour re: the destination directory. Both
functions now also work for ZIP files with MIME type
`"application/x-zip-compressed"` (#573).
* `use_version()` can detect `"(development version)"` in a NEWS header and
update it with an actual version (#768, @DavisVaughan).
## Dependency changes
R 3.1 is no longer explicitly supported or tested. Our general practice is to support the current release (3.6, at time of writing), devel, and the 4 previous versions of R (3.5, 3.4, 3.3, 3.2).
fs minimum version is stated to be v1.3.0.
glue minimum version is stated to be v1.3.0.
# usethis 1.5.0
## Git, GitHub (and GitLab)
usethis gains several functions to inspect and manipulate the Git situation for the current project = repository. We also provide more control and visibility
into git2r's workings, especially around credentials (usethis uses git2r for all
Git operations).
* `git_sitrep()` lets you know what's up with your Git, git2r and GitHub
config (#328).
* `git_vaccinate()` vaccinates your global (i.e. user-level) git ignore file.
It adds standard entries for R users, such as `.Rhistory` and `.Rdata`. This
decreases the chance that you commit and push files containing confidential
information (#469).
* `git_remotes()` and `use_git_remote()` are new helpers to inspect or modify
Git remote URLs for the repo associated with the active project (#649).
* `git_protocol()` + `use_git_protocol()` and `git_credentials()` +
`use_git_credentials()` are new helpers to summon or set Git transport
protocol (SSH or HTTPS) or git2r credentials, respectively. These functions
are primarily for internal use. Most users can rely on default behaviour. Use
these helpers to intervene if git2r isn't discovering the right credentials
(#653). usethis honors the `usethis.protocol` option, which allows you to
express a general preference for SSH vs. HTTPS.
Other improvements and bug fixes:
* `use_github()` tries harder but also fails earlier, with more informative
messages, making it less likely to leave the repo partially configured (#221).
* `use_github()` and `create_from_github()` gain a `protocol` argument
(#494, @cderv).
* `create_from_github()` pulls from upstream master in a fork (#695, @ijlyttle).
* `use_release_issue()` creates a GitHub issue containing a release checklist,
reflecting the standard practices of the tidyverse team (#338).
* `use_github_release()` creates a draft GitHub release using the entries in
`NEWS.md` (#137).
* `use_gitlab_ci()` creates a `gitlab-ci.yaml` config file for GitLab CI
(#565, @overmar).
* `use_git_config()` now invisibly returns the previous values of the
settings.
* `use_github_labels()` has been rewritten be more flexible. You can now supply
a repo name, and `descriptions`, and you can set colours/descriptions
independently of creating labels. You can also `rename` existing labels
(#290).
## GitHub pull requests
We've added **experimental** functions to work with GitHub pull requests. They
are aimed at both a maintainer (who may make, review, and modify pull
requests) and a contributor (who may make or explore pull requests).
* `git_sitrep()` includes a section at the end aimed at describing "pull request
readiness". Expect that to develop and expand.
* `pr_init()`, `pr_fetch()`, `pr_push()`, `pr_pull()`, `pr_finish()`, and
`pr_view()` constitute the new family of helpers. They are designed to be
smart about the significance of remotes with the standard names of `origin`
and `upstream` and to facilitate both internal and external pull requests.
## Partial file management
usethis gains tooling to manage part of a file. This is currently used for
managing badges in your README and roxygen import tags:
* `use_badge()` and friends now automatically add badges if your README
contains a specially formatted badge block (#497):
```
<-- badge:start -->
<-- badge:end -->
```
* `use_tibble()` and `use_rcpp()` automatically add roxygen tags to
to `{package}-package.R` if it contains a specially formatted namespace
block (#517):
```R
## usethis namespace: start
## usethis namespace: end
NULL
```
Unfortunately this means that `use_rcpp()` no longer supports non-roxygen2
workflows, but I suspect the set of people who use usethis and Rcpp but
not roxygen2 is very small.
## Extending and wrapping usethis
* New `proj_activate()` lets you activate a project, either opening a new
RStudio session (if you use RStudio) or changing the working directory
(#511).
* `proj_get()` and `proj_set()` no longer have a `quiet` argument. The
user-facing message about setting a project is now under the same control
as other messages, i.e. `getOption("usethis.quiet", default = FALSE)` (#441).
* A new set of `ui_*()` functions makes it possible to give your own code
the same user interface as usethis (#308). All use the glue and crayon and
packages to power easy interpolation and formatting. There are four families
of functions:
* block styles: `ui_line()`, `ui_done()`, `ui_todo()`, `ui_oops()`,
`ui_info()`.
* conditions: `ui_stop()`, `ui_warn()`.
* questions: `ui_yeah()`, `ui_nope()`.
* inline styles: `ui_field()`, `ui_value()`, `ui_path()`, `ui_code()`.
* `with_project()` and `local_project()` are new withr-style functions to
temporarily set an active usethis project. They make usethis functions easier
to use in an *ad hoc* fashion or from another package (#441).
## Tidyverse standards
These standards are (aspirationally) used by all tidyverse packages; you are
welcome to use them if you find them helpful.
* Call `use_tidy_labels()` to update GitHub labels. Colours are less
saturated, docs is now documentation, we use some emoji, and performance is
no longer automatically added to all repos (#519). Repo specific issues
should be given colour `#eeeeee` and have an emoji.
* Call `use_logo()` to update the package logo to the latest specifications:
`man/figure/logo.png` should be 240 x 278, and README should contain
``.
This gives a nicer display on retina displays. The logo is also linked to the
pkgdown site if available (#536).
* When creating a new package, use `create_tidy_package()` to start with a
package following the tidyverse standards (#461).
* `NEWS.md` for the development version should use "(development version)"
rather than the specific version (#440).
* pkgdown sites should now be built by travis and deployed automatically to
GitHub pages. `use_pkgdown_travis()` will help you set that up.
* When starting the release process, call `use_release_issue()` to create a
release checklist issue (#338).
* Prior to CRAN submission call `use_tidy_release_test_env()` to update the
test environment section in `cran-comments()` (#496).
* After acceptance, try `use_github_release()` to automatically create a
release. It's created as a draft so you have a chance to look over before
publishing.
* `use_vignette()` includes the a standard initialisation chunk with
`knitr::opts_chunk$set(comment = "#>", collapse = TRUE)` which should
be used for all Rmds.
## New functions not already mentioned
* `use_devtools()` (#624), `use_conflicted()` (#362), and `use_reprex()` (#465)
help add useful packages to your `.Rprofile`.
* `use_partial_warnings()` helps the user add a standard warning block to
`.Rprofile` (#64).
* `edit_r_buildignore()` opens `.Rbuildignore` for manual editing
(#462, @bfgray3).
* `use_lgpl_license()` automates set up of the LGL license (#448, @krlmlr).
* `use_ccby_license()` adds a CCBY 4.0 license (#547, @njtierney).
* `use_rcpp_armadillo()` and `use_rcpp_eigen()` set up a package to use
RcppArmadillo or RcppEigen, respectively (#421, @coatless, @duckmayr).
* `use_c("foo")` sets up `src/` and creates `src/foo.c` (#117).
* `use_covr_ignore()` makes it easy to ignore files in test coverage (#434).
* `use_pkgdown_travis()` helps you set up pkgdown for automatic build-and-deploy
from Travis-CI to GitHub Pages (#524).
* `use_addin()` does setup for RStudio addins (#353, @haozhu233).
* `use_tutorial()` creates a new interactive R Markdown tutorial, as implemented
by the [`learnr` package](https://rstudio.github.io/learnr/index.html)
(@angela-li, #645).
* `use_article()` creates articles, vignettes that are automatically added to
`.Rbuildignore`. These appear on pkgdown sites, but are not included with the
package itself (#281).
* `use_citation()` creates a basic `CITATION` template and puts it in the
right place (#100).
## Other minor bug fixes and improvements
* `write_union()` appends the novel `lines`, but does not remove duplicates
from existing lines (#583, @khailper).
* `use_rcpp("foo")` now creates `src/foo.cpp` (#117).
* `use_data()` gains a `version` argument and defaults to serialization format
version 2 (#675).
* `use_data_raw()` accepts a name for the to-be-prepared dataset and opens a
templated R script (#646).
* `browse_github()` now falls back to CRAN organisation (with a warning) if
package doesn't have its own GitHub repo (#186).
* `create_*()` restore the active project if they error part way through,
and use `proj_activate()` (#453, #511).
* `edit_r_profile()` and `edit_r_environ()` now respect environment variables
`R_PROFILE_USER` and `R_ENVIRON_USER`, respectively (#480).
* `use_description()` once again prints the generated description (#287).
* `use_description_field()` is no longer sensitive to whitespace, which
allows `use_vignette()` to work even if the `VignetteBuilder` field is
spread over multiple lines (#439).
* `use_logo()` can override existing logo if user gives permission (#454).
It also produces retina appropriate logos by default, and matches the
aspect ratio to the specification (#499).
* `use_news_md()` will optionally commit.
* `use_package()` gains a `min_version` argument to specify a minimum
version requirement (#498). Set to `TRUE` to use the currently installed
version (#386). This is used by `use_tidy_eval()` in order to require version
0.1.2 or greater of rlang (#484).
* `use_pkgdown()` is now configurable with site options (@jayhesselberth, #467),
and no longer creates the `docs/` directory (#495).
* `use_test()` no longer forces the filename to be lowercase (#613, @stufield).
* `use_test()` will not include a `context()` in the generated file if used
with testthat 2.1.0 and above (the future release of testthat) (#325).
* `use_tidy_description()` sets the `Encoding` field in `DESCRIPTION`
(#502, @krlmlr).
* `use_tidy_eval()` re-exports `:=` (#595, @jonthegeek).
* `use_tidy_versions()` has source argument so that you can choose to use
local or CRAN versions (#309).
* `use_travis()` gains an `ext` argument, defaulting to `"org"`. Use
`ext = "com"` for `https://travis-ci.com` (@cderv, #500).
* `use_version()` asks before committing.
* `use_vignette()` now has a `title` argument which is used in YAML header
(in the two places where it is needed). The vignettes also lose the default
author and date fields (@rorynolan, #445), and the R Markdown starter material.
They gain a standard setup chunk.
* `use_version("dev")` now creates a standard "(development version)" heading
in `NEWS.md` (#440).
* `use_vignette()` now checks if the vignette name is valid (starts with letter
and consists of letters, numbers, hyphen, and underscore) and throws an error
if not (@akgold, #555).
* `restart_rstudio()` now returns `FALSE` in RStudio if no project is open,
fixing an issue that caused errors in helpers that suggest restarting
RStudio (@gadenbuie, #571).
## Dependency changes
* withr moves from Suggests to Imports.
* purrr and yaml are new in Imports.
# usethis 1.4.0
## File system
All usethis file system operations now use the [fs](https://fs.r-lib.org) package (#177). This should not change how usethis functions, but users may notice these features of fs-mediated paths:
- Paths are "tidy", meaning `/` is the path separator and there are never multiple or trailing `/`.
- Paths are UTF-8 encoded.
- A Windows user's home directory is interpreted as `C:\Users\username` (typical of Unix-oriented tools, like Git and ssh; also matches Python), as opposed to `C:\Users\username\Documents` (R's default on Windows). Read more in [`fs::path_expand()`](https://fs.r-lib.org/reference/path_expand.html).
## Extending or wrapping usethis
These changes make it easier for others to extend usethis, i.e. to create workflow packages specific to their organization, or to use usethis in other packages.
* `proj_path()` is newly exported. Use it to build paths within the active project. Like `proj_get()` and `proj_set()`, it is not aimed at end users, but rather for use in extension packages. End users should use [rprojroot](https://rprojroot.r-lib.org) or its simpler companion, [here](https://here.r-lib.org), to programmatically detect a project and
build paths within it (#415, #425).
* `edit_file()`, `write_over()`, and `write_union()` are newly exported helpers. They are mostly for internal use, but can also be useful in packages that extend or customize usethis (#344, #366, #389).
* `use_template()` no longer errors when a user chooses not to overwrite an existing file and simply exits with confirmation that the file is unchanged (#348, #350, @boshek).
* `getOption("usethis.quiet", default = FALSE)` is consulted when printing user-facing messages. Set this option to `TRUE` to suppress output, e.g., to use usethis functions quietly in another package. For example, use `withr::local_options(list(usethis.quiet = TRUE))` in the calling function (#416, #424).
## New functions
* `proj_sitrep()` reports current working directory, the active usethis project, and the active RStudio Project. Call this function if things seem weird and you're not sure what's wrong or how to fix it. Designed for interactive use and debugging, not for programmatic use (#426).
* `use_tibble()` does minimum setup necessary for a package that returns or exports a tibble. For example, this guarantees a tibble will print as a tibble (#324 @martinjhnhadley).
* `use_logo()` resizes and adds a logo to a package (#358, @jimhester).
* `use_spell_check()` adds a whitelist of words and a unit test to spell check package documentation during `R CMD check` (#285 @jeroen).
## Other small changes and bug fixes
* usethis has a new logo! (#429)
* `use_course()` reports progress during download (#276, #380).
* `use_git()` only makes an initial commit of all files if user gives explicit consent (#378).
* `create_from_github()`: the `repo` argument is renamed to `repo_spec`, since it takes input of the form "OWNER/REPO" (#376).
* `use_depsy_badge()` is defunct. The Depsy project has officially concluded and is no longer being maintained (#354).
* `use_github()` fails earlier, with a more informative message, in the absence of a GitHub personal access token (PAT). Also looks for the PAT more proactively in the usual environment variables (i.e., GITHUB_PAT, GITHUB_TOKEN) (#320, #340, @cderv).
* The logic for setting DESCRIPTION fields in `create_package()` and `use_description()` got a Spring Cleaning. Fields directly specified by the user take precedence, then the named list in `getOption("usethis.description")` is consulted, and finally defaults built into usethis. `use_description_defaults()` is a new function that reveals fields found in options and built into usethis. Options specific to one DESCRIPTION field, e.g. `devtools.desc.license`, are no longer supported. Instead, use a single named list for all fields, preferably stored in an option named `"usethis.description"` (however,`"devtools.desc"` is still consulted for backwards compatibility). (#159, #233, #367)
## Dependency changes
New Imports: fs, glue, utils
No longer in Imports: backports, httr, rematch2, rmarkdown (moved to Suggests), styler (moved to Suggests)
# usethis 1.3.0
* usethis has a website: (#217). It includes an article with advice on system setup, for usethis and for R development more generally.
* `edit_*()` functions now return the target path, invisibly (#255).
* `edit_git_ignore(scope = "user")` prefers `~/.gitignore`, but detects an existing `~/.gitignore_global`, if it exists. If a new global gitignore file is created, it is created as `~/.gitignore` and recorded in user's git config as the `core.excludesfile` (#255).
* `create_from_github()` gains several arguments and new functionality. The `protocol` argument lets user convey whether remote URLs should be ssh or https. In the case of "fork and clone", the original repo is added as `upstream` remote. It is now possible -- although rarely necessary -- to directly specify the GitHub PAT, credentials (in git2r form), and GitHub host (#214, #214, #253).
* `use_github_labels()` can create or update the colour of arbitrary GitHub issue labels, defaulting to a set of labels and colours used by the tidyverse packages, which are now exposed via `tidy_labels()`. That set now includes the labels "good first issue" and "help wanted" (#168, #249).
* `appveyor_info()` no longer reverses the repo's URL and image link. Corrects the markdown produced by `use_appveyor_badge()` (#240, @llrs).
* `use_cran_badge()` uses an HTTPS URL for the CRAN badge image (#235, @jdblischak).
* `create_package()` and `create_project()` return a normalized path, even if target directory does not pre-exist (#227, #228).
## New functions
* `use_git_config()` can set user's Git name or email, globally or locally in a project/repo (#267).
* `browse_github_pat()` goes to the webpage where a GitHub user can create a personal access token (PAT) for the GitHub API. If the user configures a PAT, they can use functions like `create_from_github()` and `use_github()` to easily create and connect GitHub repos to local projects. (#248, #257, @jeroen, via @jennybc).
* `use_version()` increments the version of the active package, including an interactive chooser. `use_dev_version()` is now a special case wrapper around this. (#188, #223, @EmilHvitfeldt).
* `use_tidy_github()` creates a standard set of files that make a GitHub repository more navigable for users and contributors: an issue template, contributing guidelines, support documentation, and a code of conduct. All are now placed in a `.github/` subdirectory (#165, @batpigandme).
* `use_bioc_badge` creates a Bioconductor badge that links to the build report (#271, @LiNk-NY).
* `use_binder_badge()` creates a badge indicating the repository can be launched in an executable environment via [Binder](https://mybinder.org/) (#242, @uribo).
# usethis 1.2.0
## New functions
* `use_course()` downloads a folder's worth of materials from a ZIP file, with deliberate choices around the default folder name and location. Developed for use at the start of a workshop. Helps participants obtain materials from, e.g., a DropBox folder or GitHub repo (#196).
* `use_blank_slate()` provides a way to opt in to an RStudio workflow where the user's workspace is neither saved nor reloaded between R sessions. Automated for `scope = "project"`. Provides UI instructions for `scope = "user"`, for now (#139).
* `use_tidy_style()` styles an entire project according to (#72, #197 @lorenzwalthert).
* GitHub conventions common to tidyverse packages are enacted by `use_tidy_contributing()`, `use_tidy_issue_template()`, and `use_tidy_support()` (@batpigandme, #143, #166).
Other changes
* New projects that don't exhibit other obvious criteria for being a "project" will include a sentinel, empty file named `.here`, so they can be recognized as a project.
* Project launching and switching works on RStudio server (#115, #129).
* `use_template()` is newly exported, so that other packages can provide
templating functions using this framework (@ijlyttle #120).
* `use_readme_rmd()` and `use_readme_md()` work, in a similar fashion, for projects that are and are not a package (#131, #135).
* `use_readme_rmd()` once again creates a pre-commit git hook, to help keep `README.Rmd` and `README.md` in sync (@PeteHaitch #41).
* Substantial increase in unit test coverage.
# usethis 1.1.0
## New helpers
* `browse_github()`, `browse_github_issues()`, `browse_github_pulls()`,
`browse_cran()` and `browse_travis()` open useful websites related to
the current project or a named package. (#96, #103).
* `create_from_github()` creates a project from an existing GitHub
repository, forking if needed (#109).
* `use_cc0_license()` applies a CC0 license, particularly appropriate for data
packages (#94)
* `use_lifecycle_badge()` creates a badge describing current stage in
project lifecycle (#48).
* `use_pkgdown()` creates the basics needed for a
[pkgdown](https://github.com/r-lib/pkgdown) website (#88).
* `use_r("foo")` creates and edit `R/foo.R` file. If you have a test file open,
`use_r()` will open the corresponding `.R` file (#105).
* `use_tidy_versions()` sets minimum version requirement for all dependencies.
## Bug fixes and improvements
* `use_dev_version()` now correctly updates the `Version` field in a package
description file. (@tjmahr, #104)
* `use_revdep()` now also git-ignores the SQLite database (#107).
* `use_tidy_eval()` has been tweaked to reflect current guidance (#106)
# usethis 1.0.0
This is a new package that extracts out many functions that previously lived in devtools, as well as providing more building blocks so you can create your own helpers. As well as the many new helpers listed below, there are three main improvements to the package:
* More support for general R projects, other than packages.
* A notion of an "active" project that all commands operate on.
* Refined output.
usethis is gradually evolving towards supporting more general R "projects", not just packages. This is still a work in progress, so please let me know if you use a function that you think should work with projects but doesn't. You can also try out the new `create_project()` which creates a basic RStudio project.
The concept of the working directory and the "base path" have been refined. Rather than using an argument to specify the active project, all `use_` functions now use a global active project setting, as returned by `proj_get()`. This is cached throughout a session, although it will be updated by `create_package()` and `create_project()`. You'll now get an clear error if you attempt to `use_something()` outside of a project, and `create_something()` will warn if you're trying to create inside an existing project.
The output from all usethis commands has been reviewed to be informative but not overwhelming. usethis takes advantage of colour (using crayon and RStudio 1.1) to help chunk the output and clearly differentiate what you need to do vs. what has been done for you.
## New functions
* `use_apl2_license()` if you want to use the Apache 2.0 license.
* `use_depsy_badge()` allows including a Depsy badge (@gvegayon, #68).
* `use_dev_package()` works like `use_package()` but also adds the
repo to the `Remotes` field (#32).
* `use_github_labels()` will automatically set up a standard set of labels,
optionally removing the default labels (#1).
* `use_pipe()` creates a template to use magrittr's `%>%` in your package (#15).
* `use_tidy_ci()` which sets up travis and codecov using the tidyverse
conventions (#14)
* `use_tidy_description()` puts description fields in a standard order
and alphabetises dependencies.
* `use_tidy_eval()` imports and re-exports the recommend set of tidy eval
helpers if your package uses tidy eval (#46).
* `use_usethis()` opens your `.Rprofile` and gives you the code to copy
and paste in.
## New edit functions
A new class of functions make it easy to edit common config files:
* `edit_r_profile_user()` opens `.Rprofile`
* `edit_r_environ_user()` opens `.Renviron`
* `edit_r_makevars_user()` opens `.R/Makevars`
* `edit_git_config_user()` opens `.gitconfig`
* `edit_git_ignore_user()` opens `.gitignore`
* `edit_rstudio_snippets(type)` opens `~/R/snippets/{type}.snippets`
## Updates
* `use_coverage("codecov")` now sets a default threshold of 1% to try and
reduce false positives (#8).
* `use_description()` now sets `ByteCompile: true` so you can benefit from
the byte compiler (#29)
* The license functions (`use_mit_license()`, `use_apl2_license()`, and
`use_gpl3_license()`) save a copy of the standard license text in
`LICENSE.md`, which is then added to `.Rbuildignore`. This allows you
to follow standard licensing best practices while adhering to CRANs
requirements (#10).
* `use_package_doc()` uses more a modern roxygen2 template that requires
less duplication.
* `use_test()` will use the name of the currently open file in RStudio
if you don't supply an explicit name (#89).
* `use_readme_rmd()` now puts images in `man/figures/` and no longer
adds to `.Rbuildgnore`. This ensures that the rendered `README.md` will
also work on CRAN (#16, #19). The first chunk now uses `include = FALSE`
and is named setup (#19).
* `use_revdep()` creates structure for use with revdepcheck package, the
preferred way to run revdepchecks. (#33)
## Building blocks
* New `use_badge()` for adding any badge to a README. Now only prints a
todo message if the badge does not already exist.
* `use_directory()` is now exported (#27).
## Bug fixes and minor improvements
* Functions which require code to be copied now automatically put the code on
the clipboard if it is available (#52).
* `create_package()` no longer creates a dependency on the current version of
R.
* `use_build_ignore()` now strips trailing `/`
* `use_git()` will restart RStudio if needed (and possible) (#42).
* `use_github()` now has an organisation parameter so you can create repos
in organisations (#4).
* `use_template()` and `use_test()` now convert title to a slug that only
contains lowercase letters, numbers, and `-`.
* `use_vignette()` now adds `*.html` and `*.R` to your `.gitgnore` so you
don't accidentally add in compiled vignette products (#35).
* `use_travis_badge()` and `use_appveyor_badge()` are now exported functions,
so they can be used even if ci was separately set up (#765, @smwindecker).
usethis/DESCRIPTION 0000644 0001750 0001750 00000004157 14154505162 013610 0 ustar nilesh nilesh Package: usethis
Title: Automate Package and Project Setup
Version: 2.1.5
Authors@R:
c(person(given = "Hadley",
family = "Wickham",
role = "aut",
email = "hadley@rstudio.com",
comment = c(ORCID = "0000-0003-4757-117X")),
person(given = "Jennifer",
family = "Bryan",
role = c("aut", "cre"),
email = "jenny@rstudio.com",
comment = c(ORCID = "0000-0002-6983-2759")),
person(given = "Malcolm",
family = "Barrett",
role = "aut",
email = "malcolmbarrett@gmail.com",
comment = c(ORCID = "0000-0003-0299-5825")),
person(given = "RStudio",
role = c("cph", "fnd")))
Description: Automate package and project setup tasks that are
otherwise performed manually. This includes setting up unit testing,
test coverage, continuous integration, Git, 'GitHub', licenses,
'Rcpp', 'RStudio' projects, and more.
License: MIT + file LICENSE
URL: https://usethis.r-lib.org, https://github.com/r-lib/usethis
BugReports: https://github.com/r-lib/usethis/issues
Depends: R (>= 3.4)
Imports: cli (>= 3.0.1), clipr (>= 0.3.0), crayon, curl (>= 2.7), desc
(>= 1.4.0), fs (>= 1.3.0), gert (>= 1.4.1), gh (>= 1.2.1), glue
(>= 1.3.0), jsonlite, lifecycle (>= 1.0.0), purrr, rappdirs,
rlang (>= 0.4.10), rprojroot (>= 1.2), rstudioapi, stats,
utils, whisker, withr (>= 2.3.0), yaml
Suggests: covr, knitr, magick, mockr, pkgload, rmarkdown, roxygen2 (>=
7.1.2), spelling (>= 1.2), styler (>= 1.2.0), testthat (>=
3.1.0)
Config/Needs/website: tidyverse/tidytemplate
Config/testthat/edition: 3
Encoding: UTF-8
Language: en-US
RoxygenNote: 7.1.2
NeedsCompilation: no
Packaged: 2021-12-09 18:41:36 UTC; jenny
Author: Hadley Wickham [aut] (),
Jennifer Bryan [aut, cre] (),
Malcolm Barrett [aut] (),
RStudio [cph, fnd]
Maintainer: Jennifer Bryan
Repository: CRAN
Date/Publication: 2021-12-09 23:00:02 UTC
usethis/README.md 0000644 0001750 0001750 00000011325 14153722476 013364 0 ustar nilesh nilesh
# usethis
[](https://github.com/r-lib/usethis/actions)
[](https://app.codecov.io/gh/r-lib/usethis?branch=main)
[](https://CRAN.R-project.org/package=usethis)
[](https://lifecycle.r-lib.org/articles/stages.html#stable)
usethis is a workflow package: it automates repetitive tasks that arise
during project setup and development, both for R packages and
non-package projects.
## Installation
Install the released version of usethis from CRAN:
``` r
install.packages("usethis")
```
Or install the development version from GitHub with:
``` r
# install.packages("devtools")
devtools::install_github("r-lib/usethis")
```
## Usage
Most `use_*()` functions operate on the *active project*: literally, a
directory on your computer. If you’ve just used usethis to create a new
package or project, that will be the active project. Otherwise, usethis
verifies that current working directory is or is below a valid project
directory and that becomes the active project. Use `proj_get()` or
`proj_sitrep()` to manually query the project and [read more in the
docs](https://usethis.r-lib.org/reference/proj_utils.html).
A few usethis functions have no strong connections to projects and will
expect you to provide a path.
usethis is quite chatty, explaining what it’s doing and assigning you
tasks. `✔` indicates something usethis has done for you. `●` indicates
that you’ll need to do some work yourself.
Below is a quick look at how usethis can help to set up a package. But
remember, many usethis functions are also applicable to analytical
projects that are not packages.
``` r
library(usethis)
# Create a new package -------------------------------------------------
path <- file.path(tempdir(), "mypkg")
create_package(path)
#> ✓ Creating '/tmp/Rtmp86lEpD/mypkg/'
#> ✓ Setting active project to '/private/tmp/Rtmp86lEpD/mypkg'
#> ✓ Creating 'R/'
#> ✓ Writing 'DESCRIPTION'
#> Package: mypkg
#> Title: What the Package Does (One Line, Title Case)
#> Version: 0.0.0.9000
#> Authors@R (parsed):
#> * First Last [aut, cre] (YOUR-ORCID-ID)
#> Description: What the package does (one paragraph).
#> License: `use_mit_license()`, `use_gpl3_license()` or friends to pick a
#> license
#> Encoding: UTF-8
#> Roxygen: list(markdown = TRUE)
#> RoxygenNote: 7.1.2
#> ✓ Writing 'NAMESPACE'
#> ✓ Setting active project to ''
# only needed since this session isn't interactive
proj_activate(path)
#> ✓ Setting active project to '/private/tmp/Rtmp86lEpD/mypkg'
#> ✓ Changing working directory to '/tmp/Rtmp86lEpD/mypkg/'
# Modify the description ----------------------------------------------
use_mit_license("My Name")
#> ✓ Setting License field in DESCRIPTION to 'MIT + file LICENSE'
#> ✓ Writing 'LICENSE'
#> ✓ Writing 'LICENSE.md'
#> ✓ Adding '^LICENSE\\.md$' to '.Rbuildignore'
use_package("ggplot2", "Suggests")
#> ✓ Adding 'ggplot2' to Suggests field in DESCRIPTION
#> • Use `requireNamespace("ggplot2", quietly = TRUE)` to test if package is installed
#> • Then directly refer to functions with `ggplot2::fun()`
# Set up other files -------------------------------------------------
use_readme_md()
#> ✓ Writing 'README.md'
#> • Update 'README.md' to include installation instructions.
use_news_md()
#> ✓ Writing 'NEWS.md'
use_test("my-test")
#> ✓ Adding 'testthat' to Suggests field in DESCRIPTION
#> ✓ Setting Config/testthat/edition field in DESCRIPTION to '3'
#> ✓ Creating 'tests/testthat/'
#> ✓ Writing 'tests/testthat.R'
#> ✓ Writing 'tests/testthat/test-my-test.R'
#> • Edit 'tests/testthat/test-my-test.R'
x <- 1
y <- 2
use_data(x, y)
#> ✓ Adding 'R' to Depends field in DESCRIPTION
#> ✓ Creating 'data/'
#> ✓ Setting LazyData to 'true' in 'DESCRIPTION'
#> ✓ Saving 'x', 'y' to 'data/x.rda', 'data/y.rda'
#> • Document your data (see 'https://r-pkgs.org/data.html')
# Use git ------------------------------------------------------------
use_git()
#> ✓ Initialising Git repo
#> ✓ Adding '.Rproj.user', '.Rhistory', '.Rdata', '.httr-oauth', '.DS_Store' to '.gitignore'
```
## Code of Conduct
Please note that the usethis project is released with a [Contributor
Code of Conduct](https://usethis.r-lib.org/CODE_OF_CONDUCT.html). By
contributing to this project, you agree to abide by its terms.
usethis/man/ 0000755 0001750 0001750 00000000000 14154446735 012660 5 ustar nilesh nilesh usethis/man/use_pkgdown.Rd 0000644 0001750 0001750 00000003354 14132400710 015454 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pkgdown.R
\name{use_pkgdown}
\alias{use_pkgdown}
\alias{use_pkgdown_github_pages}
\alias{use_pkgdown_travis}
\title{Use pkgdown}
\usage{
use_pkgdown(config_file = "_pkgdown.yml", destdir = "docs")
use_pkgdown_github_pages()
use_pkgdown_travis()
}
\arguments{
\item{config_file}{Path to the pkgdown yaml config file}
\item{destdir}{Target directory for pkgdown docs}
}
\description{
\href{https://pkgdown.r-lib.org}{pkgdown} makes it easy to turn your package into
a beautiful website. usethis provides two functions to help you use pkgdown:
\itemize{
\item \code{use_pkgdown()}: creates a pkgdown config file and adds relevant files or
directories to \code{.Rbuildignore} and \code{.gitignore}.
\item \code{use_pkgdown_github_pages()}: implements the GitHub setup needed to
automatically publish your pkgdown site to GitHub pages:
\itemize{
\item (first, it calls \code{use_pkgdown()})
\item \code{\link[=use_github_pages]{use_github_pages()}} prepares to publish the pkgdown site from the
\code{github-pages} branch
\item \code{\link[=use_github_action]{use_github_action("pkgdown")}} configures a
GitHub Action to automatically build the pkgdown site and deploy it via
GitHub Pages
\item The pkgdown site's URL is added to the pkgdown configuration file,
to the URL field of DESCRIPTION, and to the GitHub repo.
\item Packages owned by certain GitHub organizations (tidyverse, r-lib, and
tidymodels) get some special treatment, in terms of anticipating the
(eventual) site URL and the use of a pkgdown template.
}
}
\code{use_pkgdown_travis()} is deprecated; we no longer recommend that you use
Travis-CI.
}
\seealso{
\url{https://pkgdown.r-lib.org/articles/pkgdown.html#configuration}
}
usethis/man/git-default-branch.Rd 0000644 0001750 0001750 00000011754 14133333111 016573 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/git-default-branch.R
\name{git-default-branch}
\alias{git-default-branch}
\alias{git_default_branch}
\alias{git_default_branch_configure}
\alias{git_default_branch_rediscover}
\alias{git_default_branch_rename}
\title{Get or set the default Git branch}
\usage{
git_default_branch()
git_default_branch_configure(name = "main")
git_default_branch_rediscover(current_local_default = NULL)
git_default_branch_rename(from = NULL, to = "main")
}
\arguments{
\item{name}{Default name for the initial branch in new Git repositories.}
\item{current_local_default}{Name of the local branch that is currently
functioning as the default branch. If unspecified, this can often be
inferred.}
\item{from}{Name of the branch that is currently functioning as the default
branch.}
\item{to}{New name for the default branch.}
}
\value{
Name of the default branch.
}
\description{
The \verb{git_default_branch*()} functions put some structure around the somewhat
fuzzy (but definitely real) concept of the default branch. In particular,
they support new conventions around the Git default branch name, globally or
in a specific project / Git repository.
}
\section{Background on the default branch}{
Technically, Git has no official concept of the default branch. But in
reality, almost all Git repos have an \emph{effective default branch}. If there's
only one branch, this is it! It is the branch that most bug fixes and
features get merged in to. It is the branch you see when you first visit a
repo on a site such as GitHub. On a Git remote, it is the branch that \code{HEAD}
points to.
Historically, \code{master} has been the most common name for the default branch,
but \code{main} is an increasingly popular choice.
}
\section{\code{git_default_branch_configure()}}{
This configures \code{init.defaultBranch} at the global (a.k.a user) level. This
setting determines the name of the branch that gets created when you make the
first commit in a new Git repo. \code{init.defaultBranch} only affects the local
Git repos you create in the future.
}
\section{\code{git_default_branch()}}{
This figures out the default branch of the current Git repo, integrating
information from the local repo and, if applicable, the \code{upstream} or
\code{origin} remote. If there is a local vs. remote mismatch,
\code{git_default_branch()} throws an error with advice to call
\code{git_default_branch_rediscover()} to repair the situation.
For a remote repo, the default branch is the branch that \code{HEAD} points to.
For the local repo, if there is only one branch, that must be the default!
Otherwise we try to identify the relevant local branch by looking for
specific branch names, in this order:
\itemize{
\item whatever the default branch of \code{upstream} or \code{origin} is, if applicable
\item \code{main}
\item \code{master}
\item the value of the Git option \code{init.defaultBranch}, with the usual deal where
a local value, if present, takes precedence over a global (a.k.a.
user-level) value
}
}
\section{\code{git_default_branch_rediscover()}}{
This consults an external authority -- specifically, the remote \strong{source
repo} on GitHub -- to learn the default branch of the current project /
repo. If that doesn't match the apparent local default branch (for example,
the project switched from \code{master} to \code{main}), we do the corresponding branch
renaming in your local repo and, if relevant, in your fork.
See \url{https://happygitwithr.com/common-remote-setups.html} for more about
GitHub remote configurations and, e.g., what we mean by the source repo. This
function works for the configurations \code{"ours"}, \code{"fork"}, and \code{"theirs"}.
}
\section{\code{git_default_branch_rename()}}{
Note: this only works for a repo that you effectively own. In terms of
GitHub, you must own the \strong{source repo} personally or, if
organization-owned, you must have \code{admin} permission on the \strong{source repo}.
This renames the default branch in the \strong{source repo} on GitHub and then
calls \code{git_default_branch_rediscover()}, to make any necessary changes in the
local repo and, if relevant, in your personal fork.
See \url{https://happygitwithr.com/common-remote-setups.html} for more about
GitHub remote configurations and, e.g., what we mean by the source repo. This
function works for the configurations \code{"ours"}, \code{"fork"}, and \code{"no_github"}.
Regarding \code{"no_github"}: Of course, this function does what you expect for a
local repo with no GitHub remotes, but that is not the primary use case.
}
\examples{
\dontrun{
git_default_branch()
}
\dontrun{
git_default_branch_configure()
}
\dontrun{
git_default_branch_rediscover()
# you can always explicitly specify the local branch that's been playing the
# role of the default
git_default_branch_rediscover("unconventional_default_branch_name")
}
\dontrun{
git_default_branch_rename()
# you can always explicitly specify one or both branch names
git_default_branch_rename(from = "this", to = "that")
}
}
usethis/man/use_tutorial.Rd 0000644 0001750 0001750 00000002514 13737204645 015666 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tutorial.R
\name{use_tutorial}
\alias{use_tutorial}
\title{Create a learnr tutorial}
\usage{
use_tutorial(name, title, open = rlang::is_interactive())
}
\arguments{
\item{name}{Base for file name to use for new \code{.Rmd} tutorial. Should consist
only of numbers, letters, \verb{_} and \code{-}. We recommend using lower case.}
\item{title}{The human-facing title of the tutorial.}
\item{open}{Open the newly created file for editing? Happens in RStudio, if
applicable, or via \code{\link[utils:file.edit]{utils::file.edit()}} otherwise.}
}
\description{
Creates a new tutorial below \verb{inst/tutorials/}. Tutorials are interactive R
Markdown documents built with the \href{https://rstudio.github.io/learnr/index.html}{\code{learnr} package}. \code{use_tutorial()} does
this setup:
\itemize{
\item Adds learnr to Suggests in \code{DESCRIPTION}.
\item Gitignores \verb{inst/tutorials/*.html} so you don't accidentally track
rendered tutorials.
\item Creates a new \code{.Rmd} tutorial from a template and, optionally, opens it
for editing.
\item Adds new \code{.Rmd} to \code{.Rbuildignore}.
}
}
\examples{
\dontrun{
use_tutorial("learn-to-do-stuff", "Learn to do stuff")
}
}
\seealso{
The \href{https://rstudio.github.io/learnr/index.html}{learnr package documentation}.
}
usethis/man/ui-questions.Rd 0000644 0001750 0001750 00000004370 13737204645 015616 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ui.R
\name{ui-questions}
\alias{ui-questions}
\alias{ui_yeah}
\alias{ui_nope}
\title{User interface - Questions}
\usage{
ui_yeah(
x,
yes = c("Yes", "Definitely", "For sure", "Yup", "Yeah", "I agree", "Absolutely"),
no = c("No way", "Not now", "Negative", "No", "Nope", "Absolutely not"),
n_yes = 1,
n_no = 2,
shuffle = TRUE,
.envir = parent.frame()
)
ui_nope(
x,
yes = c("Yes", "Definitely", "For sure", "Yup", "Yeah", "I agree", "Absolutely"),
no = c("No way", "Not now", "Negative", "No", "Nope", "Absolutely not"),
n_yes = 1,
n_no = 2,
shuffle = TRUE,
.envir = parent.frame()
)
}
\arguments{
\item{x}{A character vector.
For block styles, conditions, and questions, each element of the
vector becomes a line, and the result is processed by \code{\link[glue:glue]{glue::glue()}}.
For inline styles, each element of the vector becomes an entry in a
comma separated list.}
\item{yes}{A character vector of "yes" strings, which are randomly sampled to
populate the menu.}
\item{no}{A character vector of "no" strings, which are randomly sampled to
populate the menu.}
\item{n_yes}{An integer. The number of "yes" strings to include.}
\item{n_no}{An integer. The number of "no" strings to include.}
\item{shuffle}{A logical. Should the order of the menu options be randomly
shuffled?}
\item{.envir}{Used to ensure that \code{\link[glue:glue]{glue::glue()}} gets the correct
environment. For expert use only.}
}
\value{
A logical. \code{ui_yeah()} returns \code{TRUE} when the user selects a "yes"
option and \code{FALSE} otherwise, i.e. when user selects a "no" option or
refuses to make a selection (cancels). \code{ui_nope()} is the logical opposite
of \code{ui_yeah()}.
}
\description{
These functions are used to interact with the user by posing a simple yes or
no question. For details on the other \verb{ui_*()} functions, see the \link{ui} help
page.
}
\examples{
\dontrun{
ui_yeah("Do you like R?")
ui_nope("Have you tried turning it off and on again?", n_yes = 1, n_no = 1)
ui_yeah("Are you sure its plugged in?", yes = "Yes", no = "No", shuffle = FALSE)
}
}
\seealso{
Other user interface functions:
\code{\link{ui}}
}
\concept{user interface functions}
\keyword{internal}
usethis/man/use_rmarkdown_template.Rd 0000644 0001750 0001750 00000002234 13737204645 017721 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rmarkdown.R
\name{use_rmarkdown_template}
\alias{use_rmarkdown_template}
\title{Add an RMarkdown Template}
\usage{
use_rmarkdown_template(
template_name = "Template Name",
template_dir = NULL,
template_description = "A description of the template",
template_create_dir = FALSE
)
}
\arguments{
\item{template_name}{The name as printed in the template menu.}
\item{template_dir}{Name of the directory the template will live in within
\code{inst/rmarkdown/templates}. If none is provided by the user, it will be
created from \code{template_name}.}
\item{template_description}{Sets the value of \code{description} in
\code{template.yml}.}
\item{template_create_dir}{Sets the value of \code{create_dir} in \code{template.yml}.}
}
\description{
Adds files and directories necessary to add a custom rmarkdown template to
RStudio. It creates:
\itemize{
\item \code{inst/rmarkdown/templates/{{template_dir}}}. Main directory.
\item \code{skeleton/skeleton.Rmd}. Your template Rmd file.
\item \code{template.yml} with basic information filled in.
}
}
\examples{
\dontrun{
use_rmarkdown_template()
}
}
usethis/man/write-this.Rd 0000644 0001750 0001750 00000003615 14117743363 015247 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/write.R
\name{write-this}
\alias{write-this}
\alias{write_union}
\alias{write_over}
\title{Write into or over a file}
\usage{
write_union(path, lines, quiet = FALSE)
write_over(path, lines, quiet = FALSE)
}
\arguments{
\item{path}{Path to target file. It is created if it does not exist, but the
parent directory must exist.}
\item{lines}{Character vector of lines. For \code{write_union()}, these are lines
to add to the target file, if not already present. For \code{write_over()},
these are the exact lines desired in the target file.}
\item{quiet}{Logical. Whether to message about what is happening.}
\item{contents}{Character vector of lines.}
}
\value{
Logical indicating whether a write occurred, invisibly.
}
\description{
Helpers to write into or over a new or pre-existing file. Designed mostly for
for internal use. File is written with UTF-8 encoding.
}
\section{Functions}{
\itemize{
\item \code{write_union}: writes lines to a file, taking the union of what's
already there, if anything, and some new lines. Note, there is no explicit
promise about the line order. Designed to modify simple config files like
\code{.Rbuildignore} and \code{.gitignore}.
\item \code{write_over}: writes a file with specific lines, creating it if
necessary or overwriting existing, if proposed contents are not identical
and user is available to give permission.
}}
\examples{
\dontshow{
.old_wd <- setwd(tempdir())
}
write_union("a_file", letters[1:3])
readLines("a_file")
write_union("a_file", letters[1:5])
readLines("a_file")
write_over("another_file", letters[1:3])
readLines("another_file")
write_over("another_file", letters[1:3])
\dontrun{
## will error if user isn't present to approve the overwrite
write_over("another_file", letters[3:1])
}
## clean up
file.remove("a_file", "another_file")
\dontshow{
setwd(.old_wd)
}
}
\keyword{internal}
usethis/man/use_git_ignore.Rd 0000644 0001750 0001750 00000001045 14117743363 016145 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/git.R
\name{use_git_ignore}
\alias{use_git_ignore}
\title{Tell Git to ignore files}
\usage{
use_git_ignore(ignores, directory = ".")
}
\arguments{
\item{ignores}{Character vector of ignores, specified as file globs.}
\item{directory}{Directory relative to active project to set ignores}
}
\description{
Tell Git to ignore files
}
\seealso{
Other git helpers:
\code{\link{use_git_config}()},
\code{\link{use_git_hook}()},
\code{\link{use_git}()}
}
\concept{git helpers}
usethis/man/use_package.Rd 0000644 0001750 0001750 00000003006 14117743363 015411 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/package.R
\name{use_package}
\alias{use_package}
\alias{use_dev_package}
\title{Depend on another package}
\usage{
use_package(package, type = "Imports", min_version = NULL)
use_dev_package(package, type = "Imports", remote = NULL)
}
\arguments{
\item{package}{Name of package to depend on.}
\item{type}{Type of dependency: must be one of "Imports", "Depends",
"Suggests", "Enhances", or "LinkingTo" (or unique abbreviation). Matching
is case insensitive.}
\item{min_version}{Optionally, supply a minimum version for the package.
Set to \code{TRUE} to use the currently installed version.}
\item{remote}{By default, an \code{OWNER/REPO} GitHub remote is inserted.
Optionally, you can supply a character string to specify the remote, e.g.
\code{"gitlab::jimhester/covr"}, using any syntax supported by the \href{https://remotes.r-lib.org/articles/dependencies.html#other-sources}{remotes package}.}
}
\description{
\code{use_package()} adds a CRAN package dependency to \code{DESCRIPTION} and offers a
little advice about how to best use it. \code{use_dev_package()} adds a
dependency on an in-development package, adding the dev repo to \code{Remotes} so
it will be automatically installed from the correct location.
}
\examples{
\dontrun{
use_package("ggplot2")
use_package("dplyr", "suggests")
use_dev_package("glue")
}
}
\seealso{
The \href{https://r-pkgs.org/description.html#dependencies}{dependencies section} of \href{https://r-pkgs.org}{R Packages}.
}
usethis/man/use_readme_rmd.Rd 0000644 0001750 0001750 00000002766 14117743363 016131 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/readme.R
\name{use_readme_rmd}
\alias{use_readme_rmd}
\alias{use_readme_md}
\title{Create README files}
\usage{
use_readme_rmd(open = rlang::is_interactive())
use_readme_md(open = rlang::is_interactive())
}
\arguments{
\item{open}{Open the newly created file for editing? Happens in RStudio, if
applicable, or via \code{\link[utils:file.edit]{utils::file.edit()}} otherwise.}
}
\description{
Creates skeleton README files with sections for
\itemize{
\item a high-level description of the package and its goals
\item R code to install from GitHub, if GitHub usage detected
\item a basic example
}
Use \code{Rmd} if you want a rich intermingling of code and output. Use \code{md} for a
basic README. \code{README.Rmd} will be automatically added to \code{.Rbuildignore}.
The resulting README is populated with default YAML frontmatter and R fenced
code blocks (\code{md}) or chunks (\code{Rmd}).
If you use \code{Rmd}, you'll still need to render it regularly, to keep
\code{README.md} up-to-date. \code{devtools::build_readme()} is handy for this. You
could also use GitHub Actions to re-render \code{README.Rmd} every time you push.
An example workflow can be found in the \verb{examples/} directory here:
\url{https://github.com/r-lib/actions/}.
}
\examples{
\dontrun{
use_readme_rmd()
use_readme_md()
}
}
\seealso{
The \href{https://r-pkgs.org/release.html#important-files}{important files section} of \href{https://r-pkgs.org}{R Packages}.
}
usethis/man/use_github_pages.Rd 0000644 0001750 0001750 00000005115 14131645451 016455 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/github-pages.R
\name{use_github_pages}
\alias{use_github_pages}
\title{Configure a GitHub Pages site}
\usage{
use_github_pages(branch = "gh-pages", path = "/", cname = NA)
}
\arguments{
\item{branch, path}{Branch and path for the site source. The default of
\code{branch = "gh-pages"} and \code{path = "/"} reflects strong GitHub support for
this configuration: when a \code{gh-pages} branch is first created, it is
\emph{automatically} published to Pages, using the source found in \code{"/"}. If a
\code{gh-pages} branch does not yet exist on the host, \code{use_github_pages()}
creates an empty, orphan remote branch.
The most common alternative is to use the repo's default branch, coupled
with \code{path = "/docs"}. It is the user's responsibility to ensure that this
\code{branch} pre-exists on the host.
Note that GitHub does not support an arbitrary \code{path} and, at the time of
writing, only \code{"/"} or \code{"/docs"} are accepted.}
\item{cname}{Optional, custom domain name. The \code{NA} default means "don't set
or change this", whereas a value of \code{NULL} removes any previously
configured custom domain.
Note that this \emph{can} add or modify a CNAME file in your repository. If you
are using Pages to host a pkgdown site, it is better to specify its URL in
the pkgdown config file and let pkgdown manage CNAME.}
}
\value{
Site metadata returned by the GitHub API, invisibly
}
\description{
Activates or reconfigures a GitHub Pages site for a project hosted on GitHub.
This function anticipates two specific usage modes:
\itemize{
\item Publish from the root directory of a \code{gh-pages} branch, which is assumed to
be only (or at least primarily) a remote branch. Typically the \code{gh-pages}
branch is managed by an automatic "build and deploy" job, such as the one
configured by \code{\link[=use_github_action]{use_github_action("pkgdown")}}.
\item Publish from the \code{"/docs"} directory of a "regular" branch, probably the
repo's default branch. The user is assumed to have a plan for how they will
manage the content below \code{"/docs"}.
}
}
\examples{
\dontrun{
use_github_pages()
use_github_pages(branch = git_default_branch(), path = "/docs")
}
}
\seealso{
\itemize{
\item \code{\link[=use_pkgdown_github_pages]{use_pkgdown_github_pages()}} combines \code{use_github_pages()} with other functions to
fully configure a pkgdown site
\item \url{https://docs.github.com/en/free-pro-team@latest/github/working-with-github-pages}
\item \url{https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#pages}
}
}
usethis/man/use_rstudio.Rd 0000644 0001750 0001750 00000001674 13737204645 015522 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rstudio.R
\name{use_rstudio}
\alias{use_rstudio}
\title{Add RStudio Project infrastructure}
\usage{
use_rstudio(line_ending = c("posix", "windows"))
}
\arguments{
\item{line_ending}{Line ending}
}
\description{
It is likely that you want to use \code{\link[=create_project]{create_project()}} or \code{\link[=create_package]{create_package()}}
instead of \code{use_rstudio()}! Both \verb{create_*()} functions can add RStudio
Project infrastructure to a pre-existing project or package. \code{use_rstudio()}
is mostly for internal use or for those creating a usethis-like package for
their organization. It does the following in the current project, often after
executing \code{proj_set(..., force = TRUE)}:
\itemize{
\item Creates an \code{.Rproj} file
\item Adds RStudio files to \code{.gitignore}
\item Adds RStudio files to \code{.Rbuildignore}, if project is a package
}
}
usethis/man/zip-utils.Rd 0000644 0001750 0001750 00000006363 14153502006 015076 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/course.R
\name{zip-utils}
\alias{zip-utils}
\alias{use_course}
\alias{use_zip}
\title{Download and unpack a ZIP file}
\usage{
use_course(url, destdir = getOption("usethis.destdir"))
use_zip(
url,
destdir = getwd(),
cleanup = if (rlang::is_interactive()) NA else FALSE
)
}
\arguments{
\item{url}{Link to a ZIP file containing the materials. To reduce the chance
of typos in live settings, these shorter forms are accepted:\preformatted{* GitHub repo spec: "OWNER/REPO". Equivalent to
`https://github.com/OWNER/REPO/DEFAULT_BRANCH.zip`.
* bit.ly or rstd.io shortlinks: "bit.ly/xxx-yyy-zzz" or "rstd.io/foofy".
The instructor must then arrange for the shortlink to point to a valid
download URL for the target ZIP file. The helper
[create_download_url()] helps to create such URLs for GitHub, DropBox,
and Google Drive.
}}
\item{destdir}{The new folder is stored here. If \code{NULL}, defaults to user's
Desktop or some other conspicuous place. You can also set a default
location using the option \code{usethis.destdir}, e.g.
\code{options(usethis.destdir = "a/good/dir")}, perhaps saved to your
\code{.Rprofile} with \code{\link[=edit_r_profile]{edit_r_profile()}}}
\item{cleanup}{Whether to delete the original ZIP file after unpacking its
contents. In an interactive setting, \code{NA} leads to a menu where user can
approve the deletion (or decline).}
}
\value{
Path to the new directory holding the unpacked ZIP file, invisibly.
}
\description{
Functions to download and unpack a ZIP file into a local folder of files,
with very intentional default behaviour. Useful in pedagogical settings or
anytime you need a large audience to download a set of files quickly and
actually be able to find them. The underlying helpers are documented in
\link{use_course_details}.
}
\section{Functions}{
\itemize{
\item \code{use_course}: Designed with live workshops in mind. Includes intentional friction to
highlight the download destination. Workflow:
\itemize{
\item User executes, e.g., \code{use_course("bit.ly/xxx-yyy-zzz")}.
\item User is asked to notice and confirm the location of the new folder. Specify
\code{destdir} or configure the \code{"usethis.destdir"} option to prevent this.
\item User is asked if they'd like to delete the ZIP file.
\item If new folder contains an \code{.Rproj} file, a new instance of RStudio is
launched. Otherwise, the folder is opened in the file manager, e.g. Finder
or File Explorer.
}
\item \code{use_zip}: More useful in day-to-day work. Downloads in current working directory, by
default, and allows \code{cleanup} behaviour to be specified.
}}
\examples{
\dontrun{
# download the source of usethis from GitHub, behind a bit.ly shortlink
use_course("bit.ly/usethis-shortlink-example")
use_course("http://bit.ly/usethis-shortlink-example")
# download the source of rematch2 package from CRAN
use_course("https://cran.r-project.org/bin/windows/contrib/3.4/rematch2_2.0.1.zip")
# download the source of rematch2 package from GitHub, 4 ways
use_course("r-lib/rematch2")
use_course("https://api.github.com/repos/r-lib/rematch2/zipball/HEAD")
use_course("https://api.github.com/repos/r-lib/rematch2/zipball/main")
use_course("https://github.com/r-lib/rematch2/archive/main.zip")
}
}
usethis/man/rename_files.Rd 0000644 0001750 0001750 00000001474 13737204645 015604 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/r.R
\name{rename_files}
\alias{rename_files}
\title{Automatically rename paired \verb{R/} and \verb{test/} files}
\usage{
rename_files(old, new)
}
\arguments{
\item{old, new}{Old and new file names (with or without extensions).}
}
\description{
\itemize{
\item Moves \verb{R/\{old\}.R} to \verb{R/\{new\}.R}
\item Moves \verb{tests/testthat/test-\{old\}.R} to \verb{tests/testthat/test-\{new\}.R}
\item Moves \verb{tests/testthat/test-\{old\}-*.*} to \verb{tests/testthat/test-\{new\}-*.*}
and updates paths in the test file.
\item Removes \code{context()} calls from the test file, which are unnecessary
(and discouraged) as of testthat v2.1.0.
}
This is a potentially dangerous operation, so you must be using Git in
order to use this function.
}
usethis/man/github_actions.Rd 0000644 0001750 0001750 00000011613 14131645451 016142 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/github-actions.R
\name{github_actions}
\alias{github_actions}
\alias{use_github_actions}
\alias{use_github_actions_badge}
\alias{use_github_action}
\alias{use_github_action_check_release}
\alias{use_github_action_check_standard}
\alias{use_github_action_pr_commands}
\title{GitHub Actions setup}
\usage{
use_github_actions()
use_github_actions_badge(name = "R-CMD-check", repo_spec = NULL)
use_github_action(
name,
url = NULL,
save_as = NULL,
readme = NULL,
ignore = TRUE,
open = FALSE
)
use_github_action_check_release(
save_as = "R-CMD-check.yaml",
ignore = TRUE,
open = FALSE
)
use_github_action_check_standard(
save_as = "R-CMD-check.yaml",
ignore = TRUE,
open = FALSE
)
use_github_action_pr_commands(
save_as = "pr-commands.yaml",
ignore = TRUE,
open = FALSE
)
}
\arguments{
\item{name}{For \code{use_github_action()}: Name of one of the example workflows
from \url{https://github.com/r-lib/actions/tree/v1/examples}, with or without a
\code{.yaml} extension, e.g. "pkgdown" or "test-coverage.yaml".
For \code{use_github_actions_badge()}: Specifies the workflow whose status the
badge will report. Usually, this is the \code{name} keyword that appears in the
workflow \code{.yaml} file.}
\item{repo_spec}{Optional GitHub repo specification in this form: \code{owner/repo}. This can usually be inferred from the GitHub remotes of active project.}
\item{url}{The full URL to a \code{.yaml} file on GitHub.}
\item{save_as}{Name of the local workflow file. Defaults to \code{name} or
\code{fs::path_file(url)} for \code{use_github_action()}. Do not specify any other
part of the path; the parent directory will always be \code{.github/workflows},
within the active project.}
\item{readme}{The full URL to a \code{README} file that provides more details
about the workflow. Ignored when \code{url} is \code{NULL}.}
\item{ignore}{Should the newly created file be added to \code{.Rbuildignore}?}
\item{open}{Open the newly created file for editing? Happens in RStudio, if
applicable, or via \code{\link[utils:file.edit]{utils::file.edit()}} otherwise.}
}
\description{
Sets up continuous integration (CI) for an R package that is developed on
GitHub using \href{https://github.com/features/actions}{GitHub Actions}. CI can be
used to trigger various operations for each push or pull request, such as:
\itemize{
\item Run \verb{R CMD check} on various operating systems and R versions
\item Build and deploy a pkgdown site
\item Determine test coverage
}
This family of functions
\itemize{
\item Adds the necessary configuration files and lists them in \code{.Rbuildignore}
\item Provides the markdown to insert a badge into your README
}
}
\section{\code{use_github_actions()}}{
Configures a basic \verb{R CMD check} workflow on GitHub Actions by adding a
standard \code{R-CMD-check.yaml} file to the \code{.github/workflows} directory of the
active project. This is actually just an alias for
\code{use_github_action_check_release()}.
}
\section{\code{use_github_actions_badge()}}{
Generates a GitHub Actions badge and that's all. It does not configure a
workflow. This exists mostly for internal use in the other functions
documented here.
}
\section{\code{use_github_action()}}{
Configures an individual, specific \href{https://github.com/features/actions}{GitHub Actions} workflow, either one of the
examples from
\href{https://github.com/r-lib/actions/tree/v1/examples}{r-lib/actions/examples}
or a custom workflow given by the \code{url} parameter.
Used internally to power all the other GitHub Actions functions, but it can
also be called directly by the user.
}
\section{\code{use_github_action_check_release()}}{
This entry-level, bare-minimum workflow installs the latest release of R (on
a current distribution of Linux) and runs \verb{R CMD check} via the
\href{https://github.com/r-lib/rcmdcheck}{rcmdcheck} package.
}
\section{\code{use_github_action_check_standard()}}{
This workflow runs \verb{R CMD check} via the
\href{https://github.com/r-lib/rcmdcheck}{rcmdcheck} package on the three major
operating systems (Linux, macOS, and Windows) on the latest release of R and
on R-devel. This workflow is appropriate for a package that is (or aspires to
be) on CRAN or Bioconductor.
}
\section{\code{use_github_action_pr_commands()}}{
This workflow enables the use of two R-specific commands in pull request
issue comments:
\itemize{
\item \verb{/document} to run \code{roxygen2::roxygenise()} and update the PR
\item \verb{/style} to run \code{styler::style_pkg()} and update the PR
}
}
\examples{
\dontrun{
use_github_actions()
use_github_action_check_standard()
use_github_action("pkgdown")
}
}
\seealso{
\itemize{
\item \code{\link[=use_github_file]{use_github_file()}} for more about \code{url} format and parsing.
\item \code{\link[=use_tidy_github_actions]{use_tidy_github_actions()}} for the standard GitHub Actions used for
tidyverse packages.
}
}
usethis/man/use_make.Rd 0000644 0001750 0001750 00000000542 13764577255 014751 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/make.R
\name{use_make}
\alias{use_make}
\title{Create Makefile}
\usage{
use_make()
}
\description{
\code{use_make()} adds a basic Makefile to the project root directory.
}
\seealso{
The \href{https://www.gnu.org/software/make/manual/html_node/}{documentation for GNU Make}.
}
usethis/man/use_github_links.Rd 0000644 0001750 0001750 00000002733 14117743363 016506 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/github.R
\name{use_github_links}
\alias{use_github_links}
\title{Use GitHub links in URL and BugReports}
\usage{
use_github_links(
auth_token = deprecated(),
host = deprecated(),
overwrite = FALSE
)
}
\arguments{
\item{host, auth_token}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}: No longer consulted
now that usethis consults the current project's GitHub remotes to get the
\code{host} and then relies on gh to discover an appropriate token.}
\item{overwrite}{By default, \code{use_github_links()} will not overwrite existing
fields. Set to \code{TRUE} to overwrite existing links.}
}
\description{
Populates the \code{URL} and \code{BugReports} fields of a GitHub-using R package with
appropriate links. The GitHub repo to link to is determined from the current
project's GitHub remotes:
\itemize{
\item If we are not working with a fork, this function expects \code{origin} to be a
GitHub remote and the links target that repo.
\item If we are working in a fork, this function expects to find two GitHub
remotes: \code{origin} (the fork) and \code{upstream} (the fork's parent) remote. In
an interactive session, the user can confirm which repo to use for the
links. In a noninteractive session, links are formed using \code{upstream}.
}
}
\examples{
\dontrun{
use_github_links()
}
}
usethis/man/rprofile-helper.Rd 0000644 0001750 0001750 00000001576 14117743363 016253 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rprofile.R
\name{rprofile-helper}
\alias{rprofile-helper}
\alias{use_conflicted}
\alias{use_reprex}
\alias{use_usethis}
\alias{use_devtools}
\alias{use_partial_warnings}
\title{Helpers to make useful changes to \code{.Rprofile}}
\usage{
use_conflicted()
use_reprex()
use_usethis()
use_devtools()
use_partial_warnings()
}
\description{
All functions open your \code{.Rprofile} and give you the code you need to
paste in.
\itemize{
\item \code{use_devtools()}: makes devtools available in interactive sessions.
\item \code{use_usethis()}: makes usethis available in interactive sessions.
\item \code{use_reprex()}: makes reprex available in interactive sessions.
\item \code{use_conflicted()}: makes conflicted available in interactive sessions.
\item \code{use_partial_warnings()}: warns on partial matches.
}
}
usethis/man/git_credentials.Rd 0000644 0001750 0001750 00000003017 14117743363 016304 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/usethis-defunct.R
\name{git_credentials}
\alias{git_credentials}
\alias{use_git_credentials}
\title{Produce or register credentials for git2r}
\usage{
git_credentials(protocol = deprecated(), auth_token = deprecated())
use_git_credentials(credentials = deprecated())
}
\arguments{
\item{protocol}{Deprecated.}
\item{auth_token}{Deprecated.}
\item{credentials}{Deprecated.}
}
\value{
These functions raise a warning and return an invisible \code{NULL}.
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}
In usethis v2.0.0, usethis switched from git2r to gert (+ credentials) for
all Git operations. This pair of packages (gert + credentials) is designed to
discover and use the same credentials as command line Git. As a result, a
great deal of credential-handling assistance has been removed from usethis,
primarily around SSH keys.
If you have credential problems, focus your troubleshooting on getting the
credentials package to find your credentials. The \href{https://docs.ropensci.org/credentials/articles/intro.html}{introductory vignette}
is a good place to start.
If you use the HTTPS protocol (which we recommend), a GitHub personal access
token will satisfy all auth needs, for both Git and the GitHub API, and is
therefore the easiest approach to get working. See \code{\link[=gh_token_help]{gh_token_help()}} for
more.
}
usethis/man/use_git.Rd 0000644 0001750 0001750 00000001132 13737204645 014601 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/git.R
\name{use_git}
\alias{use_git}
\title{Initialise a git repository}
\usage{
use_git(message = "Initial commit")
}
\arguments{
\item{message}{Message to use for first commit.}
}
\description{
\code{use_git()} initialises a Git repository and adds important files to
\code{.gitignore}. If user consents, it also makes an initial commit.
}
\examples{
\dontrun{
use_git()
}
}
\seealso{
Other git helpers:
\code{\link{use_git_config}()},
\code{\link{use_git_hook}()},
\code{\link{use_git_ignore}()}
}
\concept{git helpers}
usethis/man/use_pipe.Rd 0000644 0001750 0001750 00000001642 13737204645 014761 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pipe.R
\name{use_pipe}
\alias{use_pipe}
\title{Use magrittr's pipe in your package}
\usage{
use_pipe(export = TRUE)
}
\arguments{
\item{export}{If \code{TRUE}, the file \code{R/utils-pipe.R} is added, which provides
the roxygen template to import and re-export \verb{\%>\%}. If \code{FALSE}, the necessary
roxygen directive is added, if possible, or otherwise instructions are given.}
}
\description{
Does setup necessary to use magrittr's pipe operator, \verb{\%>\%} in your package.
This function requires the use roxygen.
\itemize{
\item Adds magrittr to "Imports" in \code{DESCRIPTION}.
\item Imports the pipe operator specifically, which is necessary for internal
use.
\item Exports the pipe operator, if \code{export = TRUE}, which is necessary to make
\verb{\%>\%} available to the users of your package.
}
}
\examples{
\dontrun{
use_pipe()
}
}
usethis/man/use_cpp11.Rd 0000644 0001750 0001750 00000001031 14117743363 014736 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cpp11.R
\name{use_cpp11}
\alias{use_cpp11}
\title{Use C++ via the cpp11 package}
\usage{
use_cpp11()
}
\description{
Adds infrastructure needed to use the \href{https://cpp11.r-lib.org}{cpp11}
package, a header-only R package that helps R package developers handle R
objects with C++ code. compiled code:
\itemize{
\item Creates \verb{src/}
\item Adds cpp11 to \code{DESCRIPTION}
\item Creates \code{src/code.cpp}, an initial placeholder \code{.cpp} file
}
}
usethis/man/use_code_of_conduct.Rd 0000644 0001750 0001750 00000002645 14117743363 017143 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/code-of-conduct.R
\name{use_code_of_conduct}
\alias{use_code_of_conduct}
\title{Add a code of conduct}
\usage{
use_code_of_conduct(contact, path = NULL)
}
\arguments{
\item{contact}{Contact details for making a code of conduct report.
Usually an email address.}
\item{path}{Path of the directory to put \code{CODE_OF_CONDUCT.md} in, relative to
the active project. Passed along to \code{\link[=use_directory]{use_directory()}}. Default is to locate
at top-level, but \verb{.github/} is also common.}
}
\description{
Adds a \code{CODE_OF_CONDUCT.md} file to the active project and lists in
\code{.Rbuildignore}, in the case of a package. The goal of a code of conduct is
to foster an environment of inclusiveness, and to explicitly discourage
inappropriate behaviour. The template comes from
\url{https://www.contributor-covenant.org}, version 2:
\url{https://www.contributor-covenant.org/version/2/0/code_of_conduct/}.
}
\details{
If your package is going to CRAN, the link to the CoC in your README must
be an absolute link to a rendered website as \code{CODE_OF_CONDUCT.md} is not
included in the package sent to CRAN. \code{use_code_of_conduct()} will
automatically generate this link if (1) you use pkgdown and (2) have set the
\code{url} field in \verb{_pkgdown.yml}; otherwise it will link to a copy of the CoC
on \url{https://www.contributor-covenant.org}.
}
usethis/man/use_git_config.Rd 0000644 0001750 0001750 00000002370 14117743363 016131 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/git.R
\name{use_git_config}
\alias{use_git_config}
\title{Configure Git}
\usage{
use_git_config(scope = c("user", "project"), ...)
}
\arguments{
\item{scope}{Edit globally for the current \strong{user}, or locally for the
current \strong{project}}
\item{...}{Name-value pairs, processed as
<\code{\link[rlang:dyn-dots]{dynamic-dots}}>.}
}
\value{
Invisibly, the previous values of the modified components, as a named
list.
}
\description{
Sets Git options, for either the user or the project ("global" or "local", in
Git terminology). Wraps \code{\link[gert:git_config]{gert::git_config_set()}} and
\code{\link[gert:git_config]{gert::git_config_global_set()}}. To inspect Git config, see
\code{\link[gert:git_config]{gert::git_config()}}.
}
\examples{
\dontrun{
# set the user's global user.name and user.email
use_git_config(user.name = "Jane", user.email = "jane@example.org")
# set the user.name and user.email locally, i.e. for current repo/project
use_git_config(
scope = "project",
user.name = "Jane",
user.email = "jane@example.org"
)
}
}
\seealso{
Other git helpers:
\code{\link{use_git_hook}()},
\code{\link{use_git_ignore}()},
\code{\link{use_git}()}
}
\concept{git helpers}
usethis/man/use_latest_dependencies.Rd 0000644 0001750 0001750 00000001330 14117743363 020016 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/latest-dependencies.R
\name{use_latest_dependencies}
\alias{use_latest_dependencies}
\title{Use "latest" versions of all dependencies}
\usage{
use_latest_dependencies(overwrite = FALSE, source = c("local", "CRAN"))
}
\arguments{
\item{overwrite}{By default (\code{FALSE}), only dependencies without version
specifications will be modified. Set to \code{TRUE} to modify all dependencies.}
\item{source}{Use "local" or "CRAN" package versions.}
}
\description{
Pins minimum versions of dependencies to latest ones (as determined by \code{source}).
Useful for the tidyverse package, but should otherwise be used with extreme care.
}
\keyword{internal}
usethis/man/use_news_md.Rd 0000644 0001750 0001750 00000001131 13737204645 015451 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/news.R
\name{use_news_md}
\alias{use_news_md}
\title{Create a simple \code{NEWS.md}}
\usage{
use_news_md(open = rlang::is_interactive())
}
\arguments{
\item{open}{Open the newly created file for editing? Happens in RStudio, if
applicable, or via \code{\link[utils:file.edit]{utils::file.edit()}} otherwise.}
}
\description{
This creates a basic \code{NEWS.md} in the root directory.
}
\seealso{
The \href{https://r-pkgs.org/release.html#important-files}{important files section} of \href{https://r-pkgs.org}{R Packages}.
}
usethis/man/proj_activate.Rd 0000644 0001750 0001750 00000001035 13676400413 015767 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/proj.R
\name{proj_activate}
\alias{proj_activate}
\title{Activate a project}
\usage{
proj_activate(path)
}
\arguments{
\item{path}{Project directory}
}
\value{
Single logical value indicating if current session is modified.
}
\description{
Activates a project in usethis, R session, and (if relevant) RStudio senses.
If you are in RStudio, this will open a new RStudio session. If not, it will
change the working directory and \link[=proj_set]{active project}.
}
usethis/man/use_github_file.Rd 0000644 0001750 0001750 00000005112 14131645451 016272 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/use_github_file.R
\name{use_github_file}
\alias{use_github_file}
\title{Copy a file from any GitHub repo into the current project}
\usage{
use_github_file(
repo_spec,
path = NULL,
save_as = NULL,
ref = NULL,
ignore = FALSE,
open = FALSE,
host = NULL
)
}
\arguments{
\item{repo_spec}{A string identifying the GitHub repo or, alternatively, a
GitHub file URL. Acceptable forms:
\itemize{
\item Plain \code{OWNER/REPO} spec
\item A blob URL, such as \code{"https://github.com/OWNER/REPO/blob/REF/path/to/some/file"}
\item A raw URL, such as \code{"https://raw.githubusercontent.com/OWNER/REPO/REF/path/to/some/file"}
}
In the case of a URL, the \code{path}, \code{ref}, and \code{host} are extracted from it, in
addition to the \code{repo_spec}.}
\item{path}{Path of file to copy, relative to the GitHub repo it lives in.
This is extracted from \code{repo_spec} when user provides a URL.}
\item{save_as}{Path of file to create, relative to root of active project.
Defaults to the last part of \code{path}, in the sense of \code{basename(path)} or
\code{fs::path_file(path)}.}
\item{ref}{The name of a branch, tag, or commit. By default, the file at
\code{path} will by copied from its current state in the repo's default branch.
This is extracted from \code{repo_spec} when user provides a URL.}
\item{ignore}{Should the newly created file be added to \code{.Rbuildignore}?}
\item{open}{Open the newly created file for editing? Happens in RStudio, if
applicable, or via \code{\link[utils:file.edit]{utils::file.edit()}} otherwise.}
\item{host}{GitHub host to target, passed to the \code{.api_url} argument of
\code{\link[gh:gh]{gh::gh()}}. If unspecified, gh defaults to "https://api.github.com",
although gh's default can be customised by setting the GITHUB_API_URL
environment variable.
For a hypothetical GitHub Enterprise instance, either
"https://github.acme.com/api/v3" or "https://github.acme.com" is
acceptable.}
}
\value{
A logical indicator of whether a file was written, invisibly.
}
\description{
Gets the content of a file from GitHub, from any repo the user can read, and
writes it into the active project. This function wraps an endpoint of the
GitHub API which supports specifying a target reference (i.e. branch, tag,
or commit) and which follows symlinks.
}
\examples{
\dontrun{
use_github_file(
"https://github.com/r-lib/actions/blob/v1/examples/check-standard.yaml"
)
use_github_file(
"r-lib/actions",
path = "examples/check-standard.yaml",
ref = "v1",
save_as = ".github/workflows/R-CMD-check.yaml"
)
}
}
usethis/man/proj_utils.Rd 0000644 0001750 0001750 00000007726 14117743363 015351 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/proj.R
\name{proj_utils}
\alias{proj_utils}
\alias{proj_get}
\alias{proj_set}
\alias{proj_path}
\alias{with_project}
\alias{local_project}
\title{Utility functions for the active project}
\usage{
proj_get()
proj_set(path = ".", force = FALSE)
proj_path(..., ext = "")
with_project(
path = ".",
code,
force = FALSE,
setwd = TRUE,
quiet = getOption("usethis.quiet", default = FALSE)
)
local_project(
path = ".",
force = FALSE,
setwd = TRUE,
quiet = getOption("usethis.quiet", default = FALSE),
.local_envir = parent.frame()
)
}
\arguments{
\item{path}{Path to set. This \code{path} should exist or be \code{NULL}.}
\item{force}{If \code{TRUE}, use this path without checking the usual criteria for
a project. Use sparingly! The main application is to solve a temporary
chicken-egg problem: you need to set the active project in order to add
project-signalling infrastructure, such as initialising a Git repo or
adding a \code{DESCRIPTION} file.}
\item{...}{character vectors, if any values are NA, the result will also be
NA. The paths follow the recycling rules used in the tibble package,
namely that only length 1 arguments are recycled.}
\item{ext}{An optional extension to append to the generated path.}
\item{code}{Code to run with temporary active project}
\item{setwd}{Whether to also temporarily set the working directory to the
active project, if it is not \code{NULL}}
\item{quiet}{Whether to suppress user-facing messages, while operating in the
temporary active project}
\item{.local_envir}{The environment to use for scoping. Defaults to current
execution environment.}
}
\description{
Most \verb{use_*()} functions act on the \strong{active project}. If it is
unset, usethis uses \href{https://rprojroot.r-lib.org}{rprojroot} to
find the project root of the current working directory. It establishes the
project root by looking for a \code{.here} file, an RStudio Project, a package
\code{DESCRIPTION}, Git infrastructure, a \code{remake.yml} file, or a \code{.projectile}
file. It then stores the active project for use for the remainder of the
session.
}
\details{
In general, end user scripts should not contain direct calls to
\verb{usethis::proj_*()} utility functions. They are internal functions that are
exported for occasional interactive use or use in packages that extend
usethis. End user code should call functions in
\href{https://rprojroot.r-lib.org}{rprojroot} or its simpler companion,
\href{https://here.r-lib.org}{here}, to programmatically detect a project and
build paths within it.
}
\section{Functions}{
\itemize{
\item \code{proj_get}: Retrieves the active project and, if necessary,
attempts to set it in the first place.
\item \code{proj_set}: Sets the active project.
\item \code{proj_path}: Builds a path within the active project returned by
\code{proj_get()}. Thin wrapper around \code{\link[fs:path]{fs::path()}}.
\item \code{with_project}: Runs code with a temporary active project and,
optionally, working directory. It is an example of the \verb{with_*()} functions
in \href{https://withr.r-lib.org}{withr}.
\item \code{local_project}: Sets an active project and, optionally, working
directory until the current execution environment goes out of scope, e.g.
the end of the current function or test. It is an example of the
\verb{local_*()} functions in \href{https://withr.r-lib.org}{withr}.
}}
\examples{
\dontrun{
## see the active project
proj_get()
## manually set the active project
proj_set("path/to/target/project")
## build a path within the active project (both produce same result)
proj_path("R/foo.R")
proj_path("R", "foo", ext = "R")
## build a path within SOME OTHER project
with_project("path/to/some/other/project", proj_path("blah.R"))
## convince yourself that with_project() temporarily changes the project
with_project("path/to/some/other/project", print(proj_sitrep()))
}
}
\seealso{
Other project functions:
\code{\link{proj_sitrep}()}
}
\concept{project functions}
usethis/man/use_directory.Rd 0000644 0001750 0001750 00000001271 13676400413 016017 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/directory.R
\name{use_directory}
\alias{use_directory}
\title{Use a directory}
\usage{
use_directory(path, ignore = FALSE)
}
\arguments{
\item{path}{Path of the directory to create, relative to the project.}
\item{ignore}{Should the newly created file be added to \code{.Rbuildignore}?}
}
\description{
\code{use_directory()} creates a directory (if it does not already exist) in the
project's top-level directory. This function powers many of the other \code{use_}
functions such as \code{\link[=use_data]{use_data()}} and \code{\link[=use_vignette]{use_vignette()}}.
}
\examples{
\dontrun{
use_directory("inst")
}
}
usethis/man/use_tidy_thanks.Rd 0000644 0001750 0001750 00000004273 14117743363 016346 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tidyverse.R
\name{use_tidy_thanks}
\alias{use_tidy_thanks}
\title{Identify contributors via GitHub activity}
\usage{
use_tidy_thanks(repo_spec = NULL, from = NULL, to = NULL)
}
\arguments{
\item{repo_spec}{Optional GitHub repo specification in any form accepted for
the \code{repo_spec} argument of \code{\link[=create_from_github]{create_from_github()}} (plain spec or a browser
or Git URL). A URL specification is the only way to target a GitHub host
other than \code{"github.com"}, which is the default.}
\item{from, to}{GitHub ref (i.e., a SHA, tag, or release) or a timestamp in
ISO 8601 format, specifying the start or end of the interval of interest,
in the sense of \verb{[from, to]}. Examples: "08a560d", "v1.3.0",
"2018-02-24T00:13:45Z", "2018-05-01". When \verb{from = NULL, to = NULL}, we set
\code{from} to the timestamp of the most recent (GitHub) release. Otherwise,
\code{NULL} means "no bound".}
}
\value{
A character vector of GitHub usernames, invisibly.
}
\description{
Derives a list of GitHub usernames, based on who has opened issues or pull
requests. Used to populate the acknowledgment section of package release blog
posts at \url{https://www.tidyverse.org/blog/}. If no arguments are given, we
retrieve all contributors to the active project since its last (GitHub)
release. Unexported helper functions, \code{releases()} and \code{ref_df()} can be
useful interactively to get a quick look at release tag names and a data
frame about refs (defaulting to releases), respectively.
}
\examples{
\dontrun{
# active project, interval = since the last release
use_tidy_thanks()
# active project, interval = since a specific datetime
use_tidy_thanks(from = "2020-07-24T00:13:45Z")
# r-lib/usethis, interval = since a certain date
use_tidy_thanks("r-lib/usethis", from = "2020-08-01")
# r-lib/usethis, up to a specific release
use_tidy_thanks("r-lib/usethis", from = NULL, to = "v1.1.0")
# r-lib/usethis, since a specific commit, up to a specific date
use_tidy_thanks("r-lib/usethis", from = "08a560d", to = "2018-05-14")
# r-lib/usethis, but with copy/paste of a browser URL
use_tidy_thanks("https://github.com/r-lib/usethis")
}
}
usethis/man/use_tibble.Rd 0000644 0001750 0001750 00000002714 14117743363 015264 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tibble.R
\name{use_tibble}
\alias{use_tibble}
\title{Prepare to return a tibble}
\usage{
use_tibble()
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#questioning}{\figure{lifecycle-questioning.svg}{options: alt='[Questioning]'}}}{\strong{[Questioning]}}
Does minimum setup such that a tibble returned by your package
is handled using the tibble method for generics like \code{print()} or \code{[}.
Presumably you care about this if you've chosen to store and expose an
object with class \code{tbl_df}. Specifically:
\itemize{
\item Check that the active package uses roxygen2
\item Add the tibble package to "Imports" in \code{DESCRIPTION}
\item Prepare the roxygen directive necessary to import at least one function
from tibble:
\itemize{
\item If possible, the directive is inserted into existing package-level
documentation, i.e. the roxygen snippet created by \code{\link[=use_package_doc]{use_package_doc()}}
\item Otherwise, we issue advice on where the user should add the directive
}
}
This is necessary when your package returns a stored data object that has
class \code{tbl_df}, but the package code does not make direct use of functions
from the tibble package. If you do nothing, the tibble namespace is not
necessarily loaded and your tibble may therefore be printed and subsetted
like a base \code{data.frame}.
}
\examples{
\dontrun{
use_tibble()
}
}
usethis/man/use_git_hook.Rd 0000644 0001750 0001750 00000001355 13737204645 015630 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/git.R
\name{use_git_hook}
\alias{use_git_hook}
\title{Add a git hook}
\usage{
use_git_hook(hook, script)
}
\arguments{
\item{hook}{Hook name. One of "pre-commit", "prepare-commit-msg",
"commit-msg", "post-commit", "applypatch-msg", "pre-applypatch",
"post-applypatch", "pre-rebase", "post-rewrite", "post-checkout",
"post-merge", "pre-push", "pre-auto-gc".}
\item{script}{Text of script to run}
}
\description{
Sets up a git hook using specified script. Creates hook directory if
needed, and sets correct permissions on hook.
}
\seealso{
Other git helpers:
\code{\link{use_git_config}()},
\code{\link{use_git_ignore}()},
\code{\link{use_git}()}
}
\concept{git helpers}
usethis/man/use_data.Rd 0000644 0001750 0001750 00000004265 13737204645 014741 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\name{use_data}
\alias{use_data}
\alias{use_data_raw}
\title{Create package data}
\usage{
use_data(
...,
internal = FALSE,
overwrite = FALSE,
compress = "bzip2",
version = 2
)
use_data_raw(name = "DATASET", open = rlang::is_interactive())
}
\arguments{
\item{...}{Unquoted names of existing objects to save.}
\item{internal}{If \code{FALSE}, saves each object in its own \code{.rda}
file in the \verb{data/} directory. These data files bypass the usual
export mechanism and are available whenever the package is loaded
(or via \code{\link[=data]{data()}} if \code{LazyData} is not true).
If \code{TRUE}, stores all objects in a single \code{R/sysdata.rda} file.
Objects in this file follow the usual export rules. Note that this means
they will be exported if you are using the common \code{exportPattern()}
rule which exports all objects except for those that start with \code{.}.}
\item{overwrite}{By default, \code{use_data()} will not overwrite existing
files. If you really want to do so, set this to \code{TRUE}.}
\item{compress}{Choose the type of compression used by \code{\link[=save]{save()}}.
Should be one of "gzip", "bzip2", or "xz".}
\item{version}{The serialization format version to use. The default, 2, was
the default format from R 1.4.0 to 3.5.3. Version 3 became the default from
R 3.6.0 and can only be read by R versions 3.5.0 and higher.}
\item{name}{Name of the dataset to be prepared for inclusion in the package.}
\item{open}{Open the newly created file for editing? Happens in RStudio, if
applicable, or via \code{\link[utils:file.edit]{utils::file.edit()}} otherwise.}
}
\description{
\code{use_data()} makes it easy to save package data in the correct format. I
recommend you save scripts that generate package data in \code{data-raw}: use
\code{use_data_raw()} to set it up. You also need to document exported datasets.
}
\examples{
\dontrun{
x <- 1:10
y <- 1:100
use_data(x, y) # For external use
use_data(x, y, internal = TRUE) # For internal use
}
\dontrun{
use_data_raw("daisy")
}
}
\seealso{
The \href{https://r-pkgs.org/data.html}{data chapter} of \href{https://r-pkgs.org}{R Packages}.
}
usethis/man/tidyverse.Rd 0000644 0001750 0001750 00000011551 14132445361 015156 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/github-actions.R, R/tidy-upkeep.R,
% R/tidyverse.R
\name{use_tidy_github_actions}
\alias{use_tidy_github_actions}
\alias{use_tidy_upkeep_issue}
\alias{tidyverse}
\alias{create_tidy_package}
\alias{use_tidy_description}
\alias{use_tidy_dependencies}
\alias{use_tidy_eval}
\alias{use_tidy_contributing}
\alias{use_tidy_support}
\alias{use_tidy_issue_template}
\alias{use_tidy_coc}
\alias{use_tidy_github}
\alias{use_tidy_style}
\title{Helpers for tidyverse development}
\usage{
use_tidy_github_actions()
use_tidy_upkeep_issue(year = NULL)
create_tidy_package(path, copyright_holder = NULL)
use_tidy_description()
use_tidy_dependencies()
use_tidy_eval()
use_tidy_contributing()
use_tidy_support()
use_tidy_issue_template()
use_tidy_coc()
use_tidy_github()
use_tidy_style(strict = TRUE)
}
\arguments{
\item{year}{Approximate year when you last touched this package. If \code{NULL},
the default, will give you a full set of actions to perform.}
\item{path}{A path. If it exists, it is used. If it does not exist, it is
created, provided that the parent path exists.}
\item{copyright_holder}{Name of the copyright holder or holders. This
defaults to "{package name} authors"; you should only change this if you
use a CLA to assign copyright to a single entity.}
\item{strict}{Boolean indicating whether or not a strict version of styling
should be applied. See \code{\link[styler:tidyverse_style]{styler::tidyverse_style()}} for details.}
}
\description{
These helpers follow tidyverse conventions which are generally a little
stricter than the defaults, reflecting the need for greater rigor in
commonly used packages.
}
\details{
\itemize{
\item \code{use_tidy_github_actions()}: Sets up the following workflows using \href{https://github.com/features/actions}{GitHub Actions}:
\itemize{
\item Run \verb{R CMD check} on the current release, devel, and four previous
versions of R. The build matrix also ensures \verb{R CMD check} is run at
least once on each of the three major operating systems (Linux, macOS,
and Windows).
\item Report test coverage.
\item Build and deploy a pkgdown site.
\item Provide two commands to be used in pull requests: \verb{/document} to run
\code{roxygen2::roxygenise()} and update the PR, and \verb{/style} to run
\code{styler::style_pkg()} and update the PR.
This is how the tidyverse team checks its packages, but it is overkill
for less widely used packages. Consider using the more streamlined
workflows set up by \code{\link[=use_github_actions]{use_github_actions()}} or
\code{\link[=use_github_action_check_standard]{use_github_action_check_standard()}}.
}
}
\itemize{
\item \code{create_tidy_package()}: creates a new package, immediately applies as many
of the tidyverse conventions as possible, issues a few reminders, and
activates the new package.
\item \code{use_tidy_dependencies()}: sets up standard dependencies used by all
tidyverse packages (except packages that are designed to be dependency free).
\item \code{use_tidy_description()}: puts fields in standard order and alphabetises
dependencies.
\item \code{use_tidy_eval()}: imports a standard set of helpers to facilitate
programming with the tidy eval toolkit.
\item \code{use_tidy_style()}: styles source code according to the \href{https://style.tidyverse.org}{tidyverse style guide}. This function will overwrite files! See
below for usage advice.
\item \code{use_tidy_contributing()}: adds standard tidyverse contributing guidelines.
\item \code{use_tidy_issue_template()}: adds a standard tidyverse issue template.
\item \code{use_tidy_release_test_env()}: updates the test environment section in
\code{cran-comments.md}.
\item \code{use_tidy_support()}: adds a standard description of support resources for
the tidyverse.
\item \code{use_tidy_coc()}: equivalent to \code{use_code_of_conduct()}, but puts the
document in a \verb{.github/} subdirectory.
\item \code{use_tidy_github()}: convenience wrapper that calls
\code{use_tidy_contributing()}, \code{use_tidy_issue_template()}, \code{use_tidy_support()},
\code{use_tidy_coc()}.
\item \code{\link[=use_tidy_github_labels]{use_tidy_github_labels()}} calls \code{use_github_labels()} to implement
tidyverse conventions around GitHub issue label names and colours.
\item \code{use_tidy_upkeep_issue()} creates an issue containing a checklist of
actions to bring your package up to current tidyverse standards.
}
}
\section{\code{use_tidy_style()}}{
Uses the \href{https://styler.r-lib.org}{styler package} package to style all code
in a package, project, or directory, according to the \href{https://style.tidyverse.org}{tidyverse style guide}.
\strong{Warning:} This function will overwrite files! It is strongly suggested to
only style files that are under version control or to first create a backup
copy.
Invisibly returns a data frame with one row per file, that indicates whether
styling caused a change.
}
usethis/man/use_testthat.Rd 0000644 0001750 0001750 00000001607 14117743363 015663 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/test.R
\name{use_testthat}
\alias{use_testthat}
\title{Sets up overall testing infrastructure}
\usage{
use_testthat(edition = NULL, parallel = FALSE)
}
\arguments{
\item{edition}{testthat edition to use. Defaults to the latest edition, i.e.
the major version number of the currently installed testthat.}
\item{parallel}{Should tests be run in parallel? This feature appeared in
testthat 3.0.0; see \url{https://testthat.r-lib.org/articles/parallel.html} for
details and caveats.}
}
\description{
Creates \verb{tests/testthat/}, \code{tests/testthat.R}, and adds the testthat package
to the Suggests field. Learn more in \url{https://r-pkgs.org/tests.html}
}
\examples{
\dontrun{
use_testthat()
use_test()
use_test("something-management")
}
}
\seealso{
\code{\link[=use_test]{use_test()}} to create individual test files
}
usethis/man/use_coverage.Rd 0000644 0001750 0001750 00000001256 14117743363 015616 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/coverage.R
\name{use_coverage}
\alias{use_coverage}
\alias{use_covr_ignore}
\title{Test coverage}
\usage{
use_coverage(type = c("codecov", "coveralls"), repo_spec = NULL)
use_covr_ignore(files)
}
\arguments{
\item{type}{Which web service to use.}
\item{repo_spec}{Optional GitHub repo specification in this form: \code{owner/repo}. This can usually be inferred from the GitHub remotes of active project.}
\item{files}{Character vector of file globs.}
}
\description{
Adds test coverage reporting to a package, using either Codecov
(\verb{https://codecov.io}) or Coveralls (\verb{https://coveralls.io}).
}
usethis/man/use_package_doc.Rd 0000644 0001750 0001750 00000002155 14117743363 016242 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/documentation.R
\name{use_package_doc}
\alias{use_package_doc}
\title{Package-level documentation}
\usage{
use_package_doc(open = rlang::is_interactive())
}
\arguments{
\item{open}{Open the newly created file for editing? Happens in RStudio, if
applicable, or via \code{\link[utils:file.edit]{utils::file.edit()}} otherwise.}
}
\description{
Adds a dummy \code{.R} file that will prompt roxygen to generate basic
package-level documentation. If your package is named "foo", this will make
help available to the user via \code{?foo} or \code{package?foo}. Once you call
\code{devtools::document()}, roxygen will flesh out the \code{.Rd} file using data from
the \code{DESCRIPTION}. That ensures you don't need to repeat the same information
in multiple places. This \code{.R} file is also a good place for roxygen
directives that apply to the whole package (vs. a specific function), such as
global namespace tags like \verb{@importFrom}.
}
\seealso{
The \href{https://r-pkgs.org/man.html}{documentation chapter} of \href{https://r-pkgs.org}{R Packages}
}
usethis/man/use_data_table.Rd 0000644 0001750 0001750 00000001752 14131622147 016074 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data-table.R
\name{use_data_table}
\alias{use_data_table}
\title{Prepare for importing data.table}
\usage{
use_data_table()
}
\description{
\code{use_data_table()} imports the \code{data.table()} function from the data.table
package, as well as several important symbols: \verb{:=}, \code{.SD}, \code{.BY}, \code{.N},
\code{.I}, \code{.GRP}, \code{.NGRP}, \code{.EACHI}. This is a minimal setup to get \code{data.table}s
working with your package. See the \href{https://rdatatable.gitlab.io/data.table/articles/datatable-importing.html}{importing data.table}
vignette for other strategies. In addition to importing these function,
\code{use_data_table()} also blocks the usage of data.table in the \code{Depends} field
of the \code{DESCRIPTION} file; \code{data.table} should be used as an \emph{imported} or
\emph{suggested} package only. See this
\href{https://github.com/Rdatatable/data.table/issues/3076}{discussion}.
}
usethis/man/use_r.Rd 0000644 0001750 0001750 00000002275 14117743363 014266 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/r.R
\name{use_r}
\alias{use_r}
\alias{use_test}
\title{Create or edit R or test files}
\usage{
use_r(name = NULL, open = rlang::is_interactive())
use_test(name = NULL, open = rlang::is_interactive())
}
\arguments{
\item{name}{Either a name without extension, or \code{NULL} to create the
paired file based on currently open file in the script editor. If
the R file is open, \code{use_test()} will create/open the corresponding
test file; if the test file is open, \code{use_r()} will create/open the
corresponding R file.}
\item{open}{Whether to open the file for interactive editing.}
}
\description{
This pair of functions makes it easy to create paired R and test files,
using the convention that the tests for \code{R/foofy.R} should live
in \code{tests/testthat/test-foofy.R}. You can use them to create new files
from scratch by supplying \code{name}, or if you use RStudio, you can call
to create (or navigate to) the paired file based on the currently open
script.
}
\seealso{
The \href{https://r-pkgs.org/tests.html}{testing} and
\href{https://r-pkgs.org/r.html}{R code} chapters of
\href{https://r-pkgs.org}{R Packages}.
}
usethis/man/create_package.Rd 0000644 0001750 0001750 00000004446 14132400710 016050 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/create.R
\name{create_package}
\alias{create_package}
\alias{create_project}
\title{Create a package or project}
\usage{
create_package(
path,
fields = list(),
rstudio = rstudioapi::isAvailable(),
roxygen = TRUE,
check_name = TRUE,
open = rlang::is_interactive()
)
create_project(
path,
rstudio = rstudioapi::isAvailable(),
open = rlang::is_interactive()
)
}
\arguments{
\item{path}{A path. If it exists, it is used. If it does not exist, it is
created, provided that the parent path exists.}
\item{fields}{A named list of fields to add to \code{DESCRIPTION}, potentially
overriding default values. See \code{\link[=use_description]{use_description()}} for how you can set
personalized defaults using package options.}
\item{rstudio}{If \code{TRUE}, calls \code{\link[=use_rstudio]{use_rstudio()}} to make the new package or
project into an \href{https://support.rstudio.com/hc/en-us/articles/200526207-Using-Projects}{RStudio Project}.
If \code{FALSE} and a non-package project, a sentinel \code{.here} file is placed so
that the directory can be recognized as a project by the
\href{https://here.r-lib.org}{here} or
\href{https://rprojroot.r-lib.org}{rprojroot} packages.}
\item{roxygen}{Do you plan to use roxygen2 to document your package?}
\item{check_name}{Whether to check if the name is valid for CRAN and throw an
error if not.}
\item{open}{If \code{TRUE}, \link[=proj_activate]{activates} the new project:
\itemize{
\item If RStudio desktop, the package is opened in a new session.
\item If on RStudio server, the current RStudio project is activated.
\item Otherwise, the working directory and active project is changed.
}}
}
\value{
Path to the newly created project or package, invisibly.
}
\description{
These functions create an R project:
\itemize{
\item \code{create_package()} creates an R package
\item \code{create_project()} creates a non-package project, i.e. a data analysis
project
}
Both functions can be called on an existing project; you will be asked before
any existing files are changed.
}
\seealso{
\code{\link[=create_tidy_package]{create_tidy_package()}} is a convenience function that extends
\code{create_package()} by immediately applying as many of the tidyverse
development conventions as possible.
}
usethis/man/ci.Rd 0000644 0001750 0001750 00000007334 14132400710 013524 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ci.R
\name{ci}
\alias{use_travis}
\alias{use_travis_badge}
\alias{use_appveyor}
\alias{use_appveyor_badge}
\alias{use_gitlab_ci}
\alias{use_circleci}
\alias{use_circleci_badge}
\title{Continuous integration setup and badges}
\usage{
use_travis(browse = rlang::is_interactive(), ext = c("com", "org"))
use_travis_badge(ext = c("com", "org"), repo_spec = NULL)
use_appveyor(browse = rlang::is_interactive())
use_appveyor_badge(repo_spec = NULL)
use_gitlab_ci()
use_circleci(browse = rlang::is_interactive(), image = "rocker/verse:latest")
use_circleci_badge(repo_spec = NULL)
}
\arguments{
\item{browse}{Open a browser window to enable automatic builds for the
package.}
\item{ext}{Which travis website to use. Defaults to \code{"com"} for
https://www.travis-ci.com/. Change to \code{"org"} for https://travis-ci.org.}
\item{repo_spec}{Optional GitHub repo specification in this form: \code{owner/repo}. This can usually be inferred from the GitHub remotes of active project.}
\item{image}{The Docker image to use for build. Must be available on
\href{https://hub.docker.com}{DockerHub}. The
\href{https://hub.docker.com/r/rocker/verse}{rocker/verse} image includes
TeXLive, pandoc, and the tidyverse packages. For a minimal image, try
\href{https://hub.docker.com/r/rocker/r-ver}{rocker/r-ver}. To specify a version
of R, change the tag from \code{latest} to the version you want, e.g.
\verb{rocker/r-ver:3.5.3}.}
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}
Some of these functions are now soft-deprecated since the tidyverse team has
started using \href{https://github.com/features/actions}{GitHub Actions (GHA)} for
continuous integration (CI). See \code{\link[=use_github_actions]{use_github_actions()}} for help configuring
GHA. GHA functionality in usethis is actively maintained and exercised, which
is no longer true for Travis-CI or AppVeyor.
Sets up third-party continuous integration (CI) services for an R package
that is developed on GitHub or, perhaps, GitLab. These functions
\itemize{
\item Add service-specific configuration files and add them to \code{.Rbuildignore}.
\item Activate a service or give the user a detailed prompt.
\item Provide the markdown to insert a badge into README.
}
}
\section{\code{use_travis()}}{
Adds a basic \code{.travis.yml} to the top-level directory of a package. This is a
configuration file for the \href{https://www.travis-ci.com/}{Travis CI} continuous
integration service.
}
\section{\code{use_travis_badge()}}{
Only adds the Travis CI badge. Use for a project where Travis is already
configured.
}
\section{\code{use_appveyor()}}{
Adds a basic \code{appveyor.yml} to the top-level directory of a package. This is
a configuration file for the \href{https://www.appveyor.com}{AppVeyor} continuous
integration service for Windows.
}
\section{\code{use_appveyor_badge()}}{
Only adds the \href{https://www.appveyor.com}{AppVeyor} badge. Use for a project
where AppVeyor is already configured.
}
\section{\code{use_gitlab_ci()}}{
Adds a basic \code{.gitlab-ci.yml} to the top-level directory of a package. This
is a configuration file for the \href{https://docs.gitlab.com/ee/ci/}{GitLab CI/CD} continuous integration service.
}
\section{\code{use_circleci()}}{
Adds a basic \code{.circleci/config.yml} to the top-level directory of a package.
This is a configuration file for the \href{https://circleci.com/}{CircleCI}
continuous integration service.
}
\section{\code{use_circleci_badge()}}{
Only adds the \href{https://circleci.com/}{Circle CI} badge. Use for a project
where Circle CI is already configured.
}
usethis/man/use_github_release.Rd 0000644 0001750 0001750 00000002542 14132400710 016763 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/release.R
\name{use_github_release}
\alias{use_github_release}
\title{Draft a GitHub release}
\usage{
use_github_release(host = deprecated(), auth_token = deprecated())
}
\arguments{
\item{host, auth_token}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}: No longer
consulted now that usethis allows the gh package to lookup a token based on
a URL determined from the current project's GitHub remotes.}
}
\description{
Creates a \strong{draft} GitHub release for the current package. Once you are
satisfied that it is correct, you will need to publish the release from
GitHub. The key pieces of info are which commit / SHA to tag, the associated
package version, and the relevant NEWS entries.
If you use \code{devtools::release()} or \code{devtools::submit_cran()} to submit to
CRAN, information about the submitted state is captured in a CRAN-SUBMISSION
or CRAN-RELEASE file. \code{use_github_release()} uses this info to populate the
draft GitHub release and, after success, deletes the CRAN-SUBMISSION or
CRAN-RELEASE file.
In the absence of such a file, we must fall back to assuming the current
state (SHA of \code{HEAD}, package version, NEWS) is the submitted state.
}
usethis/man/use_description.Rd 0000644 0001750 0001750 00000005206 14132400710 016324 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/description.R
\name{use_description}
\alias{use_description}
\alias{use_description_defaults}
\title{Create or modify a DESCRIPTION file}
\usage{
use_description(fields = list(), check_name = TRUE, roxygen = TRUE)
use_description_defaults(package = NULL, roxygen = TRUE, fields = list())
}
\arguments{
\item{fields}{A named list of fields to add to \code{DESCRIPTION}, potentially
overriding default values. See \code{\link[=use_description]{use_description()}} for how you can set
personalized defaults using package options.}
\item{check_name}{Whether to check if the name is valid for CRAN and throw an
error if not.}
\item{roxygen}{If \code{TRUE}, sets \code{RoxygenNote} to current roxygen2 version}
\item{package}{Package name}
}
\description{
\code{use_description()} creates a \code{DESCRIPTION} file. Although mostly associated
with R packages, a \code{DESCRIPTION} file can also be used to declare
dependencies for a non-package project. Within such a project,
\code{devtools::install_deps()} can then be used to install all the required
packages. Note that, by default, \code{use_decription()} checks for a
CRAN-compliant package name. You can turn this off with \code{check_name = FALSE}.
usethis consults the following sources, in this order, to set \code{DESCRIPTION}
fields:
\itemize{
\item \code{fields} argument of \code{\link[=create_package]{create_package()}} or \code{\link[=use_description]{use_description()}}
\item \code{getOption("usethis.description")}
\item Defaults built into usethis
}
The fields discovered via options or the usethis package can be viewed with
\code{use_description_defaults()}.
If you create a lot of packages, consider storing personalized defaults as a
named list in an option named \code{"usethis.description"}. Here's an example of
code to include in \code{.Rprofile}, which can be opened via \code{\link[=edit_r_profile]{edit_r_profile()}}:\preformatted{options(
usethis.description = list(
`Authors@R` = 'person("Jane", "Doe", email = "jane@example.com",
role = c("aut", "cre"),
comment = c(ORCID = "YOUR-ORCID-ID"))',
License = "MIT + file LICENSE",
Language = "es"
)
)
}
Prior to usethis v2.0.0, \code{getOption("devtools.desc")} was consulted for
backwards compatibility, but now only the \code{"usethis.description"} option is
supported.
}
\examples{
\dontrun{
use_description()
use_description(fields = list(Language = "es"))
use_description_defaults()
}
}
\seealso{
The \href{https://r-pkgs.org/description.html}{description chapter}
of \href{https://r-pkgs.org}{R Packages}
}
usethis/man/usethis-defunct.Rd 0000644 0001750 0001750 00000003721 14131645451 016253 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/usethis-defunct.R
\name{usethis-defunct}
\alias{usethis-defunct}
\alias{pr_pull_upstream}
\alias{pr_sync}
\alias{browse_github_token}
\alias{browse_github_pat}
\alias{github_token}
\alias{git_branch_default}
\alias{use_tidy_labels}
\alias{use_tidy_ci}
\alias{use_github_action_check_full}
\title{Defunct and deprecated functions in usethis}
\usage{
pr_pull_upstream()
pr_sync()
browse_github_token(...)
browse_github_pat(...)
github_token()
git_branch_default()
use_tidy_labels()
use_tidy_ci(...)
use_github_action_check_full(
save_as = "R-CMD-check.yaml",
ignore = TRUE,
open = FALSE,
repo_spec = NULL
)
}
\description{
These functions have either been deprecated or removed from usethis.
}
\section{\code{pr_pull_upstream()}}{
This function has been replaced by \code{\link[=pr_merge_main]{pr_merge_main()}}.
}
\section{\code{pr_sync()}}{
Bundling these operations together did not seem justified, in terms of how
rarely this comes up and, when it does, how likely merge conflicts are.
Users of \code{pr_sync()} should implement these steps "by hand":
\itemize{
\item (Check you are on a PR branch)
\item \code{pr_pull()}
\item \code{pr_merge_main()}, deal with any merge conflicts, if any
\item \code{pr_push()}
}
}
\section{\code{browse_github_token()}, \code{browse_github_pat()}}{
These functions have been replaced by \code{\link[=create_github_token]{create_github_token()}}.
}
\section{\code{github_token()}}{
All implicit and explicit token discovery routes through \code{\link[gh:gh_token]{gh::gh_token()}}
now.
}
\section{\code{git_branch_default()}}{
Please call \code{\link[=git_default_branch]{git_default_branch()}} instead. In hindsight, that is a better
name for this function.
}
\section{\code{use_tidy_labels()}}{
Please call \code{\link[=use_tidy_github_labels]{use_tidy_github_labels()}} instead. In hindsight, that is a
better name for this function.
}
\keyword{internal}
usethis/man/use_github.Rd 0000644 0001750 0001750 00000010566 14153502006 015274 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/github.R
\name{use_github}
\alias{use_github}
\title{Connect a local repo with GitHub}
\usage{
use_github(
organisation = NULL,
private = FALSE,
visibility = c("public", "private", "internal"),
protocol = git_protocol(),
host = NULL,
auth_token = deprecated(),
credentials = deprecated()
)
}
\arguments{
\item{organisation}{If supplied, the repo will be created under this
organisation, instead of the login associated with the GitHub token
discovered for this \code{host}. The user's role and the token's scopes must be
such that you have permission to create repositories in this
\code{organisation}.}
\item{private}{If \code{TRUE}, creates a private repository.}
\item{visibility}{Only relevant for organisation-owned repos associated with
certain GitHub Enterprise products. The special "internal" \code{visibility}
grants read permission to all organisation members, i.e. it's intermediate
between "private" and "public", within GHE. When specified, \code{visibility}
takes precedence over \code{private = TRUE/FALSE}.}
\item{protocol}{One of "https" or "ssh"}
\item{host}{GitHub host to target, passed to the \code{.api_url} argument of
\code{\link[gh:gh]{gh::gh()}}. If unspecified, gh defaults to "https://api.github.com",
although gh's default can be customised by setting the GITHUB_API_URL
environment variable.
For a hypothetical GitHub Enterprise instance, either
"https://github.acme.com/api/v3" or "https://github.acme.com" is
acceptable.}
\item{auth_token, credentials}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}: No longer
consulted now that usethis uses the gert package for Git operations,
instead of git2r; gert relies on the credentials package for auth. The API
requests are now authorized with the token associated with the \code{host}, as
retrieved by \code{\link[gh:gh_token]{gh::gh_token()}}.}
}
\description{
\code{use_github()} takes a local project and:
\itemize{
\item Checks that the initial state is good to go:
\itemize{
\item Project is already a Git repo
\item Current branch is the default branch, e.g. \code{main} or \code{master}
\item No uncommitted changes
\item No pre-existing \code{origin} remote
}
\item Creates an associated repo on GitHub
\item Adds that GitHub repo to your local repo as the \code{origin} remote
\item Makes an initial push to GitHub
\item Calls \code{\link[=use_github_links]{use_github_links()}}, if the project is an R package
\item Configures \code{origin/DEFAULT} to be the upstream branch of the local
\code{DEFAULT} branch, e.g. \code{main} or \code{master}
}
See below for the authentication setup that is necessary for all of this to
work.
}
\section{Git/GitHub Authentication}{
Many usethis functions, including those documented here, potentially interact
with GitHub in two different ways:
\itemize{
\item Via the GitHub REST API. Examples: create a repo, a fork, or a pull
request.
\item As a conventional Git remote. Examples: clone, fetch, or push.
}
Therefore two types of auth can happen and your credentials must be
discoverable. Which credentials do we mean?
\itemize{
\item A GitHub personal access token (PAT) must be discoverable by the gh
package, which is used for GitHub operations via the REST API. See
\code{\link[=gh_token_help]{gh_token_help()}} for more about getting and configuring a PAT.
\item If you use the HTTPS protocol for Git remotes, your PAT is also used for
Git operations, such as \verb{git push}. Usethis uses the gert package for this,
so the PAT must be discoverable by gert. Generally gert and gh will
discover and use the same PAT. This ability to "kill two birds with one
stone" is why HTTPS + PAT is our recommended auth strategy for those new
to Git and GitHub and PRs.
\item If you use SSH remotes, your SSH keys must also be discoverable, in
addition to your PAT. The public key must be added to your GitHub account.
}
Git/GitHub credential management is covered in a dedicated article:
\href{https://usethis.r-lib.org/articles/articles/git-credentials.html}{Managing Git(Hub) Credentials}
}
\examples{
\dontrun{
pkgpath <- file.path(tempdir(), "testpkg")
create_package(pkgpath)
## now, working inside "testpkg", initialize git repository
use_git()
## create github repository and configure as git remote
use_github()
}
}
usethis/man/use_import_from.Rd 0000644 0001750 0001750 00000002164 14117743363 016357 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/use_import_from.R
\name{use_import_from}
\alias{use_import_from}
\title{Import a function from another package}
\usage{
use_import_from(package, fun, load = is_interactive())
}
\arguments{
\item{package}{Package name}
\item{fun}{A vector of function names}
\item{load}{Logical. Re-load with \code{\link[pkgload:load_all]{pkgload::load_all()}}?}
}
\value{
Invisibly, \code{TRUE} if the package document has changed, \code{FALSE} if not.
}
\description{
\code{use_import_from()} imports a function from another package by adding the
roxygen2 \verb{@importFrom} tag to the package-level documentation (which can be
created with \code{\link[=use_package_doc]{use_package_doc()}}). Importing a function from another
package allows you to refer to it without a namespace (e.g., \code{fun()} instead
of \code{package::fun()}).
\code{use_import_from()} also re-documents the NAMESPACE, and re-load the current
package. This ensures that \code{fun} is immediately available in your development
session.
}
\examples{
\dontrun{
use_import_from("usethis", "ui_todo")
}
}
usethis/man/use_spell_check.Rd 0000644 0001750 0001750 00000001757 13737204645 016307 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/spelling.R
\name{use_spell_check}
\alias{use_spell_check}
\title{Use spell check}
\usage{
use_spell_check(vignettes = TRUE, lang = "en-US", error = FALSE)
}
\arguments{
\item{vignettes}{Logical, \code{TRUE} to spell check all \code{rmd} and \code{rnw} files in
the \verb{vignettes/} folder.}
\item{lang}{Preferred spelling language. Usually either \code{"en-US"} or
\code{"en-GB"}.}
\item{error}{Logical, indicating whether the unit test should fail if
spelling errors are found. Defaults to \code{FALSE}, which does not error, but
prints potential spelling errors}
}
\description{
Adds a unit test to automatically run a spell check on documentation and,
optionally, vignettes during \verb{R CMD check}, using the
\link[spelling:spell_check_package]{spelling} package. Also adds a \code{WORDLIST}
file to the package, which is a dictionary of whitelisted words. See
\link[spelling:wordlist]{spelling::wordlist} for details.
}
usethis/man/use_rcpp.Rd 0000644 0001750 0001750 00000002002 13737204645 014757 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rcpp.R
\name{use_rcpp}
\alias{use_rcpp}
\alias{use_rcpp_armadillo}
\alias{use_rcpp_eigen}
\alias{use_c}
\title{Use C, C++, RcppArmadillo, or RcppEigen}
\usage{
use_rcpp(name = NULL)
use_rcpp_armadillo(name = NULL)
use_rcpp_eigen(name = NULL)
use_c(name = NULL)
}
\arguments{
\item{name}{If supplied, creates and opens \verb{src/name.\{c,cpp\}}.}
}
\description{
Adds infrastructure commonly needed when using compiled code:
\itemize{
\item Creates \verb{src/}
\item Adds required packages to \code{DESCRIPTION}
\item May create an initial placeholder \code{.c} or \code{.cpp} file
\item Creates \code{Makevars} and \code{Makevars.win} files (\code{use_rcpp_armadillo()} only)
}
}
\details{
When using compiled code, please note that there must be at least one file
inside the \verb{src/} directory prior to building the package. As a result,
if an empty \verb{src/} directory is detected, either a \code{.c} or \code{.cpp} file will
be added.
}
usethis/man/git_sitrep.Rd 0000644 0001750 0001750 00000000672 14117743363 015321 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/git.R
\name{git_sitrep}
\alias{git_sitrep}
\title{Git/GitHub sitrep}
\usage{
git_sitrep()
}
\description{
Get a situation report on your current Git/GitHub status. Useful for
diagnosing problems. \code{\link[=git_vaccinate]{git_vaccinate()}} adds some basic R- and RStudio-related
entries to the user-level git ignore file.
}
\examples{
\dontrun{
git_sitrep()
}
}
usethis/man/git_vaccinate.Rd 0000644 0001750 0001750 00000001157 14131622147 015737 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/git.R
\name{git_vaccinate}
\alias{git_vaccinate}
\title{Vaccinate your global gitignore file}
\usage{
git_vaccinate()
}
\description{
Adds \code{.DS_Store}, \code{.Rproj.user}, \code{.Rdata}, \code{.Rhistory}, and \code{.httr-oauth} to
your global (a.k.a. user-level) \code{.gitignore}. This is good practice as it
decreases the chance that you will accidentally leak credentials to GitHub.
\code{git_vaccinate()} also tries to detect and fix the situation where you have a
global gitignore file, but it's missing from your global Git config.
}
usethis/man/edit.Rd 0000644 0001750 0001750 00000004373 14153502006 014062 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/edit.R
\name{edit}
\alias{edit}
\alias{edit_r_profile}
\alias{edit_r_environ}
\alias{edit_r_buildignore}
\alias{edit_r_makevars}
\alias{edit_rstudio_snippets}
\alias{edit_rstudio_prefs}
\alias{edit_git_config}
\alias{edit_git_ignore}
\alias{edit_pkgdown_config}
\title{Open configuration files}
\usage{
edit_r_profile(scope = c("user", "project"))
edit_r_environ(scope = c("user", "project"))
edit_r_buildignore()
edit_r_makevars(scope = c("user", "project"))
edit_rstudio_snippets(
type = c("r", "markdown", "c_cpp", "css", "html", "java", "javascript", "python",
"sql", "stan", "tex")
)
edit_rstudio_prefs()
edit_git_config(scope = c("user", "project"))
edit_git_ignore(scope = c("user", "project"))
edit_pkgdown_config()
}
\arguments{
\item{scope}{Edit globally for the current \strong{user}, or locally for the
current \strong{project}}
\item{type}{Snippet type (case insensitive text).}
}
\value{
Path to the file, invisibly.
}
\description{
\itemize{
\item \code{edit_r_profile()} opens \code{.Rprofile}
\item \code{edit_r_environ()} opens \code{.Renviron}
\item \code{edit_r_makevars()} opens \code{.R/Makevars}
\item \code{edit_git_config()} opens \code{.gitconfig} or \code{.git/config}
\item \code{edit_git_ignore()} opens global (user-level) gitignore file and ensures
its path is declared in your global Git config.
\item \code{edit_pkgdown_config} opens the pkgdown YAML configuration file for the
current Project.
\item \code{edit_rstudio_snippets()} opens RStudio's snippet config for the given type.
\item \code{edit_rstudio_prefs()} opens RStudio's preference file.
}
}
\details{
The \verb{edit_r_*()} functions consult R's notion of user's home directory.
The \verb{edit_git_*()} functions (and \pkg{usethis} in general) inherit home
directory behaviour from the \pkg{fs} package, which differs from R itself
on Windows. The \pkg{fs} default is more conventional in terms of the
location of user-level Git config files. See \code{\link[fs:path_expand]{fs::path_home()}} for more
details.
Files created by \code{edit_rstudio_snippets()} will \emph{mask}, not supplement,
the built-in default snippets. If you like the built-in snippets, copy them
and include with your custom snippets.
}
usethis/man/use_revdep.Rd 0000644 0001750 0001750 00000001206 13676400413 015276 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/revdep.R
\name{use_revdep}
\alias{use_revdep}
\title{Reverse dependency checks}
\usage{
use_revdep()
}
\description{
Performs set up for checking the reverse dependencies of an R package, as
implemented by the revdepcheck package:
\itemize{
\item Adds \code{revdep} directory and adds it to \code{.Rbuildignore}
\item Populates \code{revdep/.gitignore} to prevent tracking of various revdep
artefacts
\item Creates \code{revdep/email.yml} for use with \code{revdepcheck::revdep_email()}
\item Prompts user to run the checks with \code{revdepcheck::revdep_check()}
}
}
usethis/man/use_addin.Rd 0000644 0001750 0001750 00000001222 13762553000 015063 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/addin.R
\name{use_addin}
\alias{use_addin}
\title{Add minimal RStudio Addin binding}
\usage{
use_addin(addin = "new_addin", open = rlang::is_interactive())
}
\arguments{
\item{addin}{Name of the addin function, which should be defined in the
\code{R} folder.}
\item{open}{Open the newly created file for editing? Happens in RStudio, if
applicable, or via \code{\link[utils:file.edit]{utils::file.edit()}} otherwise.}
}
\description{
This function helps you add a minimal
\href{https://rstudio.github.io/rstudioaddins/}{RStudio Addin} binding to
\code{inst/rstudio/addins.dcf}.
}
usethis/man/use_git_remote.Rd 0000644 0001750 0001750 00000004104 13737204645 016156 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/git.R
\name{use_git_remote}
\alias{use_git_remote}
\alias{git_remotes}
\title{Configure and report Git remotes}
\usage{
use_git_remote(name = "origin", url, overwrite = FALSE)
git_remotes()
}
\arguments{
\item{name}{A string giving the short name of a remote.}
\item{url}{A string giving the url of a remote.}
\item{overwrite}{Logical. Controls whether an existing remote can be
modified.}
}
\value{
Named list of Git remotes.
}
\description{
Two helpers are available:
\itemize{
\item \code{use_git_remote()} sets the remote associated with \code{name} to \code{url}.
\item \code{git_remotes()} reports the configured remotes, similar to
\verb{git remote -v}.
}
}
\examples{
\dontrun{
# see current remotes
git_remotes()
# add new remote named 'foo', a la `git remote add `
use_git_remote(name = "foo", url = "https://github.com//.git")
# remove existing 'foo' remote, a la `git remote remove `
use_git_remote(name = "foo", url = NULL, overwrite = TRUE)
# change URL of remote 'foo', a la `git remote set-url `
use_git_remote(
name = "foo",
url = "https://github.com//.git",
overwrite = TRUE
)
# Scenario: Fix remotes when you cloned someone's repo, but you should
# have fork-and-cloned (in order to make a pull request).
# Store origin = main repo's URL, e.g., "git@github.com:/.git"
upstream_url <- git_remotes()[["origin"]]
# IN THE BROWSER: fork the main GitHub repo and get your fork's remote URL
my_url <- "git@github.com:/.git"
# Rotate the remotes
use_git_remote(name = "origin", url = my_url)
use_git_remote(name = "upstream", url = upstream_url)
git_remotes()
# Scenario: Add upstream remote to a repo that you fork-and-cloned, so you
# can pull upstream changes.
# Note: If you fork-and-clone via `usethis::create_from_github()`, this is
# done automatically!
# Get URL of main GitHub repo, probably in the browser
upstream_url <- "git@github.com:/.git"
use_git_remote(name = "upstream", url = upstream_url)
}
}
usethis/man/use_cran_comments.Rd 0000644 0001750 0001750 00000001454 13737204645 016655 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cran.R
\name{use_cran_comments}
\alias{use_cran_comments}
\title{CRAN submission comments}
\usage{
use_cran_comments(open = rlang::is_interactive())
}
\arguments{
\item{open}{Open the newly created file for editing? Happens in RStudio, if
applicable, or via \code{\link[utils:file.edit]{utils::file.edit()}} otherwise.}
}
\description{
Creates \code{cran-comments.md}, a template for your communications with CRAN when
submitting a package. The goal is to clearly communicate the steps you have
taken to check your package on a wide range of operating systems. If you are
submitting an update to a package that is used by other packages, you also
need to summarize the results of your \link[=use_revdep]{reverse dependency checks}.
}
usethis/man/use_lifecycle.Rd 0000644 0001750 0001750 00000001337 14131622147 015752 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lifecycle.R
\name{use_lifecycle}
\alias{use_lifecycle}
\title{Use lifecycle badges}
\usage{
use_lifecycle()
}
\description{
This helper:
\itemize{
\item Adds lifecycle as a dependency.
\item Imports \code{\link[lifecycle:deprecated]{lifecycle::deprecated()}} for use in function arguments.
\item Copies the lifecycle badges into \code{man/figures}.
\item Reminds you how to use the badge syntax.
}
Learn more at \url{https://lifecycle.r-lib.org/articles/communicate.html}
}
\seealso{
\code{\link[=use_lifecycle_badge]{use_lifecycle_badge()}} to signal the
\href{https://lifecycle.r-lib.org/articles/stages.html}{lifecycle stage} of
your package as whole
}
usethis/man/use_build_ignore.Rd 0000644 0001750 0001750 00000002017 13737204645 016463 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ignore.R
\name{use_build_ignore}
\alias{use_build_ignore}
\title{Add files to \code{.Rbuildignore}}
\usage{
use_build_ignore(files, escape = TRUE)
}
\arguments{
\item{files}{Character vector of path names.}
\item{escape}{If \code{TRUE}, the default, will escape \code{.} to
\verb{\\\\.} and surround with \code{^} and \code{$}.}
}
\description{
\code{.Rbuildignore} has a regular expression on each line, but it's
usually easier to work with specific file names. By default,
\code{use_build_ignore()} will (crudely) turn a filename into a regular
expression that will only match that path. Repeated entries will be
silently removed.
\code{use_build_ignore()} is designed to ignore \emph{individual} files. If you
want to ignore \emph{all} files with a given extension, consider providing
an "as-is" regular expression, using \code{escape = FALSE}; see examples.
}
\examples{
\dontrun{
# ignore all Excel files
use_build_ignore("[.]xlsx$", escape = FALSE)
}
}
usethis/man/use_logo.Rd 0000644 0001750 0001750 00000001541 13676400413 014753 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/logo.R
\name{use_logo}
\alias{use_logo}
\title{Use a package logo}
\usage{
use_logo(img, geometry = "240x278", retina = TRUE)
}
\arguments{
\item{img}{The path to an existing image file}
\item{geometry}{a \link[magick:geometry]{magick::geometry} string specifying size. The default
assumes that you have a hex logo using spec from
\url{http://hexb.in/sticker.html}.}
\item{retina}{\code{TRUE}, the default, scales the image on the README,
assuming that geometry is double the desired size.}
}
\description{
This function helps you use a logo in your package:
\itemize{
\item Enforces a specific size
\item Stores logo image file at \code{man/figures/logo.png}
\item Produces the markdown text you need in README to include the logo
}
}
\examples{
\dontrun{
use_logo("usethis.png")
}
}
usethis/man/use_blank_slate.Rd 0000644 0001750 0001750 00000001557 14117743363 016306 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rstudio.R
\name{use_blank_slate}
\alias{use_blank_slate}
\title{Don't save/load user workspace between sessions}
\usage{
use_blank_slate(scope = c("user", "project"))
}
\arguments{
\item{scope}{Edit globally for the current \strong{user}, or locally for the
current \strong{project}}
}
\description{
R can save and reload the user's workspace between sessions via an \code{.RData}
file in the current directory. However, long-term reproducibility is enhanced
when you turn this feature off and clear R's memory at every restart.
Starting with a blank slate provides timely feedback that encourages the
development of scripts that are complete and self-contained. More detail can
be found in the blog post \href{https://www.tidyverse.org/blog/2017/12/workflow-vs-script/}{Project-oriented workflow}.
}
usethis/man/use_citation.Rd 0000644 0001750 0001750 00000000442 13676400413 015624 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/citation.R
\name{use_citation}
\alias{use_citation}
\title{Create a CITATION template}
\usage{
use_citation()
}
\description{
Use this if you want to encourage users of your package to cite an
article or book.
}
usethis/man/issue-this.Rd 0000644 0001750 0001750 00000002554 14131645451 015241 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/issue.R
\name{issue-this}
\alias{issue-this}
\alias{issue_close_community}
\alias{issue_reprex_needed}
\title{Helpers for GitHub issues}
\usage{
issue_close_community(number, reprex = FALSE)
issue_reprex_needed(number)
}
\arguments{
\item{number}{Issue number}
\item{reprex}{Does the issue also need a reprex?}
}
\description{
The \verb{issue_*} family of functions allows you to perform common operations on
GitHub issues from within R. They're designed to help you efficiently deal
with large numbers of issues, particularly motivated by the challenges faced
by the tidyverse team.
\itemize{
\item \code{issue_close_community()} closes an issue, because it's not a bug report or
feature request, and points the author towards RStudio Community as a
better place to discuss usage (\url{https://community.rstudio.com}).
\item \code{issue_reprex_needed()} labels the issue with the "reprex" label and
gives the author some advice about what is needed.
}
}
\section{Saved replies}{
Unlike GitHub's "saved replies", these functions can:
\itemize{
\item Be shared between people
\item Perform other actions, like labelling, or closing
\item Have additional arguments
\item Include randomness (like friendly gifs)
}
}
\examples{
\dontrun{
issue_close_community(12, reprex = TRUE)
issue_reprex_needed(241)
}
}
usethis/man/roxygen/ 0000755 0001750 0001750 00000000000 14117743363 014347 5 ustar nilesh nilesh usethis/man/roxygen/templates/ 0000755 0001750 0001750 00000000000 14117743363 016345 5 ustar nilesh nilesh usethis/man/roxygen/templates/double-auth.R 0000644 0001750 0001750 00000002572 14117743363 020707 0 ustar nilesh nilesh #' @section Git/GitHub Authentication:
#' Many usethis functions, including those documented here, potentially interact
#' with GitHub in two different ways:
#' * Via the GitHub REST API. Examples: create a repo, a fork, or a pull
#' request.
#' * As a conventional Git remote. Examples: clone, fetch, or push.
#'
#' Therefore two types of auth can happen and your credentials must be
#' discoverable. Which credentials do we mean?
#'
#' * A GitHub personal access token (PAT) must be discoverable by the gh
#' package, which is used for GitHub operations via the REST API. See
#' [gh_token_help()] for more about getting and configuring a PAT.
#' * If you use the HTTPS protocol for Git remotes, your PAT is also used for
#' Git operations, such as `git push`. Usethis uses the gert package for this,
#' so the PAT must be discoverable by gert. Generally gert and gh will
#' discover and use the same PAT. This ability to "kill two birds with one
#' stone" is why HTTPS + PAT is our recommended auth strategy for those new
#' to Git and GitHub and PRs.
#' * If you use SSH remotes, your SSH keys must also be discoverable, in
#' addition to your PAT. The public key must be added to your GitHub account.
#'
#' Git/GitHub credential management is covered in a dedicated article:
#' [Managing Git(Hub) Credentials](https://usethis.r-lib.org/articles/articles/git-credentials.html)
usethis/man/edit_file.Rd 0000644 0001750 0001750 00000002036 14117743363 015070 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/edit.R
\name{edit_file}
\alias{edit_file}
\alias{edit_template}
\title{Open file for editing}
\usage{
edit_file(path, open = rlang::is_interactive())
edit_template(template = NULL, open = rlang::is_interactive())
}
\arguments{
\item{path}{Path to target file.}
\item{open}{Whether to open the file for interactive editing.}
\item{template}{The target template file. If not specified, existing template
files are offered for interactive selection.}
}
\value{
Target path, invisibly.
}
\description{
Opens a file for editing in RStudio, if that is the active environment, or
via \code{\link[utils:file.edit]{utils::file.edit()}} otherwise. If the file does not exist, it is
created. If the parent directory does not exist, it is also created.
\code{edit_template()} specifically opens templates in \code{inst/templates} for use
with \code{\link[=use_template]{use_template()}}.
}
\examples{
\dontrun{
edit_file("DESCRIPTION")
edit_file("~/.gitconfig")
}
}
\keyword{internal}
usethis/man/use_version.Rd 0000644 0001750 0001750 00000002307 14117743363 015506 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/version.R
\name{use_version}
\alias{use_version}
\alias{use_dev_version}
\title{Increment package version}
\usage{
use_version(which = NULL)
use_dev_version()
}
\arguments{
\item{which}{A string specifying which level to increment, one of: "major",
"minor", "patch", "dev". If \code{NULL}, user can choose interactively.}
}
\description{
\code{use_version()} increments the "Version" field in \code{DESCRIPTION},
adds a new heading to \code{NEWS.md} (if it exists), and commits those changes
(if package uses Git). It makes the same update to a line like \code{PKG_version = "x.y.z";} in \code{src/version.c} (if it exists).
\code{use_dev_version()} increments to a development version, e.g.
from 1.0.0 to 1.0.0.9000. If the existing version is already a development
version with four components, it does nothing. Thin wrapper around
\code{use_version()}.
}
\examples{
\dontrun{
## for interactive selection, do this:
use_version()
## request a specific type of increment
use_version("minor")
use_dev_version()
}
}
\seealso{
The \href{https://r-pkgs.org/description.html#version}{version section} of \href{https://r-pkgs.org}{R Packages}.
}
usethis/man/use_vignette.Rd 0000644 0001750 0001750 00000002304 14117743363 015643 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vignette.R
\name{use_vignette}
\alias{use_vignette}
\alias{use_article}
\title{Create a vignette or article}
\usage{
use_vignette(name, title = name)
use_article(name, title = name)
}
\arguments{
\item{name}{Base for file name to use for new vignette. Should consist only
of numbers, letters, \verb{_} and \code{-}. Lower case is recommended.}
\item{title}{The title of the vignette.}
}
\description{
Creates a new vignette or article in \verb{vignettes/}. Articles are a special
type of vignette that appear on pkgdown websites, but are not included
in the package itself (because they are added to \code{.Rbuildignore}
automatically).
}
\section{General setup}{
\itemize{
\item Adds needed packages to \code{DESCRIPTION}.
\item Adds \code{inst/doc} to \code{.gitignore} so built vignettes aren't tracked.
\item Adds \verb{vignettes/*.html} and \verb{vignettes/*.R} to \code{.gitignore} so
you never accidentally track rendered vignettes.
}
}
\examples{
\dontrun{
use_vignette("how-to-do-stuff", "How to do stuff")
}
}
\seealso{
The \href{https://r-pkgs.org/vignettes.html}{vignettes chapter} of
\href{https://r-pkgs.org}{R Packages}.
}
usethis/man/use_jenkins.Rd 0000644 0001750 0001750 00000001204 13764577255 015471 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/jenkins.R
\name{use_jenkins}
\alias{use_jenkins}
\title{Create Jenkinsfile for Jenkins CI Pipelines}
\usage{
use_jenkins()
}
\description{
\code{use_jenkins()} adds a basic Jenkinsfile for R packages to the project root
directory. The Jenkinsfile stages take advantage of calls to \code{make}, and so
calling this function will also run \code{use_make()} if a Makefile does not
already exist at the project root.
}
\seealso{
The \href{https://www.jenkins.io/doc/book/pipeline/jenkinsfile/}{documentation on Jenkins Pipelines}.
\code{\link[=use_make]{use_make()}}
}
usethis/man/proj_sitrep.Rd 0000644 0001750 0001750 00000001572 13737204645 015512 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sitrep.R
\name{proj_sitrep}
\alias{proj_sitrep}
\title{Report working directory and usethis/RStudio project}
\usage{
proj_sitrep()
}
\value{
A named list, with S3 class \code{sitrep} (for printing purposes),
reporting current working directory, active usethis project, and active
RStudio Project
}
\description{
\code{proj_sitrep()} reports
\itemize{
\item current working directory
\item the active usethis project
\item the active RStudio Project
}
Call this function if things seem weird and you're not sure
what's wrong or how to fix it. Usually, all three of these should coincide
(or be unset) and \code{proj_sitrep()} provides suggested commands for getting
back to this happy state.
}
\examples{
proj_sitrep()
}
\seealso{
Other project functions:
\code{\link{proj_utils}}
}
\concept{project functions}
usethis/man/use_release_issue.Rd 0000644 0001750 0001750 00000002443 14131645451 016645 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/release.R
\name{use_release_issue}
\alias{use_release_issue}
\title{Create a release checklist in a GitHub issue}
\usage{
use_release_issue(version = NULL)
}
\arguments{
\item{version}{Optional version number for release. If unspecified, you can
make an interactive choice.}
}
\description{
When preparing to release a package to CRAN there are quite a few steps that
need to be performed, and some of the steps can take multiple hours. This
function creates a checklist in a GitHub issue to:
\itemize{
\item Help you keep track of where you are in the process
\item Feel a sense of satisfaction as you progress towards final submission
\item Help watchers of your package stay informed.
}
The checklist contains a generic set of steps that we've found to be helpful,
based on the type of release ("patch", "minor", or "major"). You're
encouraged to edit the issue to customize this list to meet your needs.
If you want to consistently add extra bullets for every release, you can
include your own custom bullets by providing a (unexported) a
\code{release_bullets()} function that returns a character vector.
(For historical reasons, \code{release_questions()} is also supported).
}
\examples{
\dontrun{
use_release_issue("2.0.0")
}
}
usethis/man/usethis-package.Rd 0000644 0001750 0001750 00000002256 14132450375 016220 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/usethis-package.R
\docType{package}
\name{usethis-package}
\alias{usethis}
\alias{usethis-package}
\title{usethis: Automate Package and Project Setup}
\description{
\if{html}{\figure{logo.png}{options: align='right' alt='logo' width='120'}}
Automate package and project setup tasks that are otherwise performed manually. This includes setting up unit testing, test coverage, continuous integration, Git, 'GitHub', licenses, 'Rcpp', 'RStudio' projects, and more.
}
\seealso{
Useful links:
\itemize{
\item \url{https://usethis.r-lib.org}
\item \url{https://github.com/r-lib/usethis}
\item Report bugs at \url{https://github.com/r-lib/usethis/issues}
}
}
\author{
\strong{Maintainer}: Jennifer Bryan \email{jenny@rstudio.com} (\href{https://orcid.org/0000-0002-6983-2759}{ORCID})
Authors:
\itemize{
\item Hadley Wickham \email{hadley@rstudio.com} (\href{https://orcid.org/0000-0003-4757-117X}{ORCID})
\item Malcolm Barrett \email{malcolmbarrett@gmail.com} (\href{https://orcid.org/0000-0003-0299-5825}{ORCID})
}
Other contributors:
\itemize{
\item RStudio [copyright holder, funder]
}
}
\keyword{internal}
usethis/man/use_template.Rd 0000644 0001750 0001750 00000004232 13737204645 015635 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/template.R
\name{use_template}
\alias{use_template}
\title{Use a usethis-style template}
\usage{
use_template(
template,
save_as = template,
data = list(),
ignore = FALSE,
open = FALSE,
package = "usethis"
)
}
\arguments{
\item{template}{Path to template file relative to \verb{templates/} directory
within \code{package}; see details.}
\item{save_as}{Path of file to create, relative to root of active project.
Defaults to \code{template}}
\item{data}{A list of data passed to the template.}
\item{ignore}{Should the newly created file be added to \code{.Rbuildignore}?}
\item{open}{Open the newly created file for editing? Happens in RStudio, if
applicable, or via \code{\link[utils:file.edit]{utils::file.edit()}} otherwise.}
\item{package}{Name of the package where the template is found.}
}
\value{
A logical vector indicating if file was modified.
}
\description{
Creates a file from data and a template found in a package. Provides control
over file name, the addition to \code{.Rbuildignore}, and opening the file for
inspection.
}
\details{
This function can be used as the engine for a templating function in other
packages. The \code{template} argument is used along with the \code{package} argument
to derive the path to your template file; it will be expected at
\code{fs::path_package(package = package, "templates", template)}. We use
\code{fs::path_package()} instead of \code{base::system.file()} so that path
construction works even in a development workflow, e.g., works with
\code{devtools::load_all()} or \code{pkgload::load_all()}. \emph{Note this describes the
behaviour of \code{fs::path_package()} in fs v1.2.7.9001 and higher.}
To interpolate your data into the template, supply a list using
the \code{data} argument. Internally, this function uses
\code{\link[whisker:whisker.render]{whisker::whisker.render()}} to combine your template file with your data.
}
\examples{
\dontrun{
# Note: running this will write `NEWS.md` to your working directory
use_template(
template = "NEWS.md",
data = list(Package = "acme", Version = "1.2.3"),
package = "usethis"
)
}
}
usethis/man/licenses.Rd 0000644 0001750 0001750 00000005755 14117743363 014764 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/license.R
\name{licenses}
\alias{use_mit_license}
\alias{use_gpl_license}
\alias{use_agpl_license}
\alias{use_lgpl_license}
\alias{use_apache_license}
\alias{use_cc0_license}
\alias{use_ccby_license}
\alias{use_proprietary_license}
\alias{use_gpl3_license}
\alias{use_agpl3_license}
\alias{use_apl2_license}
\title{License a package}
\usage{
use_mit_license(copyright_holder = NULL)
use_gpl_license(version = 3, include_future = TRUE)
use_agpl_license(version = 3, include_future = TRUE)
use_lgpl_license(version = 3, include_future = TRUE)
use_apache_license(version = 2, include_future = TRUE)
use_cc0_license()
use_ccby_license()
use_proprietary_license(copyright_holder)
}
\arguments{
\item{copyright_holder}{Name of the copyright holder or holders. This
defaults to "{package name} authors"; you should only change this if you
use a CLA to assign copyright to a single entity.}
\item{version}{License version. This defaults to latest version all licenses.}
\item{include_future}{If \code{TRUE}, will license your package under the current
and any potential future versions of the license. This is generally
considered to be good practice because it means your package will
automatically include "bug" fixes in licenses.}
}
\description{
Adds the necessary infrastructure to declare your package as licensed
with one of these popular open source licenses:
Permissive:
\itemize{
\item \href{https://choosealicense.com/licenses/mit/}{MIT}: simple and permissive.
\item \href{https://choosealicense.com/licenses/apache-2.0/}{Apache 2.0}: MIT +
provides patent protection.
}
Copyleft:
\itemize{
\item \href{https://choosealicense.com/licenses/gpl-2.0/}{GPL v2}: requires sharing
of improvements.
\item \href{https://choosealicense.com/licenses/gpl-3.0/}{GPL v3}: requires sharing
of improvements.
\item \href{https://choosealicense.com/licenses/agpl-3.0/}{AGPL v3}: requires sharing
of improvements.
\item \href{https://choosealicense.com/licenses/lgpl-2.1/}{LGPL v2.1}: requires sharing
of improvements.
\item \href{https://choosealicense.com/licenses/lgpl-3.0/}{LGPL v3}: requires sharing
of improvements.
}
Creative commons licenses appropriate for data packages:
\itemize{
\item \href{https://creativecommons.org/publicdomain/zero/1.0/}{CC0}: dedicated
to public domain.
\item \href{https://creativecommons.org/licenses/by/4.0/}{CC-BY}: Free to share and
adapt, must give appropriate credit.
}
See \url{https://choosealicense.com} for more details and other options.
Alternatively, for code that you don't want to share with others,
\code{use_proprietary_license()} makes it clear that all rights are reserved,
and the code is not open source.
}
\details{
CRAN does not permit you to include copies of standard licenses in your
package, so these functions save the license as \code{LICENSE.md} and add it
to \code{.Rbuildignore}.
}
\seealso{
For more details, refer to the the
\href{https://r-pkgs.org/license.html}{license chapter} in \emph{R Packages}.
}
usethis/man/use_course_details.Rd 0000644 0001750 0001750 00000014267 14153502006 017021 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/course.R
\name{use_course_details}
\alias{use_course_details}
\alias{create_download_url}
\title{Helpers to download and unpack a ZIP file}
\usage{
create_download_url(url)
}
\arguments{
\item{url}{a GitHub, DropBox, or Google Drive URL, as copied from a web
browser.}
\item{destdir}{Path to existing local directory where the ZIP file will be
stored. Defaults to current working directory, but note that \code{\link[=use_course]{use_course()}}
has different default behavior.}
\item{zipfile}{Path to local ZIP file.}
}
\description{
Details on the internal and helper functions that power \code{\link[=use_course]{use_course()}} and
\code{\link[=use_zip]{use_zip()}}. Only \code{create_download_url()} is exported.
}
\section{tidy_download()}{
\preformatted{## function signature
tidy_download(url, destdir = getwd())
# as called inside use_course()
tidy_download(
url, ## after post-processing with normalize_url()
# conspicuous_place() = `getOption('usethis.destdir')` or desktop or home
# directory or working directory
destdir = destdir \%||\% conspicuous_place()
)
}
Special-purpose function to download a ZIP file and automatically determine
the file name, which often determines the folder name after unpacking.
Developed with DropBox and GitHub as primary targets, possibly via
shortlinks. Both platforms offer a way to download an entire folder or repo
as a ZIP file, with information about the original folder or repo transmitted
in the \code{Content-Disposition} header. In the absence of this header, a
filename is generated from the input URL. In either case, the filename is
sanitized. Returns the path to downloaded ZIP file, invisibly.
\code{tidy_download()} is setup to retry after a download failure. In an
interactive session, it asks for user's consent. All retries use a longer
connect timeout.
\subsection{DropBox}{
To make a folder available for ZIP download, create a shared link for it:
\itemize{
\item \url{https://help.dropbox.com/files-folders/share/view-only-access}
}
A shared link will have this form:\preformatted{https://www.dropbox.com/sh/12345abcde/6789wxyz?dl=0
}
Replace the \code{dl=0} at the end with \code{dl=1} to create a download link:\preformatted{https://www.dropbox.com/sh/12345abcde/6789wxyz?dl=1
}
You can use \code{create_download_url()} to do this conversion.
This download link (or a shortlink that points to it) is suitable as input
for \code{tidy_download()}. After one or more redirections, this link will
eventually lead to a download URL. For more details, see
\url{https://help.dropbox.com/files-folders/share/force-download} and
\url{https://help.dropbox.com/installs-integrations/sync-uploads/download-entire-folders}.
}
\subsection{GitHub}{
Click on the repo's "Clone or download" button, to reveal a "Download ZIP"
button. Capture this URL, which will have this form:\preformatted{https://github.com/r-lib/usethis/archive/main.zip
}
This download link (or a shortlink that points to it) is suitable as input
for \code{tidy_download()}. After one or more redirections, this link will
eventually lead to a download URL. Here are other links that also lead to
ZIP download, albeit with a different filenaming scheme (REF could be a
branch name, a tag, or a SHA):\preformatted{https://github.com/github.com/r-lib/usethis/zipball/HEAD
https://api.github.com/repos/r-lib/rematch2/zipball/REF
https://api.github.com/repos/r-lib/rematch2/zipball/HEAD
https://api.github.com/repos/r-lib/usethis/zipball/REF
}
You can use \code{create_download_url()} to create the "Download ZIP" URL from
a typical GitHub browser URL.
}
\subsection{Google Drive}{
To our knowledge, it is not possible to download a Google Drive folder as a
ZIP archive. It is however possible to share a ZIP file stored on Google
Drive. To get its URL, click on "Get the shareable link" (within the "Share"
menu). This URL doesn't allow for direct download, as it's designed to be
processed in a web browser first. Such a sharing link looks like:\preformatted{https://drive.google.com/open?id=123456789xxyyyzzz
}
To be able to get the URL suitable for direct download, you need to extract
the "id" element from the URL and include it in this URL format:\preformatted{https://drive.google.com/uc?export=download&id=123456789xxyyyzzz
}
Use \code{create_download_url()} to perform this transformation automatically.
}
}
\section{tidy_unzip()}{
Special-purpose function to unpack a ZIP file and (attempt to) create the
directory structure most people want. When unpacking an archive, it is easy
to get one more or one less level of nesting than you expected.
It's especially important to finesse the directory structure here: we want
the same local result when unzipping the same content from either GitHub or
DropBox ZIP files, which pack things differently. Here is the intent:
\itemize{
\item If the ZIP archive \code{foo.zip} does not contain a single top-level directory,
i.e. it is packed as "loose parts", unzip into a directory named \code{foo}.
Typical of DropBox ZIP files.
\item If the ZIP archive \code{foo.zip} has a single top-level directory (which, by
the way, is not necessarily called "foo"), unpack into said directory.
Typical of GitHub ZIP files.
}
Returns path to the directory holding the unpacked files, invisibly.
\strong{DropBox:}
The ZIP files produced by DropBox are special. The file list tends to contain
a spurious directory \code{"/"}, which we ignore during unzip. Also, if the
directory is a Git repo and/or RStudio Project, we unzip-ignore various
hidden files, such as \code{.RData}, \code{.Rhistory}, and those below \verb{.git/} and
\code{.Rproj.user}.
}
\examples{
\dontrun{
tidy_download("https://github.com/r-lib/rematch2/archive/main.zip")
}
\dontrun{
tidy_download("https://github.com/r-lib/rematch2/archive/main.zip")
tidy_unzip("rematch2-main.zip")
}
# GitHub
create_download_url("https://github.com/r-lib/usethis")
create_download_url("https://github.com/r-lib/usethis/issues")
# DropBox
create_download_url("https://www.dropbox.com/sh/12345abcde/6789wxyz?dl=0")
# Google Drive
create_download_url("https://drive.google.com/open?id=123456789xxyyyzzz")
create_download_url("https://drive.google.com/open?id=123456789xxyyyzzz/view")
}
\keyword{internal}
usethis/man/pull-requests.Rd 0000644 0001750 0001750 00000023730 14131645451 015770 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pr.R
\name{pull-requests}
\alias{pull-requests}
\alias{pr_init}
\alias{pr_resume}
\alias{pr_fetch}
\alias{pr_push}
\alias{pr_pull}
\alias{pr_merge_main}
\alias{pr_view}
\alias{pr_pause}
\alias{pr_finish}
\alias{pr_forget}
\title{Helpers for GitHub pull requests}
\usage{
pr_init(branch)
pr_resume(branch = NULL)
pr_fetch(number = NULL, target = c("source", "primary"))
pr_push()
pr_pull()
pr_merge_main()
pr_view(number = NULL, target = c("source", "primary"))
pr_pause()
pr_finish(number = NULL, target = c("source", "primary"))
pr_forget()
}
\arguments{
\item{branch}{Name of a new or existing local branch. If creating a new
branch, note this should usually consist of lower case letters, numbers,
and \code{-}.}
\item{number}{Number of PR.}
\item{target}{Which repo to target? This is only a question in the case of a
fork. In a fork, there is some slim chance that you want to consider pull
requests against your fork (the primary repo, i.e. \code{origin}) instead of
those against the source repo (i.e. \code{upstream}, which is the default).}
}
\description{
The \verb{pr_*} family of functions is designed to make working with GitHub pull
requests (PRs) as painless as possible for both contributors and package
maintainers.
To use the \verb{pr_*} functions, your project must be a Git repo and have one of
these GitHub remote configurations:
\itemize{
\item "ours": You can push to the GitHub remote configured as \code{origin} and it's
not a fork.
\item "fork": You can push to the GitHub remote configured as \code{origin}, it's a
fork, and its parent is configured as \code{upstream}. \code{origin} points to your
\strong{personal} copy and \code{upstream} points to the \strong{source repo}.
}
"Ours" and "fork" are two of several GitHub remote configurations examined in
\href{https://happygitwithr.com/common-remote-setups.html}{Common remote setups}
in Happy Git and GitHub for the useR.
The \href{https://usethis.r-lib.org/articles/articles/pr-functions.html}{Pull Request Helpers}
article walks through the process of making a pull request with the \verb{pr_*}
functions.
The \verb{pr_*} functions also use your Git/GitHub credentials to carry out
various remote operations; see below for more about auth. The \verb{pr_*}
functions also proactively check for agreement re: the default branch in your
local repo and the source repo. See \code{\link[=git_default_branch]{git_default_branch()}} for more.
}
\section{Git/GitHub Authentication}{
Many usethis functions, including those documented here, potentially interact
with GitHub in two different ways:
\itemize{
\item Via the GitHub REST API. Examples: create a repo, a fork, or a pull
request.
\item As a conventional Git remote. Examples: clone, fetch, or push.
}
Therefore two types of auth can happen and your credentials must be
discoverable. Which credentials do we mean?
\itemize{
\item A GitHub personal access token (PAT) must be discoverable by the gh
package, which is used for GitHub operations via the REST API. See
\code{\link[=gh_token_help]{gh_token_help()}} for more about getting and configuring a PAT.
\item If you use the HTTPS protocol for Git remotes, your PAT is also used for
Git operations, such as \verb{git push}. Usethis uses the gert package for this,
so the PAT must be discoverable by gert. Generally gert and gh will
discover and use the same PAT. This ability to "kill two birds with one
stone" is why HTTPS + PAT is our recommended auth strategy for those new
to Git and GitHub and PRs.
\item If you use SSH remotes, your SSH keys must also be discoverable, in
addition to your PAT. The public key must be added to your GitHub account.
}
Git/GitHub credential management is covered in a dedicated article:
\href{https://usethis.r-lib.org/articles/articles/git-credentials.html}{Managing Git(Hub) Credentials}
}
\section{For contributors}{
To contribute to a package, first use \code{create_from_github("OWNER/REPO")}.
This forks the source repository and checks out a local copy.
Next use \code{pr_init()} to create a branch for your PR. It is best practice to
never make commits to the default branch branch of a fork (usually named
\code{main} or \code{master}), because you do not own it. A pull request should always
come from a feature branch. It will be much easier to pull upstream changes
from the fork parent if you only allow yourself to work in feature branches.
It is also much easier for a maintainer to explore and extend your PR if you
create a feature branch.
Work locally, in your branch, making changes to files, and committing your
work. Once you're ready to create the PR, run \code{pr_push()} to push your local
branch to GitHub, and open a webpage that lets you initiate the PR (or draft
PR).
To learn more about the process of making a pull request, read the \href{https://usethis.r-lib.org/articles/articles/pr-functions.html}{Pull Request Helpers}
vignette.
If you are lucky, your PR will be perfect, and the maintainer will accept it.
You can then run \code{pr_finish()} to delete your PR branch. In most cases,
however, the maintainer will ask you to make some changes. Make the changes,
then run \code{pr_push()} to update your PR.
It's also possible that the maintainer will contribute some code to your PR:
to get those changes back onto your computer, run \code{pr_pull()}. It can also
happen that other changes have occurred in the package since you first
created your PR. You might need to merge the default branch (usually named
\code{main} or \code{master}) into your PR branch. Do that by running
\code{pr_merge_main()}: this makes sure that your PR is compatible with the
primary repo's main line of development. Both \code{pr_pull()} and
\code{pr_merge_main()} can result in merge conflicts, so be prepared to resolve
before continuing.
}
\section{For maintainers}{
To download a PR locally so that you can experiment with it, run
\code{pr_fetch()} and select the PR or, if you already know its number, call
\verb{pr_fetch()}. If you make changes, run \code{pr_push()} to push them
back to GitHub. After you have merged the PR, run \code{pr_finish()} to delete the
local branch and remove the remote associated with the contributor's fork.
}
\section{Overview of all the functions}{
\itemize{
\item \code{pr_init()}: Does a preparatory pull of the default branch from the source
repo, to get a good start point. Creates and checks out a new branch. Nothing
is pushed to or created on GitHub (that does not happen until the first time
you call \code{pr_push()}).
\item \code{pr_resume()}: Resume work on a PR by switching to an existing local branch
and pulling any changes from its upstream tracking branch, if it has one. If
called with no arguments, up to 9 local branches are offered for interactive
selection, with a preference for branches connected to PRs and for branches
with recent activity.
\item \code{pr_fetch()}: Checks out a PR on the source repo for local exploration. If
called with no arguments, up to 9 open PRs are offered for interactive
selection. This can cause a new remote to be configured and a new local
branch to be created. The local branch is configured to track its remote
counterpart. The transport protocol (HTTPS vs SSH) for any new remote is
inherited from the remote representing the source repo. \code{pr_fetch()} puts a
maintainer in a position where they can push changes into an internal or
external PR via \code{pr_push()}.
\item \code{pr_push()}: The first time it's called, a PR branch is pushed to GitHub
and you're taken to a webpage where a new PR (or draft PR) can be created.
This also sets up the local branch to track its remote counterpart.
Subsequent calls to \code{pr_push()} make sure the local branch has all the remote
changes and, if so, pushes local changes, thereby updating the PR.
\item \code{pr_pull()}: Pulls changes from the local branch's remote tracking branch.
If a maintainer has extended your PR, this is how you bring those changes
back into your local work.
\item \code{pr_merge_main()}: Pulls changes from the default branch of the source repo
into the current local branch. This can be used when the local branch is the
default branch or when it's a PR branch.
\item \code{pr_pause()}: Makes sure you're up-to-date with any remote changes in the
PR. Then switches back to the default branch and pulls from the source repo.
\item \code{pr_view()}: Visits the PR associated with the current branch in the
browser (default) or the specific PR identified by \code{number}.
(FYI \code{\link[=browse_github_pulls]{browse_github_pulls()}} is a handy way to visit the list of all PRs for
the current project.)
\item \code{pr_forget()}: Does local clean up when the current branch is an actual or
notional PR that you want to abandon. Maybe you initiated it yourself, via
\code{pr_init()}, or you used \code{pr_fetch()} to explore a PR from GitHub. Only does
\emph{local} operations: does not update or delete any remote branches, nor does
it close any PRs. Alerts the user to any uncommitted or unpushed work that is
at risk of being lost. If user chooses to proceed, switches back to the
default branch, pulls changes from source repo, and deletes local PR branch.
Any associated Git remote is deleted, if the "forgotten" PR was the only
branch using it.
\item \code{pr_finish()}: Does post-PR clean up, but does NOT actually merge or close
a PR (maintainer should do this in the browser). If \code{number} is not given,
infers the PR from the upstream tracking branch of the current branch. If
\code{number} is given, it does not matter whether the PR exists locally. If PR
exists locally, alerts the user to uncommitted or unpushed changes, then
switches back to the default branch, pulls changes from source repo, and
deletes local PR branch. If the PR came from an external fork, any associated
Git remote is deleted, provided it's not in use by any other local branches.
If the PR has been merged and user has permission, deletes the remote branch
(this is the only remote operation that \code{pr_finish()} potentially does).
}
}
\examples{
\dontrun{
pr_fetch(123)
}
}
usethis/man/use_namespace.Rd 0000644 0001750 0001750 00000001321 13737204645 015752 0 ustar nilesh nilesh % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/namespace.R
\name{use_namespace}
\alias{use_namespace}
\title{Use a basic \code{NAMESPACE}}
\usage{
use_namespace(roxygen = TRUE)
}
\arguments{
\item{roxygen}{Do you plan to manage \code{NAMESPACE} with roxygen2?}
}
\description{
If \code{roxygen} is \code{TRUE} generates an empty \code{NAMESPACE} that exports nothing;
you'll need to explicitly export functions with \verb{@export}. If \code{roxygen}
is \code{FALSE}, generates a default \code{NAMESPACE} that exports all functions
except those that start with \code{.}.
}
\seealso{
The \href{https://r-pkgs.org/namespace.html}{namespace chapter} of
\href{https://r-pkgs.org}{R Packages}.
}
usethis/man/figures/ 0000755 0001750 0001750 00000000000 14154446735 014324 5 ustar nilesh nilesh usethis/man/figures/lifecycle-defunct.svg 0000644 0001750 0001750 00000001704 14117743363 020430 0 ustar nilesh nilesh