Skip to content

Commit

Permalink
doc: update contrib docs
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions authored and seanmonstar committed Jan 20, 2024
1 parent 2f74552 commit fac1ea7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
26 changes: 26 additions & 0 deletions _contrib/code-style.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: Code Style
layout: guide
hyper_path: docs/CODE_STYLE.md
---

hyper uses the default configuration of `rustfmt`.

## cargo fmt

`cargo fmt --all` does not work in hyper. Please use the following commands:

```txt
# Mac or Linux
rustfmt --check --edition 2018 $(git ls-files '*.rs')
# Powershell
Get-ChildItem . -Filter "*.rs" -Recurse | foreach { rustfmt --check --edition 2018 $_.FullName }
```

> **NOTE**: If you are using `rust-analyzer`, you can add the following two lines in your `settings.json` to make sure the features get taken into account when checking the project:
>
> ```json
> "rust-analyzer.cargo.features": ["full"],
> "rust-analyzer.check.features": ["full"],
> ```
19 changes: 0 additions & 19 deletions _contrib/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,3 @@ You want to contribute? You're awesome! Don't know where to start? Check the [li

- [Submitting a Pull Request](pull-requests.md#submitting-a-pull-request)
- [Commit Guidelines](commits.md)

## Cargo fmt

`cargo fmt --all` does not work in hyper. Please use the following commands:

```txt
# Mac or Linux
rustfmt --check --edition 2018 $(git ls-files '*.rs')
# Powershell
Get-ChildItem . -Filter "*.rs" -Recurse | foreach { rustfmt --check --edition 2018 $_.FullName }
```

> **NOTE**: If you are using `rust-analyzer`, you can add the following two lines in your `settings.json` to make sure the features get taken into account when checking the project:
>
> ```json
> "rust-analyzer.cargo.features": ["full"],
> "rust-analyzer.check.features": ["full"],
> ```

0 comments on commit fac1ea7

Please sign in to comment.