Skip to content

Commit 66e7397

Browse files
committed
refactor: add Prettier
1 parent bbb0fc3 commit 66e7397

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+4610
-4188
lines changed

CHANGELOG.md

Lines changed: 219 additions & 204 deletions
Large diffs are not rendered by default.

CODE_OF_CONDUCT.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo
88

99
Examples of behavior that contributes to creating a positive environment include:
1010

11-
* Using welcoming and inclusive language
12-
* Being respectful of differing viewpoints and experiences
13-
* Gracefully accepting constructive criticism
14-
* Focusing on what is best for the community
15-
* Showing empathy towards other community members
11+
- Using welcoming and inclusive language
12+
- Being respectful of differing viewpoints and experiences
13+
- Gracefully accepting constructive criticism
14+
- Focusing on what is best for the community
15+
- Showing empathy towards other community members
1616

1717
Examples of unacceptable behavior by participants include:
1818

19-
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20-
* Trolling, insulting/derogatory comments, and personal or political attacks
21-
* Public or private harassment
22-
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23-
* Other conduct which could reasonably be considered inappropriate in a professional setting
19+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
- Trolling, insulting/derogatory comments, and personal or political attacks
21+
- Public or private harassment
22+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
- Other conduct which could reasonably be considered inappropriate in a professional setting
2424

2525
## Our Responsibilities
2626

CONTRIBUTING.md

Lines changed: 84 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ We'd love for you to contribute to our source code and to make DADI API even bet
66

77
Here are the guidelines we'd like you to follow:
88

