-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Add CONTRIBUTING.md #272
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d79e166
Initial CONTRIBUTING.md
paul-hansen 068ed5a
Remove lines about Cargo.lock that I'm not sure are true
paul-hansen f160d8a
Remove common issues section for now
paul-hansen 4ea0cb6
Add a link to CONTRIBUTING in the README
paul-hansen e0d0fb8
Tweak to say PR title matters for changelogs not commit title
paul-hansen 3d0d616
Add a chapter about issues
DataTriny 4e80b60
Update the chapter about Cargo.lock
DataTriny 4424f57
Update the Changelog chapter
DataTriny d2383c8
Update the tests chapter
DataTriny 5e8a77e
Add a checklist for pull requests
DataTriny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Contributing to AccessKit | ||
|
||
## Making a Pull Request | ||
|
||
### Cargo.lock File | ||
|
||
AccessKit intentionally includes the `Cargo.lock` file in our git repository. | ||
This is mainly due to our bindings to other languages. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A better defense of why this is needed might be a good addition here. I don't know the specific reason myself so this was the best I had. |
||
|
||
Usually you should not run cargo update when creating a pull request even when adding/changing a dependency. | ||
Simply building the library should update the `Cargo.lock` file with the minimal changes needed. | ||
|
||
> [!NOTE] | ||
> This is not normal / best practice for most libraries. | ||
> If you are writing your own library, your `Cargo.lock` file is not used when the library is included in another project. | ||
> This means your CI will be testing with an out of date set of dependencies compared to your users, missing potential problems. | ||
> See the [official documentation](https://doc.rust-lang.org/cargo/faq.html#why-do-binaries-have-cargolock-in-version-control-but-not-libraries) for more information. | ||
|
||
### CHANGELOG.md | ||
|
||
Our CHANGELOG.md files are auto generated using [Release Please](https://github.com/googleapis/release-please) and should not be edited manually. | ||
|
||
To control what is in the CHANGELOG.md for your change, use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) when writing your commit messages. | ||
paul-hansen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
#### Example Commit Messages | ||
Taken from [Conventional Commits documentation](https://www.conventionalcommits.org/en/v1.0.0/#summary): | ||
> feat: allow provided config object to extend other configs | ||
> | ||
> BREAKING CHANGE: `extends` key in config file is now used for extending other config files | ||
|
||
> fix: prevent racing of requests | ||
> | ||
> Introduce a request id and a reference to latest request. Dismiss | ||
incoming responses other than from latest request. | ||
DataTriny marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Testing Locally | ||
|
||
We have some platform specific tests that are not run with `cargo test` from the project root by default. | ||
|
||
1. Run test that work on all platforms | ||
``` shell | ||
cargo test | ||
``` | ||
2. Run platform specific tests. | ||
|
||
Run the appropriate command for your platform | ||
``` shell | ||
cargo test -p accesskit_windows | ||
cargo test -p accesskit_unix | ||
cargo test -p accesskit_macos | ||
``` | ||
Not all platforms have tests at this time, but they may in the future. | ||
|
||
> [!WARNING] | ||
> **Windows**: Some tests may fail if the created window looses focus while testing. This can also happen when using the terminal built into your IDE. Try running them from your native terminal if you get failures. | ||
|
||
### Common issues | ||
|
||
#### CI Errors | ||
|
||
If you get an error in the CI step `Run cmake --build build` that includes near the end of the error: | ||
``` | ||
ERROR: Couldn't generate bindings for /home/runner/work/accesskit/accesskit/bindings/c. | ||
``` | ||
Somewhere in the big block of text in the error message it also says: | ||
``` | ||
unknown feature `proc_macro_span_shrink` | ||
``` | ||
|
||
This is likely not an issue with your PR and just means `proc-macro2` needs to be updated in our Cargo.lock file. | ||
You probably want to make this change in a separate PR as `proc-macro2` can update often and your PR could become out of date if it takes a while to be reviewed. | ||
paul-hansen marked this conversation as resolved.
Show resolved
Hide resolved
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A welcoming message, perhaps including something about what types of contributions you are looking for / open to would be fitting to have here.
Felt like it would be disingenuous if I tried to write one as I'm not a regular maintainer.