summaryrefslogtreecommitdiff
path: root/CONTRIBUTING.md
blob: 243de096a51b3c44038be056f008b11b71a6837d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Contributing

By reading this document, you have already entered the Elite Hall
of Ziglings Maintenance!


## The Ziglings Audience

Ziglings is intended for programmers of all experience levels. No
specific language knowledge is expected. Anyone who can install
the current Zig snapshot, setup a copy of Ziglings, and knows
common language building blocks (if/then/else, loops, and
functions) is ready for Ziglings.

Ziglings is intended to be completely self-contained. If you
can't solve an exercise from the information you've gleaned so
far from Ziglings, then the exercise probably needs some
additional work. Please file an issue!

If an example doesn't match a description or if something is
unclear, please file an issue!


## Spelling/Grammar

If you see any typos, please file an issue...or make a pull
request!

No mistake is too small. The Ziglings must be perfect. :-)


## Ideas

If you have ideas for new lessons or a way Ziglings could be
improved, don't hesitate to file an issue.

Feel free to submit new exercises but please understand that they
may be heavily edited or rejected entirely if we feel they don't
fit for one reason or another.

## Platforms and Zig Versions


Because it uses the Zig build system, Ziglings should work
wherever Zig does.

Since Ziglings is a Zig language learning resource, it tracks the
current development snapshots of Zig from the official website
downloads page.

If you run into an error in Ziglings caused by breaking changes
in the latest development build of Zig, that's a new bug in
Ziglings. Please file an issue...or make a pull request!
For the latter, also read "The Secrets” section.


## Formatting

All exercises should conform to `zig fmt`.


## Pull Request Workflow

Ziglings uses the "standard" Codeberg workflow as guided by the Web
interface.  Specifically:

* Fork this repository
* Create a branch from `main` for your work:
      `git checkout -b my-branch`
* Make changes, commit them
* When your changes are ready for review, push your branch:
      `git push origin my-branch`
* Create a pull request from your branch to `ziglings/main`
* Your faithful Ziglings maintainers will take a look at your
  request ASAP (we don't talk about May-July, LOL)
* Once the changes are reviewed, your request will be merged and
  eternal Ziglings contributor glory is yours!


## Licence

If you submit your contribution to the repository/project,
you agree that your contribution will be licensed under
the license of this repository/this project.
Please note, it does not change your rights to use your own
contribution for any other purpose.


## The Secrets

If you want to peek at the secrets, take a look at the `patches/`
directory.

Every Ziglings exercise contains mistakes on purpose.
To keep our automated tests happy, each exercise also
has a patch in `patches/healed` that “heals” it.

When you change an exercise, you’ll usually need to update
its patch too. That’s where our little helper Gollum comes in:

  1. In the project root, create a folder called answers/.
  2. Put your solved version of the exercise file in there.
  3. Back in the root, run:
     `./patches/gollum <exercise-number>`
     For example: ./patches/gollum 106
     This will generate a shiny new patch.

Double-check everything by asking the magical Eowyn:
     `./patches/eowyn`

If all tests pass: 🎉 You’re done!
Don’t forget to commit the patch file.