Skip to content

Commit

Permalink
Update contributing.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnatsel committed Jul 29, 2024
1 parent a6c1d12 commit 91a1e69
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@ We don't want any bespoke unsafe code in `wondermagick`. We declare `#![forbid(u

We are also cautious with pulling in dependencies that use unsafe code. Any unsafe code that enhances performance should be disabled, with the exception of SIMD intrinsics. Any unsafe code that does get included despite the previous restriction, should be fuzzed with [`cargo fuzz`](https://github.com/rust-fuzz/cargo-fuzz) or an equally capable fuzzer (e.g. AFL) and a fuzzing harness contributed upstream. The project must also have a test suite and run it in CI under Address Sanitizer or [miri](https://github.com/rust-lang/miri). If it does not, please add such a CI setup upstream before adding the dependency to `wondermagick`.

# How to contribute
# How to contribute code

There are two main ways to contribute:
There are two main ways to contribute code:

1. Improve crates such as `image` that `wondermagick` relies on
1. Improve crates such as `image` that `wondermagick` relies on. See [here](https://github.com/Shnatsel/wondermagick/issues/1) for a list of things we need.
1. Add new commands to `wondermagick`

## How to add new commands

1. Add the operation to the `Operation` enum in `src/operations/mod.rs`
1. Add the flag to the `Arg` enum in `src/args.rs`
1. Follow the trail of compiler errors and fix all of them. That should be it!

`wondermagick` commands should be backed by algorithms available elsewhere, not just in `wondermagick`. If you are contributing e.g. a blur implementation, ideally it should be in `image` or `imageproc`. If you really need to write it yourself and contributing to an existing crate is not an option (e.g. the maintainers rejected it), please structure it as a separate crate within this repository.

Command implementations go in `src/operations/`. To add the command-line argument for it and wire it up to the rest of `wondermagick`, add your argument to the `Arg` enum in `src/args.rs` and follow the trail of compiler errors. Once it compiles, you're done!

0 comments on commit 91a1e69

Please sign in to comment.