Skip to content

Commit

Permalink
Merge branch 'develop' into feat/http-rpc-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jcnelson committed Oct 21, 2023
2 parents 5a41eaa + 5ac03fc commit a6af378
Show file tree
Hide file tree
Showing 400 changed files with 5,726 additions and 7,941 deletions.
2 changes: 1 addition & 1 deletion .github/actions/bitcoin-int-tests/Dockerfile.rustfmt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ RUN rustup component add rustfmt

COPY . .

RUN cargo fmt --all -- --check
RUN cargo fmt --all -- --check --config group_imports=StdExternalCrate,imports_granularity=Module
13 changes: 13 additions & 0 deletions .github/workflows/stacks-blockchain-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ jobs:
- name: Checkout the latest code
id: git_checkout
uses: actions/checkout@v3
- name: Reclaim disk space
id: cleanup
run: |
sudo apt-get update
sudo apt-get remove -y '^dotnet-.*'
sudo apt-get remove -y '^llvm-.*'
sudo apt-get remove -y 'php.*'
sudo apt-get remove -y '^mongodb-.*'
sudo apt-get remove -y '^mysql-.*'
sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri
sudo apt-get autoremove -y
sudo apt-get clean
docker system prune --force
- name: Single full genesis integration test
id: full_genesis_test
env:
Expand Down
17 changes: 11 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ you push your code. Follow these instruction to set it up:
2. Change the content of `.git/hooks/pre-commit` to be the following
```sh
#!/bin/sh
git diff --name-only --staged | grep '\.rs$' | xargs -P 8 -I {} rustfmt {} --edition 2021 --check --config group_imports=StdExternalCrate || (
echo 'rustfmt failed: run "cargo fmt --all -- --config group_imports=StdExternalCrate"';
git diff --name-only --staged | grep '\.rs$' | xargs -P 8 -I {} rustfmt {} --edition 2021 --check --config group_imports=StdExternalCrate,imports_granularity=Module || (
echo 'rustfmt failed: run "cargo fmt --all -- --config group_imports=StdExternalCrate,imports_granularity=Module"';
exit 1
)
```
Expand Down Expand Up @@ -384,19 +384,24 @@ A test should be marked `#[ignore]` if:

## Formatting

This repository uses the default rustfmt formatting style. PRs will be checked against `rustfmt` and will _fail_ if not
properly formatted.
PRs will be checked against `rustfmt` and will _fail_ if not properly formatted.
Unfortunately, some config options that we require cannot currently be set in `.rustfmt` files currently, so arguments must be passed via the command line.
There is a Makefile target to simplify calling `cargo fmt` with the desired config.

You can check the formatting locally via:

```bash
cargo fmt --all -- --check --config group_imports=StdExternalCrate
cargo fmt --all -- --check --config group_imports=StdExternalCrate,imports_granularity=Module
# Or
make fmt-check
```

You can automatically reformat your commit via:

```bash
cargo fmt --all -- --config group_imports=StdExternalCrate
cargo fmt --all -- --config group_imports=StdExternalCrate,imports_granularity=Module
# Or
make fmt
```

## Comments
Expand Down
Loading

0 comments on commit a6af378

Please sign in to comment.