Skip to content

Commit c92f2e5

Browse files
st--willtebbuttdevmotion
authored
Contributing guidelines (#251)
* initial notes on how to make a release * add colprac and other links * rename to uppercase * clarify versioning * PR template * Makefile example * add formatting * Apply suggestions from code review Co-authored-by: willtebbutt <wct23@cam.ac.uk> * Apply suggestions from code review Co-authored-by: willtebbutt <wct23@cam.ac.uk> * Update Makefile Co-authored-by: David Widmann <devmotion@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: David Widmann <devmotion@users.noreply.github.com> Co-authored-by: willtebbutt <wct23@cam.ac.uk> Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
1 parent 3028ecc commit c92f2e5

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
New? Check CONTRIBUTING.md!

CONTRIBUTING.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Contribution guidelines
2+
3+
We follow the [ColPrac guide for collaborative practices](https://colprac.sciml.ai/). New contributors should make sure to read the [first section](https://github.com/SciML/ColPrac#colprac-contributors-guide-on-collaborative-practices-for-community-packages) of that guide, but could also read the [Further Guidance](https://github.com/SciML/ColPrac#colprac-further-guidance) section if interested.
4+
5+
6+
# Workflows
7+
8+
9+
## Creating a new [pull request](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)
10+
11+
### Bumping the version number
12+
13+
When contributing a PR, bump the version number (defined by `version = "..."` at the top of the base `Project.toml`) accordingly (as explained by the [guidance on the versioning scheme](https://colprac.sciml.ai/#incrementing-the-package-version) in the ColPrac guide).
14+
If unsure about what the new version should be, please just open the PR anyway -- existing contributors will provide a suggestion.
15+
16+
### Running tests locally
17+
18+
Firstly, run `using Pkg; Pkg.develop("KernelFunctions")` at the Julia REPL, and navigate to `~/.julia/dev/KernelFunctions`.
19+
20+
Running `make test` will now run the entire test suite.
21+
These tests can take a long time to run, so it's often a good idea to simply comment out the blocks of tests not required in `test/runtests.jl`.
22+
Test files are paired 1-1 with source files, so if you're modifying code in `src/foo.jl`, you should only need to run the tests in `test/foo.jl` during development.
23+
24+
### Code formatting
25+
26+
Run `make format` before pushing your changes.
27+
28+
29+
### How to make a new release (for organization members)
30+
31+
We use [JuliaRegistrator](https://github.com/JuliaRegistries/Registrator.jl#via-the-github-app):
32+
33+
On Github, go to the commit that you want to register (this should normally be the commit of a squash-merged pull request on the `master` branch that has bumped the version number) and add a comment saying `@JuliaRegistrator register`.
34+
35+
The next release will then be processed automatically. KernelFunctions.jl does use TagBot so you can ignore the message about tagging. Note that it may take around 20 minutes until the actual release appears and you can edit the release notes if needed.

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
JULIA=$(shell which julia)
2+
3+
.PHONY: help format test
4+
5+
help:
6+
@echo "The following make targets are available:"
7+
@echo " format auto-format code"
8+
@echo " test run all tests"
9+
10+
format:
11+
@if [ "$(JULIA)" = "" ]; then echo 'Julia not found; run `make JULIA=/path/to/julia format`'; exit 1; fi
12+
$(JULIA) -e 'using Pkg; Pkg.activate(; temp=true); Pkg.add("JuliaFormatter"); using JuliaFormatter; format(".")'
13+
14+
test:
15+
@if [ "$(JULIA)" = "" ]; then echo 'Julia not found; run `make JULIA=/path/to/julia test`'; exit 1; fi
16+
$(JULIA) --project=. -e 'using Pkg; Pkg.test()'

0 commit comments

Comments
 (0)