iachat/.husky/pre-commit
Gabriel Jablonski 52a55827c3 chore: lint files (#2)
* chore: lint files

* chore: suppress warning

* chore: disable suggest extensions

* chore: do not stage changes in pre-commit

* chore: remove git add from FE lint and `-a` flag from rubocop on husky
2025-04-03 23:28:38 -03:00

12 lines
325 B
Bash
Executable File

#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# lint js and vue files
npx --no-install lint-staged
# lint only staged ruby files
git diff --name-only --cached | xargs ls -1 2>/dev/null | grep '\.rb$' | xargs bundle exec rubocop --force-exclusion
# stage rubocop changes to files
# git diff --name-only --cached | xargs git add