{"action":"created","issue":{"url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/6398","repository_url":"https://api.github.com/repos/rubocop-hq/rubocop","labels_url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/6398/labels{/name}","comments_url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/6398/comments","events_url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/6398/events","html_url":"https://github.com/rubocop-hq/rubocop/issues/6398","id":372267957,"node_id":"MDU6SXNzdWUzNzIyNjc5NTc=","number":6398,"title":"TargetRubyVersion is inferred (2.1) from rainbow gem on Travis CI","user":{"login":"dgmstuart","id":393167,"node_id":"MDQ6VXNlcjM5MzE2Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/393167?v=4","gravatar_id":"","url":"https://api.github.com/users/dgmstuart","html_url":"https://github.com/dgmstuart","followers_url":"https://api.github.com/users/dgmstuart/followers","following_url":"https://api.github.com/users/dgmstuart/following{/other_user}","gists_url":"https://api.github.com/users/dgmstuart/gists{/gist_id}","starred_url":"https://api.github.com/users/dgmstuart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgmstuart/subscriptions","organizations_url":"https://api.github.com/users/dgmstuart/orgs","repos_url":"https://api.github.com/users/dgmstuart/repos","events_url":"https://api.github.com/users/dgmstuart/events{/privacy}","received_events_url":"https://api.github.com/users/dgmstuart/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-10-21T01:06:40Z","updated_at":"2018-10-22T16:51:02Z","closed_at":null,"author_association":"NONE","body":"On 0.59.2, Ruby 2.5.1 rubocop is running fine locally, but fails with the following message on Travis:\r\n\r\n```\r\nError: Unsupported Ruby version 2.1 found in `TargetRubyVersion` parameter (in vendor/bundle/ruby/2.5.0/gems/rainbow-3.0.0/.rubocop.yml). 2.1-compatible analysis was dropped after version 0.58.\r\nSupported versions: 2.2, 2.3, 2.4, 2.5\r\n```\r\n\r\nThis seems odd: I wouldn't expect the .rubocop.yml from the rainbow gem to be involved in determining how rubocop runs for my repo.\r\n\r\nI've tried specifying the TargetRubyVersion explicitly, as well as allowing it to be inferred from the Gemfile.lock.\r\n\r\nI suppose this might be an issue with Travis?\r\n\r\nBranch: https://github.com/dgmstuart/swing-out-london/tree/travis-fail\r\nBuild: https://travis-ci.com/dgmstuart/swing-out-london/builds/88642470\r\n\r\n--------\r\n\r\n## Expected behavior\r\n\r\nBuilds on CI should infer the TargetRubyVersion from the Gemfile.lock\r\n\r\n## Actual behavior\r\n\r\nBuilds on Travis CI seems to be inferring the TargetRubyVersion from the `.rubocop.yml` of the `rainbow` gem, which is a runtime dependency of rubocop.\r\n\r\n## Steps to reproduce the problem\r\n\r\nThe following branch has the issue:\r\nhttps://github.com/dgmstuart/swing-out-london/tree/travis-fail\r\n\r\nRunning `Rake` locally runs rubocop correctly, but running on Travis fails.\r\n\r\nHere is an example of a failing build: https://travis-ci.com/dgmstuart/swing-out-london/builds/88642470\r\n\r\n## RuboCop version\r\n\r\n```\r\n$ bundle exec rubocop -V\r\n0.59.2 (using Parser 2.5.1.2, running on ruby 2.5.1 x86_64-darwin17)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/comments/431894566","html_url":"https://github.com/rubocop-hq/rubocop/issues/6398#issuecomment-431894566","issue_url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/6398","id":431894566,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTg5NDU2Ng==","user":{"login":"dgmstuart","id":393167,"node_id":"MDQ6VXNlcjM5MzE2Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/393167?v=4","gravatar_id":"","url":"https://api.github.com/users/dgmstuart","html_url":"https://github.com/dgmstuart","followers_url":"https://api.github.com/users/dgmstuart/followers","following_url":"https://api.github.com/users/dgmstuart/following{/other_user}","gists_url":"https://api.github.com/users/dgmstuart/gists{/gist_id}","starred_url":"https://api.github.com/users/dgmstuart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgmstuart/subscriptions","organizations_url":"https://api.github.com/users/dgmstuart/orgs","repos_url":"https://api.github.com/users/dgmstuart/repos","events_url":"https://api.github.com/users/dgmstuart/events{/privacy}","received_events_url":"https://api.github.com/users/dgmstuart/received_events","type":"User","site_admin":false},"created_at":"2018-10-22T16:51:02Z","updated_at":"2018-10-22T16:51:02Z","author_association":"NONE","body":"@deivid-rodriguez Ah OK, I wasn't familiar with that distinction between what is committed and what gets \"shipped\" but I think I understand it - thank you for explaining.\r\n\r\nI also now think I understand why this only showed up on CI:\r\n\r\nLocally gems are bundled to a system location, but on travis the command is \r\n```\r\n$ bundle install --jobs=3 --retry=3 --deployment --path=${BUNDLE_PATH:-vendor/bundle}\r\n```\r\nThat means that the gems are inside the application root, and so rubocop will be run over them. Rubocop allows nesting different .rubocop.yml files in subdirectories, so inside the Rainbow gem, it would just consider that to be the config that should be used to run checks inside that gem directory.\r\n\r\nI guess this means that even if Rainbow wasn't shipping their `.rubocop.yml file` I'd still probably get failures since rubocop would be running with my configuration on other people's code."}}
{"actor":{"display_login":"dgmstuart"}}