Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New cop for yoda expressions #9222

Closed
fatkodima opened this issue Dec 13, 2020 · 2 comments · Fixed by #11333
Closed

New cop for yoda expressions #9222

fatkodima opened this issue Dec 13, 2020 · 2 comments · Fixed by #11333

Comments

@fatkodima
Copy link
Contributor

Inspired by https://palantir.github.io/tslint/rules/binary-expression-operand-order/

This is in addition to existing Style/YodaCondition cop.

# bad
y = 1 + x

# good
y = x + 1
@bbatsov
Copy link
Collaborator

bbatsov commented Dec 14, 2020

Seems like a good idea to me.

@IamRaviTejaG
Copy link
Contributor

@fatkodima @bbatsov I'd like to take a jab at this.

kachick added a commit to kachick/declare that referenced this issue Jan 3, 2023
* Update rubocop requirement from ~> 1.41.1 to ~> 1.42.0

Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v1.41.1...v1.42.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* Supress rubocop warns

Warning: obsolete parameter `IgnoredMethods` (for `Style/MethodCallWithArgsParentheses`) found in .rubocop.yml
`IgnoredMethods` has been renamed to `AllowedMethods` and/or `AllowedPatterns`.

* Disable meaningless Style/YodaExpression as Style/YodaCondition did

rubocop/rubocop#9222

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kenichi Kamiya <kachick1@gmail.com>
kachick added a commit to kachick/ruby-gem-template that referenced this issue Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants