|
1 | 1 | Some guidelines and tips for development.
|
2 | 2 |
|
3 |
| -### git |
| 3 | +## git |
4 | 4 |
|
5 |
| -1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository. |
6 |
| -2. Make changes on a branch of your choice. Atomic commits are better than clobbering commits. |
7 |
| -3. [Sync your fork](https://help.github.com/articles/syncing-a-fork/) and keep your branch up to date with [master](https://github.com/X1011/git-directory-deploy/tree/master). |
8 |
| -4. [Create a pull request](https://help.github.com/articles/creating-a-pull-request/) to this repository. |
| 5 | +Feel free to [fork](https://help.github.com/articles/fork-a-repo) this repository and [create a pull request](https://help.github.com/articles/creating-a-pull-request). Before making a large change, please open an issue to discuss it. |
9 | 6 |
|
10 |
| -Once a pull request is opened, be careful with `git commit --amend` and `git rebase`. No need to squash a branch into multiple commits, either. When in doubt, preserve your history. |
| 7 | +Make descriptive, granular commits. No need to squash them for the pull request. |
11 | 8 |
|
12 |
| -### syntax & style |
| 9 | +If you drift too far from the master branch, please [merge](https://help.github.com/articles/syncing-a-fork) rather than rebasing. This will preserve the commit history that shows the context in which the code was written. |
| 10 | + |
| 11 | +## style |
13 | 12 |
|
14 | 13 | - Tabs for indenting. Spaces for alignment.
|
15 |
| -- Wrap discrete chunks of code in functions. This makes writing test easier. |
| 14 | +- Wrap discrete chunks of code in functions. This makes writing tests easier. |
16 | 15 | - See [.editorconfig](.editorconfig) for more specifics and exceptions.
|
17 | 16 | - Follow the style you see in the code that's already here.
|
18 | 17 |
|
19 |
| -### testing |
| 18 | +## testing |
20 | 19 |
|
21 | 20 | Have [bats](https://github.com/sstephenson/bats#readme) installed.
|
22 | 21 |
|
23 | 22 | Groups of tests are in `.bats` files in the repository root. You can [run tests manually](https://github.com/sstephenson/bats#running-tests) or use the `./watch` script (requires [`entr`](https://github.com/clibs/entr)) to automatically run them when any file is changed.
|
24 | 23 |
|
25 | 24 | Discrete chunks of code should have a discrete set of tests. If possible, tests should call the relevant function rather than running the whole script.
|
26 | 25 |
|
27 |
| -Write test names so that they tell a story for a test group, and indent each test |
| 26 | +Write test names so that they tell a story for a test group, and indent each test. |
28 | 27 |
|
29 |
| -For anything that involves touching the file system, use `setup()` & `teardown()` functions for the `.bats` file that make the tests run in a temporary folder: |
| 28 | +For anything that involves touching the file system, use `setup()` & `teardown()` functions to create a temporary directory: |
30 | 29 |
|
31 | 30 | ```bash
|
32 | 31 | setup() {
|
|
0 commit comments