-
Notifications
You must be signed in to change notification settings - Fork 20
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,11 @@ | ||
require: | ||
- rubocop-performance | ||
- rubocop-minitest | ||
inherit_from: .rubocop_todo.yml | ||
|
||
AllCops: | ||
NewCops: enable | ||
|
||
Layout/EmptyLineAfterGuardClause: | ||
Enabled: false | ||
inherit_gem: | ||
theforeman-rubocop: | ||
- strictest.yml | ||
|
||
Layout/LineLength: | ||
Enabled: false | ||
AllCops: | ||
TargetRubyVersion: 2.7 | ||
|
||
Metrics: | ||
Enabled: false | ||
|
||
Style/FormatStringToken: | ||
EnforcedStyle: template | ||
|
||
Style/HashSyntax: | ||
EnforcedStyle: no_mixed_keys | ||
|
||
Style/SymbolArray: | ||
EnforcedStyle: brackets | ||
|
||
Style/Documentation: | ||
Enabled: false | ||
|
||
Style/GuardClause: | ||
Enabled: false | ||
|
||
Style/StringLiterals: | ||
Enabled: false | ||
|
||
Style/FrozenStringLiteralComment: | ||
Enabled: false | ||
|
||
Style/IfUnlessModifier: | ||
Enabled: false | ||
|
||
Gemspec/RequireMFA: | ||
Enabled: false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2024-07-31 10:08:15 UTC using RuboCop version 1.64.1. | ||
# The point is for the user to remove these configuration records | ||
# one by one as the offenses are removed from the code base. | ||
# Note that changes in the inspected code, or installation of new | ||
# versions of RuboCop, may require this file to be generated again. | ||
|
||
# Offense count: 21 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: EnforcedStyle, IndentationWidth. | ||
# SupportedStyles: with_first_argument, with_fixed_indentation | ||
Layout/ArgumentAlignment: | ||
Exclude: | ||
- 'lib/hammer_cli_foreman_discovery.rb' | ||
- 'lib/hammer_cli_foreman_discovery/command_extensions/provision_with_puppet.rb' | ||
- 'lib/hammer_cli_foreman_discovery/discovery.rb' | ||
- 'lib/hammer_cli_foreman_discovery/discovery_rule.rb' | ||
- 'test/unit/discovery_rules_test.rb' | ||
- 'test/unit/discovery_test.rb' | ||
|
||
# Offense count: 2 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: EnforcedStyle, IndentationWidth. | ||
# SupportedStyles: special_inside_parentheses, consistent, align_braces | ||
Layout/FirstHashElementIndentation: | ||
Exclude: | ||
- 'test/unit/discovery_resource_mock.rb' | ||
|
||
# Offense count: 15 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. | ||
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys | ||
# SupportedShorthandSyntax: always, never, either, consistent, either_consistent | ||
Style/HashSyntax: | ||
Exclude: | ||
- 'Rakefile' | ||
- 'lib/hammer_cli_foreman_discovery.rb' | ||
- 'lib/hammer_cli_foreman_discovery/discovery.rb' | ||
- 'lib/hammer_cli_foreman_discovery/discovery_references.rb' | ||
- 'lib/hammer_cli_foreman_discovery/discovery_rule.rb' | ||
|
||
# Offense count: 350 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. | ||
# SupportedStyles: single_quotes, double_quotes | ||
Style/StringLiterals: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
Exclude: | ||
- 'Rakefile' | ||
- 'hammer_cli_foreman_discovery.gemspec' | ||
- 'lib/hammer_cli_foreman_discovery.rb' | ||
- 'lib/hammer_cli_foreman_discovery/command_extensions/provision_with_puppet.rb' | ||
- 'lib/hammer_cli_foreman_discovery/discovery.rb' | ||
- 'lib/hammer_cli_foreman_discovery/discovery_references.rb' | ||
- 'lib/hammer_cli_foreman_discovery/discovery_rule.rb' | ||
- 'test/unit/discovery_resource_mock.rb' | ||
- 'test/unit/discovery_rules_test.rb' | ||
- 'test/unit/discovery_test.rb' | ||
|
||
# Offense count: 18 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. | ||
# URISchemes: http, https | ||
Layout/LineLength: | ||
Max: 169 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rake/testtask' | ||
require 'bundler/gem_tasks' | ||
|
||
|
@@ -24,5 +26,5 @@ rescue LoadError | |
task default: :test | ||
else | ||
RuboCop::RakeTask.new | ||
task default: [:rubocop, :test] | ||
task default: %i[rubocop test] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is due to |
||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module HammerCLIForemanDiscovery | ||
require 'hammer_cli_foreman_discovery/version' | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module HammerCLIForemanDiscovery | ||
module DiscoveryReferences | ||
def self.hosts(dsl) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'hammer_cli/i18n' | ||
|
||
module HammerCLIForemanDiscovery | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.