Skip to content

Commit

Permalink
Add pre-commit / typos (#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sixty committed May 15, 2024
1 parent b51a5d8 commit bc73039
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 5 deletions.
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: end-of-file-fixer
exclude: '(.*\.snap)'
- id: check-yaml
- id: mixed-line-ending
- repo: https://github.com/crate-ci/typos
rev: v1.20.10
hooks:
- id: typos
# https://github.com/crate-ci/typos/issues/347
pass_filenames: false
- repo: https://github.com/rhysd/actionlint
rev: v1.6.27
hooks:
- id: actionlint
- repo: https://github.com/tcort/markdown-link-check
rev: v3.12.1
hooks:
- id: markdown-link-check
name: markdown-link-check-all
stages: [manual]
- repo: local
hooks:
- id: no-dbg
name: no-dbg
description: We shouldn't merge code with `dbg!` in
language: pygrep
types: ["rust"]
entry: "dbg!"
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ To silence the warning add them to your `insta` dependency. Additionally the

## 1.17.2

- Remove an accidentaly debug print output.
- Remove an accidentally debug print output.

## 1.17.1

Expand Down
2 changes: 1 addition & 1 deletion insta/src/content/yaml/vendored/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ a4:
#[test]
fn test_emit_complex() {
let s = r#"
cataloge:
catalogue:
product: &coffee { name: Coffee, price: 2.5 , unit: 1l }
product: &cookies { name: Cookies!, price: 3.40 , unit: 400g}
Expand Down
2 changes: 1 addition & 1 deletion insta/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl ToolConfig {
break;
}
// ideally we would not swallow all errors here but unfortunately there are
// some cases where we cannot detect the error propertly.
// some cases where we cannot detect the error properly.
// Eg we can see NotADirectory here as kind, but on stable rust it cannot
// be matched on.
Err(_) => continue,
Expand Down
2 changes: 1 addition & 1 deletion insta/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ macro_rules! _assert_serialized_snapshot {
// If there are redaction expressions and an inline snapshot, capture
// the redactions expressions and pass to `_assert_snapshot_base`
//
// Note that if we could unify the Inline & File represenations of snapshots
// Note that if we could unify the Inline & File representations of snapshots
// redactions we could unify some of these branches.

(format=$format:ident, $value:expr, $(match ..)? {$($k:expr => $v:expr),* $(,)?}, @$snapshot:literal) => {{
Expand Down
2 changes: 1 addition & 1 deletion insta/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ impl Settings {
///
/// This is the recommended way to temporarily bind settings and replaces
/// the earlier [`bind_to_scope`](Settings::bind_to_scope) and relies on
/// drop guards. An alterantive is [`bind`](Settings::bind) which binds
/// drop guards. An alternative is [`bind`](Settings::bind) which binds
/// for the duration of the block it wraps.
///
/// ```
Expand Down

0 comments on commit bc73039

Please sign in to comment.