meta: Add pre-commit configuration
This commit is contained in:
parent
495b26bf70
commit
5001988e09
|
@ -0,0 +1,24 @@
|
||||||
|
# See https://pre-commit.com for more information
|
||||||
|
# See https://pre-commit.com/hooks.html for more hooks
|
||||||
|
|
||||||
|
default_stages: [commit]
|
||||||
|
|
||||||
|
repos:
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: nac3-cargo-fmt
|
||||||
|
name: nac3 cargo format
|
||||||
|
entry: cargo
|
||||||
|
language: system
|
||||||
|
types: [file, rust]
|
||||||
|
pass_filenames: false
|
||||||
|
description: Runs cargo fmt on the codebase.
|
||||||
|
args: [fmt]
|
||||||
|
- id: nac3-cargo-clippy
|
||||||
|
name: nac3 cargo clippy
|
||||||
|
entry: cargo
|
||||||
|
language: system
|
||||||
|
types: [file, rust]
|
||||||
|
pass_filenames: false
|
||||||
|
description: Runs cargo clippy on the codebase.
|
||||||
|
args: [clippy]
|
|
@ -314,10 +314,8 @@ fn main() {
|
||||||
StmtKind::ImportFrom { module, names, .. }
|
StmtKind::ImportFrom { module, names, .. }
|
||||||
if module == &Some("__future__".into())
|
if module == &Some("__future__".into())
|
||||||
&& names.len() == 1
|
&& names.len() == 1
|
||||||
&& names[0].name == "annotations".into() =>
|
&& names[0].name == "annotations".into() => {}
|
||||||
{
|
|
||||||
()
|
|
||||||
}
|
|
||||||
_ => {
|
_ => {
|
||||||
let (name, def_id, ty) = composer
|
let (name, def_id, ty) = composer
|
||||||
.register_top_level(stmt, Some(resolver.clone()), "__main__", true)
|
.register_top_level(stmt, Some(resolver.clone()), "__main__", true)
|
||||||
|
|
Loading…
Reference in New Issue