-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from bastelfreak/rubocop2
Add rubocop config
- Loading branch information
Showing
12 changed files
with
189 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
require: | ||
- rubocop-rake | ||
- rubocop-rspec | ||
|
||
# this alligns with our settings in voxpupuli-rubocop | ||
# but we cannot depend on that because it pulls in newer rubocop versions, | ||
# which would break our modules on legacy puppetserver | ||
AllCops: | ||
NewCops: enable | ||
DisplayCopNames: true | ||
ExtraDetails: true | ||
DisplayStyleGuide: true | ||
|
||
# this currently doesn't work with the way we handle our secrets | ||
Gemspec/RequireMFA: | ||
Enabled: false | ||
|
||
# Vox Pupuli default is to use `add_development_dependency` in the gemspec | ||
Gemspec/DevelopmentDependencies: | ||
Enabled: false | ||
|
||
Style/TernaryParentheses: | ||
EnforcedStyle: require_parentheses_when_complex | ||
|
||
Style/TrailingCommaInHashLiteral: | ||
Enabled: true | ||
EnforcedStyleForMultiline: consistent_comma | ||
|
||
Style/TrailingCommaInArrayLiteral: | ||
Enabled: true | ||
EnforcedStyleForMultiline: consistent_comma | ||
|
||
Style/TrailingCommaInArguments: | ||
Enabled: true | ||
EnforcedStyleForMultiline: comma | ||
|
||
Style/IfUnlessModifier: | ||
Enabled: false | ||
|
||
inherit_from: .rubocop_todo.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2024-06-21 10:27:03 UTC using RuboCop version 1.50.2. | ||
# 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: 1 | ||
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. | ||
Metrics/AbcSize: | ||
Max: 18 | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: AllowedMethods, AllowedPatterns. | ||
Metrics/CyclomaticComplexity: | ||
Max: 10 | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. | ||
Metrics/MethodLength: | ||
Max: 24 | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: Prefixes, AllowedPatterns. | ||
# Prefixes: when, with, without | ||
RSpec/ContextWording: | ||
Exclude: | ||
- 'spec/facts_spec.rb' | ||
|
||
# Offense count: 2 | ||
# Configuration parameters: IgnoredMetadata. | ||
RSpec/DescribeClass: | ||
Exclude: | ||
- '**/spec/features/**/*' | ||
- '**/spec/requests/**/*' | ||
- '**/spec/routing/**/*' | ||
- '**/spec/system/**/*' | ||
- '**/spec/views/**/*' | ||
- 'spec/facts_spec.rb' | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: CountAsOne. | ||
RSpec/ExampleLength: | ||
Max: 7 | ||
|
||
# Offense count: 6 | ||
# Configuration parameters: . | ||
# SupportedStyles: have_received, receive | ||
RSpec/MessageSpies: | ||
EnforcedStyle: receive | ||
|
||
# Offense count: 1 | ||
RSpec/MultipleDescribes: | ||
Exclude: | ||
- 'spec/facts_spec.rb' | ||
|
||
# Offense count: 1 | ||
RSpec/MultipleExpectations: | ||
Max: 4 | ||
|
||
# Offense count: 1 | ||
Style/MixinUsage: | ||
Exclude: | ||
- 'lib/voxpupuli/test/facts.rb' | ||
|
||
# Offense count: 1 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. | ||
# URISchemes: http, https | ||
Layout/LineLength: | ||
Max: 136 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,31 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rspec/core/rake_task' | ||
|
||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
task :default => :spec | ||
task default: :spec | ||
|
||
begin | ||
require 'github_changelog_generator/task' | ||
|
||
GitHubChangelogGenerator::RakeTask.new :changelog do |config| | ||
config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file." | ||
config.exclude_labels = %w{duplicate question invalid wontfix wont-fix skip-changelog} | ||
config.exclude_labels = %w[duplicate question invalid wontfix wont-fix skip-changelog] | ||
config.user = 'voxpupuli' | ||
config.project = 'voxpupuli-test' | ||
config.future_release = "v#{Gem::Specification.load("#{config.project}.gemspec").version}" | ||
end | ||
rescue LoadError | ||
# Optional gem, release group is probably disabled | ||
end | ||
|
||
# this is identical to our config in voxpupuli-rubocop, but that gem targets Ruby 2.7 | ||
# and voxupuli-test depends on an older rubocop version because we provide it for our modules | ||
require 'rubocop/rake_task' | ||
RuboCop::RakeTask.new(:rubocop) do |task| | ||
# These make the rubocop experience maybe slightly less terrible | ||
task.options = ['--display-cop-names', '--display-style-guide', '--extra-details'] | ||
# Use Rubocop's Github Actions formatter if possible | ||
task.formatters << 'github' if ENV['GITHUB_ACTIONS'] == 'true' | ||
end |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.