-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add rubocop support * Add rubocop todo config * Fix run on ruby 2.5 * Detect ruby version * Fix rubocop `Gemspec/OrderedDependencies` cop * Fix rubocop `Layout/ArgumentAlignmen` cop # Please enter the commit message for your changes. Lines starting * Fix rubocop `Layout/ArrayAlignment` cop * Fix rubocop `Layout/BlockAlignment` cop * Fix rubocop `Layout/ClosingParenthesisIndentation` cop * Fix rubocop `Layout/EmptyLineAfterGuardClause` cop * Fix rubocop `Layout/EmptyLineAfterMagicComment` cop * Fix rubocop `Layout/EmptyLines` cop * Fix rubocop `Layout/EmptyLinesAroundBlockBody` cop * Fix rubocop `Layout/EndAlignment` cop * Move one option to config * Add `Gemspec/RubyVersionGlobalsUsage` to disables * Fix rubocop `Layout/ExtraSpacing` cop * Fix rubocop `Layout/FirstArgumentIndentation` cop * Fix rubocop `Layout/FirstHashElementIndentation` cop * Fix rubocop `Layout/IndentationConsistency` cop * Fix rubocop `Layout/IndentationWidth` cop * Fix rubocop `Layout/MultilineMethodCallBraceLayout` cop * Fix rubocop `Layout/MultilineMethodCallIndentation` cop * Fix rubocop `Layout/SpaceAfterColon` cop * Fix rubocop `Layout/SpaceAfterComma` cop * Fix rubocop `Layout/SpaceAroundOperators` cop * Fix rubocop `Layout/SpaceBeforeBlockBraces` cop * Fix rubocop `Layout/SpaceInsideArrayLiteralBrackets` cop * Fix rubocop `Layout/SpaceInsideBlockBraces` cop * Fix rubocop `Layout/SpaceInsideHashLiteralBraces` cop * Fix rubocop `Layout/SpaceInsideReferenceBrackets` cop * Fix rubocop `Layout/TrailingEmptyLines` cop * Fix rubocop `Layout/TrailingWhitespace` cop * Fix all layout cops * Fix rubocop `Lint/AmbiguousRegexpLiteral` cop * Fix rubocop `Style/CaseLikeIf` cop * Fix rubocop `Security/JSONLoad` cop * Fix rubocop `Security/YAMLLoad` cop * Fix rubocop `Rake/Desc` cop * Fix rubocop `Performance/BlockGivenWithExplicitBlock` cop * Fix rubocop `Performance/InefficientHashSearch` cop * Fix rubocop `Performance/RedundantBlockCall` cop * Fix rubocop `Performance/RegexpMatch` cop * Fix rubocop `Style/ClassCheck` cop * Fix rubocop `Style/Encoding` cop * Fix rubocop `Style/ExpandPathArguments` cop * Fix rubocop `Style/FetchEnvVar` cop * Fix rubocop `Style/IfUnlessModifier` cop * Fix rubocop `Style/MethodCallWithoutArgsParentheses` cop * Fix rubocop `Style/MutableConstant` cop * Fix rubocop `Lint/SymbolConversion` cop * Fix rubocop `Lint/UselessAssignment` cop * Fix rubocop `RSpec/EmptyLineAfterFinalLet` cop * Fix rubocop `RSpec/ExampleWording` cop * Fix rubocop `RSpec/ExpectChange` cop * Fix rubocop `RSpec/LeadingSubject` cop * Fix rubocop `RSpec/DescribedClass` cop * Fix rubocop `RSpec/DescribedClass` cop * Fix rubocop `RSpec/NotToNot` cop * Fix rubocop `Style/ExplicitBlockArgument` cop * Fix rubocop `Style/BlockDelimiters` cop * Fix rubocop `Style/FrozenStringLiteralComment` cop * Fix rubocop `Style/FloatDivision` cop * Fix rubocop `Style/HashConversion` cop * Fix rubocop `Style/NumericLiterals` cop * Fix rubocop `Style/NumericPredicate` cop * Fix rubocop `Style/HashSyntax` cop * Fix rubocop `Style/PercentLiteralDelimiters` cop * Fix rubocop `Style/RedundantFreeze` cop * Fix rubocop `RSpec/BeEq` cop * Fix rubocop `Style/PerlBackrefs` cop * Fix rubocop `Style/RaiseArgs` cop * Fix rubocop `Style/RedundantPercentQ` cop * Fix rubocop `Style/RedundantRegexpEscape` cop * Fix rubocop `Style/RedundantSelf` cop * Fix rubocop `Style/RegexpLiteral` cop * Fix rubocop `Style/SafeNavigation` cop * Fix rubocop `Style/StringLiterals` cop * Fix rubocop `Style/SymbolArray` cop * Fix rubocop `Style/SymbolProc` cop * Fix rubocop `Style/TrailingCommaInArguments` cop * Fix rubocop `Style/TrailingCommaInArrayLiteral` cop * Fix rubocop `Style/TrailingCommaInHashLiteral` cop * Fix rubocop `Style/WordArray` cop * Fix rubocop `Lint/NonDeterministicRequireOrder` cop * Revert "Fix rubocop `Style/SymbolProc` cop" This reverts commit 5dc2a90.
- Loading branch information
1 parent
60a5b97
commit 7af5ac1
Showing
125 changed files
with
1,050 additions
and
786 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: rubocop | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.1 | ||
bundler-cache: true | ||
- name: Test | ||
run: | | ||
bundle exec rubocop |
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
*.rbc | ||
.bundle | ||
.config | ||
.idea | ||
.yardoc | ||
Gemfile.lock | ||
InstalledFiles | ||
|
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,22 @@ | ||
require: | ||
- rubocop-packaging | ||
- rubocop-performance | ||
- rubocop-rake | ||
- rubocop-rspec | ||
|
||
inherit_from: .rubocop_todo.yml | ||
|
||
AllCops: | ||
NewCops: enable | ||
# Should be the same as gem's `required_ruby_version` | ||
TargetRubyVersion: 2.5 | ||
|
||
|
||
# Maintainers need to decide if they | ||
# want to use to enable MFA for gem releases | ||
Gemspec/RequireMFA: | ||
Enabled: false | ||
|
||
# Possible need to drop ruby-2.5 support | ||
Gemspec/RubyVersionGlobalsUsage: | ||
Enabled: false |
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,182 @@ | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2022-06-23 17:10:56 UTC using RuboCop version 1.30.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: 4 | ||
# Configuration parameters: AllowedMethods. | ||
# AllowedMethods: enums | ||
Lint/ConstantDefinitionInBlock: | ||
Exclude: | ||
- 'lib/droplet_kit/mappings/kubernetes_options_mapping.rb' | ||
- 'spec/lib/droplet_kit/client_spec.rb' | ||
|
||
# Offense count: 3 | ||
# Configuration parameters: AllowComments, AllowEmptyLambdas. | ||
Lint/EmptyBlock: | ||
Exclude: | ||
- 'spec/lib/droplet_kit/paginated_resource_spec.rb' | ||
- 'spec/support/shared_examples/paginated_endpoint.rb' | ||
|
||
# Offense count: 2 | ||
Lint/StructNewOverride: | ||
Exclude: | ||
- 'lib/droplet_kit/models/pagination_information.rb' | ||
- 'spec/lib/droplet_kit/paginated_resource_spec.rb' | ||
|
||
# Offense count: 1 | ||
Lint/ToEnumArguments: | ||
Exclude: | ||
- 'lib/droplet_kit/utils.rb' | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: AllowKeywordBlockArguments. | ||
Lint/UnderscorePrefixedVariableName: | ||
Exclude: | ||
- 'spec/lib/droplet_kit/client_spec.rb' | ||
|
||
# Offense count: 36 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. | ||
Lint/UnusedBlockArgument: | ||
Enabled: false | ||
|
||
# Offense count: 2 | ||
# Configuration parameters: CheckForMethodsWithNoSideEffects. | ||
Lint/Void: | ||
Exclude: | ||
- 'spec/lib/droplet_kit/paginated_resource_spec.rb' | ||
|
||
# Offense count: 4 | ||
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes. | ||
Metrics/AbcSize: | ||
Max: 184 | ||
|
||
# Offense count: 16 | ||
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods, inherit_mode. | ||
# IgnoredMethods: refine | ||
Metrics/BlockLength: | ||
Max: 127 | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: CountComments, CountAsOne. | ||
Metrics/ClassLength: | ||
Max: 133 | ||
|
||
# Offense count: 4 | ||
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. | ||
Metrics/MethodLength: | ||
Max: 55 | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: CountComments, CountAsOne. | ||
Metrics/ModuleLength: | ||
Max: 164 | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: EnforcedStyleForLeadingUnderscores. | ||
# SupportedStylesForLeadingUnderscores: disallowed, required, optional | ||
Naming/MemoizedInstanceVariableName: | ||
Exclude: | ||
- 'lib/droplet_kit/client.rb' | ||
|
||
# Offense count: 14 | ||
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. | ||
# SupportedStyles: snake_case, normalcase, non_integer | ||
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339 | ||
Naming/VariableNumber: | ||
Exclude: | ||
- 'spec/lib/droplet_kit/resources/droplet_action_resource_spec.rb' | ||
- 'spec/lib/droplet_kit/resources/firewall_resource_spec.rb' | ||
- 'spec/lib/droplet_kit/resources/load_balancer_resource_spec.rb' | ||
|
||
# Offense count: 33 | ||
# Configuration parameters: Prefixes. | ||
# Prefixes: when, with, without | ||
RSpec/ContextWording: | ||
Exclude: | ||
- 'spec/lib/droplet_kit/client_spec.rb' | ||
- 'spec/lib/droplet_kit/paginated_resource_spec.rb' | ||
- 'spec/lib/droplet_kit/resources/certificate_resource_spec.rb' | ||
- 'spec/lib/droplet_kit/resources/container_registry_resource_spec.rb' | ||
- 'spec/lib/droplet_kit/resources/database_resource_spec.rb' | ||
- 'spec/lib/droplet_kit/resources/droplet_resource_spec.rb' | ||
- 'spec/lib/droplet_kit/resources/firewall_resource_spec.rb' | ||
- 'spec/lib/droplet_kit/resources/floating_ip_resource_spec.rb' | ||
- 'spec/lib/droplet_kit/resources/kubernetes_cluster_resource_spec.rb' | ||
- 'spec/lib/droplet_kit/resources/load_balancer_resource_spec.rb' | ||
- 'spec/lib/droplet_kit/resources/reserved_ip_resource_spec.rb' | ||
- 'spec/lib/droplet_kit/resources/volume_resource_spec.rb' | ||
- 'spec/lib/droplet_kit/resources/vpc_resource_spec.rb' | ||
- 'spec/support/resource_context.rb' | ||
|
||
# Offense count: 114 | ||
# Configuration parameters: CountAsOne. | ||
RSpec/ExampleLength: | ||
Max: 43 | ||
|
||
# Offense count: 36 | ||
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly. | ||
# Include: **/*_spec*rb*, **/spec/**/* | ||
RSpec/FilePath: | ||
Enabled: false | ||
|
||
# Offense count: 2 | ||
RSpec/IteratedExpectation: | ||
Exclude: | ||
- 'spec/lib/droplet_kit/resources/kubernetes_cluster_resource_spec.rb' | ||
|
||
# Offense count: 2 | ||
RSpec/LeakyConstantDeclaration: | ||
Exclude: | ||
- 'spec/lib/droplet_kit/client_spec.rb' | ||
|
||
# Offense count: 118 | ||
RSpec/MultipleExpectations: | ||
Max: 30 | ||
|
||
# Offense count: 32 | ||
# Configuration parameters: AllowSubject. | ||
RSpec/MultipleMemoizedHelpers: | ||
Max: 11 | ||
|
||
# Offense count: 3 | ||
RSpec/NestedGroups: | ||
Max: 4 | ||
|
||
# Offense count: 58 | ||
# Configuration parameters: AllowedConstants. | ||
Style/Documentation: | ||
Enabled: false | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. | ||
Style/GuardClause: | ||
Exclude: | ||
- 'lib/droplet_kit/paginated_resource.rb' | ||
|
||
# Offense count: 1 | ||
Style/MissingRespondToMissing: | ||
Exclude: | ||
- 'lib/droplet_kit/client.rb' | ||
|
||
# Offense count: 5 | ||
# This cop supports unsafe autocorrection (--autocorrect-all). | ||
# Configuration parameters: AllowMethodsWithArguments, IgnoredMethods, AllowComments. | ||
# IgnoredMethods: respond_to, define_method | ||
Style/SymbolProc: | ||
Exclude: | ||
- 'lib/droplet_kit/resources/container_registry_resource.rb' | ||
- 'lib/droplet_kit/resources/droplet_action_resource.rb' | ||
- 'lib/droplet_kit/resources/kubernetes_cluster_resource.rb' | ||
- 'lib/tasks/resource_doc.rake' | ||
|
||
# Offense count: 86 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns. | ||
# URISchemes: http, https | ||
Layout/LineLength: | ||
Max: 221 |
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,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
|
||
gem 'simplecov' | ||
|
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,3 +1,5 @@ | ||
require "bundler/gem_tasks" | ||
# frozen_string_literal: true | ||
|
||
require 'bundler/gem_tasks' | ||
|
||
load './lib/tasks/resource_doc.rake' |
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,32 +1,45 @@ | ||
# coding: utf-8 | ||
lib = File.expand_path('../lib', __FILE__) | ||
# frozen_string_literal: true | ||
|
||
lib = File.expand_path('lib', __dir__) | ||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | ||
require 'droplet_kit/version' | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "droplet_kit" | ||
spec.name = 'droplet_kit' | ||
spec.version = DropletKit::VERSION | ||
spec.authors = ["DigitalOcean API Engineering team"] | ||
spec.email = ["[email protected]"] | ||
spec.summary = %q{Droplet Kit is the official Ruby library for DigitalOcean's API} | ||
spec.description = %q{Droplet Kit is the official Ruby library for DigitalOcean's API} | ||
spec.homepage = "https://github.com/digitalocean/droplet_kit" | ||
spec.license = "MIT" | ||
spec.authors = ['DigitalOcean API Engineering team'] | ||
spec.email = ['[email protected]'] | ||
spec.summary = "Droplet Kit is the official Ruby library for DigitalOcean's API" | ||
spec.description = "Droplet Kit is the official Ruby library for DigitalOcean's API" | ||
spec.homepage = 'https://github.com/digitalocean/droplet_kit' | ||
spec.license = 'MIT' | ||
|
||
spec.files = %w{LICENSE.txt README.md} + Dir.glob("lib/**/*", File::FNM_DOTMATCH).reject { |f| File.directory?(f) } | ||
spec.require_paths = ["lib"] | ||
spec.files = %w[LICENSE.txt README.md] + Dir.glob('lib/**/*', File::FNM_DOTMATCH).reject { |f| File.directory?(f) } | ||
spec.require_paths = ['lib'] | ||
|
||
spec.required_ruby_version = '>= 2.5.0' | ||
|
||
spec.add_dependency 'faraday', '>= 0.15' | ||
spec.add_dependency 'kartograph', '~> 0.2.8' | ||
spec.add_dependency 'resource_kit', '~> 0.1.5' | ||
spec.add_dependency 'virtus', '>= 1.0.3', '<= 3' | ||
spec.add_dependency "resource_kit", '~> 0.1.5' | ||
spec.add_dependency "kartograph", '~> 0.2.8' | ||
spec.add_dependency "faraday", '>= 0.15' | ||
|
||
spec.add_development_dependency "bundler", ">= 2.1.2" | ||
spec.add_development_dependency "rake" | ||
spec.add_development_dependency "rspec", "~> 3.9.0" | ||
spec.add_development_dependency "rb-readline" | ||
spec.add_development_dependency 'bundler', '>= 2.1.2' | ||
spec.add_development_dependency 'rake' | ||
spec.add_development_dependency 'rb-readline' | ||
spec.add_development_dependency 'rspec', '~> 3.9.0' | ||
if RUBY_VERSION >= '2.6' | ||
spec.add_development_dependency 'rubocop', '>= 1.30.0' | ||
spec.add_development_dependency 'rubocop-performance', '>= 1.14.2' | ||
spec.add_development_dependency 'rubocop-rspec', '>= 2.11.1' | ||
else | ||
# latest rubocop with ruby 2.5 support | ||
spec.add_development_dependency 'rubocop', '1.28.2' | ||
spec.add_development_dependency 'rubocop-performance', '1.13.3' | ||
spec.add_development_dependency 'rubocop-rspec', '2.10.0' | ||
end | ||
spec.add_development_dependency 'rubocop-packaging', '>= 0.5.1' | ||
spec.add_development_dependency 'rubocop-rake', '>= 0.6.0' | ||
|
||
spec.add_development_dependency 'webmock', '~> 3.8.0' | ||
end |
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
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.