Unverified Commit 00aea747 authored by Leah's avatar Leah Committed by GitHub

add `cargo fmt` to lint staged (#56430)

Keep forgetting to run `cargo fmt` before committing

Closes WEB-1707
parent 338f80b4
...@@ -27,6 +27,12 @@ module.exports = { ...@@ -27,6 +27,12 @@ module.exports = {
`git add ${escapedFileNames}`, `git add ${escapedFileNames}`,
] ]
}, },
'**/*.rs': (filenames) => {
const escapedFileNames = filenames
.map((filename) => (isWin ? filename : escape([filename])))
.join(' ')
return [`cargo fmt -- ${escapedFileNames}`, `git add ${escapedFileNames}`]
},
} }
function escape(str) { function escape(str) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment