Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
352 changes: 346 additions & 6 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,357 @@
inherit_gem:
google-style: google-style.yml
AllCops:
NewCops: disable
SuggestExtensions: false
TargetRubyVersion: 2.7

Gemspec/AddRuntimeDependency:
Enabled: true
Gemspec/AttributeAssignment:
Enabled: true
Gemspec/DeprecatedAttributeAssignment:
Enabled: true
Gemspec/DevelopmentDependencies:
Enabled: true
Gemspec/RequireMFA:
Enabled: false

Layout/EmptyLineAfterGuardClause:
Enabled: false
Layout/EmptyLinesAfterModuleInclusion:
Enabled: true
Layout/HashAlignment:
Enabled: false
Layout/LineContinuationLeadingSpace:
Enabled: true
Layout/LineContinuationSpacing:
Enabled: true
Layout/LineEndStringConcatenationIndentation:
Enabled: true
Layout/LineLength:
Max: 120
Layout/SpaceBeforeBrackets:
Enabled: true
Layout/SpaceInsideHashLiteralBraces:
Enabled: false


Lint/AmbiguousAssignment:
Enabled: true
Lint/AmbiguousOperatorPrecedence:
Enabled: true
Lint/AmbiguousRange:
Enabled: true
Lint/ArrayLiteralInRegexp:
Enabled: true
Lint/ConstantOverwrittenInRescue:
Enabled: true
Lint/ConstantReassignment:
Enabled: true
Lint/CopDirectiveSyntax:
Enabled: true
Lint/DeprecatedConstants:
Enabled: true
Lint/DuplicateBranch:
Enabled: true
Lint/DuplicateMagicComment:
Enabled: true
Lint/DuplicateMatchPattern:
Enabled: true
Lint/DuplicateRegexpCharacterClassElement:
Enabled: true
Lint/DuplicateSetElement:
Enabled: true
Lint/EmptyBlock:
Enabled: true
Lint/EmptyClass:
AllowComments: true
Enabled: true
Lint/EmptyInPattern:
Enabled: true
Lint/HashNewWithKeywordArgumentsAsDefault:
Enabled: true
Lint/IncompatibleIoSelectWithFiberScheduler:
Enabled: true
Lint/ItWithoutArgumentsInBlock:
Enabled: true
Lint/LambdaWithoutLiteralBlock:
Enabled: true
Lint/LiteralAssignmentInCondition:
Enabled: true
Lint/MixedCaseRange:
Enabled: true
Lint/NonAtomicFileOperation:
Enabled: true
Lint/NoReturnInBeginEndBlocks:
Enabled: true
Lint/NumberedParameterAssignment:
Enabled: true
Lint/NumericOperationWithConstantResult:
Enabled: true
Lint/OrAssignmentToConstant:
Enabled: true
Lint/RedundantDirGlobSort:
Enabled: true
Lint/RedundantRegexpQuantifiers:
Enabled: true
Lint/RedundantTypeConversion:
Enabled: true
Lint/RefinementImportMethods:
Enabled: true
Lint/RequireRangeParentheses:
Enabled: true
Lint/RequireRelativeSelfPath:
Enabled: true
Lint/SharedMutableDefault:
Enabled: true
Lint/SuppressedExceptionInNumberConversion:
Enabled: true
Lint/SymbolConversion:
Enabled: true
Lint/ToEnumArguments:
Enabled: true
Lint/TripleQuotes:
Enabled: true
Lint/UnescapedBracketInRegexp:
Enabled: true
Lint/UnexpectedBlockArity:
Enabled: true
Lint/UnmodifiedReduceAccumulator:
Enabled: true
Lint/UnusedMethodArgument:
Exclude:
- "lib/cloud_events/format.rb"
Lint/UselessConstantScoping:
Enabled: true
Lint/UselessDefaultValueArgument:
Enabled: true
Lint/UselessDefined:
Enabled: true
Lint/UselessNumericOperation:
Enabled: true
Lint/UselessOr:
Enabled: true
Lint/UselessRescue:
Enabled: true
Lint/UselessRuby2Keywords:
Enabled: true

Metrics/AbcSize:
Max: 30
Metrics/BlockLength:
Exclude:
- "test/**/test_*.rb"
Metrics/ClassLength:
Max: 300
Metrics/CollectionLiteralLength:
Enabled: true
Metrics/CyclomaticComplexity:
Max: 12
Metrics/MethodLength:
Max: 25
Metrics/ModuleLength:
Max: 300
Naming/FileName:
Exclude:
- "examples/*/Gemfile"
- ".toys/**/*.rb"
Metrics/ParameterLists:
Enabled: false
Metrics/PerceivedComplexity:
Max: 12

Naming/BlockForwarding:
Enabled: true
Naming/PredicateMethod:
Enabled: true

Security/CompoundHash:
Enabled: true
Security/IoMethods:
Enabled: true

