Coder Social home page Coder Social logo

Comments (11)

salbertson avatar salbertson commented on August 28, 2024

@Adam89, thanks for opening an issue.

from hound.

gabebw avatar gabebw commented on August 28, 2024

Yup, this is still an issue, just got this comment from @houndci:

Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||.

That's definitely against our style guide.

from hound.

salbertson avatar salbertson commented on August 28, 2024

@gabebw, would you provide the code that Hound commented on?

from hound.

gabebw avatar gabebw commented on August 28, 2024

I'm not 100% sure (not my code, and a lot of commits since then), but I think this was it:

if signed_in? then redirect_to dashboard_path end

from hound.

salbertson avatar salbertson commented on August 28, 2024

@gabebw, thanks. Those comments won't be created anymore.

from hound.

mrageh avatar mrageh commented on August 28, 2024

Can we close this PR now?

from hound.

salbertson avatar salbertson commented on August 28, 2024

@Adam89, not yet because we aren't checking for ternary expressions yet. I opened a pull request for RuboCop to add the check for us to use.

rubocop/rubocop#1059

from hound.

Koronen avatar Koronen commented on August 28, 2024

@salbertson rubocop/rubocop#1059 was closed on Jun 12th. Maybe we could use the code from that PR as a custom cop that we either release as a gem, or just ship with Hound?

from hound.

gylaz avatar gylaz commented on August 28, 2024

@Koronen That PR was merged into RuboCop, but there's a flaw with that cop. We should submit a PR upstream fixing it.

from hound.

thorncp avatar thorncp commented on August 28, 2024

Looks like there has been no progress on this. To summarize the outcome of rubocop/rubocop#1059, the OneLineConditional, MultilineTernaryOperator, and TernaryOperator cops should be merged into a single cop with the 3 alternate styles. Anyone willing to take that on?

from hound.

thorncp avatar thorncp commented on August 28, 2024

Closing for inactivity.

from hound.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.