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

Use theforeman-rubocop gem #58

Merged
merged 1 commit into from
Jul 31, 2024
Merged

Conversation

archanaserver
Copy link
Contributor

Inherited strictest.yml here, this rules have NewCops enable config.
Also dropped some cops from here because that was either included
in the inherit file or was not needed anymore.

This is part of Rubocop standerdization, link for the reference:
https://community.theforeman.org/t/standardizing-rubocop-with-theforeman-rubocop/37239
https://github.com/theforeman/theforeman-rubocop/?tab=readme-ov-file#all-opinionated-cops-with-new-ones---strictest

@archanaserver archanaserver changed the title Use theforeman-rubcoop Gem Use theforeman-rubocop gem May 29, 2024

Layout/LineLength:
Enabled: false

Metrics:
Enabled: false

Style/FormatStringToken:
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question as in https://github.com/theforeman/hammer_cli_foreman_bootdisk/pull/18/files. Can we remove all other exceptions and have the config file the same as in the https://github.com/theforeman/hammer-cli-foreman-google/blob/master/.rubocop.yml?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stejskalleos here we already have rubocop todo file so added some cops in there, because right now our focus is more on adding theforeman-rubocop gem and less focus on solving all the offenses because of the new style rules. but i tried to solve some.

Inherited strictest.yml here, this rules have NewCops enable config.
Also dropped some cops from here because that was either included in
the inherit file or was not needed anymore.
@@ -24,5 +26,5 @@ rescue LoadError
task default: :test
else
RuboCop::RakeTask.new
task default: [:rubocop, :test]
task default: %i[rubocop test]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change is due to Style/SymbolArray cop

# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also updated some cops in todo file, which was causing major changes in the code, but what do you think of it?

@stejskalleos stejskalleos merged commit 7b7eae9 into theforeman:master Jul 31, 2024
10 checks passed
@stejskalleos
Copy link
Contributor

Thanks @archanaserver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants