Skip to content

Commit 991a87f

Browse files
authored
Add basic pre commit (#3484)
[43 PRs](https://github.com/bazelbuild/rules_rust/pulls?q=is%3Apr+typo+is%3Aclosed) with the keyword "typo" in the title have been merged. To make the a more scalable solution, I want to introduce pre-commit and starting rolling out https://github.com/crate-ci/typos as a pre-commit hook. In a follow up PR, we can also add a CI for this.
1 parent a4353c8 commit 991a87f

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

.bazelci/presubmit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ single_rust_channel_targets: &single_rust_channel_targets
4141
- "-//test/unpretty/..."
4242
single_rust_channel_min_version_targets: &single_rust_channel_min_version_targets
4343
# START - Copied from 'single_rust_channel_targets'.
44-
# TODO: Figure out how to do proper list inheritence.
44+
# TODO: Figure out how to do proper list inheritance.
4545
- "--"
4646
- "//..."
4747
# TODO: Remove this and replace `cargo_bootstrap_repository` with a

.pre-commit-config.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
default_stages: [pre-commit]
2+
repos:
3+
- repo: meta
4+
hooks:
5+
- id: check-hooks-apply
6+
- id: check-useless-excludes
7+
- repo: https://github.com/crate-ci/typos
8+
rev: v1.33.1
9+
hooks:
10+
- id: typos
11+
exclude: |
12+
(?x)^(
13+
cargo|
14+
crate_universe|
15+
examples|
16+
extensions|
17+
ffi|
18+
nix|
19+
rust|
20+
test|
21+
tools|
22+
util
23+
)

.prettierrc.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# Prettier config file. For more opitons see https://prettier.io/docs/en/options
1+
# Prettier config file. For more options see https://prettier.io/docs/en/options
22
tabWidth = 4
33
trailingComma = "all"

0 commit comments

Comments
 (0)