Skip to content

Commit a378e7f

Browse files
committed
pre-commit add manual hooks bundle install and audit
1 parent dcd4fe9 commit a378e7f

3 files changed

Lines changed: 37 additions & 2 deletions

File tree

.pre-commit-config.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,24 @@ repos:
2525
language: node
2626
additional_dependencies: ["prettier@3.7.4"]
2727
stages: [manual]
28+
- id: bundle-install
29+
name: bundle-install
30+
description: >-
31+
Ensures that the local Ruby environment stays in sync by running 'bundle install'
32+
whenever the Gemfile or Gemfile.lock is modified.
33+
entry: bash -c 'bundle install || { echo "bundle install failed"; exit 1; }'
34+
language: system
35+
stages: [manual]
36+
files: ^(Gemfile|Gemfile\.lock)$
37+
- id: bundle-audit
38+
name: bundle-audit
39+
description: >-
40+
Updates the ruby-advisory-db and scans Gemfile.lock for known security
41+
vulnerabilities in dependencies.
42+
entry: bash -c 'bundle exec bundle-audit update && bundle exec bundle-audit'
43+
language: system
44+
stages: [manual]
45+
files: ^Gemfile\.lock$
2846
- id: check-zip-file-is-not-committed
2947
name: disallow zip files
3048
description: Zip files are not allowed in the repository

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ gem 'rake'
66
gem 'yard'
77
gem 'yard-coderay'
88
gem 'yard-mruby'
9+
10+
group :development, :test do
11+
gem 'bundler-audit', require: false
12+
end

Gemfile.lock

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4+
bundler-audit (0.9.3)
5+
bundler (>= 1.2.0)
6+
thor (~> 1.0)
47
coderay (1.1.3)
58
rake (13.3.1)
9+
thor (1.4.0)
610
yard (0.9.38)
711
yard-coderay (0.1.0)
812
coderay
@@ -12,14 +16,23 @@ GEM
1216

1317
PLATFORMS
1418
ruby
15-
x86_64-darwin-21
1619
x86_64-linux
1720

1821
DEPENDENCIES
22+
bundler-audit
1923
rake
2024
yard
2125
yard-coderay
2226
yard-mruby
2327

28+
CHECKSUMS
29+
bundler-audit (0.9.3) sha256=81c8766c71e47d0d28a0f98c7eed028539f21a6ea3cd8f685eb6f42333c9b4e9
30+
coderay (1.1.3) sha256=dc530018a4684512f8f38143cd2a096c9f02a1fc2459edcfe534787a7fc77d4b
31+
rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c
32+
thor (1.4.0) sha256=8763e822ccb0f1d7bee88cde131b19a65606657b847cc7b7b4b82e772bcd8a3d
33+
yard (0.9.38) sha256=721fb82afb10532aa49860655f6cc2eaa7130889df291b052e1e6b268283010f
34+
yard-coderay (0.1.0) sha256=38bb59aea471f14f4cc62085f4d7e5ac0338a10c115355d32977f73d5015163f
35+
yard-mruby (0.3.0) sha256=f950f3e5c8bde7a4fee73bcf0e7c20f2365540deca8b60590f2e2eb069d264ef
36+
2437
BUNDLED WITH
25-
2.4.10
38+
4.0.3

0 commit comments

Comments
 (0)