Style/AccessorGrouping:
Enabled: false
Style/AmbiguousEndlessMethodDefinition:
Enabled: true
Style/ArgumentsForwarding:
Enabled: true
Style/ArrayIntersect:
Enabled: true
Style/ArrayIntersectWithSingleElement:
Enabled: true
Style/BisectedAttrAccessor:
Enabled: false
Style/BitwisePredicate:
Enabled: true
Style/CaseEquality:
Enabled: false
Style/CollectionCompact:
Enabled: true
Style/CollectionQuerying:
Enabled: true
Style/CombinableDefined:
Enabled: true
Style/ComparableBetween:
Enabled: false
Style/ComparableClamp:
Enabled: true
Style/ConcatArrayLiterals:
Enabled: true
Style/DataInheritance:
Enabled: true
Style/DigChain:
Enabled: true
Style/DirEmpty:
Enabled: true
Style/DocumentDynamicEvalDefinition:
Enabled: true
Style/DocumentationMethod:
Enabled: false
Style/EmptyHeredoc:
Enabled: true
Style/EmptyStringInsideInterpolation:
Enabled: true
Style/EndlessMethod:
Enabled: true
Style/EnvHome:
Enabled: true
Style/ExactRegexpMatch:
Enabled: true
Style/FetchEnvVar:
Enabled: true
Style/FileEmpty:
Enabled: true
Style/FileNull:
Enabled: true
Style/FileRead:
Enabled: true
Style/FileTouch:
Enabled: true
Style/FileWrite:
Enabled: true
Style/GuardClause:
Enabled: false
Style/HashConversion:
Enabled: true
Style/HashExcept:
Enabled: true
Style/HashFetchChain:
Enabled: true
Style/HashSlice:
Enabled: true
Style/IfUnlessModifier:
Enabled: false
Style/IfWithBooleanLiteralBranches:
Enabled: true
Style/InPatternThen:
Enabled: true
Style/ItAssignment:
Enabled: true
Style/ItBlockParameter:
Enabled: true
Style/KeywordArgumentsMerging:
Enabled: true
Style/MagicCommentFormat:
Enabled: true
Style/MapCompactWithConditionalBlock:
Enabled: true
Style/MapIntoArray:
Enabled: true
Style/MapToHash:
Enabled: true
Style/MapToSet:
Enabled: true
Style/MethodCallWithArgsParentheses:
Enabled: true
Style/MinMaxComparison:
Enabled: true
Style/MultilineInPatternThen:
Enabled: true
Style/NegatedIfElseCondition:
Enabled: true
Style/Next:
Enabled: false
Style/NestedFileDirname:
Enabled: true
Style/NilLambda:
Enabled: true
Style/NumberedParameters:
Enabled: true
Style/NumberedParametersLimit:
Enabled: true
Style/ObjectThen:
Enabled: true
Style/OpenStructUse:
Enabled: true
Style/OperatorMethodCall:
Enabled: true
Style/OptionalBooleanParameter:
Enabled: false
Style/QuotedSymbols:
Enabled: true
Style/RedundantArgument:
Enabled: true
Style/RedundantArrayConstructor:
Enabled: true
Style/RedundantArrayFlatten:
Enabled: true
Style/RedundantConstantBase:
Enabled: false
Style/RedundantCurrentDirectoryInPath:
Enabled: true
Style/RedundantDoubleSplatHashBraces:
Enabled: true
Style/RedundantEach:
Enabled: true
Style/RedundantFilterChain:
Enabled: true
Style/RedundantFormat:
Enabled: true
Style/RedundantHeredocDelimiterQuotes:
Enabled: true
Style/RedundantInitialize:
Enabled: true
Style/RedundantInterpolationUnfreeze:
Enabled: true
Style/RedundantLineContinuation:
Enabled: true
Style/RedundantRegexpArgument:
Enabled: true
Style/RedundantRegexpConstructor:
Enabled: true
Style/RedundantSelfAssignmentBranch:
Enabled: true
Style/RedundantStringEscape:
Enabled: true
Style/RescueModifier:
Enabled: false
Style/ReturnNilInPredicateMethodDefinition:
Enabled: true
Style/SafeNavigationChainLength:
Enabled: true
Style/SelectByRegexp:
Enabled: true
Style/SendWithLiteralMethodName:
Enabled: true
Style/SingleLineDoEndBlock:
Enabled: true
Style/SoleNestedConditional:
Enabled: false
Style/StringChars:
Enabled: true
Style/StringLiterals:
EnforcedStyle: double_quotes
Style/SuperArguments:
Enabled: true
Style/SuperWithArgsParentheses:
Enabled: true
Style/SwapValues:
Enabled: true
Style/SymbolArray:
EnforcedStyle: brackets
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma
Style/WhileUntilModifier:
Enabled: false
Style/WordArray:
EnforcedStyle: brackets
Style/YAMLFileRead:
Enabled: true
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# frozen_string_literal: true

source "https://rubygems.org"
gemspec

gem "cucumber", "~> 9.2"
gem "google-style", "~> 1.27.1"
gem "minitest", "~> 5.25"
gem "minitest-focus", "~> 1.4"
gem "minitest-rg", "~> 5.3"
gem "rack", "~> 3.2"
gem "redcarpet", "~> 3.6" unless ::RUBY_PLATFORM == "java"
gem "rubocop", "~> 1.81"
gem "webrick", "~> 1.9"
gem "yard", "~> 0.9.37"
2 changes: 1 addition & 1 deletion cloud_events.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ version = ::CloudEvents::VERSION
spec.require_paths = ["lib"]
spec.required_ruby_version = ">= 2.7"

if spec.respond_to? :metadata
if spec.respond_to?(:metadata)
spec.metadata["changelog_uri"] = "https://cloudevents.github.io/sdk-ruby/v#{version}/file.CHANGELOG.html"
spec.metadata["source_code_uri"] = "https://github.com/cloudevents/sdk-ruby"
spec.metadata["bug_tracker_uri"] = "https://github.com/cloudevents/sdk-ruby/issues"
Expand Down
2 changes: 2 additions & 0 deletions examples/client/Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# frozen_string_literal: true

source "https://rubygems.org"
gem "cloud_events", path: "../.."
Loading
Loading