BundlerChecksum: Add command to lint gems checksums
What does this MR do and why?
BundlerChecksum: Add command to lint gems checksums
This command checks if every gem has a corresponding checksum stored. It does not verify the checksum though.
To avoid failing CI pipelines let lefthook lint gems when Gemfile.lock
has changed and ensure that every gem has a checksum stored.
Contributes to #414374 (closed).
Screenshots or screen recordings
No gem changes |
Gemfile.lock changed without checksum |
Gemfile.lock with checksum changes |
---|---|---|
How to set up and validate locally
- Add
gem "foo"
toGemfile
(see httos;//rubygems.org/gems/foo) - Run
bundle install
- Commit the changes
git commit -m 'Add gems' Gemfile*
- Run
bundle exec lefthook run pre-push
💥 - Run
bundle exec bundler-checksum init
- Amend the latest commit
git commit --amend -m 'Add gems' Gemfile*
- Run
bundle exec lefthook run pre-push
✅
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Peter Leitzen