When running Rubocop I get this error for all yml files under config folder.
example:
config/database.yml:1:8: E: unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
default: &default
^
config/database.yml:2:10: E: unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
adapter: postgresql
^
config/database.yml:3:11: E: unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
encoding: unicode
^
config/database.yml:4:7: E: unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
pool: 5
^
This is my database.yml file:
default: &default
adapter: postgresql
encoding: unicode
pool: 5
development:
<<: *default
database: otimicar_development
test:
<<: *default
database: otimicar_test
What does it means? Other files likes secrets.yml are generating the same kind of error also...
rubocop -L
?rubocop config/*
, then I realized that this command would force rubocop to scan all files inside the folder. The correct command isrubocop config/
, without the '*' 🙄