Skip to content

Commit 965459e

Browse files
authored
Merge pull request #415 from The-Strategy-Unit/215-repo
Add 'make your repo useful for others' style section
2 parents 53363e4 + 67d2c75 commit 965459e

2 files changed

Lines changed: 104 additions & 43 deletions

File tree

renv.lock

Lines changed: 28 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"R": {
3-
"Version": "4.5.1",
3+
"Version": "4.5.2",
44
"Repositories": [
55
{
66
"Name": "CRAN",
@@ -21,17 +21,17 @@
2121
},
2222
"base64enc": {
2323
"Package": "base64enc",
24-
"Version": "0.1-3",
24+
"Version": "0.1-6",
2525
"Source": "Repository",
2626
"Repository": "CRAN",
2727
"Requirements": [
2828
"R"
2929
],
30-
"Hash": "543776ae6848fde2f48ff3816d0628bc"
30+
"Hash": "5edb675b7baa6e9a0d86dd2c28de1676"
3131
},
3232
"bslib": {
3333
"Package": "bslib",
34-
"Version": "0.9.0",
34+
"Version": "0.10.0",
3535
"Source": "Repository",
3636
"Repository": "CRAN",
3737
"Requirements": [
@@ -49,7 +49,7 @@
4949
"rlang",
5050
"sass"
5151
],
52-
"Hash": "70a6489cc254171fb9b4a7f130f44dca"
52+
"Hash": "d6072fb96c4868d8cb40d4071cdc472b"
5353
},
5454
"cachem": {
5555
"Package": "cachem",
@@ -75,24 +75,24 @@
7575
},
7676
"digest": {
7777
"Package": "digest",
78-
"Version": "0.6.37",
78+
"Version": "0.6.39",
7979
"Source": "Repository",
8080
"Repository": "CRAN",
8181
"Requirements": [
8282
"R",
8383
"utils"
8484
],
85-
"Hash": "33698c4b3127fc9f506654607fb73676"
85+
"Hash": "d18028e978a88b2b16ef8d400cb49adf"
8686
},
8787
"evaluate": {
8888
"Package": "evaluate",
89-
"Version": "1.0.3",
89+
"Version": "1.0.5",
9090
"Source": "Repository",
9191
"Repository": "CRAN",
9292
"Requirements": [
9393
"R"
9494
],
95-
"Hash": "e9651417729bbe7472e32b5027370e79"
95+
"Hash": "94cf2c54237f6841cee68e3ba4ab5a14"
9696
},
9797
"fastmap": {
9898
"Package": "fastmap",
@@ -124,17 +124,6 @@
124124
],
125125
"Hash": "7eb1e342eee7e0a7449c49cdaa526d39"
126126
},
127-
"glue": {
128-
"Package": "glue",
129-
"Version": "1.8.0",
130-
"Source": "Repository",
131-
"Repository": "CRAN",
132-
"Requirements": [
133-
"R",
134-
"methods"
135-
],
136-
"Hash": "5899f1eaa825580172bb56c08266f37c"
137-
},
138127
"highr": {
139128
"Package": "highr",
140129
"Version": "0.11",
@@ -148,9 +137,9 @@
148137
},
149138
"htmltools": {
150139
"Package": "htmltools",
151-
"Version": "0.5.8.1",
140+
"Version": "0.5.9",
152141
"Source": "Repository",
153-
"Repository": "RSPM",
142+
"Repository": "CRAN",
154143
"Requirements": [
155144
"R",
156145
"base64enc",
@@ -160,7 +149,7 @@
160149
"rlang",
161150
"utils"
162151
],
163-
"Hash": "81d371a9cc60640e74e4ab6ac46dcedc"
152+
"Hash": "102298e238c14eb830cc4b5edd23c3e8"
164153
},
165154
"jquerylib": {
166155
"Package": "jquerylib",
@@ -184,7 +173,7 @@
184173
},
185174
"knitr": {
186175
"Package": "knitr",
187-
"Version": "1.50",
176+
"Version": "1.51",
188177
"Source": "Repository",
189178
"Repository": "CRAN",
190179
"Requirements": [
@@ -196,20 +185,19 @@
196185
"xfun",
197186
"yaml"
198187
],
199-
"Hash": "5a07d8ec459d7b80bd4acca5f4a6e062"
188+
"Hash": "27682babb50f03b6eb7939ea69ec79ca"
200189
},
201190
"lifecycle": {
202191
"Package": "lifecycle",
203-
"Version": "1.0.4",
192+
"Version": "1.0.5",
204193
"Source": "Repository",
205194
"Repository": "CRAN",
206195
"Requirements": [
207196
"R",
208197
"cli",
209-
"glue",
210198
"rlang"
211199
],
212-
"Hash": "b8552d117e1b808b09a832f589b79035"
200+
"Hash": "36dbfe4fba6c064db50a671a90297c85"
213201
},
214202
"memoise": {
215203
"Package": "memoise",
@@ -234,13 +222,13 @@
234222
},
235223
"rappdirs": {
236224
"Package": "rappdirs",
237-
"Version": "0.3.3",
225+
"Version": "0.3.4",
238226
"Source": "Repository",
239227
"Repository": "CRAN",
240228
"Requirements": [
241229
"R"
242230
],
243-
"Hash": "5e3c5dc0b071b21fa128676560dbe94d"
231+
"Hash": "f146a5bfc94db048309712535d4d0aee"
244232
},
245233
"renv": {
246234
"Package": "renv",
@@ -254,18 +242,18 @@
254242
},
255243
"rlang": {
256244
"Package": "rlang",
257-
"Version": "1.1.6",
245+
"Version": "1.1.7",
258246
"Source": "Repository",
259247
"Repository": "CRAN",
260248
"Requirements": [
261249
"R",
262250
"utils"
263251
],
264-
"Hash": "892124978869b74935dc3934c42bfe5a"
252+
"Hash": "34c0d101f4613098abc538b82e0d86c5"
265253
},
266254
"rmarkdown": {
267255
"Package": "rmarkdown",
268-
"Version": "2.29",
256+
"Version": "2.30",
269257
"Source": "Repository",
270258
"Repository": "CRAN",
271259
"Requirements": [
@@ -284,7 +272,7 @@
284272
"xfun",
285273
"yaml"
286274
],
287-
"Hash": "df99277f63d01c34e95e3d2f06a79736"
275+
"Hash": "efe19db0fde0fff13cea7eec6f695021"
288276
},
289277
"sass": {
290278
"Package": "sass",
@@ -302,17 +290,17 @@
302290
},
303291
"tinytex": {
304292
"Package": "tinytex",
305-
"Version": "0.57",
293+
"Version": "0.58",
306294
"Source": "Repository",
307295
"Repository": "CRAN",
308296
"Requirements": [
309297
"xfun"
310298
],
311-
"Hash": "02d65e0c0415bf36a7ddc0d2ba50a840"
299+
"Hash": "03af3ad04817f3019de8ee5c73dab807"
312300
},
313301
"xfun": {
314302
"Package": "xfun",
315-
"Version": "0.52",
303+
"Version": "0.56",
316304
"Source": "Repository",
317305
"Repository": "CRAN",
318306
"Requirements": [
@@ -321,14 +309,14 @@
321309
"stats",
322310
"tools"
323311
],
324-
"Hash": "652ce36fe7d57688e6786819b09d9190"
312+
"Hash": "f1f18d352a39c6252932da4faa029cdd"
325313
},
326314
"yaml": {
327315
"Package": "yaml",
328-
"Version": "2.3.10",
316+
"Version": "2.3.12",
329317
"Source": "Repository",
330318
"Repository": "CRAN",
331-
"Hash": "51dab85c6c98e50a18d7551e9d49f76c"
319+
"Hash": "7cd77cb32abd9220d744307e9fc94ffb"
332320
}
333321
}
334322
}

