-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add rubocop config #130
Merged
Merged
Add rubocop config #130
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I honestly don't now if puppet-lint understands this format.
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.
It seems to work fine:
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.
was asking myself the same (my rubocop plugin wanted to auto fix this every time i opend the file XD) . but if it is tested...