Restore ability to specify "gemfile: false" in config#863
Merged
Conversation
Owner
|
Thank you. |
sds
pushed a commit
that referenced
this pull request
Feb 19, 2025
…t.yml (#865) Related to #863 and [this comment](#862 (comment)): > Having a similar problem since we had this line in our `.overcommit.yml`: > > ```yaml > gemfile: Gemfile # enforce bundled version of overcommit > ``` > > And now overcommit doesn't strip out the inline comment, resulting in this weird looking error message: > > ``` > Problem loading 'Gemfile # enforce bundled version of overcommit': /path/to/project/Gemfile # enforce bundled version of overcommit not found > ``` I think adding support for comments in the `gemfile:` regexp is likely overkill and may still not be enough when the next person tries to use yet another YAML feature in that line, but perhaps this little warning would help someone else avoid tripping.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Setting
gemfile: falsein.overcommit.ymlis supposed to disable Bundler. However, a recently-introduced bug causesfalseto be interpreted as the name of the gemfile. Bundler looks for a gemfile named "false", which fails, leading overcommit's hooks to crash.This PR fixes the bug by adjusting the regex used to parse the
gemfile:line in the config. Now,falseis no longer interpreted as a gemfile name.I added an integration test to verify the fix.
Fixes #862