Skip to content

Commit 24e1374

Browse files
authored
Merge pull request #208 from NHSDigital/dev/NPA-5063_Run_Prettier
NPA-5054 Add Prettier Commit Check
2 parents 7667530 + 4705531 commit 24e1374

File tree

11 files changed

+133
-104
lines changed

11 files changed

+133
-104
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ If applicable, add screenshots to help explain your problem.
2525

2626
**Desktop (please complete the following information):**
2727

28-
- OS: [e.g. iOS]
29-
- Browser: [e.g. chrome, safari]
30-
- Version: [e.g. 22]
28+
- OS: [e.g. iOS]
29+
- Browser: [e.g. chrome, safari]
30+
- Version: [e.g. 22]
3131

3232
**Smartphone (please complete the following information):**
3333

34-
- Device: [e.g. iPhone6]
35-
- OS: [e.g. iOS8.1]
36-
- Browser: [e.g. stock browser, safari]
37-
- Version: [e.g. 22]
34+
- Device: [e.g. iPhone6]
35+
- OS: [e.g. iOS8.1]
36+
- Browser: [e.g. stock browser, safari]
37+
- Version: [e.g. 22]
3838

3939
**Additional context**
4040
Add any other context about the problem here.

.github/pull_request_template.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ Stages to complete before opening the Pull Request:
4242

4343
:information_source: This section is to be filled in by the **reviewer**.
4444

45-
- [ ] I have reviewed the changes in this PR and they fill all or part of the acceptance criteria of the ticket, and the code is in a mergeable state.
46-
- [ ] If there were infrastructure, operational, or build changes, I have made sure there is sufficient evidence that the changes will work.
47-
- [ ] I have ensured the changelog has been updated by the submitter, if necessary.
45+
- [ ] I have reviewed the changes in this PR and they fill all or part of the acceptance criteria of the ticket, and the code is in a mergeable state.
46+
- [ ] If there were infrastructure, operational, or build changes, I have made sure there is sufficient evidence that the changes will work.
47+
- [ ] I have ensured the changelog has been updated by the submitter, if necessary.
4848

