The pre-commit hook was failing when there were staged deleted files
because:
- It was using 'ls' to filter files, which fails when they don't exist
in the filesystem
- Deleted files are still in Git's staging area but not in the
filesystem
Changes made:
1. Added a check to filter files with 'test -f' before passing to
Rubocop
2. Added the same check for staging Rubocop's changes
3. Added '|| true' to prevent errors when no files match the filters
This ensures the pre-commit hook completes successfully even when files
are staged for deletion.
Added a command to sync files in the locale/*/ folder. Run `pnpm
sync:i18n` would copy index.js in `dashboard/locale/en` to every other
folder `dashboard/locale/*/`
---------
Co-authored-by: Pranav <pranavrajs@gmail.com>
The pre-commit hook would format event those files excluded in the config. This is because the files were passed as args instead of the linter running on the entire project. When this happens, the exclude is not respect.
The --force-exclusion flag instructs our machine overlords to force exlucde files specified in the configuration Exclude even if they are explicitly passed as arguments.