Skip to content

Commit

Permalink
fix: rust-backticks
Browse files Browse the repository at this point in the history
  • Loading branch information
domodwyer committed Aug 24, 2024
1 parent 567672e commit 1a2ca02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,6 @@
entry: run-rust-backticks.sh
language: "script"
files: \.rs$
pass_filenames: true
pass_filenames: false
minimum_pre_commit_version: 0.15.0
description: "Check for empty backtick pairs"
10 changes: 8 additions & 2 deletions run-rust-backticks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@

set -euo pipefail

srgn -j --fail-no-files -G "$@" \
STDOUT=$(srgn -j --fail-no-files \
--rust doc-comments \
--rust comments \
'[^`]`{2}[^`]+'
'[^`]`{2}[^`]+')

if [[ -n $STDOUT ]]
then
printf -- "%s\n" "$STDOUT"
exit 1;
fi

0 comments on commit 1a2ca02

Please sign in to comment.