-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
233 additions
and
7 deletions.
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,32 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = true | ||
max_line_length = 100 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
indent_size = unset | ||
max_line_length = 150 | ||
|
||
[{*.yml,*.yaml,*.toml}] | ||
indent_size = 2 | ||
max_line_length = 150 | ||
|
||
# Ignore paths | ||
[{.git/**/*,**/*.lock,LICENSE}] | ||
charset = unset | ||
end_of_line = unset | ||
indent_size = unset | ||
indent_style = unset | ||
insert_final_newline = unset | ||
max_line_length = unset | ||
trim_trailing_whitespace = unset |
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,2 @@ | ||
Copyright (c) Alberto Sonnino | ||
SPDX-License-Identifier: Apache-2.0 |
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,81 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-merge-conflict | ||
- id: check-yaml | ||
- id: trailing-whitespace | ||
- id: check-symlinks | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python | ||
rev: "2.7.3" | ||
hooks: | ||
- id: editorconfig-checker | ||
alias: ec | ||
- repo: https://github.com/notken12/licensesnip | ||
rev: 19b1186 | ||
hooks: | ||
- id: licensesnip | ||
args: [] | ||
pass_filenames: false | ||
- repo: https://github.com/crate-ci/typos | ||
rev: v1.19.0 | ||
hooks: | ||
- id: typos | ||
pass_filenames: false | ||
- repo: https://github.com/DevinR528/cargo-sort | ||
rev: v1.0.9 | ||
hooks: | ||
- id: cargo-sort | ||
args: ["--workspace"] | ||
- repo: https://github.com/EmbarkStudios/cargo-deny | ||
rev: 0.14.19 | ||
hooks: | ||
- id: cargo-deny | ||
- repo: local | ||
hooks: | ||
- id: cargo-fmt | ||
name: cargo-fmt | ||
entry: cargo fmt | ||
args: | ||
- "--" | ||
- "--config" | ||
- "group_imports=StdExternalCrate,imports_granularity=Crate,imports_layout=HorizontalVertical" | ||
language: rust | ||
types: [rust] | ||
pass_filenames: false | ||
- id: cargo-check | ||
name: cargo-check | ||
entry: cargo check | ||
language: rust | ||
files: ^(crates/|Cargo\.(toml|lock)$) | ||
pass_filenames: false | ||
- id: cargo-test | ||
name: cargo-test | ||
entry: cargo test | ||
language: rust | ||
files: ^(crates/|Cargo\.(toml|lock)$) | ||
pass_filenames: false | ||
- id: clippy-with-tests | ||
name: clippy-with-tests | ||
entry: cargo clippy | ||
args: ["--all-features", "--tests", "--", "-D", "warnings"] | ||
language: rust | ||
files: ^(crates/|Cargo\.(toml|lock)$) | ||
pass_filenames: false | ||
- id: clippy | ||
name: clippy | ||
entry: cargo clippy | ||
args: ["--all-features", "--", "-D", "warnings"] | ||
language: rust | ||
files: ^(crates/|Cargo\.(toml|lock)$) | ||
pass_filenames: false | ||
- id: cargo-doc | ||
name: cargo-doc | ||
entry: env RUSTDOCFLAGS="-D warnings" cargo doc | ||
args: ["--workspace", "--no-deps"] | ||
language: rust | ||
files: ^(crates/|Cargo\.(toml|lock)$) | ||
pass_filenames: false |
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,72 @@ | ||
# This section is considered when running `cargo deny check advisories` | ||
# More documentation for the advisories section can be found here: | ||
# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html | ||
[advisories] | ||
version = 2 | ||
ignore = [ | ||
"RUSTSEC-2023-0071", | ||
# Difference 2.0.0 is unmaintained. | ||
"RUSTSEC-2020-0095", | ||
# Rust-yaml is not maintained, but is a dependency in many of our packages. | ||
"RUSTSEC-2024-0320", | ||
# Ignore the h2 advisory as we do not have control over most of the H2 usage. | ||
"RUSTSEC-2024-0332", | ||
] | ||
|
||
# This section is considered when running `cargo deny check licenses` | ||
# More documentation for the licenses section can be found here: | ||
# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html | ||
[licenses] | ||
version = 2 | ||
# List of explicitly allowed licenses | ||
# See https://spdx.org/licenses/ for list of possible licenses | ||
# [possible values: any SPDX 3.11 short identifier (+ optional exception)]. | ||
allow = [ | ||
"Apache-2.0", | ||
"BSD-3-Clause", | ||
"LicenseRef-ring", | ||
"MIT", | ||
"Unicode-DFS-2016", | ||
] | ||
# The confidence threshold for detecting a license from license text. | ||
# The higher the value, the more closely the license text must be to the | ||
# canonical license text of a valid SPDX license file. | ||
# [possible values: any between 0.0 and 1.0]. | ||
confidence-threshold = 0.8 | ||
|
||
[[licenses.clarify]] | ||
name = "ring" | ||
expression = "LicenseRef-ring" | ||
license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }] | ||
|
||
[licenses.private] | ||
# If true, ignores workspace crates that aren't published, or are only | ||
# published to private registries. | ||
# To see how to mark a crate as unpublished (to the official registry), | ||
# visit https://doc.rust-lang.org/cargo/reference/manifest.html#the-publish-field. | ||
ignore = true | ||
|
||
# This section is considered when running `cargo deny check bans`. | ||
# More documentation about the 'bans' section can be found here: | ||
# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html | ||
[bans] | ||
# Lint level for when multiple versions of the same crate are detected | ||
multiple-versions = "deny" | ||
skip = [] | ||
skip-tree = [] | ||
|
||
# This section is considered when running `cargo deny check sources`. | ||
# More documentation about the 'sources' section can be found here: | ||
# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html | ||
[sources] | ||
# Lint level for what to happen when a crate from a crate registry that is not | ||
# in the allow list is encountered | ||
unknown-registry = "deny" | ||
# Lint level for what to happen when a crate from a git repository that is not | ||
# in the allow list is encountered | ||
unknown-git = "deny" | ||
allow-git = [] | ||
|
||
[sources.allow-org] | ||
# 1 or more github.com organizations to allow git sources for | ||
github = ["MystenLabs"] |
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,8 @@ | ||
{ | ||
"use_gitignore": true, | ||
"file_types": { | ||
"move": { | ||
"before_line": "// " | ||
} | ||
} | ||
} |
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
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
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
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
// Copyright (c) Alberto Sonnino | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use std::{ | ||
array, | ||
collections::HashMap, | ||
|
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
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,12 @@ | ||
[default] | ||
workspace = true | ||
skip-clean = true | ||
run-types = ["Bins", "Doctests", "Examples", "Lib", "Tests"] | ||
out = ["Html", "Xml"] | ||
# Don't include test and benchmark code in the coverage result. | ||
exclude-files = [ | ||
"crates/**/benches/**/*", | ||
"crates/**/tests/**/*", | ||
"crates/**/test_utils/**/*", | ||
] | ||
args = ["--include-ignored"] |