9-
- [Question or Problem?](#question)
10-
- [Issues and Bugs](#issue)
11-
- [Feature Requests](#feature)
12-
- [Submission Guidelines](#submit)
13-
- [Coding Rules](#rules)
14-
- [Git Commit Guidelines](#commit)
9+
- [Question or Problem?](#question)
10+
- [Issues and Bugs](#issue)
11+
- [Feature Requests](#feature)
12+
- [Submission Guidelines](#submit)
13+
- [Coding Rules](#rules)
14+
- [Git Commit Guidelines](#commit)
1515

1616
## <a name="question"></a> Got a Question or Problem?
1717

@@ -21,75 +21,80 @@ If the documentation doesn't answer your problem please feel free to email the
2121
DADI team directly on: team@dadi.tech, or join us on [Slack](http://dadi-chat.herokuapp.com).
2222

2323
## <a name="issue"></a> Found an Issue?
24+
2425
If you find a bug in the source code or a mistake in the documentation, you can help us by
2526
submitting an issue to our [GitHub Repository][github]. But we'd love it if you
2627
submitted a Pull Request with a fix instead!
2728

2829
**Please see the Submission Guidelines below**.
2930

3031
## <a name="feature"></a> Want a Feature?
32+
3133
You can request a new feature by submitting an issue to our [GitHub][issues] issue tracker.
3234
If you would like to implement a new feature then consider what kind of change it is:
3335

34-
* **Major Changes** that you wish to contribute to the project should be added as
35-
a Feature Request in the [GitHub][issues] issue tracker. This will get the conversation
36-
started.
37-
* **Small Changes** can be crafted and submitted to the [GitHub Repository][github] as a Pull Request.
36+
- **Major Changes** that you wish to contribute to the project should be added as
37+
a Feature Request in the [GitHub][issues] issue tracker. This will get the conversation
38+
started.
39+
- **Small Changes** can be crafted and submitted to the [GitHub Repository][github] as a Pull Request.
3840

3941
## <a name="submit"></a> Submission Guidelines
4042

4143
### Submitting an Issue
44+
4245
Before you submit your issue [search the archive][issues], maybe your question was already answered.
4346

4447
If your issue appears to be a bug, and hasn't been reported, open a new issue.
4548
Help us to maximize the effort we can spend fixing issues and adding new
46-
features, by not reporting duplicate issues. Providing the following information will increase the
49+
features, by not reporting duplicate issues. Providing the following information will increase the
4750
chances of your issue being dealt with quickly:
4851

49-
* **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps
50-
* **Motivation for or Use Case** - explain why this is a bug for you
51-
* **DADI API Version**
52-
* **Operating System**
53-
* **Steps to Reproduce** - provide a set of steps to follow to reproduce the error.
54-
* **Related Issues** - has a similar issue been reported before?
55-
* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
52+
- **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps
53+
- **Motivation for or Use Case** - explain why this is a bug for you
54+
- **DADI API Version**
55+
- **Operating System**
56+
- **Steps to Reproduce** - provide a set of steps to follow to reproduce the error.
57+
- **Related Issues** - has a similar issue been reported before?
58+
- **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
5659
causing the problem (e.g. a line of code or a commit)
5760

5861
### Submitting a Pull Request
62+
5963
Before you submit your pull request consider the following guidelines:
6064

61-
* Search [GitHub][pulls] for an open or closed Pull Request
65+
- Search [GitHub][pulls] for an open or closed Pull Request
6266
that relates to your submission. You don't want to duplicate effort.
63-
* Fork the original repository and clone your fork ([see this GitHub article](https://help.github.com/articles/fork-a-repo/)).
64-
* Add the original repository as an upstream remote: `git remote add upstream https://github.com/dadi/api.git`
65-
66-
* Make your changes in a new git branch. Name your branch using the format `topic/branch_name`.
67-
Use `fix` for fixes and `feature` for features:
68-
69-
```shell
70-
git checkout -b fix/my-fix-branch master
71-
```
72-
```shell
73-
git checkout -b feature/my-new-feature-branch master
74-
```
75-
76-
* Create your patch, **including appropriate test cases**.
77-
* Follow our [Coding Rules](#rules).
78-
* Run the full test suite using `npm test` and ensure that all tests pass.
79-
* Commit your changes using a descriptive commit message that follows our
67+
- Fork the original repository and clone your fork ([see this GitHub article](https://help.github.com/articles/fork-a-repo/)).
68+
- Add the original repository as an upstream remote: `git remote add upstream https://github.com/dadi/api.git`
69+
70+
- Make your changes in a new git branch. Name your branch using the format `topic/branch_name`.
71+
Use `fix` for fixes and `feature` for features:
72+
73+
```shell
74+
git checkout -b fix/my-fix-branch master
75+
```
76+
77+
```shell
78+
git checkout -b feature/my-new-feature-branch master
79+
```
80+
81+
- Create your patch, **including appropriate test cases**.
82+
- Follow our [Coding Rules](#rules).
83+
- Run the full test suite using `npm test` and ensure that all tests pass.
84+
- Commit your changes using a descriptive commit message that follows our
8085
[commit message conventions](#commit-message-format) and passes our commit message presubmit hook. Adherence to the [commit message conventions](#commit-message-format) is required because release notes are automatically generated from these messages.
81-
* Push your branch to GitHub:
86+
- Push your branch to GitHub:
8287

8388
```shell
8489
git push origin fix/my-fix-branch
8590
```
8691

87-
* In GitHub, send a pull request to `dadi/api:master`.
88-
* If we suggest changes then:
89-
* Make the required updates.
90-
* Re-run the full test suite to ensure tests are still passing.
91-
* Commit your changes to your branch (e.g. `fix/my-fix-branch`).
92-
* Push the changes to GitHub (this will update your Pull Request).
92+
- In GitHub, send a pull request to `dadi/api:master`.
93+
- If we suggest changes then:
94+
- Make the required updates.
95+
- Re-run the full test suite to ensure tests are still passing.
96+
- Commit your changes to your branch (e.g. `fix/my-fix-branch`).
97+
- Push the changes to GitHub (this will update your Pull Request).
9398

9499
If the pull request gets too outdated we may ask you to rebase and force push to update the pull request:
95100

@@ -98,50 +103,51 @@ git rebase master -i
98103
git push origin fix/my-fix-branch -f
99104
```
100105

101-
*WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.*
106+
_WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits._
102107

103-
* Documentation! Please add relevant documentation to the pull request. If this is a new feature then
104-
please document it fully within the pull request. If you're making changes to an existing feature, please
105-
give us a link to the existing [documentation][docs] along with your documentation changes. If you need
106-
an example of excellent pull request documentation, have a look at the [effort put in here](https://github.com/dadi/api/pull/27).
108+
- Documentation! Please add relevant documentation to the pull request. If this is a new feature then
109+
please document it fully within the pull request. If you're making changes to an existing feature, please
110+
give us a link to the existing [documentation][docs] along with your documentation changes. If you need
111+
an example of excellent pull request documentation, have a look at the [effort put in here](https://github.com/dadi/api/pull/27).
107112

108113
> That's it! Thank you for your contribution!
109114
110115
#### After your pull request is merged
111116

112117
After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:
113118

114-
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
119+
- Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
115120

116121
```shell
117122
git push origin --delete my-fix-branch
118123
```
119124

120-
* Check out the master branch:
125+
- Check out the master branch:
121126

122127
```shell
123128
git checkout master -f
124129
```
125130

126-
* Delete the local branch:
131+
- Delete the local branch:
127132

128133
```shell
129134
git branch -D my-fix-branch
130135
```
131136

132-
* Update your master with the latest upstream version:
137+
- Update your master with the latest upstream version:
133138

134139
```shell
135140
git pull --ff upstream master
136141
```
137142

138143
## <a name="rules"></a> Coding Rules
144+
139145
To ensure consistency throughout the source code, keep these rules in mind as you are working:
140146

141-
* Please use **two-space indentation**, as used in Node.JS itself.
142-
* All features or bug fixes **must be tested** by one or more tests. Browse the [test
143-
suite][tests] for examples.
144-
* All public API methods **must be documented** with [JSDoc](http://usejsdoc.org/).
147+
- Please use **two-space indentation**, as used in Node.JS itself.
148+
- All features or bug fixes **must be tested** by one or more tests. Browse the [test
149+
suite][tests] for examples.
150+
- All public API methods **must be documented** with [JSDoc](http://usejsdoc.org/).
145151

146152
## <a name="commit"></a> Git Commit Guidelines
147153

@@ -153,7 +159,7 @@ Please don't include more than one change in each patch. If your commit message
153159

154160
### Commit Message Format
155161

156-
We have very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that are easy to follow when looking through the **project history**. We also use the git commit messages to **generate the change log**.
162+
We have very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that are easy to follow when looking through the **project history**. We also use the git commit messages to **generate the change log**.
157163

158164
We use [husky](https://www.npmjs.com/package/husky) and [validate-commit-msg](https://github.com/kentcdodds/validate-commit-msg) to perform the commit message validation. Commit messages will be validated when you commit. When validation fails, you'll see a message similar to the following:
159165

@@ -169,7 +175,7 @@ Any line of the commit message cannot be longer 100 characters. This allows the
169175

170176
#### Message Format
171177

172-
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type** and a **subject**:
178+
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type** and a **subject**:
173179

174180
```
175181
type: subject
@@ -181,43 +187,47 @@ Close #yyy
181187
Ref #zzz
182188
```
183189

184-
* Use `Fix #xxx` when the commit fixes an open issue.
185-
* Use `Close #xxx` when the commit closes an open pull request.
186-
* Use `Ref #xxx` when referencing an issue or pull request that is already closed or should remain open. Examples include partial fixes and commits that add a test but not a fix.
190+
- Use `Fix #xxx` when the commit fixes an open issue.
191+
- Use `Close #xxx` when the commit closes an open pull request.
192+
- Use `Ref #xxx` when referencing an issue or pull request that is already closed or should remain open. Examples include partial fixes and commits that add a test but not a fix.
187193

188194
### Reverting
189-
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
195+
196+
If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
190197

191198
### Type
199+
192200
Must be one of the following:
193201

194-
* **feat**: A new feature
195-
* **fix**: A bug fix
196-
* **docs**: Documentation only changes
197-
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
198-
* **refactor**: A code change that neither fixes a bug nor adds a feature
199-
* **perf**: A code change that improves performance
200-
* **test**: Adding missing tests
201-
* **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
202+
- **feat**: A new feature
203+
- **fix**: A bug fix
204+
- **docs**: Documentation only changes
205+
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
206+
- **refactor**: A code change that neither fixes a bug nor adds a feature
207+
- **perf**: A code change that improves performance
208+
- **test**: Adding missing tests
209+
- **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
202210

203211
### Subject
212+
204213
The subject contains a succinct description of the change:
205214

206-
* use the imperative, present tense: "fix" not "fixed" nor "fixes"
207-
* don't capitalize first letter
208-
* no dot (.) at the end
215+
- use the imperative, present tense: "fix" not "fixed" nor "fixes"
216+
- don't capitalize first letter
217+
- no dot (.) at the end
209218

210219
### Body
220+
211221
Just as in the **subject**, write your commit message in the imperative: "Fix bug" and not "Fixed bug" or "Fixes bug". This convention matches up with commit messages generated by commands like `git merge` and `git revert`.
212222

213223
The body should include the motivation for the change and contrast this with previous behavior.
214224

215225
### Footer
226+
216227
The footer should contain any information about **Breaking Changes** and is also the place to reference GitHub issues that this commit **Closes**.
217228

218229
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
219230

220-
221231
[github]: https://github.com/dadi/api
222232
[issues]: https://github.com/dadi/api/issues
223233
[pulls]: https://github.com/dadi/api/pulls

0 commit comments

Comments
 (0)