|
2 | 2 |
|
3 | 3 | Thank you for your interest in contributing to `zizmor`!
|
4 | 4 |
|
5 |
| -The information below will help you set up a local development environment, |
6 |
| -as well as with performing common development tasks. |
| 5 | +This is intended to be a "high-level" guide with some suggestions |
| 6 | +for ways to contribute. Once you've picked a contribution idea, |
| 7 | +please see our [development docs] |
| 8 | +for concrete guidance on specific development tasks (such as building `zizmor` |
| 9 | +itself or the documentation website). |
7 | 10 |
|
8 |
| -This is intended to be a "high-level" guide; for concrete development |
9 |
| -goals (such as modifying an audit or contributing a new audit), |
10 |
| -please see our [development docs](./docs/DEVELOPMENT.md). |
| 11 | +## How to contribute |
11 | 12 |
|
12 |
| -## Requirements |
| 13 | +Here's a short list of steps you can follow to contribute: |
13 | 14 |
|
14 |
| -`zizmor`'s only development requirement the Rust compiler. |
| 15 | +1. *Figure out what you want to contribute.* See the |
| 16 | + [contribution ideas](#contribution-ideas) section below if you're looking |
| 17 | + for ideas! |
| 18 | +2. *File or reply to an issue, if appropriate.* Some contributions require |
| 19 | + new issues (like new bugs), while others involve an existing issue |
| 20 | + (like known documentation defects). Others don't require an issue at all, |
| 21 | + like small typo fixes. In general, if you aren't sure, *error on the side |
| 22 | + of making or replying to an issue* — it helps maintain shared |
| 23 | + development context. |
| 24 | +3. *Hack away.* Once you know what you're working on, refer to our |
| 25 | + [development docs] for help with specific development tasks. And don't be |
| 26 | + afraid to ask for help! |
15 | 27 |
|
16 |
| -You can install Rust by following the steps on [Rust's official website]. |
| 28 | +## Contribution ideas |
17 | 29 |
|
18 |
| -[Rust's official website]: https://www.rust-lang.org/tools/install |
| 30 | +Here are some ways that you can contribute to `zizmor`. These aren't the only |
| 31 | +ways; they're just for inspiration. |
19 | 32 |
|
20 |
| -## Development steps |
| 33 | +### Good first issues |
21 | 34 |
|
22 |
| -To get started, you'll need to clone the repository and perform a debug build: |
| 35 | +We use the ["good first issue"] label to track issues that we think are |
| 36 | +(somewhat) easy and/or straightforward, making them good choices for an |
| 37 | +early contribution. |
23 | 38 |
|
24 |
| -```bash |
25 |
| -git clone https://github.com/woodruffw/zizmor |
26 |
| -cd zizmor |
27 |
| -cargo build |
28 |
| -``` |
| 39 | +To work on one of these, **please leave a comment** on its issue before opening |
| 40 | +a pull request to make sure nobody else duplicates your work! |
29 | 41 |
|
30 |
| -Once `cargo build` completes, you should have a functional development |
31 |
| -build of `zizmor`! |
| 42 | +["good first issue"]: https://github.com/woodruffw/zizmor/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 |
32 | 43 |
|
33 |
| -```bash |
34 |
| -# cargo run -- --help also works |
35 |
| -./target/debug/zizmor --help |
36 |
| -``` |
| 44 | +### Writing documentation |
37 | 45 |
|
38 |
| -## Linting |
| 46 | +One of the best ways to help us with `zizmor` is to help us improve our |
| 47 | +documentation! |
39 | 48 |
|
40 |
| -`zizmor` is linted with `cargo clippy` and auto-formatted with `cargo fmt`. |
41 |
| -Our CI enforces both, but you should also run them locally to minimize |
42 |
| -unnecessary review cycles: |
| 49 | +Here are some things we could use help with: |
43 | 50 |
|
44 |
| -```bash |
45 |
| -cargo fmt |
46 |
| -cargo clippy --fix |
47 |
| -``` |
| 51 | +* Improving our [CLI usage recipes](https://woodruffw.github.io/zizmor/usage/). |
| 52 | +* Improving the detail in our |
| 53 | + [audit documentation pages](https://woodruffw.github.io/zizmor/audits/). |
| 54 | +* Improving our internal (Rust API) documentation, especially in conjunction |
| 55 | + with more unit tests. |
48 | 56 |
|
49 |
| -## Testing |
| 57 | +More generally, see [issues labeled with `documentation`] for a potential |
| 58 | +list of documentation efforts to contribute on. |
50 | 59 |
|
51 |
| -`zizmor` uses `cargo test`: |
| 60 | +[issues labeled with `documentation`]: https://github.com/woodruffw/zizmor/issues?q=is%3Aissue+is%3Aopen+label%3Adocumentation |
52 | 61 |
|
53 |
| -```bash |
54 |
| -cargo test |
55 |
| -``` |
| 62 | +### Writing unit tests |
56 | 63 |
|
57 |
| -## Development practices |
| 64 | +We can always use more unit tests! Pick a part of the Rust codebase and |
| 65 | +start testing. |
58 | 66 |
|
59 |
| -Here are some guidelines to follow if you're working on `zizmor`: |
| 67 | +Keep the cardinal rule of unit testing in mind: a unit test must test |
| 68 | +**a single unit** of behavior. If it tests more than one unit, then |
| 69 | +consider making it an integration test instead. |
| 70 | + |
| 71 | +### Reducing false positives/negatives in audits |
| 72 | + |
| 73 | +Static analysis is inherently imprecise, and `zizmor` is no exception. |
| 74 | + |
| 75 | +We track imprecision bugs with the ["false positive"] and ["false negative"] |
| 76 | +labels. These can sometimes be tricky to address, so we recommend |
| 77 | +(but don't require) leaving an explanatory comment on the issue before |
| 78 | +beginning a pull request. |
| 79 | + |
| 80 | +["false positive"]: https://github.com/woodruffw/zizmor/issues?q=is%3Aopen+label%3Afalse-positive |
| 81 | + |
| 82 | +["false negative"]: https://github.com/woodruffw/zizmor/issues?q=is%3Aopen+label%3Afalse-negative |
| 83 | + |
| 84 | +[development docs]: https://woodruffw.github.io/zizmor/development/ |
60 | 85 |
|
61 |
| -* *Document internal APIs*. `zizmor` doesn't have a public Rust API (yet), |
62 |
| - but the internal APIs should be documented *as if* they might become public |
63 |
| - one day. Plus, well-documented internals make life easier for new |
64 |
| - contributors. |
65 |
| -* *Write unit tests*. It's easy for small changes in `zizmor`'s internals to |
66 |
| - percolate into large bugs (e.g. incorrect location information); help us |
67 |
| - catch these bugs earlier by testing your changes at the smallest unit of |
68 |
| - behavior. |
69 |
| -* *Test on real inputs*. If you're contributing to or adding a new audit, |
70 |
| - make sure your analysis is reliable and accurate on non-sample inputs. |
|
0 commit comments