Skip to content

Enable rubocop for development#505

Merged
mayorova merged 4 commits intomasterfrom
enable-rubocop
Jun 28, 2023
Merged

Enable rubocop for development#505
mayorova merged 4 commits intomasterfrom
enable-rubocop

Conversation

@mayorova
Copy link
Copy Markdown
Contributor

@mayorova mayorova commented Jun 28, 2023

I added RuboCop gem to development and test environments.
.rubocop.yml file was already there, but the gem was not in the Gemfile.

Also, the config was very outdated, so I updated the Cop names.

The 1st commit just makes the changes in the config (renaming obsolete ones, reordering according to the new namespaces etc.), but keeping them the same.

The 2nd commit cleans up the configs, removing all the cops that had Enabled: false, as it's redundant, given AllCops:DisabledByDefault: true setting. The rubocop output is the same for before and after the 2nd commit.

I also updated the .codeclimate.yml file, it was outdated too, so it was using some old Ruby. It's up-to-date now.

@mayorova mayorova merged commit a413a9f into master Jun 28, 2023
@mayorova mayorova deleted the enable-rubocop branch June 28, 2023 15:44

def self.for_model(model)
new(model: model, tenant: model.try!(:tenant))
new(model: model, tenant: model&.tenant)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@mayorova , this is not the same. try! should ignore any call errors while &.tenant will raise if model is not nil and #tenant method does not exist.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@akostadinov I've checked this, and what you're saying is true for .try, on the other hand .try! does throw a NoMethodError, so its behavior is identical to &.

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.

3 participants