From 7f7cbae8cc49742ba722bb136d51f4b879a0707e Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Wed, 23 Feb 2022 00:20:44 +0100 Subject: [PATCH 1/2] docs: update readme and changelog --- CONTRIBUTING.md | 42 ++++++++++++++++++++++++++++++++++++------ README.md | 21 +++++---------------- 2 files changed, 41 insertions(+), 22 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bef20c82d4..0c8774fc5a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,15 +1,45 @@ -# Contributing to Anchor +
+ + +

Anchor

+
+
Thank you for your interest in contributing to Anchor! All contributions are welcome no matter how big or small. This includes (but is not limited to) filing issues, adding documentation, fixing bugs, creating examples, and implementing features. -If you'd like to contribute, please claim an issue by commenting, forking, and -opening a pull request, even if empty. This allows the maintainers to track who -is working on what issue as to not overlap work. If you're looking to get started, +## Finding issues to work on + +If you're looking to get started, check out [good first issues](https://github.com/project-serum/anchor/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) or issues where [help is wanted](https://github.com/project-serum/anchor/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22). -For simple documentation changes, feel free to just open a pull request. +For simple documentation changes or typos, feel free to just open a pull request. If you're considering larger changes or self motivated features, please file an issue -and engage with the maintainers in [Discord](https://discord.com/channels/889577356681945098). +and engage with the maintainers in [Discord](https://discord.gg/sxy4zxBckh). + +## Choosing an issue + +If you'd like to contribute, please claim an issue by commenting, forking, and +opening a pull request, even if empty. This allows the maintainers to track who +is working on what issue as to not overlap work. + +## Issue Guidelines + +Please follow these guidelines: + +Before coding: +- choose a branch name that describes the issue you're working on + +While coding: +- Submit a draft PR asap +- Only change code directly relevant to your PR. Sometimes you might find some code that could really need some refactoring. However, if it's not relevant to your PR, do not touch it. File an issue instead. This allows the reviewer to focus on a single problem at a time. +- If you write comments, do not exceed 80 chars per line. This allows contributors who work with multiple open windows to still read the comments without horizontally scrolling. +- Write adversarial tests. For example, if you're adding a new account type, do not only write tests where the instruction succeeds. Also write tests that test whether the instruction fails, if a check inside the new type is violated. + +After coding: +- If you've moved code around, build the docs with `cargo doc --open` and adjust broken links +- Adjust the cli templates if necessary +- If you made a change to anchor's periphery (avm or cli), make a PR to the `anchor-book` repo if necessary +- If you've added a new folder to the `tests` directory, add it to the [CI](./.github/workflows/tests.yaml). \ No newline at end of file diff --git a/README.md b/README.md index 7b4685beb0..5c2945a736 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ If you're familiar with developing in Ethereum's [Solidity](https://docs.solidit ## Getting Started -For a quickstart guide and in depth tutorials, see the guided [documentation](https://project-serum.github.io/anchor/getting-started/introduction.html). +For a quickstart guide and in depth tutorials, see the [anchor book](https://book.anchor-lang.com) and the older [documentation](https://project-serum.github.io/anchor/getting-started/introduction.html) that is being phased out. To jump straight to examples, go [here](https://github.com/project-serum/anchor/tree/master/examples). For the latest Rust and TypeScript API documentation, see [docs.rs](https://docs.rs/anchor-lang) and the [typedoc](https://project-serum.github.io/anchor/ts/index.html). ## Packages @@ -58,14 +58,14 @@ declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"); mod counter { use super::*; - pub fn initialize(ctx: Context, start: u64) -> ProgramResult { + pub fn initialize(ctx: Context, start: u64) -> Result<()> { let counter = &mut ctx.accounts.counter; counter.authority = *ctx.accounts.authority.key; counter.count = start; Ok(()) } - pub fn increment(ctx: Context) -> ProgramResult { + pub fn increment(ctx: Context) -> Result<()> { let counter = &mut ctx.accounts.counter; counter.count += 1; Ok(()) @@ -107,19 +107,8 @@ licensed as above, without any additional terms or conditions. ## Contribution -Thank you for your interest in contributing to Anchor! All contributions are welcome no -matter how big or small. This includes (but is not limited to) filing issues, -adding documentation, fixing bugs, creating examples, and implementing features. - -If you'd like to contribute, please claim an issue by commenting, forking, and -opening a pull request, even if empty. This allows the maintainers to track who -is working on what issue as to not overlap work. If you're looking to get started, -check out [good first issues](https://github.com/project-serum/anchor/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) -or issues where [help is wanted](https://github.com/project-serum/anchor/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22). -For simple documentation changes, feel free to just open a pull request. - -If you're considering larger changes or self motivated features, please file an issue -and engage with the maintainers in [Discord](https://discord.gg/sxy4zxBckh). +Thank you for your interest in contributing to Anchor! +Please see the [CONTRIBUTING.md](./CONTRIBUTING.md) to learn how. ### Thanks ❤️ From f9629f0fff1e8ae483aacdc35693aa3710690e0a Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Wed, 23 Feb 2022 00:39:37 +0100 Subject: [PATCH 2/2] contributign --- CONTRIBUTING.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0c8774fc5a..c9e19cab6b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,9 +1,4 @@ -
- - -

Anchor

-
-
+# Contributing to Anchor Thank you for your interest in contributing to Anchor! All contributions are welcome no matter how big or small. This includes (but is not limited to) filing issues,