summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.md118
-rw-r--r--README.md8
2 files changed, 119 insertions, 7 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..acf7220
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,118 @@
1## Contributing
2
3First off, thank you for considering contributing to snuffleupagus.
4
5### 1. Where do I go from here?
6
7If you've noticed a bug or have a question,
8look at the [faq](https://snuffleupagus.readthedocs.io/faq.html) and
9[search the issue tracker](https://github.com/nbs-system/snuffleupagus/issues)
10to see if someone else has already created a ticket. If not, go ahead and
11[make one](https://github.com/nbs-system/snuffleupagus/issues/new)!
12
13### 2. Fork & create a branch
14
15If this is something you think you can fix,
16then [fork snuffleupagus](https://help.github.com/articles/fork-a-repo) and
17create a branch with a descriptive name.
18
19A good branch name would be (where issue #325 is the ticket you're working on):
20
21```sh
22git checkout -b 325-kill-sql-injections
23```
24
25### 3. Get the test suite running
26
27Just type `make coverage` or `make debug`, the testsuite should be run
28automatically.
29
30### 4. Did you find a bug?
31
32* **Ensure the bug was not already reported** by
33 [searching all issues](https://github.com/nbs-system/snuffleupagus/issues?q=).
34* If you're unable to find an open issue addressing the problem,
35 [open a new one](https://github.com/nbs-system/snuffleupagus/issues/new).
36 Be sure to include a **title and clear description**,
37 as much relevant information as possible, and a **code sample**
38 or an **executable test case** demonstrating the expected behavior that is not
39 occurring.
40
41
42### 5. Get the style right
43
44Your patch should follow the same conventions & pass the same code quality
45checks as the rest of the project. We're using [clang-format](http://clang.llvm.org/docs/ClangFormat.html) to
46ensure a consistent code-style. Please run it with `clang-format -style=google`
47before committing, or even better, use a [pre-commit hook](https://github.com/andrewseidl/githook-clang-format).
48
49### 6. Make a Pull Request
50
51At this point, you should switch back to your master branch and make sure it's
52up to date with Active Admin's master branch:
53
54```sh
55git remote add upstream git@github.com:nbs-system/snuffleupagus.git
56git checkout master
57git pull upstream master
58```
59
60Then update your feature branch from your local copy of master, and push it!
61
62```sh
63git checkout 325-kill-sql-injections
64git rebase master
65git push --set-upstream origin 325-kill-sql-injections
66```
67
68Finally, go to GitHub and [make a Pull Request](https://help.github.com/articles/creating-a-pull-request) :D
69
70Travis CI will run our test suite against all supported PHP versions. We care
71about quality, so your PR won't be merged until all tests pass. It's unlikely,
72but it's possible that your changes pass tests in one PHP version but fail in
73another. In that case, you'll have to setup your development environment
74to use the problematic PHP version, and investigate
75what's going on!
76
77### 7. Keeping your Pull Request updated
78
79If a maintainer asks you to "rebase" your PR, they're saying that a lot of code
80has changed, and that you need to update your branch so it's easier to merge.
81
82To learn more about rebasing in Git, there are a lot of [good](http://git-scm.com/book/en/Git-Branching-Rebasing)
83[resources](https://help.github.com/articles/interactive-rebase) but here's the suggested workflow:
84
85```sh
86git checkout 325-kill-sql-injections
87git pull --rebase upstream master
88git push --force-with-lease 325-kill-sql-injections
89```
90
91### 8. Merging a PR (maintainers only)
92
93A PR can only be merged into master by a maintainer if:
94
95* It is passing CI.
96* It has been approved by at least two maintainers. If it was a maintainer who
97 opened the PR, only one extra approval is needed.
98* It has no requested changes.
99* It is up to date with current master.
100
101Any maintainer is allowed to merge a PR if all of these conditions are
102met.
103
104### 9. Shipping a release (maintainers only)
105
106Maintainers need to do the following to push out a release:
107
108* Make sure all pull requests are in and that changelog is current
109* Update `snuggleupagus.h` file and changelog with new version number
110* Create a stable branch for that release:
111
112 ```sh
113 git pull master
114 make coverage
115 git tag -s $MAJOR.$MINOR.$PATCH
116 git push --tags
117 ```
118* Do the *secret release dance* \ No newline at end of file
diff --git a/README.md b/README.md
index f516dfc..fcb336f 100644
--- a/README.md
+++ b/README.md
@@ -13,10 +13,4 @@ classes, and also providing a powerful virtual-patching system, allowing
13administrator to fix specific vulnerabilities and audit suspicious behaviours 13administrator to fix specific vulnerabilities and audit suspicious behaviours
14without having to touch the PHP code. 14without having to touch the PHP code.
15 15
16You can read its documentation [here](https://snuffleupagus.readthedocs.io/). 16You can read its documentation [here](https://snuffleupagus.readthedocs.io/). \ No newline at end of file
17
18# Code style
19
20We're using [clang-format](http://clang.llvm.org/docs/ClangFormat.html) to
21ensure a consistent code-style. Please run it with `clang-format -style=google`
22before committing, or even better, use a [pre-commit hook](https://github.com/andrewseidl/githook-clang-format)