You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ Most of the projects are built with customisability and extendability in mind. A
51
51
52
52
Describe or link templates on how to raise an issue, feature request or make a contribution to the codebase. Reference the other documentation files, like
53
53
54
-
- Environment setup for contribution, i.e. `CONTRIBUTING.md`
54
+
- Environment setup for contribution, i.e. [CONTRIBUTING.md](./docs/CONTRIBUTING.md)
55
55
- Coding standards, branching, linting, practices for development and testing
To ensure all the prerequisite are installed and configured correctly, please follow the [nhs-england-tools/dotfiles](https://github.com/nhs-england-tools/dotfiles) installation process.
39
40
@@ -55,15 +56,16 @@ The commands below will configure your Git command-line client globally. Please,
55
56
This configuration is to support trunk-based development and git linear history.
56
57
57
58
```shell
58
-
git config --global user.name "Your Name"# Use your full name here
59
-
git config --global user.email "youremail@domain"# Use your email address here
59
+
git config user.name "Your Name"# Use your full name here
60
+
git config user.email "youremail@domain"# Use your email address here
60
61
git config branch.autosetupmerge false
61
62
git config branch.autosetuprebase always
62
63
git config commit.gpgsign true
63
64
git config core.autocrlf input
64
65
git config core.filemode true
65
66
git config core.hidedotfiles false
66
67
git config core.ignorecase false
68
+
git config credential.helper cache
67
69
git config pull.rebase true
68
70
git config push.default current
69
71
git config push.followTags true
@@ -78,14 +80,17 @@ More information on the git settings can be found in the [Git Reference document
78
80
Signing Git commits is a good practice and ensures the correct web of trust has been established for the distributed version control management.
Generate a new pair of GPG keys. Please, change the passphrase (<spanstyle="color:red">pleaseChooseYourKeyPassphrase</span>) below and save it in your password manager.
83
+
If you do not have it already generate a new pair of GPG keys. Please, change the passphrase (<spanstyle="color:red">pleaseChooseYourKeyPassphrase</span>) below and save it in your password manager.
82
84
83
85
```shell
84
86
USER_NAME="Your Name"
85
-
USER_EMAIL="your.name@nhs.net"
87
+
USER_EMAIL="your.name@email"
86
88
file=$(echo $USER_EMAIL| sed "s/[^[:alpha:]]/-/g")
# or do it manually by running `gpg --full-gen-key`
103
109
```
104
110
@@ -108,12 +114,12 @@ Make note of the ID and save the keys.
108
114
gpg --list-secret-keys --keyid-format LONG $USER_EMAIL
109
115
```
110
116
111
-
You should see a similar output to this:
117
+
You should see a similar output to this
112
118
113
119
```shell
114
120
sec nistp256/AAAAAAAAAAAAAAAA 2023-01-01 [SCA]
115
121
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
116
-
uid [ultimate] Your Name <your.name@nhs.net>
122
+
uid [ultimate] Your Name <your.name@email>
117
123
ssb nistp256/BBBBBBBBBBBBBBBB 2023-01-01 [E]
118
124
```
119
125
@@ -141,41 +147,75 @@ gpg --delete-keys $ID
141
147
Configure Git to use the new key.
142
148
143
149
```shell
144
-
git config --global user.signingkey $ID
145
-
git config --global commit.gpgsign true
150
+
git config user.signingkey $ID
146
151
```
147
152
148
-
Upload the public key to your GitHub profile in the [GPG keys](https://github.com/settings/keys) section. After doing so, please make sure your email address appears as verified against the commits pushed to the remote.
153
+
Upload the public key to your GitHub profile into the [GPG keys](https://github.com/settings/keys) section. After doing so, please make sure your email address appears as verified against the commits pushed to the remote.
154
+
155
+
```shell
156
+
cat $file.gpg-key.pub
157
+
```
149
158
150
159
#### Troubleshooting
151
160
152
161
If you receive the error message "error: gpg failed to sign the data", make sure you added `export GPG_TTY=$(tty)` to your `~/.zshrc` and restarted your terminal.
153
162
154
163
```shell
155
-
sed -i '''/^export GPG_TTY/d'~/.zshrc
156
-
echoexport GPG_TTY=\$\(tty\)>>~/.zshrc
164
+
sed -i '/^export GPG_TTY/d'~/.exports
165
+
echo"export GPG_TTY=\$TTY">>~/.exports
157
166
```
158
167
159
-
Additional useful settings and commands
168
+
## Additional settings
169
+
170
+
Configure caching git commit signature passphrase for 3 hours
160
171
161
172
```shell
162
173
source~/.zshrc
163
-
sed -i '''/^pinentry-program/d'~/.gnupg/gpg-agent.conf
174
+
mkdir -p ~/.gnupg
175
+
sed -i '/^pinentry-program/d'~/.gnupg/gpg-agent.conf 2>/dev/null ||:
git rebase -i HEAD~X # Squash X number of commits into one
224
264
# When prompted change commit type to `squash` for all the commits except the top one
@@ -228,7 +268,7 @@ git push --force-with-lease
228
268
229
269
Rebasing a branch onto main
230
270
231
-
```console
271
+
```shell
232
272
git checkout main
233
273
git pull
234
274
git checkout task/REF-XXX_Descriptive_branch_name
@@ -241,7 +281,7 @@ git push --force-with-lease
241
281
242
282
Merging a branch to main - this should be done only in an exceptional circumstance as the proper process is to raise a Pull Request
243
283
244
-
```console
284
+
```shell
245
285
git checkout main
246
286
git pull --prune # Make sure main is up-to-date
247
287
git checkout task/REF-XXX_Descriptive_branch_name
@@ -271,9 +311,11 @@ If REF is currently not in use to track project changes, please drop any referen
271
311
- Wrap lines at 72 characters
272
312
- Use the body to explain what and why you have done something, which should be done as part of a Pull Request description
273
313
314
+
*(Please, bear in mind that a need for this might be superseded by the GitHub Pull Request setting in your respoitory `Settings > General > Pull Requests > Allow squash merging > Default to pull request title and description` which is a recommended configuration.)*
315
+
274
316
Example:
275
317
276
-
```console
318
+
```shell
277
319
Short (72 chars or less) summary in the imperative mood
278
320
279
321
More detailed explanatory text. Wrap it to 72 characters. The blank
@@ -347,7 +389,7 @@ Read the [Code of Conduct](../docs/CODE_OF_CONDUCT.md) to keep the community app
347
389
348
390
When writing or updating unit tests (whether you use Python, Java, Go or shell), please always structure them using the 3 A's approach of 'Arrange', 'Act', and 'Assert'. For example:
349
391
350
-
```console
392
+
```java
351
393
@Test
352
394
public listServicesNullReturn() {
353
395
@@ -364,8 +406,6 @@ public listServicesNullReturn() {
364
406
}
365
407
```
366
408
367
-
TDD ?
368
-
369
409
### Code review
370
410
371
411
Whether possible, please practice pair or/and mob programming. While performing code reviews, please refer to the [Clean Code](https://learning.oreilly.com/library/view/clean-code/9780136083238/) (especially chapter 17) and [Clean Architecture](https://learning.oreilly.com/library/view/clean-architecture-a/9780134494272/) books written by Robert C. Martin.
0 commit comments