diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index 6982b2dd2..000000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,15 +0,0 @@ -engines: - rubocop: - enabled: true - bundler-audit: - enblaed: true - duplication: - enabled: true - config: - languages: - - ruby -exclude_paths: - - spec/ - - coverage/ - - fixtures/ - - doc/ \ No newline at end of file diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 000000000..cbc678710 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,30 @@ +name: CodeQL +on: + push: + branches: [master] + pull_request: + workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + analyze: + name: CodeQL + runs-on: + group: organization/Default + permissions: + contents: read + security-events: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Initialize CodeQL + uses: github/codeql-action/init@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3 + with: + languages: ruby + build-mode: none + - name: Analyze + uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3 + with: + category: /language:ruby diff --git a/.github/workflows/run-validations.yml b/.github/workflows/run-validations.yml index f1dd31beb..2ca8187f6 100644 --- a/.github/workflows/run-validations.yml +++ b/.github/workflows/run-validations.yml @@ -1,6 +1,11 @@ name: Validations -on: [push] +on: + push: + workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: pubnub-yml: @@ -24,9 +29,23 @@ jobs: - name: Cancel workflow runs for commit on error if: failure() uses: ./.github/.release/actions/actions/utils/fast-jobs-failure + rubocop: + name: RuboCop + runs-on: + group: organization/Default + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.2.3 + bundler-cache: true + - name: Run RuboCop + run: bundle exec rubocop all-validations: name: Validations - needs: [pubnub-yml] + needs: [pubnub-yml, rubocop] runs-on: group: organization/Default steps: diff --git a/.github/workflows/vulnerability-scan.yml b/.github/workflows/vulnerability-scan.yml new file mode 100644 index 000000000..0e4240eca --- /dev/null +++ b/.github/workflows/vulnerability-scan.yml @@ -0,0 +1,18 @@ +name: Vulnerability scan +on: + push: + branches: + - master + - main + +jobs: + security: + runs-on: + group: organization/Default + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Run Snyk monitor for vulnerabilities + run: snyk monitor --org=sdk --file=Gemfile.lock + env: + SNYK_TOKEN: ${{ secrets.SNYK_SDK_TOKEN }} diff --git a/.rubocop.yml b/.rubocop.yml index 3a72db1b1..c452d4b79 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,8 +1,13 @@ +inherit_from: .rubocop_todo.yml + AllCops: + NewCops: enable + SuggestExtensions: false TargetRubyVersion: 3.0 Exclude: - 'spec/**/*' - 'examples/**/*' + - 'vendor/**/*' - 'lib/pubnub/crypto.rb' - 'lib/pubnub/format.rb' @@ -10,7 +15,7 @@ AllCops: Metrics/ClassLength: Max: 150 -Metrics/LineLength: +Layout/LineLength: Max: 150 Metrics/AbcSize: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 000000000..33c315365 --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,1083 @@ +# This configuration was generated by +# `rubocop --auto-gen-config --exclude-limit 1000 --no-auto-gen-timestamp` +# using RuboCop version 1.66.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: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. +# Include: **/*.gemfile, **/Gemfile, **/gems.rb +Bundler/OrderedGems: + Exclude: + - 'Gemfile' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Severity, Include. +# Include: **/*.gemspec +Gemspec/DeprecatedAttributeAssignment: + Exclude: + - 'pubnub.gemspec' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. +# Include: **/*.gemspec +Gemspec/OrderedDependencies: + Exclude: + - 'pubnub.gemspec' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Severity, Include. +# Include: **/*.gemspec +Gemspec/RequireMFA: + Exclude: + - 'pubnub.gemspec' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentOneStep, IndentationWidth. +# SupportedStyles: case, end +Layout/CaseIndentation: + Exclude: + - 'lib/pubnub/client.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: leading, trailing +Layout/DotPosition: + Exclude: + - 'features/support/hooks.rb' + +# Offense count: 52 +# This cop supports safe autocorrection (--autocorrect). +Layout/EmptyLineAfterGuardClause: + Exclude: + - 'lib/pubnub/cbor.rb' + - 'lib/pubnub/client.rb' + - 'lib/pubnub/client/getters_setters.rb' + - 'lib/pubnub/http_dispatcher.rb' + - 'lib/pubnub/subscribe_event/removing.rb' + - 'lib/pubnub/subscriber.rb' + - 'lib/pubnub/telemetry.rb' + - 'lib/pubnub/validators/add_channels_to_push.rb' + - 'lib/pubnub/validators/audit.rb' + - 'lib/pubnub/validators/channel_registration.rb' + - 'lib/pubnub/validators/delete.rb' + - 'lib/pubnub/validators/here_now.rb' + - 'lib/pubnub/validators/history.rb' + - 'lib/pubnub/validators/leave.rb' + - 'lib/pubnub/validators/list_push_provisions.rb' + - 'lib/pubnub/validators/presence.rb' + - 'lib/pubnub/validators/publish.rb' + - 'lib/pubnub/validators/remove_channels_from_push.rb' + - 'lib/pubnub/validators/remove_device_from_push.rb' + - 'lib/pubnub/validators/state.rb' + - 'lib/pubnub/validators/subscribe.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Layout/EmptyLineAfterMagicComment: + Exclude: + - 'features/step_definitions/crypto_steps.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, DefLikeMacros, AllowAdjacentOneLineDefs, NumberOfEmptyLines. +Layout/EmptyLineBetweenDefs: + Exclude: + - 'lib/pubnub/events/revoke_token.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Layout/EmptyLines: + Exclude: + - 'lib/pubnub/events/revoke_token.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines +Layout/EmptyLinesAroundModuleBody: + Exclude: + - 'lib/pubnub/cbor.rb' + - 'lib/pubnub/client/getters_setters.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyleAlignWith, Severity. +# SupportedStylesAlignWith: keyword, variable, start_of_line +Layout/EndAlignment: + Exclude: + - 'lib/pubnub/client.rb' + +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. +# SupportedHashRocketStyles: key, separator, table +# SupportedColonStyles: key, separator, table +# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit +Layout/HashAlignment: + Exclude: + - 'features/support/env.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: aligned, indented +Layout/LineEndStringConcatenationIndentation: + Exclude: + - 'lib/pubnub/client.rb' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. +# URISchemes: http, https +Layout/LineLength: + Exclude: + - 'features/step_definitions/access_steps.rb' + - 'lib/pubnub/events/grant_token.rb' + - 'lib/pubnub/subscribe_event/callbacks.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: aligned, indented, indented_relative_to_receiver +Layout/MultilineMethodCallIndentation: + Exclude: + - 'lib/pubnub/events/revoke_token.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: aligned, indented +Layout/MultilineOperationIndentation: + Exclude: + - 'lib/pubnub/validators/grant_token.rb' + +# Offense count: 15 +# This cop supports safe autocorrection (--autocorrect). +Layout/SpaceAfterColon: + Exclude: + - 'lib/pubnub/validators/add_message_action.rb' + - 'lib/pubnub/validators/remove_message_action.rb' + +# Offense count: 5 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator, EnforcedStyleForRationalLiterals. +# SupportedStylesForExponentOperator: space, no_space +# SupportedStylesForRationalLiterals: space, no_space +Layout/SpaceAroundOperators: + Exclude: + - 'lib/pubnub/cbor.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. +# SupportedStyles: space, no_space +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceBeforeBlockBraces: + Exclude: + - 'lib/pubnub/events/revoke_token.rb' + +# Offense count: 30 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. +# SupportedStyles: space, no_space, compact +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceInsideHashLiteralBraces: + Exclude: + - 'lib/pubnub/validators/add_message_action.rb' + - 'lib/pubnub/validators/remove_message_action.rb' + +# Offense count: 8 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: final_newline, final_blank_line +Layout/TrailingEmptyLines: + Exclude: + - 'features/support/cryptor.rb' + - 'features/support/env.rb' + - 'features/support/hooks.rb' + - 'lib/pubnub/events/add_message_action.rb' + - 'lib/pubnub/events/get_message_actions.rb' + - 'lib/pubnub/events/remove_message_actions.rb' + - 'lib/pubnub/modules/crypto/crypto_module.rb' + - 'lib/pubnub/validators/grant_token.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowInHeredoc. +Layout/TrailingWhitespace: + Exclude: + - 'lib/pubnub/cbor.rb' + +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +Lint/AmbiguousOperatorPrecedence: + Exclude: + - 'lib/pubnub/cbor.rb' + - 'lib/pubnub/client.rb' + +# Offense count: 4 +# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches. +Lint/DuplicateBranch: + Exclude: + - 'lib/pubnub/cbor.rb' + - 'lib/pubnub/formatter.rb' + +# Offense count: 2 +# Configuration parameters: AllowedParentClasses. +Lint/MissingSuper: + Exclude: + - 'lib/pubnub/error.rb' + - 'lib/pubnub/modules/crypto/cryptor_header.rb' + +# Offense count: 5 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowedImplicitNamespaces. +# AllowedImplicitNamespaces: Gem +Lint/RaiseException: + Exclude: + - 'lib/pubnub/subscribe_event/formatter.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Lint/RedundantStringCoercion: + Exclude: + - 'lib/pubnub/validators/set_channel_members.rb' + - 'lib/pubnub/validators/set_memberships.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AutoCorrect, IgnoreEmptyBlocks, AllowUnusedKeywordArguments. +Lint/UnusedBlockArgument: + Exclude: + - 'features/step_definitions/access_steps.rb' + - 'lib/pubnub/event/signature.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AutoCorrect, ContextCreatingMethods, MethodCreatingMethods. +Lint/UselessAccessModifier: + Exclude: + - 'features/support/cryptor.rb' + +# Offense count: 28 +# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max. +Metrics/AbcSize: + Exclude: + - 'lib/pubnub/cbor.rb' + - 'lib/pubnub/client/paged_history.rb' + - 'lib/pubnub/event.rb' + - 'lib/pubnub/event/signature.rb' + - 'lib/pubnub/events/fetch_messages.rb' + - 'lib/pubnub/events/get_all_channels_metadata.rb' + - 'lib/pubnub/events/get_all_uuid_metadata.rb' + - 'lib/pubnub/events/get_channel_members.rb' + - 'lib/pubnub/events/get_memberships.rb' + - 'lib/pubnub/events/get_message_actions.rb' + - 'lib/pubnub/events/remove_channel_members.rb' + - 'lib/pubnub/events/remove_memberships.rb' + - 'lib/pubnub/events/set_channel_members.rb' + - 'lib/pubnub/events/set_memberships.rb' + - 'lib/pubnub/events/set_uuid_metadata.rb' + - 'lib/pubnub/subscribe_event/formatter.rb' + - 'lib/pubnub/subscriber.rb' + - 'lib/pubnub/validators/set_channel_members.rb' + - 'lib/pubnub/validators/set_memberships.rb' + +# Offense count: 1 +# Configuration parameters: CountBlocks, CountModifierForms. +Metrics/BlockNesting: + Max: 4 + +# Offense count: 4 +# Configuration parameters: CountComments, Max, CountAsOne. +Metrics/ClassLength: + Exclude: + - 'lib/pubnub/cbor.rb' + - 'lib/pubnub/client.rb' + - 'lib/pubnub/event.rb' + - 'lib/pubnub/subscriber.rb' + +# Offense count: 16 +# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns. +Metrics/MethodLength: + Exclude: + - 'lib/pubnub/cbor.rb' + - 'lib/pubnub/client/paged_history.rb' + - 'lib/pubnub/events/get_all_channels_metadata.rb' + - 'lib/pubnub/events/get_all_uuid_metadata.rb' + - 'lib/pubnub/events/get_channel_members.rb' + - 'lib/pubnub/events/get_memberships.rb' + - 'lib/pubnub/events/get_message_actions.rb' + - 'lib/pubnub/events/history.rb' + - 'lib/pubnub/events/remove_channel_members.rb' + - 'lib/pubnub/events/remove_memberships.rb' + - 'lib/pubnub/events/set_channel_members.rb' + - 'lib/pubnub/events/set_memberships.rb' + - 'lib/pubnub/pam.rb' + - 'lib/pubnub/subscribe_event/formatter.rb' + - 'lib/pubnub/subscriber.rb' + +# Offense count: 3 +# Configuration parameters: CountComments, CountAsOne. +Metrics/ModuleLength: + Max: 231 + +# Offense count: 5 +# Configuration parameters: CountKeywordArgs, MaxOptionalParameters. +Metrics/ParameterLists: + Max: 8 + +# Offense count: 17 +# Configuration parameters: AllowedMethods, AllowedPatterns, Max. +Metrics/PerceivedComplexity: + Exclude: + - 'lib/pubnub/cbor.rb' + - 'lib/pubnub/client/paged_history.rb' + - 'lib/pubnub/events/fetch_messages.rb' + - 'lib/pubnub/events/get_all_channels_metadata.rb' + - 'lib/pubnub/events/get_all_uuid_metadata.rb' + - 'lib/pubnub/events/get_channel_members.rb' + - 'lib/pubnub/events/get_memberships.rb' + - 'lib/pubnub/events/grant.rb' + - 'lib/pubnub/events/remove_channel_members.rb' + - 'lib/pubnub/events/remove_memberships.rb' + - 'lib/pubnub/events/set_channel_members.rb' + - 'lib/pubnub/events/set_channel_metadata.rb' + - 'lib/pubnub/events/set_memberships.rb' + - 'lib/pubnub/events/set_uuid_metadata.rb' + - 'lib/pubnub/subscribe_event/formatter.rb' + - 'lib/pubnub/validators/set_channel_members.rb' + - 'lib/pubnub/validators/set_memberships.rb' + +# Offense count: 4 +Naming/AccessorMethodName: + Exclude: + - 'lib/pubnub/client.rb' + - 'lib/pubnub/event.rb' + - 'lib/pubnub/events/here_now.rb' + - 'lib/pubnub/subscriber.rb' + +# Offense count: 3 +# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. +Naming/BlockParameterName: + Exclude: + - 'features/step_definitions/access_steps.rb' + - 'features/support/hooks.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyleForLeadingUnderscores. +# SupportedStylesForLeadingUnderscores: disallowed, required, optional +Naming/MemoizedInstanceVariableName: + Exclude: + - 'lib/pubnub/subscribe_event/callbacks.rb' + +# Offense count: 4 +# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. +# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to +Naming/MethodParameterName: + Exclude: + - 'lib/pubnub/event.rb' + - 'lib/pubnub/subscribe_event/adding.rb' + - 'lib/pubnub/subscriber.rb' + +# Offense count: 1 +# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros. +# NamePrefix: is_, has_, have_ +# ForbiddenPrefixes: is_, has_, have_ +# AllowedMethods: is_a? +# MethodDefinitionMacros: define_method, define_singleton_method +Naming/PredicateName: + Exclude: + - 'spec/**/*' + - 'features/support/helper.rb' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: PreferredName. +Naming/RescuedExceptionsVariableName: + Exclude: + - 'lib/pubnub/subscribe_event.rb' + - 'lib/pubnub/subscriber.rb' + - 'lib/pubnub/telemetry.rb' + +# Offense count: 6 +# Configuration parameters: EnforcedStyle, AllowedIdentifiers, AllowedPatterns. +# SupportedStyles: snake_case, camelCase +Naming/VariableName: + Exclude: + - 'features/step_definitions/access_steps.rb' + - 'features/support/hooks.rb' + +# Offense count: 1 +Security/Eval: + Exclude: + - 'features/support/helper.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: separated, grouped +Style/AccessorGrouping: + Exclude: + - 'lib/pubnub/subscriber.rb' + +# Offense count: 8 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods. +# SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces +# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object +# FunctionalMethods: let, let!, subject, watch +# AllowedMethods: lambda, proc, it +Style/BlockDelimiters: + Exclude: + - 'features/support/helper.rb' + - 'features/support/hooks.rb' + - 'lib/pubnub/events/remove_channel_members.rb' + - 'lib/pubnub/events/remove_memberships.rb' + +# Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowedReceivers. +Style/CollectionCompact: + Exclude: + - 'lib/pubnub/events/grant.rb' + - 'lib/pubnub/events/here_now.rb' + - 'lib/pubnub/events/revoke.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/ColonMethodCall: + Exclude: + - 'lib/pubnub/events/grant.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions. +# SupportedStyles: assign_to_condition, assign_inside_condition +Style/ConditionalAssignment: + Exclude: + - 'lib/pubnub/cbor.rb' + - 'lib/pubnub/events/grant_token.rb' + +# Offense count: 1 +Style/DocumentDynamicEvalDefinition: + Exclude: + - 'features/support/helper.rb' + +# Offense count: 4 +# Configuration parameters: AllowedConstants. +Style/Documentation: + Exclude: + - 'spec/**/*' + - 'test/**/*' + - 'lib/pubnub/cbor.rb' + - 'lib/pubnub/events/grant_token.rb' + - 'lib/pubnub/http_dispatcher.rb' + - 'lib/pubnub/http_response.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/EachWithObject: + Exclude: + - 'features/support/helper.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AutoCorrect, EnforcedStyle, AllowComments. +# SupportedStyles: empty, nil, both +Style/EmptyElse: + Exclude: + - 'lib/pubnub/cbor.rb' + +# Offense count: 5 +# This cop supports safe autocorrection (--autocorrect). +Style/EmptyLiteral: + Exclude: + - 'lib/pubnub/cbor.rb' + - 'lib/pubnub/events/remove_channel_members.rb' + - 'lib/pubnub/events/remove_memberships.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/EvalWithLocation: + Exclude: + - 'features/support/helper.rb' + +# Offense count: 18 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowedVars. +Style/FetchEnvVar: + Exclude: + - 'features/step_definitions/access_steps.rb' + - 'features/support/hooks.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: left_coerce, right_coerce, single_coerce, fdiv +Style/FloatDivision: + Exclude: + - 'lib/pubnub/telemetry.rb' + +# Offense count: 9 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns. +# SupportedStyles: annotated, template, unannotated +Style/FormatStringToken: + EnforcedStyle: unannotated + +# Offense count: 99 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: always, always_true, never +Style/FrozenStringLiteralComment: + Exclude: + - 'Gemfile' + - 'Rakefile' + - 'features/step_definitions/access_steps.rb' + - 'features/support/cryptor.rb' + - 'features/support/env.rb' + - 'features/support/helper.rb' + - 'features/support/hooks.rb' + - 'gemfiles/celluloid_017.gemfile' + - 'gemfiles/celluloid_018.gemfile' + - 'gemfiles/celluloid_master.gemfile' + - 'lib/pubnub.rb' + - 'lib/pubnub/cbor.rb' + - 'lib/pubnub/client/events.rb' + - 'lib/pubnub/client/getters_setters.rb' + - 'lib/pubnub/client/helpers.rb' + - 'lib/pubnub/configuration.rb' + - 'lib/pubnub/constants.rb' + - 'lib/pubnub/envelope.rb' + - 'lib/pubnub/error.rb' + - 'lib/pubnub/error_envelope.rb' + - 'lib/pubnub/event.rb' + - 'lib/pubnub/event/formatter.rb' + - 'lib/pubnub/event/signature.rb' + - 'lib/pubnub/events/add_channels_to_push.rb' + - 'lib/pubnub/events/add_message_action.rb' + - 'lib/pubnub/events/audit.rb' + - 'lib/pubnub/events/channel_registration.rb' + - 'lib/pubnub/events/delete_messages.rb' + - 'lib/pubnub/events/get_message_actions.rb' + - 'lib/pubnub/events/grant.rb' + - 'lib/pubnub/events/grant_token.rb' + - 'lib/pubnub/events/heartbeat.rb' + - 'lib/pubnub/events/here_now.rb' + - 'lib/pubnub/events/history.rb' + - 'lib/pubnub/events/leave.rb' + - 'lib/pubnub/events/list_push_provisions.rb' + - 'lib/pubnub/events/message_counts.rb' + - 'lib/pubnub/events/presence.rb' + - 'lib/pubnub/events/publish.rb' + - 'lib/pubnub/events/remove_channels_from_push.rb' + - 'lib/pubnub/events/remove_device_from_push.rb' + - 'lib/pubnub/events/remove_message_actions.rb' + - 'lib/pubnub/events/revoke.rb' + - 'lib/pubnub/events/revoke_token.rb' + - 'lib/pubnub/events/set_state.rb' + - 'lib/pubnub/events/state.rb' + - 'lib/pubnub/events/subscribe.rb' + - 'lib/pubnub/events/time.rb' + - 'lib/pubnub/events/where_now.rb' + - 'lib/pubnub/formatter.rb' + - 'lib/pubnub/heart.rb' + - 'lib/pubnub/http_dispatcher.rb' + - 'lib/pubnub/http_response.rb' + - 'lib/pubnub/modules/crypto/crypto_module.rb' + - 'lib/pubnub/modules/crypto/cryptor_header.rb' + - 'lib/pubnub/modules/crypto/cryptors/legacy_cryptor.rb' + - 'lib/pubnub/origin_manager.rb' + - 'lib/pubnub/pam.rb' + - 'lib/pubnub/single_event.rb' + - 'lib/pubnub/subscribe_callback.rb' + - 'lib/pubnub/subscribe_event.rb' + - 'lib/pubnub/subscribe_event/adding.rb' + - 'lib/pubnub/subscribe_event/callbacks.rb' + - 'lib/pubnub/subscribe_event/formatter.rb' + - 'lib/pubnub/subscribe_event/heartbeat.rb' + - 'lib/pubnub/subscribe_event/removing.rb' + - 'lib/pubnub/subscriber.rb' + - 'lib/pubnub/telemetry.rb' + - 'lib/pubnub/uuid.rb' + - 'lib/pubnub/validators/add_channels_to_push.rb' + - 'lib/pubnub/validators/add_message_action.rb' + - 'lib/pubnub/validators/audit.rb' + - 'lib/pubnub/validators/channel_registration.rb' + - 'lib/pubnub/validators/client.rb' + - 'lib/pubnub/validators/common_validator.rb' + - 'lib/pubnub/validators/delete.rb' + - 'lib/pubnub/validators/get_message_actions.rb' + - 'lib/pubnub/validators/grant.rb' + - 'lib/pubnub/validators/grant_token.rb' + - 'lib/pubnub/validators/heartbeat.rb' + - 'lib/pubnub/validators/here_now.rb' + - 'lib/pubnub/validators/history.rb' + - 'lib/pubnub/validators/leave.rb' + - 'lib/pubnub/validators/list_push_provisions.rb' + - 'lib/pubnub/validators/message_counts.rb' + - 'lib/pubnub/validators/presence.rb' + - 'lib/pubnub/validators/publish.rb' + - 'lib/pubnub/validators/remove_channels_from_push.rb' + - 'lib/pubnub/validators/remove_device_from_push.rb' + - 'lib/pubnub/validators/remove_message_action.rb' + - 'lib/pubnub/validators/revoke.rb' + - 'lib/pubnub/validators/revoke_token.rb' + - 'lib/pubnub/validators/set_state.rb' + - 'lib/pubnub/validators/state.rb' + - 'lib/pubnub/validators/subscribe.rb' + - 'lib/pubnub/validators/time.rb' + - 'lib/pubnub/validators/where_now.rb' + - 'lib/pubnub/version.rb' + - 'pubnub.gemspec' + +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/GlobalStdStream: + Exclude: + - 'features/step_definitions/access_steps.rb' + +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. +Style/GuardClause: + Exclude: + - 'features/support/hooks.rb' + - 'lib/pubnub/validators/add_message_action.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowedReceivers. +# AllowedReceivers: Thread.current +Style/HashEachMethods: + Exclude: + - 'lib/pubnub/subscriber.rb' + +# Offense count: 6 +# 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: + - 'features/step_definitions/access_steps.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/HashTransformValues: + Exclude: + - 'lib/pubnub/events/grant_token.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowIfModifier. +Style/IfInsideElse: + Exclude: + - 'lib/pubnub/subscribe_event/removing.rb' + +# Offense count: 9 +# This cop supports safe autocorrection (--autocorrect). +Style/IfUnlessModifier: + Exclude: + - 'features/support/cryptor.rb' + - 'features/support/hooks.rb' + - 'lib/pubnub/cbor.rb' + - 'lib/pubnub/client.rb' + - 'lib/pubnub/http_dispatcher.rb' + - 'lib/pubnub/subscribe_event/callbacks.rb' + +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowedMethods. +# AllowedMethods: nonzero? +Style/IfWithBooleanLiteralBranches: + Exclude: + - 'lib/pubnub/origin_manager.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowedMethods, AllowedPatterns. +Style/MethodCallWithoutArgsParentheses: + Exclude: + - 'features/support/hooks.rb' + +# Offense count: 2 +Style/MultilineBlockChain: + Exclude: + - 'features/support/helper.rb' + - 'lib/pubnub/cbor.rb' + +# Offense count: 29 +# This cop supports safe autocorrection (--autocorrect). +Style/MultilineIfModifier: + Exclude: + - 'lib/pubnub/validators/grant.rb' + - 'lib/pubnub/validators/grant_token.rb' + - 'lib/pubnub/validators/remove_channel_members.rb' + - 'lib/pubnub/validators/remove_memberships.rb' + - 'lib/pubnub/validators/revoke_token.rb' + - 'lib/pubnub/validators/set_channel_members.rb' + - 'lib/pubnub/validators/set_memberships.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: literals, strict +Style/MutableConstant: + Exclude: + - 'lib/pubnub/cbor.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +Style/NegatedIfElseCondition: + Exclude: + - 'lib/pubnub/cbor.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, MinBodyLength. +# SupportedStyles: skip_modifier_ifs, always +Style/Next: + Exclude: + - 'lib/pubnub/validators/set_channel_members.rb' + - 'lib/pubnub/validators/set_memberships.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: predicate, comparison +Style/NilComparison: + Exclude: + - 'features/support/hooks.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: IncludeSemanticChanges. +Style/NonNilCheck: + Exclude: + - 'lib/pubnub/events/grant_token.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Style/Not: + Exclude: + - 'features/support/hooks.rb' + +# Offense count: 7 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns. +# SupportedStyles: predicate, comparison +Style/NumericPredicate: + Exclude: + - 'spec/**/*' + - 'lib/pubnub/cbor.rb' + - 'lib/pubnub/client/paged_history.rb' + - 'lib/pubnub/event/formatter.rb' + - 'lib/pubnub/subscribe_event.rb' + - 'lib/pubnub/validators/audit.rb' + +# Offense count: 32 +# Configuration parameters: AllowedMethods. +# AllowedMethods: respond_to_missing? +Style/OptionalBooleanParameter: + Exclude: + - 'lib/pubnub/client.rb' + - 'lib/pubnub/event.rb' + - 'lib/pubnub/events/audit.rb' + - 'lib/pubnub/events/delete_messages.rb' + - 'lib/pubnub/events/fetch_messages.rb' + - 'lib/pubnub/events/get_all_channels_metadata.rb' + - 'lib/pubnub/events/get_all_uuid_metadata.rb' + - 'lib/pubnub/events/get_channel_members.rb' + - 'lib/pubnub/events/get_channel_metadata.rb' + - 'lib/pubnub/events/get_memberships.rb' + - 'lib/pubnub/events/get_uuid_metadata.rb' + - 'lib/pubnub/events/grant.rb' + - 'lib/pubnub/events/remove_channel_members.rb' + - 'lib/pubnub/events/remove_memberships.rb' + - 'lib/pubnub/events/revoke.rb' + - 'lib/pubnub/events/set_channel_members.rb' + - 'lib/pubnub/events/set_channel_metadata.rb' + - 'lib/pubnub/events/set_memberships.rb' + - 'lib/pubnub/events/set_uuid_metadata.rb' + - 'lib/pubnub/formatter.rb' + - 'lib/pubnub/modules/crypto/cryptors/legacy_cryptor.rb' + - 'lib/pubnub/pam.rb' + - 'lib/pubnub/subscribe_event/removing.rb' + - 'lib/pubnub/validators/common_validator.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowSafeAssignment, AllowInMultilineConditions. +Style/ParenthesesAroundCondition: + Exclude: + - 'lib/pubnub/validators/grant_token.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: short, verbose +Style/PreferredHashMethods: + Exclude: + - 'lib/pubnub/client.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: . +# SupportedStyles: same_as_string_literals, single_quotes, double_quotes +Style/QuotedSymbols: + EnforcedStyle: double_quotes + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Methods. +Style/RedundantArgument: + Exclude: + - 'lib/pubnub/events/revoke_token.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantAssignment: + Exclude: + - 'features/support/cryptor.rb' + - 'lib/pubnub/events/publish.rb' + - 'lib/pubnub/events/signal.rb' + +# Offense count: 4 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/RedundantInterpolation: + Exclude: + - 'features/support/hooks.rb' + +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantParentheses: + Exclude: + - 'lib/pubnub/cbor.rb' + - 'lib/pubnub/event/formatter.rb' + - 'lib/pubnub/validators/grant_token.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantRegexpArgument: + Exclude: + - 'lib/pubnub/event/signature.rb' + - 'lib/pubnub/subscribe_event.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantRegexpEscape: + Exclude: + - 'pubnub.gemspec' + +# Offense count: 9 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowMultipleReturnValues. +Style/RedundantReturn: + Exclude: + - 'lib/pubnub/cbor.rb' + - 'lib/pubnub/validators/heartbeat.rb' + - 'lib/pubnub/validators/revoke.rb' + - 'lib/pubnub/validators/set_state.rb' + - 'lib/pubnub/validators/time.rb' + - 'lib/pubnub/validators/where_now.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantSelf: + Exclude: + - 'lib/pubnub/client/events.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantSelfAssignmentBranch: + Exclude: + - 'lib/pubnub/event.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, AllowInnerSlashes. +# SupportedStyles: slashes, percent_r, mixed +Style/RegexpLiteral: + Exclude: + - 'lib/pubnub/event/signature.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: implicit, explicit +Style/RescueStandardError: + Exclude: + - 'lib/pubnub/client.rb' + +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength. +# AllowedMethods: present?, blank?, presence, try, try! +Style/SafeNavigation: + Exclude: + - 'lib/pubnub/error.rb' + - 'lib/pubnub/event.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: only_raise, only_fail, semantic +Style/SignalException: + Exclude: + - 'features/step_definitions/access_steps.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/SlicingWithRange: + Exclude: + - 'lib/pubnub/modules/crypto/crypto_module.rb' + +# Offense count: 51 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Mode. +Style/StringConcatenation: + Exclude: + - 'features/support/helper.rb' + - 'features/support/hooks.rb' + - 'lib/pubnub/event.rb' + - 'lib/pubnub/event/signature.rb' + - 'lib/pubnub/events/add_channels_to_push.rb' + - 'lib/pubnub/events/add_message_action.rb' + - 'lib/pubnub/events/audit.rb' + - 'lib/pubnub/events/delete_messages.rb' + - 'lib/pubnub/events/get_all_channels_metadata.rb' + - 'lib/pubnub/events/get_all_uuid_metadata.rb' + - 'lib/pubnub/events/get_channel_members.rb' + - 'lib/pubnub/events/get_channel_metadata.rb' + - 'lib/pubnub/events/get_memberships.rb' + - 'lib/pubnub/events/get_message_actions.rb' + - 'lib/pubnub/events/get_uuid_metadata.rb' + - 'lib/pubnub/events/grant.rb' + - 'lib/pubnub/events/grant_token.rb' + - 'lib/pubnub/events/heartbeat.rb' + - 'lib/pubnub/events/here_now.rb' + - 'lib/pubnub/events/history.rb' + - 'lib/pubnub/events/leave.rb' + - 'lib/pubnub/events/list_push_provisions.rb' + - 'lib/pubnub/events/message_counts.rb' + - 'lib/pubnub/events/presence.rb' + - 'lib/pubnub/events/publish.rb' + - 'lib/pubnub/events/remove_channel_members.rb' + - 'lib/pubnub/events/remove_channel_metadata.rb' + - 'lib/pubnub/events/remove_channels_from_push.rb' + - 'lib/pubnub/events/remove_device_from_push.rb' + - 'lib/pubnub/events/remove_memberships.rb' + - 'lib/pubnub/events/remove_message_actions.rb' + - 'lib/pubnub/events/remove_uuid_metadata.rb' + - 'lib/pubnub/events/revoke.rb' + - 'lib/pubnub/events/revoke_token.rb' + - 'lib/pubnub/events/set_channel_members.rb' + - 'lib/pubnub/events/set_channel_metadata.rb' + - 'lib/pubnub/events/set_memberships.rb' + - 'lib/pubnub/events/set_state.rb' + - 'lib/pubnub/events/set_uuid_metadata.rb' + - 'lib/pubnub/events/signal.rb' + - 'lib/pubnub/events/state.rb' + - 'lib/pubnub/events/where_now.rb' + - 'lib/pubnub/formatter.rb' + - 'lib/pubnub/origin_manager.rb' + - 'lib/pubnub/subscribe_event.rb' + - 'lib/pubnub/subscribe_event/callbacks.rb' + +# Offense count: 174 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. +# SupportedStyles: single_quotes, double_quotes +Style/StringLiterals: + Exclude: + - 'features/step_definitions/access_steps.rb' + - 'features/support/helper.rb' + - 'features/support/hooks.rb' + - 'lib/pubnub/cbor.rb' + - 'lib/pubnub/client.rb' + - 'lib/pubnub/event/signature.rb' + - 'lib/pubnub/events/grant_token.rb' + - 'lib/pubnub/events/remove_channel_members.rb' + - 'lib/pubnub/events/remove_memberships.rb' + - 'lib/pubnub/events/revoke_token.rb' + - 'lib/pubnub/formatter.rb' + - 'lib/pubnub/pam.rb' + - 'lib/pubnub/validators/grant_token.rb' + - 'pubnub.gemspec' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: single_quotes, double_quotes +Style/StringLiteralsInInterpolation: + Exclude: + - 'lib/pubnub/client.rb' + - 'lib/pubnub/validators/set_channel_members.rb' + - 'lib/pubnub/validators/set_memberships.rb' + +# Offense count: 17 +# This cop supports safe autocorrection (--autocorrect). +Style/SuperArguments: + Exclude: + - 'lib/pubnub/events/audit.rb' + - 'lib/pubnub/events/delete_messages.rb' + - 'lib/pubnub/events/fetch_messages.rb' + - 'lib/pubnub/events/get_all_channels_metadata.rb' + - 'lib/pubnub/events/get_all_uuid_metadata.rb' + - 'lib/pubnub/events/get_channel_members.rb' + - 'lib/pubnub/events/get_channel_metadata.rb' + - 'lib/pubnub/events/get_memberships.rb' + - 'lib/pubnub/events/get_uuid_metadata.rb' + - 'lib/pubnub/events/grant.rb' + - 'lib/pubnub/events/remove_channel_members.rb' + - 'lib/pubnub/events/remove_memberships.rb' + - 'lib/pubnub/events/revoke.rb' + - 'lib/pubnub/events/set_channel_members.rb' + - 'lib/pubnub/events/set_channel_metadata.rb' + - 'lib/pubnub/events/set_memberships.rb' + - 'lib/pubnub/events/set_uuid_metadata.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyleForMultiline. +# SupportedStylesForMultiline: comma, consistent_comma, no_comma +Style/TrailingCommaInArrayLiteral: + Exclude: + - 'lib/pubnub/event/signature.rb' + - 'lib/pubnub/events/add_message_action.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyleForMultiline. +# SupportedStylesForMultiline: comma, consistent_comma, no_comma +Style/TrailingCommaInHashLiteral: + Exclude: + - 'features/support/hooks.rb' + - 'lib/pubnub/cbor.rb' + - 'pubnub.gemspec' + +# Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: forbid_for_all_comparison_operators, forbid_for_equality_operators_only, require_for_all_comparison_operators, require_for_equality_operators_only +Style/YodaCondition: + Exclude: + - 'lib/pubnub/cbor.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/ZeroLengthPredicate: + Exclude: + - 'lib/pubnub/validators/message_counts.rb' diff --git a/Gemfile b/Gemfile index 889ffcfcb..9ceaea17f 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,6 @@ source 'https://rubygems.org' gemspec group :test do - gem 'codacy-coverage', require: false gem 'rr' gem 'rspec' gem 'rspec-retry' diff --git a/Gemfile.lock b/Gemfile.lock index 7436756db..11c13e092 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -25,8 +25,6 @@ GEM binding_of_caller (1.0.1) debug_inspector (>= 1.2.0) builder (3.3.0) - codacy-coverage (2.2.1) - simplecov coderay (1.1.3) concurrent-ruby (1.3.4) concurrent-ruby-edge (0.7.1) @@ -193,7 +191,6 @@ PLATFORMS DEPENDENCIES awesome_print - codacy-coverage cucumber pry (>= 0.14.2) pry-rescue diff --git a/docs-snippets/access_manager.rb b/docs-snippets/access_manager.rb index 99573f4e8..906c3ac73 100644 --- a/docs-snippets/access_manager.rb +++ b/docs-snippets/access_manager.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'pubnub' pubnub = Pubnub.new( diff --git a/gemfiles/celluloid_017.gemfile b/gemfiles/celluloid_017.gemfile index c35953ce9..81520c743 100644 --- a/gemfiles/celluloid_017.gemfile +++ b/gemfiles/celluloid_017.gemfile @@ -9,7 +9,6 @@ gem 'celluloid', '>= 0.17', '< 0.18' gem 'dry-validation', '>= 0.10', '< 0.11' group :test do - gem 'codacy-coverage', require: false gem 'rr' gem 'rspec' gem 'rspec-wait' diff --git a/gemfiles/celluloid_017.gemfile.lock b/gemfiles/celluloid_017.gemfile.lock index 17f24d745..b6f11f6b7 100644 --- a/gemfiles/celluloid_017.gemfile.lock +++ b/gemfiles/celluloid_017.gemfile.lock @@ -31,8 +31,6 @@ GEM timers (>= 4.1.1) celluloid-supervision (0.20.6) timers (>= 4.1.1) - codacy-coverage (1.1.7) - simplecov coderay (1.1.2) concurrent-ruby (1.0.5) concurrent-ruby (1.0.5-java) @@ -143,7 +141,6 @@ DEPENDENCIES awesome_print bundler (~> 1.7) celluloid (>= 0.17, < 0.18) - codacy-coverage dry-validation (>= 0.10, < 0.11) pry pubnub! diff --git a/gemfiles/celluloid_018.gemfile b/gemfiles/celluloid_018.gemfile index eb5aac190..02067c081 100644 --- a/gemfiles/celluloid_018.gemfile +++ b/gemfiles/celluloid_018.gemfile @@ -9,7 +9,6 @@ gem 'celluloid', '>= 0.18.0.pre', '< 0.19' gem 'dry-validation', '>= 0.10', '< 0.11' group :test do - gem 'codacy-coverage', require: false gem 'rr' gem 'rspec' gem 'rspec-wait' diff --git a/gemfiles/celluloid_018.gemfile.lock b/gemfiles/celluloid_018.gemfile.lock index d1b0e19f0..2e201acd6 100644 --- a/gemfiles/celluloid_018.gemfile.lock +++ b/gemfiles/celluloid_018.gemfile.lock @@ -31,8 +31,6 @@ GEM timers (>= 4.1.1) celluloid-supervision (0.20.6) timers (>= 4.1.1) - codacy-coverage (1.1.7) - simplecov coderay (1.1.2) concurrent-ruby (1.0.5) concurrent-ruby (1.0.5-java) @@ -143,7 +141,6 @@ DEPENDENCIES awesome_print bundler (~> 1.7) celluloid (>= 0.18.0.pre, < 0.19) - codacy-coverage dry-validation (>= 0.10, < 0.11) pry pubnub! diff --git a/gemfiles/celluloid_master.gemfile b/gemfiles/celluloid_master.gemfile index e28aaf337..01332afb3 100644 --- a/gemfiles/celluloid_master.gemfile +++ b/gemfiles/celluloid_master.gemfile @@ -9,7 +9,6 @@ gem 'celluloid', git: 'https://github.com/celluloid/celluloid.git' gem 'dry-validation', '>= 0.10', '< 0.11' group :test do - gem 'codacy-coverage', require: false gem 'rr' gem 'rspec' gem 'rspec-wait' diff --git a/gemfiles/celluloid_master.gemfile.lock b/gemfiles/celluloid_master.gemfile.lock index dd4436444..6ec783f63 100644 --- a/gemfiles/celluloid_master.gemfile.lock +++ b/gemfiles/celluloid_master.gemfile.lock @@ -27,8 +27,6 @@ GEM timers (>= 4.1.1) celluloid-supervision (0.20.6) timers (>= 4.1.1) - codacy-coverage (1.1.7) - simplecov coderay (1.1.2) concurrent-ruby (1.0.5) concurrent-ruby (1.0.5-java) @@ -139,7 +137,6 @@ DEPENDENCIES awesome_print bundler (~> 1.7) celluloid! - codacy-coverage dry-validation (>= 0.10, < 0.11) pry pubnub! diff --git a/lib/pubnub/events/message_counts.rb b/lib/pubnub/events/message_counts.rb index 406a041aa..cb209fbb6 100644 --- a/lib/pubnub/events/message_counts.rb +++ b/lib/pubnub/events/message_counts.rb @@ -80,7 +80,7 @@ def valid_envelope(parsed_response, req_res_objects) def parse_timetokens(timetokens) timetokens ||= [] if timetokens.is_a? String - timetokens = timetokens.split(/\s*,\s*/) + timetokens = timetokens.split(',').map(&:strip) elsif timetokens.is_a? Integer timetokens = [timetokens] end diff --git a/spec/helpers/spec_helper.rb b/spec/helpers/spec_helper.rb index bdac90254..6d5631d5d 100644 --- a/spec/helpers/spec_helper.rb +++ b/spec/helpers/spec_helper.rb @@ -26,11 +26,6 @@ Pubnub::Constants::DEFAULT_RECONNECT_INTERVAL = 0 Pubnub::Constants::DEFAULT_SSL = false -if ENV["CI"] == "true" && ENV['NO_COVERAGE'] != 'true' - require "codacy-coverage" - Codacy::Reporter.start -end - # AsyncHelper allows us to wait for async operations module AsyncHelper def eventually(options = {}) @@ -94,7 +89,6 @@ def loop_it(interval, time_limit) c.cassette_library_dir = "fixtures/vcr_cassettes" c.hook_into :webmock c.allow_http_connections_when_no_cassette = false - c.ignore_hosts "api.codacy.com" c.default_cassette_options = { match_requests_on: [:method, VCR.request_matchers.uri_without_param(*ignored_params)], }