4949
## Post-merge
5050

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Prettier Checks
2+
on:
3+
pull_request:
4+
branches: [master]
5+
permissions:
6+
contents: read
7+
jobs:
8+
PrettierChecks:
9+
name: Prettier Checks
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
persist-credentials: false
17+
- name: Setup Node
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 22
21+
22+
- name: Install dependencies
23+
shell: bash
24+
run: npm install
25+
26+
- name: Run Prettier
27+
shell: bash
28+
run: npx prettier --check .

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.yaml
2+
*.yml
3+
postman/*
4+
*.js

.vscode/extensions.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
{
2-
"recommendations": [
3-
"mermade.openapi-lint",
4-
"42Crunch.vscode-openapi"
5-
]
2+
"recommendations": ["mermade.openapi-lint", "42Crunch.vscode-openapi"]
63
}

CODE_OF_CONDUCT.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
1414
Examples of behaviour that contributes to creating a positive environment
1515
include:
1616

17-
- Using welcoming and inclusive language
18-
- Being respectful of differing viewpoints and experiences
19-
- Gracefully accepting constructive criticism
20-
- Focusing on what is best for the community
21-
- Showing empathy towards other community members
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
2222

2323
Examples of unacceptable behaviour by participants include:
2424

25-
- The use of sexualized language or imagery and unwelcome sexual attention or
26-
advances
27-
- Trolling, insulting/derogatory comments, and personal or political attacks
28-
- Public or private harassment
29-
- Publishing others' private information, such as a physical or electronic
30-
address, without explicit permission
31-
- Other conduct which could reasonably be considered inappropriate in a
32-
professional setting
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
3333

3434
## Our Responsibilities
3535

CONTRIBUTING.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
> [!WARNING]
44
> Some of the documentation and links in this file are specific to the maintainers of this repository and are only available to NHS England staff.
55
6-
- [Contribution Guidelines](#contribution-guidelines)
7-
- [Raising an Issue](#raising-an-issue)
8-
- [Contributing code](#contributing-code)
9-
- [Merge responsibility](#merge-responsibility)
10-
- [Branch naming](#branch-naming)
11-
- [Developers within the NHS](#developers-within-the-nhs)
12-
- [Developers outside of the NHS](#developers-outside-of-the-nhs)
13-
- [Commit messages](#commit-messages)
14-
- [Developers within the NHS](#developers-within-the-nhs-1)
15-
- [Developers outside of the NHS](#developers-outside-of-the-nhs-1)
6+
- [Contribution Guidelines](#contribution-guidelines)
7+
- [Raising an Issue](#raising-an-issue)
8+
- [Contributing code](#contributing-code)
9+
- [Merge responsibility](#merge-responsibility)
10+
- [Branch naming](#branch-naming)
11+
- [Developers within the NHS](#developers-within-the-nhs)
12+
- [Developers outside of the NHS](#developers-outside-of-the-nhs)
13+
- [Commit messages](#commit-messages)
14+
- [Developers within the NHS](#developers-within-the-nhs-1)
15+
- [Developers outside of the NHS](#developers-outside-of-the-nhs-1)
1616

1717
## Raising an Issue
1818

@@ -29,9 +29,9 @@ so please explain why the changes need to be made (unless it is self-evident).
2929

3030
### Merge responsibility
3131

32-
- It is the responsibility of the reviewer to merge branches they have approved.
33-
- It is the responsibility of the author of the merge to ensure their merge is in a mergeable state.
34-
- It is the responsibility of the maintainers to ensure the merge process is unambiguous and automated where possible.
32+
- It is the responsibility of the reviewer to merge branches they have approved.
33+
- It is the responsibility of the author of the merge to ensure their merge is in a mergeable state.
34+
- It is the responsibility of the maintainers to ensure the merge process is unambiguous and automated where possible.
3535

3636
### Branch naming
3737

DEVELOPMENT_GUIDE.md

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@ This documentation is intended for developers to develop the schema, sandbox and
77
88
## Table of Contents
99

10-
- [Development Guide](#development-guide)
11-
- [Table of Contents](#table-of-contents)
12-
- [Development](#development)
13-
- [Requirements](#requirements)
14-
- [Make commands](#make-commands)
15-
- [Testing](#testing)
16-
- [Platform setup](#platform-setup)
17-
- [Detailed folder walk through](#detailed-folder-walk-through)
18-
- [`/.github`:](#github)
19-
- [`/azure`:](#azure)
20-
- [`/proxies`:](#proxies)
21-
- [`/scripts`:](#scripts)
22-
- [`/specification`:](#specification)
23-
- [`/tests`:](#tests)
24-
- [`Makefile`:](#makefile)
25-
- [`ecs-proxies-containers.yml ` and `ecs-proxies-deploy.yml`:](#ecs-proxies-containersyml--and-ecs-proxies-deployyml)
26-
- [`manifest_template.yml`:](#manifest_templateyml)
27-
- [Releasing a new schema version](#releasing-a-new-schema-version)
28-
- [Caveats](#caveats)
29-
- [Swagger UI](#swagger-ui)
30-
- [Apigee Portal](#apigee-portal)
10+
- [Development Guide](#development-guide)
11+
- [Table of Contents](#table-of-contents)
12+
- [Development](#development)
13+
- [Requirements](#requirements)
14+
- [Make commands](#make-commands)
15+
- [Testing](#testing)
16+
- [Platform setup](#platform-setup)
17+
- [Detailed folder walk through](#detailed-folder-walk-through)
18+
- [`/.github`:](#github)
19+
- [`/azure`:](#azure)
20+
- [`/proxies`:](#proxies)
21+
- [`/scripts`:](#scripts)
22+
- [`/specification`:](#specification)
23+
- [`/tests`:](#tests)
24+
- [`Makefile`:](#makefile)
25+
- [`ecs-proxies-containers.yml ` and `ecs-proxies-deploy.yml`:](#ecs-proxies-containersyml--and-ecs-proxies-deployyml)
26+
- [`manifest_template.yml`:](#manifest_templateyml)
27+
- [Releasing a new schema version](#releasing-a-new-schema-version)
28+
- [Caveats](#caveats)
29+
- [Swagger UI](#swagger-ui)
30+
- [Apigee Portal](#apigee-portal)
3131

3232
## Development
3333

@@ -36,22 +36,22 @@ This documentation is intended for developers to develop the schema, sandbox and
3636
3737
### Requirements
3838

39-
- GNU make
40-
- nodejs 22+
41-
- npm 10.8+
42-
- Python 3.8 +
43-
- [poetry](https://github.com/python-poetry/poetry) 1.8+
44-
- Java 8+
39+
- GNU make
40+
- nodejs 22+
41+
- npm 10.8+
42+
- Python 3.8 +
43+
- [poetry](https://github.com/python-poetry/poetry) 1.8+
44+
- Java 8+
4545

4646
### Make commands
4747

4848
To run the below make targets you will first need to run `make install-node`
4949

5050
There are `make` commands that alias scripts in the `package.json`
5151

52-
- `lint` -- Lints the spec and code
53-
- `publish` -- Outputs the specification as a **single file** into the `build/` directory
54-
- `serve` -- Serves a preview of the specification in human-readable format
52+
- `lint` -- Lints the spec and code
53+
- `publish` -- Outputs the specification as a **single file** into the `build/` directory
54+
- `serve` -- Serves a preview of the specification in human-readable format
5555

5656
### Testing
5757

@@ -77,19 +77,19 @@ For further information about Apigee and APIM see [API Producer Zone confluence]
7777

7878
`/.github/workflows`: This folder contains GitHub workflows, these workflow are mainly used to check pull requests and publish releases.
7979

80-
- `pr-lint.yaml`: This workflow links Pull Request's to Jira tickets and runs when a pull request is opened/updated.
81-
- `continuous-integration.yml`: This workflow publishes a Github release when pushing to master.
82-
- `sandbox-checks.yaml`: This workflow checks the sandbox meets the formatting and linting rules (Black + Flake8). Also it runs the sandbox unit tests (Pytest)
83-
- `dependency-review.yml`: This workflow checks for any vulnerabilities in dependencies to be added to the project.
84-
- `codeql-analysis.yml`: This workflow checks for any code vulnerabilities in the project.
80+
- `pr-lint.yaml`: This workflow links Pull Request's to Jira tickets and runs when a pull request is opened/updated.
81+
- `continuous-integration.yml`: This workflow publishes a Github release when pushing to master.
82+
- `sandbox-checks.yaml`: This workflow checks the sandbox meets the formatting and linting rules (Black + Flake8). Also it runs the sandbox unit tests (Pytest)
83+
- `dependency-review.yml`: This workflow checks for any vulnerabilities in dependencies to be added to the project.
84+
- `codeql-analysis.yml`: This workflow checks for any code vulnerabilities in the project.
8585

8686
#### `/azure`:
8787

8888
Contains Azure Devops pipelines for building and deploying to Apigee:
8989

90-
- `azure-build-pipeline.yml`: Assembles the contents of your repository into a single file ("artifact") on Azure Devops and pushes any containers to our Docker registry. This pipeline is enabled for all branches.
91-
- `azure-pr-pipeline.yml`: Deploys ephemeral versions of your proxy/spec to Apigee (and docker containers on AWS) to internal environments. This will deploy a internal-dev environment and internal-dev-sandbox for each pull request.
92-
- `azure-release-pipeline.yml`: Deploys the long-lived version of your pipeline to internal and external environments, when you merge to master.
90+
- `azure-build-pipeline.yml`: Assembles the contents of your repository into a single file ("artifact") on Azure Devops and pushes any containers to our Docker registry. This pipeline is enabled for all branches.
91+
- `azure-pr-pipeline.yml`: Deploys ephemeral versions of your proxy/spec to Apigee (and docker containers on AWS) to internal environments. This will deploy a internal-dev environment and internal-dev-sandbox for each pull request.
92+
- `azure-release-pipeline.yml`: Deploys the long-lived version of your pipeline to internal and external environments, when you merge to master.
9393

9494
`/azure/templates`: Here you can define reusable actions, such as running tests, and call these actions during Azure Devops pipelines.
9595

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ This repository does _not_ include the Validated Relationship Service FHIR API b
88

99
## Table of Contents
1010

11-
- [Validated Relationship Service API](#validated-relationship-service-api)
12-
- [Table of Contents](#table-of-contents)
13-
- [Repository Structure](#repository-structure)
14-
- [Contributing](#contributing)
15-
- [Development \& Testing](#development--testing)
16-
- [Licensing](#licensing)
11+
- [Validated Relationship Service API](#validated-relationship-service-api)
12+
- [Table of Contents](#table-of-contents)
13+
- [Repository Structure](#repository-structure)
14+
- [Contributing](#contributing)
15+
- [Development \& Testing](#development--testing)
16+
- [Licensing](#licensing)
1717

1818
## Repository Structure
1919

2020
This repository includes:
2121

22-
- [specification/validated-relationships-service-api.yaml](./specification/validated-relationships-service-api.yaml) - The [Open API Specification](https://swagger.io/docs/specification/about/) describes the endpoints, methods and messages exchanged by the API. Used to generate interactive documentation for the NHS API Catalogue; the contract between the API and its consumers.
23-
- `sandbox/` - A flask (Python) API that implements a mock implementation of the service. It's to be used as interactive documentation to illustrate interactions and concepts. It is not intended to provide an exhaustive/faithful environment suitable for full development and testing.
24-
- `scripts/` - Utilities helpful to developers for the development and release of the specification.
25-
- `proxies/` - Live and sandbox Apigee API Proxy definitions.
22+
- [specification/validated-relationships-service-api.yaml](./specification/validated-relationships-service-api.yaml) - The [Open API Specification](https://swagger.io/docs/specification/about/) describes the endpoints, methods and messages exchanged by the API. Used to generate interactive documentation for the NHS API Catalogue; the contract between the API and its consumers.
23+
- `sandbox/` - A flask (Python) API that implements a mock implementation of the service. It's to be used as interactive documentation to illustrate interactions and concepts. It is not intended to provide an exhaustive/faithful environment suitable for full development and testing.
24+
- `scripts/` - Utilities helpful to developers for the development and release of the specification.
25+
- `proxies/` - Live and sandbox Apigee API Proxy definitions.
2626

2727
## Contributing
2828

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ reproduce it.
1919

2020
You can reach us at:
2121

22-
23-
22+
23+
2424

2525
### HackerOne
2626

0 commit comments

Comments
 (0)