Skip to content

Commit be55d68

Browse files
committed
pre-commit hook
1 parent 939981d commit be55d68

4 files changed

Lines changed: 24 additions & 6 deletions

File tree

.githooks/pre-commit

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
set -e pipefail
3+
4+
# Apply formatting
5+
cargo fmt --all || {
6+
echo "❌ Cannot fmt code (run 'cargo fmt --all')"
7+
exit 1
8+
}
9+
10+
# Dependency sorting in Cargo.toml
11+
cargo sort --workspace || {
12+
echo "❌ Cannot sort dependencies (run 'cargo sort --workspace')"
13+
exit 1
14+
}

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ git config commit.gpgsign true
1313
* [Rust](https://www.rust-lang.org/tools/install)
1414
* [cargo deny](https://github.com/EmbarkStudios/cargo-deny)
1515
* [typos](https://github.com/crate-ci/typos?tab=readme-ov-file#install)
16+
* [cargo sort](https://github.com/DevinR528/cargo-sort)
1617

1718
## Code quality assurance
1819

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@ TODO(template) describe the project
55
## TODO(template) - rust template usage (remove this section after setup)
66

77
This is a rust template from ZKE team :rocket: (a focus on cryptographic libs in sync Rust).
8-
To use it - find `TODO(template)` over the repository and set appropriate values.
8+
9+
:bike: To use it - find `TODO(template)` over the repository and set appropriate values.
910

1011
- [ ] Settings -> Collaborators and teams - add your team group as admins for the repo (e.g. [zk-engineering](https://github.com/orgs/NethermindEth/teams/zk-engineering))
1112
- [ ] Settings -> General -> Pull Requests - allow only `Allow squash merging`, also tick `Automatically delete head branches`
1213
- [ ] Settings -> Pages -> Build and deployment -> Source Github Actions
1314
- [ ] Update the description of the repo at the repo's page, add tag topics
1415
- [ ] Introduce necessary sections at the repo's page (releases, deployments etc)
1516
- [ ] Add a website url (if applicable) or a docs page (see [docs](./.github/workflows/docs.yml) flow for public repos)
16-
- [ ] add [all contributors](https://allcontributors.org/docs/en/cli/installation)
17-
- [ ] import protection rulesets (see below) in the repo settings (Settings -> Rules -> Rulesets -> Import a ruleset)
17+
- [ ] Add [all contributors](https://allcontributors.org/docs/en/cli/installation)
18+
- [ ] Import protection rulesets (see below) in the repo settings (Settings -> Rules -> Rulesets -> Import a ruleset)
19+
- [ ] For binary crates with specific requirements to Rust features consider also [pinning](https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file) the rust toolchain version
1820

1921
Main branch protection
2022

@@ -104,7 +106,8 @@ See [examples](./examples/).
104106

105107
## License
106108

107-
TODO(template) - update [license](https://www.notion.so/nethermind/Open-Source-Software-Usage-and-Licensing-Policy-1c3360fc38d080fd9e61c29b35d1d5af) if needed
109+
TODO(template) - update [license](https://www.notion.so/nethermind/Open-Source-Software-Usage-and-Licensing-Policy-1c3360fc38d080fd9e61c29b35d1d5af) if needed.
110+
For commercial licenses it is required to get an approve from Legal.
108111

109112
Apache 2.0
110113

mycrate/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ license.workspace = true
1212
# Use `default-features = false`
1313
# and explicitly list features to prevent code bloat and
1414
# code break after upgrades
15-
thiserror = {version = "1.0", default-features = false }
15+
thiserror = { version = "1.0", default-features = false }
1616

1717
# TODO(template)
1818
# don't forget to put this at every crate
1919
# to inherit workspace's lints
2020
[lints]
21-
workspace = true
21+
workspace = true

0 commit comments

Comments
 (0)