Skip to content

Commit

Permalink
Merge branch 'main' into feature/binstall-support
Browse files Browse the repository at this point in the history
  • Loading branch information
simonsan authored Aug 21, 2023
2 parents 49702a9 + 7338c8d commit bf73dc8
Show file tree
Hide file tree
Showing 21 changed files with 521 additions and 257 deletions.
6 changes: 3 additions & 3 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[build]
#rustflags = "-C target-cpu=native -D warnings"
#incremental = true
# [build]
# rustflags = "-C target-cpu=native -D warnings"
# incremental = true

# TODO: Introduced for `cargo public-api` test,
# remove when it is working on sparse registry
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/lint-markdown-toml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Lint Markdown / Toml

on:
push:
branches: [main]
pull_request:

jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: dprint/check@v2.2
109 changes: 75 additions & 34 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@ We appreciate your help in making this project better.

## Code of Conduct

Please review and abide by the general Rust Community [Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct) when contributing to this project. In the future, we might create our own Code of Conduct and supplement it at this location.
Please review and abide by the general Rust Community
[Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct) when
contributing to this project. In the future, we might create our own Code of
Conduct and supplement it at this location.

## How to Contribute

### Reporting Bugs

If you find a bug, please open an [issue on GitHub](https://github.com/rustic-rs/rustic/issues/new/choose) and provide as much detail as possible. Include steps to reproduce the bug and the expected behavior.
If you find a bug, please open an
[issue on GitHub](https://github.com/rustic-rs/rustic/issues/new/choose) and
provide as much detail as possible. Include steps to reproduce the bug and the
expected behavior.

### Issue and Pull Request labels

Expand All @@ -51,25 +57,40 @@ WG - Working group

### Suggesting Enhancements

If you have an idea for an enhancement or a new feature, we'd love to hear it! Open an [issue on GitHub](https://github.com/rustic-rs/rustic/issues/new/choose) and describe your suggestion in detail.
If you have an idea for an enhancement or a new feature, we'd love to hear it!
Open an [issue on GitHub](https://github.com/rustic-rs/rustic/issues/new/choose)
and describe your suggestion in detail.

### Code Style and Formatting

We follow the Rust community's best practices for code style and formatting. Before submitting code changes, please ensure your code adheres to these guidelines:
We follow the Rust community's best practices for code style and formatting.
Before submitting code changes, please ensure your code adheres to these
guidelines:

- Use `rustfmt` to format your code. You can run it with the following command:

```bash
cargo fmt --all
```

- Write clear and concise code with meaningful, self-describing variable and function names. This tells the reader **what** the code does.
- Use `dprint` to format text in markdown, toml, and json. You can install it
with `cargo install dprint` and run it with the following command in the
repository root:

- Write clear and consise comments to tell the reader **why** you chose to implement it that way and **which** problem it solves.
```bash
dprint fmt
```

- Write clear and concise code with meaningful, self-describing variable and
function names. This tells the reader **what** the code does.

- Write clear and consise comments to tell the reader **why** you chose to
implement it that way and **which** problem it solves.

### Testing

We value code quality and maintainability. If you are adding new features or making changes, please include relevant unit tests. Run the test suite with:
We value code quality and maintainability. If you are adding new features or
making changes, please include relevant unit tests. Run the test suite with:

```bash
cargo test --workspace
Expand Down Expand Up @@ -101,32 +122,40 @@ To contribute code changes, follow these steps:
git push origin feature/your-feature-name
```

5. **Open** a Pull Request (PR) to our repository. Please include a detailed description of the changes and reference any related issues.
5. **Open** a Pull Request (PR) to our repository. Please include a detailed
description of the changes and reference any related issues.

#### `Release early and often!` also applies to pull requests

Consider drafting a Pull request early in the development process, so we can follow your progress and can give early feedback.
Consider drafting a Pull request early in the development process, so we can
follow your progress and can give early feedback.

Once your PR is submitted, it will be reviewed by the maintainers. We may suggest changes or ask for clarifications before merging.
Once your PR is submitted, it will be reviewed by the maintainers. We may
suggest changes or ask for clarifications before merging.

#### IMPORTANT NOTE

Please don't force push commits in your branch, in order to keep commit history and make it easier for us to see changes between reviews.
Please don't force push commits in your branch, in order to keep commit history
and make it easier for us to see changes between reviews.
Make sure to Allow edits of maintainers (under the text box) in the PR so people can actually collaborate on things or fix smaller issues themselves.
Make sure to Allow edits of maintainers (under the text box) in the PR so people
can actually collaborate on things or fix smaller issues themselves.
#### Rebasing and other workflows
(taken from: [openage on rebasing](https://github.com/SFTtech/openage/blob/master/doc/contributing.md#rebasing))
(taken from:
[openage on rebasing](https://github.com/SFTtech/openage/blob/master/doc/contributing.md#rebasing))
**Rebasing** is 'moving' your commits to a different parent commit.
In other words: *Cut off* your branch from its tree, and *attach it* somewhere else.
In other words: *Cut off* your branch from its tree, and *attach it* somewhere
else.
There's two main applications:

- If you based your work on a older master (so old that stuff can't be automatically merged),
you can rebase to move your commits to the current [upstream](https://help.github.com/articles/fork-a-repo/) master:
- If you based your work on a older master (so old that stuff can't be
automatically merged), you can rebase to move your commits to the current
[upstream](https://help.github.com/articles/fork-a-repo/) master:
```bash
# update the upstream remote to receive new commits
Expand All @@ -142,8 +171,9 @@ git branch my-awesome-feature-backup
git rebase -m upstream/master
```
- If you want to fix an older commit of yours, or merge several commits into a single one (**squash** them), rebase interactively.
We ***don't*** want to have a commit history like this:
- If you want to fix an older commit of yours, or merge several commits into a
single one (**squash** them), rebase interactively. We ***don't*** want to
have a commit history like this:
- `add stuff`
- `fix typo in stuff`
Expand All @@ -153,17 +183,18 @@ git rebase -m upstream/master
##### `rebase` in practice
`git log --graph --oneline` shows your commit history as graph.
To make some changes in that graph, you do an **interactive rebase**:
`git log --graph --oneline` shows your commit history as graph. To make some
changes in that graph, you do an **interactive rebase**:
```sh
git rebase -i -m upstream/master
```
With this command, your new "base" is `upstream/master` and you can
then change any of your branch's commits.
With this command, your new "base" is `upstream/master` and you can then change
any of your branch's commits.
`-i` will open an interactive editor where you can choose actions for each individual commit:
`-i` will open an interactive editor where you can choose actions for each
individual commit:
- re-order commits
- drop commits by deleting their line
Expand All @@ -175,10 +206,13 @@ Just follow the messages on screen.
##### Changing commits with `amend` and `fixup`
There's also `git commit --amend` which is a "mini-rebase" that modifies just the last commit with your current changes by `git add`.
It just skips the creation of a new commit and instead melds the changes into the last one you made.
There's also `git commit --amend` which is a "mini-rebase" that modifies just
the last commit with your current changes by `git add`. It just skips the
creation of a new commit and instead melds the changes into the last one you
made.
If you want to update a single commit in the range `[upstream/master, current HEAD]` which is not the last commit:
If you want to update a single commit in the range
`[upstream/master, current HEAD]` which is not the last commit:
- `edit stuff you wanna change in some previous commit`
- `git add changed_stuff`
Expand All @@ -187,15 +221,19 @@ If you want to update a single commit in the range `[upstream/master, current HE
##### Pushing changes
After you have rebased stuff (["rewritten history"](https://www.youtube.com/watch?v=9lXuZHkOoH8)) that had already been pushed,
git will not accept your pushes because they're not simple fast-forwards:
After you have rebased stuff
(["rewritten history"](https://www.youtube.com/watch?v=9lXuZHkOoH8)) that had
already been pushed, git will not accept your pushes because they're not simple
fast-forwards:
- The commit contents and the parent commit have changed as you updated the commit, therefore the commit hash changed, too.
- If somebody used those commits, they will keep a copy
and have a hard time updating to your updated version (because they "use" the old hashes).
- The commit contents and the parent commit have changed as you updated the
commit, therefore the commit hash changed, too.
- If somebody used those commits, they will keep a copy and have a hard time
updating to your updated version (because they "use" the old hashes).
- Update your pull request branch with your re-written history!
- **force push** is the standard way of overwriting your development work with the fixed and mergeable version of your contribution!
- **force push** is the standard way of overwriting your development work with
the fixed and mergeable version of your contribution!
- Why? You changed the commits, so you want the old ones to be deleted!
You can use any of:
Expand All @@ -211,11 +249,14 @@ Some extra tutorials on `git rebase`:
## Development Setup
If you want to set up a local development environment, follow the steps in the [development guide](/docs/dev/development_guide.md) file - which is currently being worked on.
If you want to set up a local development environment, follow the steps in the
[development guide](/docs/dev/development_guide.md) file - which is currently
being worked on.
## License
By contributing to `rustic` or any crates contained in this repository, you agree that your contributions will be licensed under:
By contributing to `rustic` or any crates contained in this repository, you
agree that your contributions will be licensed under:
- [Apache License, Version 2.0](./LICENSE-APACHE)
- [MIT license](./LICENSE-MIT).
Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bf73dc8

Please sign in to comment.