Skip to content

Commit

Permalink
ci: add pre-commit lints
Browse files Browse the repository at this point in the history
  • Loading branch information
domodwyer committed Jan 2, 2021
1 parent 4c9abf1 commit 8339e3c
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 1 deletion.
72 changes: 72 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# pre-commit configuration
#
# Uses https://pre-commit.com/
#
# Install with:
# pre-commit install -t pre-commit
# pre-commit install -t pre-push
# pre-commit install -t commit-msg
# pre-commit install -t post-checkout
#
# Requires:
# - rust (cargo & clippy in path)
# - https://github.com/commitizen-tools/commitizen
#
# To run manually:
# pre-commit run --all

repos:
- repo: https://github.com/domodwyer/pre-commit
rev: v3.1.1
hooks:
- id: rust-check
stages: [commit, push]

- id: rust-clippy
args: [
"-D rust_2018_idioms",
"-D missing_debug_implementations",
"-D unreachable_pub",
"-D missing_docs",
"-A clippy::missing_docs_in_private_items",
"-D clippy::todo",
"-D clippy::dbg_macro",
]
stages: [commit, push]

- id: rust-test
stages: [commit, push]

- id: todo-branch-tags
stages: [post-checkout]
args: ["[0-9]+"]

- id: todo-tags
stages: [push, manual]
types: [rust]
args: ["--regex=([0-9]+|dom)"]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
hooks:
- id: check-executables-have-shebangs
stages: [commit, manual]
- id: check-json
stages: [commit, manual]
- id: check-yaml
args: ["--allow-multiple-documents"]
stages: [commit, manual]
- id: check-merge-conflict
stages: [commit, manual]
- id: mixed-line-ending
args: ["--fix=no"]
stages: [commit, manual]
# - id: no-commit-to-branch
# args: ["--branch", "master"]
# stages: [commit]

- repo: https://github.com/commitizen-tools/commitizen
rev: v2.11.0
hooks:
- id: commitizen
stages: [commit-msg]
2 changes: 1 addition & 1 deletion src/bloom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::collections::hash_map::RandomState;
use std::hash::{BuildHasher, Hash, Hasher};
use std::marker::PhantomData;

// TODO: AND, OR, XOR, NOT + examples
// TODO(dom): AND, OR, XOR, NOT + examples

// [`Bloom2`]: crate::bloom2::Bloom2
// [`BloomFilterBuilder`]: crate::BloomFilterBuilder
Expand Down

0 comments on commit 8339e3c

Please sign in to comment.