You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gemfile:false option no longer behaves as expected in YAML config #862
As of 0.65, when I run overcommit with gemfile: false in the config, I get the following error:
Problem loading 'false': my-code-directory/false not found
It seems like when #859 started using regex to parse the gemfile config instead of YAML, we ended up losing some nice YAML.parse functionality?
# .overcommit.ymlgemfile: false# hook codeconfig=File.read('.overcommit.yml') =~ /gemfile: ['"]?(.*)['"]?/gemfile=Regexp.last_match(1)# gemfile is now set to the (truthy) string "false"ifgemfile# this is triggered with gemfile = 'false'ENV['BUNDLE_GEMFILE']=gemfilebeginBundler.setuprescueBundler::BundlerError=>eputs"Problem loading '#{gemfile}': #{e.message}"# Problem loading 'false'puts"Try running:\nbundle install --gemfile=#{gemfile}"ife.is_a?(Bundler::GemNotFound)exit78# EX_CONFIGendend
The issue in itself is not a big deal obviously since the comment can just be moved to the line above (which is what I did), but when I first encountered it I wasn't aware that overcommit was parsing that line on its own and the error message threw me down a misguided path of thinking Psych had changed how it parsed inline comments until I found this issue.
Perhaps a little comment in default.yml would be enough? I've opened a small PR for it: #865, but feel free to discard it of course.
Activity
sds commentedon Feb 3, 2025
Heads up @xjunior: looks like this was introduced by #859.
pilaf commentedon Feb 7, 2025
Having a similar problem since we had this line in our
.overcommit.yml:And now overcommit doesn't strip out the inline comment, resulting in this weird looking error message:
Restore ability to specify "gemfile: false" in config (#863)
mattbrictson commentedon Feb 16, 2025
@pilaf I fixed the
gemfile: falseissue, but not the inline comment problem that you mentioned. You might want to open a separate issue for that.pilaf commentedon Feb 17, 2025
@mattbrictson Thanks.
The issue in itself is not a big deal obviously since the comment can just be moved to the line above (which is what I did), but when I first encountered it I wasn't aware that overcommit was parsing that line on its own and the error message threw me down a misguided path of thinking Psych had changed how it parsed inline comments until I found this issue.
Perhaps a little comment in default.yml would be enough? I've opened a small PR for it: #865, but feel free to discard it of course.
Add note about unsupported YAML features in `gemfile:` line in defaul…