2022-02-08 15:28:34 +01:00
|
|
|
# Lefthook configuration
|
|
|
|
|
#
|
2026-04-14 17:02:13 +02:00
|
|
|
# Install lefthook with any preferred method (see https://github.com/evilmartians/lefthook?tab=readme-ov-file#install).
|
|
|
|
|
# example: `gem install lefthook`
|
2022-02-08 15:28:34 +01:00
|
|
|
#
|
2026-04-14 17:02:13 +02:00
|
|
|
# Add commit hooks with `lefthook install`.
|
|
|
|
|
#
|
|
|
|
|
# To override any config, create a `lefthook-local.yml` file - e.g., for changing the run command
|
|
|
|
|
# to be executed in a docker container context.
|
|
|
|
|
#
|
|
|
|
|
# Refer for explanation to the following link:
|
2024-03-07 14:38:37 +01:00
|
|
|
# https://github.com/evilmartians/lefthook/blob/master/docs/usage.md
|
2022-02-08 15:28:34 +01:00
|
|
|
|
|
|
|
|
pre-commit:
|
|
|
|
|
parallel: true
|
|
|
|
|
commands:
|
2022-02-15 20:20:50 +01:00
|
|
|
eslint:
|
|
|
|
|
root: "frontend/"
|
|
|
|
|
files: git diff --name-only --staged
|
|
|
|
|
glob: "*.{js,ts,jsx,tsx}"
|
|
|
|
|
run: npx eslint {staged_files}
|
2022-02-08 15:28:34 +01:00
|
|
|
rubocop:
|
|
|
|
|
files: git diff --name-only --staged
|
|
|
|
|
glob: "*.rb"
|
2022-07-01 16:11:02 +02:00
|
|
|
run: bin/dirty-rubocop --uncommitted --force-exclusion {files}
|
2025-01-31 12:42:09 +02:00
|
|
|
erb_lint:
|
|
|
|
|
files: git diff --name-only --staged
|
|
|
|
|
glob: "*.erb"
|
|
|
|
|
run: erb_lint {files}
|
2025-01-23 18:00:44 +01:00
|
|
|
primer-view-components-version-is-the-same-everyhwere:
|
|
|
|
|
files: git diff --name-only --staged
|
|
|
|
|
glob: "{Gemfile.lock,frontend/package.json}"
|
|
|
|
|
run: script/check_same_primer_view_components_version_everywhere
|