style/git_and_github.qmd

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
editor:
3-
markdown:
2+
editor:
3+
markdown:
44
wrap: sentence
55
---
66

@@ -146,6 +146,79 @@ The deputy should perform these duties in the absence of the owner and provide u
146146

147147
The Data Science team at The Strategy Unit maintain [a template repository](https://github.com/The-Strategy-Unit/template-repository) that contains the minimum set of files and basic structure needed to ensure organisational consistency in repository management. You are welcome to view, clone, copy or reuse the template as you see fit.
148148

149+
## Make your repo useful for others
150+
151+
### Motivation
152+
153+
In the spirit of [our open source policy](https://connect.strategyunitwm.nhs.uk/open-source-policy/), we should make it easy for others to reuse, repurpose or contribute to our code.
154+
Given our desire to improve transparency and help educate others, our content should be findable and the content understood easily.
155+
Visitors to our repos should be able to find what they're looking for and maybe discover something new.
156+
157+
This sentiment is true for private as well as public repositories.
158+
Thoughtful repo construction and documentation are a courtesy to your colleagues.
159+
It's also good practice because we should aim for all repos to be open eventually, if not immediately.
160+
161+
### User stories
162+
163+
You should consider who your users might be and what their user stories might be.
164+
For example, as:
165+
166+
* an internal developer I want to reuse some code so that I can ensure consistency with our existing approaches
167+
* an external developer I want to understand the contribution process for a repo so that I can submit a bug fix
168+
* an external manager I want to look at The Strategy Unit's repos so that I can understand best practice for presenting and disseminating code
169+
* a member of the public I want to inspect the code and methods used by the team so that I can understand how taxpayer money is being used
170+
171+
### Practical tips
172+
173+
Below are some non-exhaustive ideas for how you can improve the usefulness and usability of your repo to others.
174+
This is non-exhaustive set of suggestions and you will need to make your own decisions depending on the nature of the repo.
175+
176+
To improve organisation and findability:
177+
178+
* use a succinct but explanatory name for your repo (you can [change it](https://docs.github.com/en/repositories/creating-and-managing-repositories/renaming-a-repository))
179+
* add some [GitHub topics](https://github.com/topics) to group-up repos and make them more searchable (see [the topics on our NHP repos](https://github.com/The-Strategy-Unit/nhp_products/wiki/List-of-all-NHP-repos), for example)
180+
* consider [custom properties](https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization)
181+
182+
To explain your code's purpose:
183+
184+
* complete the description in the repo's 'about' section
185+
* make sure to include a `README` file with a short description near the top, which can provide quick context and link to related information or projects
186+
187+
So people can understand the state of your project:
188+
189+
* use `README` badges to indicate statuses like passing checks, [project lifecycle stage](https://www.repostatus.org/) and publication to package indexes (e.g. PyPi, CRAN)
190+
* [tag and release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository) your code using [semantic versioning](https://semver.org/) and add clear notes of the changes made
191+
* keep a human-readable changelog up-to-date (e.g. [a NEWS.md file](https://r-pkgs.org/other-markdown.html#sec-news) in an R package)
192+
193+
To make it easy for people to (re)use your code (and products):
194+
195+
* make sure your `README` file explains any prerequisites (e.g. dependencies, data, environment variables) and outlines the method to run the code
196+
* use good coding practice like clear variable naming, modularisation into functions/classes/sub-scripts and judicious use of explanatory comments
197+
* consider [a repo Wiki](https://docs.github.com/en/communities/documenting-your-project-with-wikis/about-wikis) to provide supporting info
198+
* consider organising your code into its most reusable or shareable form (e.g. an R package)
199+
* ensure you have a `LICENSE` so people know how they can (re)use your code
200+
201+
To allow people to contribute:
202+
203+
* make clear the repo's owner and deputy with a [CODEOWNERS file](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) and possibly include owners for specific directories and files
204+
* state preferred methods of contact in the `README` (e.g. via issues or perhaps [GitHub Discussions](https://github.com/features/discussions) for community building)
205+
* add instructions in [a `CONTRIBUTING.md` file](https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/setting-guidelines-for-repository-contributors)
206+
* use [issue templates](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository) to help users ask for or report things
207+
* use common [issue labels](https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels) to highlight issue complexity/priority
208+
* consider a [CODE_OF_CONDUCT.md](https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/adding-a-code-of-conduct-to-your-project) document
209+
210+
So other developers know how to dev with you:
211+
212+
* Use [rulesets](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets) to protect your main branch
213+
* make pull requests early, [marked as draft](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request) with an assignee so 'in-progress' work is visible
214+
* make clear the preferred Git branching strategy (e.g. feature branches off main)
215+
216+
To make it easier for developers to get an at-a-glance understanding:
217+
218+
* follow conventions and good-practice for the language being used, e.g. R and Python packages
219+
* use a simple, self-explanatory directory structure (e.g. images in `img/`, data in `data/`)
220+
* start with [the SU template repository](https://github.com/The-Strategy-Unit/template-repository) (click 'use this template' button or '+ create new' > 'new repository' > 'start with template')
221+
149222
## Further reading
150223

151-
See also our [GitHub as a Team Sport](../presentations/2024-05-23_github-team-sport/index.qmd) presentation.
224+
See also our [GitHub as a Team Sport](../presentations/2024-05-23_github-team-sport/index.qmd) presentation for ideas about working together in GitHub repos.

0 commit comments

Comments
 (0)