Skip to content

Commit 43c5503

Browse files
authored
Check markdown format (#267)
* Add GitHub workflow action step to check markdown * Do not check markdown if no file is changed * Compare against the origin branch * Remove interactive and tty flags * Debug * Ignore list with just spaces * Debug * Debug * Remove debug code * An attempt to fail the action by touching a markdown file * Fix formatting issues except CONTRIBUTING.md file * Show files * Check moved and renamed files * All issues fixed for the changed markdown files * Allow MD033 inline HTML
1 parent a84f4f3 commit 43c5503

File tree

6 files changed

+55
-60
lines changed

6 files changed

+55
-60
lines changed

.github/workflows/action.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/check-markdown.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Check Markdown
2+
on:
3+
push:
4+
branches: ['**']
5+
pull_request:
6+
types: [opened, synchronize, reopened]
7+
jobs:
8+
markdown-check:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 0
14+
- name: Check links
15+
uses: gaurav-nelson/[email protected]
16+
with:
17+
use-quiet-mode: 'yes'
18+
- name: Check format
19+
# Please, make sure to enable Markdown linting in your IDE. For the Visual Studio Code editor it is
20+
# `davidanson.vscode-markdownlint` that is already specified in the `.vscode/extensions.json` file.
21+
run: |
22+
files=$(git diff --diff-filter=ACMRT --name-only origin/${{ github.event.repository.default_branch }}.. "*.md")
23+
if [ -n "$files" ]; then
24+
docker run --rm \
25+
-v $PWD:/workdir \
26+
ghcr.io/igorshubovych/markdownlint-cli:latest \
27+
$files \
28+
--disable MD013 MD033
29+
fi

.github/CONTRIBUTING.md renamed to CONTRIBUTING.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Welcome to the Engineering Framework contributors guide
2+
23
Thank you for your interest in improving the framework.
34

45
In this guide you will get an overview of the contribution workflow from opening an issue, creating a PR, reviewing, and merging the PR.
@@ -8,17 +9,20 @@ The framework is concerned with engineering best practice at NHSD, however, oper
89
If you're new to Github and/or Markdown, Github's own [contributor's guide](https://github.com/github/docs/blob/main/CONTRIBUTING.md) provides good signposting on these topics.
910

1011
## Using issues
12+
1113
If you have a change (or a new page) to raise, please create an [issue](https://github.com/NHSDigital/software-engineering-quality-framework/issues) first, and reference it in your commits. Before raising a new issue, have a look through the existing ones in case it's already been raised (Framework owners will strive to keep the list small enough).
1214

1315
## Pull requests and merging
16+
1417
You can't push to the main branch. Therefore, for all changes you will need to create a new branch, and then a pull request to merge said branch into main. The framework owners will be nominated as reviewers of your PR by default, but feel free to add other people as well if you think they will have valuable input.
1518

1619
When committing your changes, please reference the issue they're resolving, so it will be closed automatically (e.g. `Closes #123`).
1720

1821
## Contributing guidelines and etiquette
22+
1923
* Preview your Markdown code to make sure the format is not broken.
2024
* Check grammar, spelling and punctuation, no one wants to look pedantic by requesting changes due to typos or inconsistent grammar/syntax, but it's only fair to keep this tidy.
2125
* The framework is open to the world. This has a few implications:
2226
* Nothing in it should be confidential, private to NHSD or include any personal data.
2327
* All links in framework pages should be public.
24-
* Use [inclusive language](../inclusive-language.md): avoid terms which cause hurt and offence, including if they have historically been considered industry-standard terms.
28+
* Use [inclusive language](inclusive-language.md): avoid terms which cause hurt and offence, including if they have historically been considered industry-standard terms.

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@ See the [Quick Start Guide](quickstart.md)
99
This framework is concerned with using "good" software engineering to support rapid and safe delivery of high-quality software, at scale
1010

1111
It aims to:
12+
1213
1. Describe a shared (across multiple teams) definition of "good" engineering
1314
2. Provide tools for teams to gain insight into their current engineering maturity levels and their level of [technical debt](tech-debt.md)
1415
3. Provide resources to support teams to increase their engineering maturity levels and manage their [technical debt](tech-debt.md)
1516

1617
![Ecosystem](images/engineering-ecosystem.png)
18+
1719
## Philosophy
1820

1921
The philosophy underpinning this framework advocates:
22+
2023
* Engineering led by user needs and service outcomes
2124
* Empowered delivery teams which are accountable for their products
2225
* Products must be actively maintained for their entire lifecycle
@@ -29,6 +32,7 @@ The philosophy underpinning this framework advocates:
2932
## Context
3033

3134
The framework is a companion to:
35+
3236
* The [NHS service standard](https://service-manual.nhs.uk/service-standard), with cross-references in this format: [SERVICE-RELIABILITY](https://service-manual.nhs.uk/service-standard/14-operate-a-reliable-service)
3337
* The [NHS Digital architectural principles](https://digital.nhs.uk/about-nhs-digital/our-work/nhs-digital-architecture/principles), with cross-references in this format: [ARCHITECTURE-SECURITY](https://digital.nhs.uk/about-nhs-digital/our-work/nhs-digital-architecture/principles/adopt-appropriate-cyber-security-standards)
3438

@@ -46,4 +50,5 @@ The framework consists of:
4650
* Guidance on how to practice [continuous improvement](continuous-improvement.md)
4751

4852
## Contributing
49-
See our [contributor's guide](./.github/CONTRIBUTING.md)
53+
54+
See our [contributor's guide](CONTRIBUTING.md)

inclusive-language.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,39 @@
77

88
## Background
99

10-
The language and terminology we use is important, and there are certain industry-standard terms which cause hurt and offence. Furthermore, the 'old' standard terms use arbitrary language, for example replacing White / Black with terms such as Allow / Deny or Permit / Block removes ambiguity and delivers a better experience for all users.
10+
The language and terminology we use is important, and there are certain industry-standard terms which cause hurt and offence. Furthermore, the 'old' standard terms use arbitrary language, for example replacing White / Black with terms such as Allow / Deny or Permit / Block removes ambiguity and delivers a better experience for all users.
1111

1212
In line with organisations such as the [Home Office](https://hodigital.blog.gov.uk/2020/07/23/not-a-black-and-white-issue-using-racially-neutral-terms-in-technology/) and the [National Cyber Security Centre](https://www.ncsc.gov.uk/blog-post/terminology-its-not-black-and-white), we recognise that historically we have used these terms, and we will strive to avoid using these terms in the future.
1313

1414
## Details
1515

16-
| Context | Term we will avoid | Terms we will use instead (suggested) |
17-
| :------------------------------ | :-------------------- | :------------------------------------ |
18-
| Infrastructure (e.g. databases) | Master | Primary |
19-
| Infrastructure (e.g. databases) | Slave | Replica / Secondary / Worker / Agent |
20-
| Source control | Master | Main (see [below](#renaming-the-master-branch-in-github) for GitHub notes) |
21-
| Security / permissions | Whitelist | Allowlist / Permitlist |
22-
| Security / permissions | Blacklist | Denylist / Blocklist |
16+
| Context | Term we will avoid | Terms we will use instead (suggested) |
17+
| :------------------------------ | :----------------- | :------------------------------------------------------------------------- |
18+
| Infrastructure (e.g. databases) | Master | Primary |
19+
| Infrastructure (e.g. databases) | Slave | Replica / Secondary / Worker / Agent |
20+
| Source control | Master | Main (see [below](#renaming-the-master-branch-in-github) for GitHub notes) |
21+
| Security / permissions | Whitelist | Allowlist / Permitlist |
22+
| Security / permissions | Blacklist | Denylist / Blocklist |
2323

24-
Note: this is not intended to be an exhaustive list, and further suggestions are [very welcome](.github/CONTRIBUTING.md).
24+
Note: this is not intended to be an exhaustive list, and further suggestions are [very welcome](CONTRIBUTING.md).
2525

2626
## Renaming the master branch in GitHub
2727

2828
GitHub have published [guidance](https://github.com/github/renaming) around renaming the master branch. It is worth noting that GitHub retains a history of the names of the parent branch so that existing links to your repository aren't broken - for example the parent branch in this repository has been renamed from master to main, but old links to the master address still work ([https://github.com/NHSDigital/software-engineering-quality-framework/blob/master/README.md](https://github.com/NHSDigital/software-engineering-quality-framework/blob/master/README.md)) and are automatically redirected to the main branch.
2929

3030
In addition to the guidance from GitHub, developers will need to update local copies of a repository if the "master" branch is renamed - this example is for a renaming from master to main:
3131

32-
```
32+
```bash
3333
git branch -m master main
3434
git fetch origin
3535
git branch -u origin/main main
3636
git remote set-head origin -a
3737
```
38+
3839
## Further reading
3940

4041
* [inclusivenaming.org](https://inclusivenaming.org/word-lists/overview/)
4142
* [Internet Engineering Task Force](https://datatracker.ietf.org/doc/draft-knodel-terminology/)
4243
* [Python](https://bugs.python.org/issue34605)
4344
* [GitHub](https://github.com/github/renaming)
4445
* [NCSC](https://www.ncsc.gov.uk/blog-post/terminology-its-not-black-and-white)
45-

project.code-workspace

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@
6666
"**/target": true,
6767
"**/tmp": true
6868
},
69-
"telemetry.enableCrashReporter": false,
70-
"telemetry.enableTelemetry": false,
7169
"terminal.integrated.fontFamily": "Hack Nerd Font",
7270
"window.title": "${activeEditorMedium}${separator}${rootName}${separator}${rootPath}",
7371
"window.zoomLevel": 0,
@@ -131,35 +129,9 @@
131129
"editor.insertSpaces": true,
132130
"editor.tabSize": 2
133131
},
134-
"yaml.customTags": [
135-
"!And",
136-
"!And sequence",
137-
"!If",
138-
"!If sequence",
139-
"!Not",
140-
"!Not sequence",
141-
"!Equals",
142-
"!Equals sequence",
143-
"!Or",
144-
"!Or sequence",
145-
"!FindInMap",
146-
"!FindInMap sequence",
147-
"!Base64",
148-
"!Join",
149-
"!Join sequence",
150-
"!Cidr",
151-
"!Ref",
152-
"!Sub",
153-
"!Sub sequence",
154-
"!GetAtt",
155-
"!GetAZs",
156-
"!ImportValue",
157-
"!ImportValue sequence",
158-
"!Select",
159-
"!Select sequence",
160-
"!Split",
161-
"!Split sequence"
162-
],
132+
"yaml.schemas": {
133+
"https://json.schemastore.org/github-workflow.json": "file://./.github/workflows/check-markdown.yml"
134+
},
163135
"workbench.colorCustomizations": {
164136
"activityBar.activeBackground": "#1accff",
165137
"activityBar.activeBorder": "#df00ad",
@@ -168,10 +140,7 @@
168140
"activityBar.inactiveForeground": "#15202b99",
169141
"activityBarBadge.background": "#df00ad",
170142
"activityBarBadge.foreground": "#e7e7e7",
171-
"editorGroup.border": "#1accff",
172-
"panel.border": "#1accff",
173143
"sash.hoverBorder": "#1accff",
174-
"sideBar.border": "#1accff",
175144
"statusBar.background": "#00b3e6",
176145
"statusBar.foreground": "#15202b",
177146
"statusBarItem.hoverBackground": "#008bb3",
@@ -182,6 +151,6 @@
182151
"titleBar.inactiveBackground": "#00b3e699",
183152
"titleBar.inactiveForeground": "#15202b99"
184153
},
185-
"peacock.color": "#00b3e6"
154+
"peacock.color": "#00b3e6",
186155
}
187156
}

0 commit comments

Comments
 (0)