add cargo fmt
to lint staged (#56430)
Keep forgetting to run `cargo fmt` before committing Closes WEB-1707
This commit is contained in:
parent
338f80b4fd
commit
00aea747c5
1 changed files with 6 additions and 0 deletions
|
@ -27,6 +27,12 @@ module.exports = {
|
|||
`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) {
|
||||
|
|
Loading…
Reference in a new issue