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

Disables Style/IfUnlessModifier rule #841

Merged

Conversation

PanosCodes
Copy link
Contributor

@PanosCodes PanosCodes commented Mar 8, 2023

Having this rule enabled forces the modifier if statement to be used

So this

if Apipie.configuration.swagger_api_host.present?
  @swagger[:host] = Apipie.configuration.swagger_api_host
end

should be changed to

@swagger[:host] = Apipie.configuration.swagger_api_host if Apipie.configuration.swagger_api_host.present?

resulting in longer, harder to read lines.

Since we use the regular if statement all over the gem's codebase we can disable this rule.

Having this rule enabled forces the modifier if statement to be used

So this

```
if Apipie.configuration.swagger_api_host.present?
  @Swagger[:host] = Apipie.configuration.swagger_api_host
end
```

should be changed to 

`@swagger[:host] = Apipie.configuration.swagger_api_host if Apipie.configuration.swagger_api_host.present?`

resulting in longer, harder to read lines.

Since the use the regular if statement all over the gem's codebase we can
disable this rule.
@mathieujobin
Copy link
Collaborator

Alright

@mathieujobin mathieujobin merged commit 43428fc into Apipie:master Mar 8, 2023
@PanosCodes PanosCodes deleted the disable-Style-IfUnlessModifier branch March 28, 2023 16:40
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 this pull request may close these issues.

2 participants