fix syntax error on 2.1 and rubocop on 2.2
Background:
Hashes {:'key': 'value'}
are not valid in 2.1 but are recommended by Rubocop on 2.2. We only use those when we have a key such as weird-key
, weird.key
, etc...
We could disable Rubocop but it wouldn't warn us about the recommended syntax since Ruby 1.9
: {key: 'value'}
, which is valid for Ruby 1.9+
.
Workaround 1 could be disabling Style/HashSyntax:
in rubocop.yml
.
Workaround 2 (tried in this MR) is to trick Rubocop using .to_sym
which is effectively the same as adding the :
. This would allow to keep the warning in place.
Merge request reports
Activity
Added 44 commits:
-
902baa2e...88e16c3d - 43 commits from branch
gitlab-org:master
- 69c4e0a1 - Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into hotfix/ruby-21-broken-update
-
902baa2e...88e16c3d - 43 commits from branch
Added 1 commit:
- 6e4d36b4 - add back master only for ruby 2.1 images
Builds succeeded for both Ruby 2.1 and Ruby 2.2 - https://gitlab.com/jameslopez/gitlab-ce/commit/69c4e0a1197b21bf0b4925edcda0943be9e0e641/builds
Reassigned to @dzaporozhets
@dzaporozhets this is ready now - builds seem fine for both Ruby 2.1 and 2.2
/cc @DouweM in case you want to check this as well
mentioned in commit 9d0065f0
Sorry @dzaporozhets for jumping the queue and merging.
@marin you are welcome!