Skip to content

Commit 9f142c2

Browse files
authored
Add note about unsupported YAML features in gemfile: line in default.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.
1 parent 88bee08 commit 9f142c2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

config/default.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
# your repository, and then set the `gemfile` option below to the name you gave
3333
# the file.
3434
# (Generate lock file by running `bundle install --gemfile=.overcommit_gems.rb`)
35+
#
36+
# NOTE: the following line will be parsed by a regexp rather than a proper YAML
37+
# parser, so avoid any values other than false or a string, and don't use inline
38+
# comments
3539
gemfile: false
3640

3741
# Where to store hook plugins specific to a repository. These are loaded in

0 commit comments

Comments
 (0)