git: add pre-commit hook: check format

This commit is contained in:
librelois 2021-03-08 17:48:29 +01:00
parent 31f6bf1032
commit ac99007064
3 changed files with 81 additions and 0 deletions

5
.rusty-hook.toml Normal file
View File

@ -0,0 +1,5 @@
[hooks]
pre-commit = "cargo fmt -- --check && flutter format --set-exit-if-changed lib packages/dubp_rs/lib/dubp.dart"
[logging]
verbose = true

75
Cargo.lock generated
View File

@ -84,6 +84,12 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "autocfg"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
[[package]] [[package]]
name = "base64" name = "base64"
version = "0.13.0" version = "0.13.0"
@ -165,6 +171,15 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "ci_info"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24f638c70e8c5753795cc9a8c07c44da91554a09e4cf11a7326e8161b0a3c45e"
dependencies = [
"envmnt",
]
[[package]] [[package]]
name = "cipher" name = "cipher"
version = "0.2.5" version = "0.2.5"
@ -263,6 +278,7 @@ dependencies = [
"fast-threadpool", "fast-threadpool",
"once_cell", "once_cell",
"parking_lot", "parking_lot",
"rusty-hook",
"thiserror", "thiserror",
] ]
@ -298,6 +314,16 @@ dependencies = [
"cryptoxide", "cryptoxide",
] ]
[[package]]
name = "envmnt"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2d328fc287c61314c4a61af7cfdcbd7e678e39778488c7cb13ec133ce0f4059"
dependencies = [
"fsio",
"indexmap",
]
[[package]] [[package]]
name = "fast-threadpool" name = "fast-threadpool"
version = "0.3.0" version = "0.3.0"
@ -318,6 +344,12 @@ dependencies = [
"spinning_top", "spinning_top",
] ]
[[package]]
name = "fsio"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1fd087255f739f4f1aeea69f11b72f8080e9c2e7645cd06955dad4a178a49e3"
[[package]] [[package]]
name = "futures-micro" name = "futures-micro"
version = "0.3.1" version = "0.3.1"
@ -334,6 +366,15 @@ dependencies = [
"version_check", "version_check",
] ]
[[package]]
name = "getopts"
version = "0.2.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5"
dependencies = [
"unicode-width",
]
[[package]] [[package]]
name = "getrandom" name = "getrandom"
version = "0.2.2" version = "0.2.2"
@ -351,6 +392,12 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
[[package]]
name = "hashbrown"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
[[package]] [[package]]
name = "heck" name = "heck"
version = "0.3.2" version = "0.3.2"
@ -369,6 +416,16 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "indexmap"
version = "1.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3"
dependencies = [
"autocfg",
"hashbrown",
]
[[package]] [[package]]
name = "instant" name = "instant"
version = "0.1.9" version = "0.1.9"
@ -423,6 +480,12 @@ dependencies = [
"cfg-if 0.1.10", "cfg-if 0.1.10",
] ]
[[package]]
name = "nias"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab250442c86f1850815b5d268639dff018c0627022bc1940eb2d642ca1ce12f0"
[[package]] [[package]]
name = "num_cpus" name = "num_cpus"
version = "1.13.0" version = "1.13.0"
@ -567,6 +630,18 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "rusty-hook"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96cee9be61be7e1cbadd851e58ed7449c29c620f00b23df937cb9cbc04ac21a3"
dependencies = [
"ci_info",
"getopts",
"nias",
"toml",
]
[[package]] [[package]]
name = "ryu" name = "ryu"
version = "1.0.5" version = "1.0.5"

View File

@ -23,3 +23,4 @@ dart-bindgen = "0.1.7"
[dev-dependencies] [dev-dependencies]
assert_matches = "1.5.0" assert_matches = "1.5.0"
rusty-hook = "^0.11.2"