-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlefthook.yml
More file actions
47 lines (44 loc) · 1.26 KB
/
lefthook.yml
File metadata and controls
47 lines (44 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Refer for explanation to following link:
# https://lefthook.dev/configuration/
pre-push:
jobs:
- name: Audit packages
tags:
- frontend
- security
run: yarn npm audit
- name: Audit gems
tags:
- backend
- security
run: bin/bundler-audit --update
- name: Scan Rails security vulnerabilities
tags:
- backend
- security
run: bin/brakeman -q --no-pager
pre-commit:
parallel: true
commands:
rubocop:
glob: "*.{rake,rb}"
run: bin/rubocop --force-exclusion -A {staged_files}
stage_fixed: true # Automatically stage fixed files
syntax_tree:
glob: "*.{rake,rb}"
run: bin/bundle exec stree write {staged_files}
stage_fixed: true
slim-lint:
glob: "*.slim"
run: bin/bundle exec slim-lint {staged_files}
prettier:
glob: "*.{css,html,js,json,md,mjs,scss,yml}"
run: yarn prettier --write --cache --cache-location .cache/prettier {staged_files}
stage_fixed: true
eslint:
glob: "*.{cjs,js,mjs}"
run: yarn eslint --cache --cache-location .cache/eslint --fix --report-unused-disable-directives {staged_files}
stage_fixed: true
rspec:
glob: "*_spec.rb"
run: bin/rspec {staged_files}