{"action":"created","issue":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/4418","repository_url":"https://api.github.com/repos/bbatsov/rubocop","labels_url":"https://api.github.com/repos/bbatsov/rubocop/issues/4418/labels{/name}","comments_url":"https://api.github.com/repos/bbatsov/rubocop/issues/4418/comments","events_url":"https://api.github.com/repos/bbatsov/rubocop/issues/4418/events","html_url":"https://github.com/bbatsov/rubocop/issues/4418","id":231107016,"number":4418,"title":"Style/ConditionalAssignment does not report when Metrics/LineLength set to less than 86","user":{"login":"daneas","id":12247686,"avatar_url":"https://avatars2.githubusercontent.com/u/12247686?v=3","gravatar_id":"","url":"https://api.github.com/users/daneas","html_url":"https://github.com/daneas","followers_url":"https://api.github.com/users/daneas/followers","following_url":"https://api.github.com/users/daneas/following{/other_user}","gists_url":"https://api.github.com/users/daneas/gists{/gist_id}","starred_url":"https://api.github.com/users/daneas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daneas/subscriptions","organizations_url":"https://api.github.com/users/daneas/orgs","repos_url":"https://api.github.com/users/daneas/repos","events_url":"https://api.github.com/users/daneas/events{/privacy}","received_events_url":"https://api.github.com/users/daneas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-05-24T16:58:05Z","updated_at":"2017-05-25T09:28:20Z","closed_at":null,"body":"`Style/ConditionalAssignment` does not report an offense if `Metrics/LineLength` is set to less than 96.\r\n\r\n--------\r\n\r\n## Expected behavior\r\n\r\nChanging settings to `Metrics/LineLength` should not affect outcome of other cops. \r\n\r\n## Actual behavior\r\n\r\nOffense is not reported when it should be. \r\n\r\n## Steps to reproduce the problem\r\n\r\nHave some code that offends Style/ConditionalAssignment cop. Such as: \r\n```\r\ndef do_this_do_that(field, value, filter)\r\n  if filter\r\n    @i_do_not_believe_in_unicorns << { field => value }\r\n  else\r\n    @i_do_not_believe_in_unicorns << { field => 'i drink bear' }\r\n  end\r\nend\r\n```\r\n\r\nSet following rubocop settings: \r\n```\r\nMetrics/LineLength:\r\n  Max: 95\r\n\r\nStyle/ConditionalAssignment:\r\n  Enabled: true\r\n```\r\nOutcome: \r\nNo offenses\r\n\r\nChange settings to (line length more than 95): \r\n```\r\nMetrics/LineLength:\r\n  Max: 96\r\n\r\nStyle/ConditionalAssignment:\r\n  Enabled: true\r\n```\r\nOutcome: \r\n`Style/ConditionalAssignment` reports an offense\r\n\r\nNote:\r\nSpecified cops are the only cops that are defined. The rest are defaults\r\nI have noticed that line length changes depending on the code. Initially line lengths were 85 and 86, but after changing to my preferred method names it increased to 95, 96. \r\n\r\n## RuboCop version\r\n\r\nInclude the output of `rubocop -V`. Here's an example:\r\n\r\n```\r\n$ rubocop -V\r\n0.46.0\r\n0.48.1\r\n0.49.0\r\n\r\nsame behavior with all version listed above.\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/comments/303965531","html_url":"https://github.com/bbatsov/rubocop/issues/4418#issuecomment-303965531","issue_url":"https://api.github.com/repos/bbatsov/rubocop/issues/4418","id":303965531,"user":{"login":"Drenmi","id":5259935,"avatar_url":"https://avatars2.githubusercontent.com/u/5259935?v=3","gravatar_id":"","url":"https://api.github.com/users/Drenmi","html_url":"https://github.com/Drenmi","followers_url":"https://api.github.com/users/Drenmi/followers","following_url":"https://api.github.com/users/Drenmi/following{/other_user}","gists_url":"https://api.github.com/users/Drenmi/gists{/gist_id}","starred_url":"https://api.github.com/users/Drenmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Drenmi/subscriptions","organizations_url":"https://api.github.com/users/Drenmi/orgs","repos_url":"https://api.github.com/users/Drenmi/repos","events_url":"https://api.github.com/users/Drenmi/events{/privacy}","received_events_url":"https://api.github.com/users/Drenmi/received_events","type":"User","site_admin":false},"created_at":"2017-05-25T09:28:20Z","updated_at":"2017-05-25T09:28:20Z","body":"Some cops will not suggest a change that would violate the maximum line length. Sounds like this is could be one of them."}}
{"actor":{"display_login":"Drenmi"}}