Skip to content
This repository has been archived by the owner on Jan 29, 2022. It is now read-only.

Rubocop and travis #11

Merged
merged 42 commits into from
Nov 2, 2017
Merged

Conversation

alexjfisher
Copy link
Member

No description provided.

else
slack_channel = '#default'
end
slack_channel = if settings.slack_channel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't this be slack_channel = settings.slack_channel || '#default'?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, it cannot. At least not yet.

The way Sinatra::ConfigFile works is that it will fail with a no method error if the config key doesn't exist in the yml file. My current workaround (which would allow this to work) is to have an empty key in the yml config file so that it will return nil.

I have some work to do on the config file front.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, nevermind. The NoMethodError would be triggered either way if the setting is missing. So, I agree with @ekohl, let's simplify that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general I like having a config file which has all the defaults in it rather than the code. It's a nice reference for users and can simplify code like this.

Copy link
Member

@dhollinger dhollinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment thread on slack_channel.settings

else
slack_channel = '#default'
end
slack_channel = if settings.slack_channel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, nevermind. The NoMethodError would be triggered either way if the setting is missing. So, I agree with @ekohl, let's simplify that.

@alexjfisher
Copy link
Member Author

The commits are mostly the result of doing individual auto-corrects (and doing a quick review for correctness). I also made sure that each new commit didn't undo any of the cops that were already fixed.

From Style/IfInsideElse on, there was nothing left that could be autocorrected and those are manual work.

@dhollinger dhollinger merged commit f11ea97 into voxpupuli:master Nov 2, 2017
@dhollinger
Copy link
Member

Partially addresses #3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants