Skip to content

Commit

Permalink
Update rubocop and enable it in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dosas committed Aug 21, 2024
1 parent f041c55 commit 7bf0904
Show file tree
Hide file tree
Showing 35 changed files with 428 additions and 85 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "bundler"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
21 changes: 20 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ permissions:

jobs:
test:

runs-on: ubuntu-latest

strategy:
Expand All @@ -32,3 +31,23 @@ jobs:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests
run: bundle exec rake

lint:
runs-on: ubuntu-latest

strategy:
matrix:
ruby-version: ['2.7', '3.0', '3.1', '3.2', 'head']
continue-on-error: ${{ matrix.ruby-version == 'head' }}

steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get install -y --no-install-recommends libcurl4-openssl-dev
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run rubocop
run: bundle exec rake rubocop
327 changes: 323 additions & 4 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
inherit_from: .rubocop_todo.yml

AllCops:
SuggestExtensions: false
Exclude:
- 'lib/fog/ovirt/compute.rb'
- 'vendor/**/*'

Style/FrozenStringLiteralComment:
Enabled: false

Style/HashSyntax:
EnforcedStyle: hash_rockets

Expand Down Expand Up @@ -28,7 +37,317 @@ Metrics/AbcSize:
Gemspec/RequiredRubyVersion:
Enabled: false

AllCops:
Exclude:
- 'lib/fog/ovirt/compute.rb'
- 'vendor/**/*'
Gemspec/AddRuntimeDependency:
Enabled: true

Gemspec/DeprecatedAttributeAssignment:
Enabled: true

Gemspec/DevelopmentDependencies:
Enabled: false

Gemspec/RequireMFA:
Enabled: true

Layout/LineContinuationLeadingSpace:
Enabled: true

Layout/LineContinuationSpacing:
Enabled: true

Layout/LineEndStringConcatenationIndentation:
Enabled: true

Layout/SpaceBeforeBrackets:
Enabled: true

Lint/AmbiguousAssignment:
Enabled: true

Lint/AmbiguousOperatorPrecedence:
Enabled: true

Lint/AmbiguousRange:
Enabled: true

Lint/ConstantOverwrittenInRescue:
Enabled: true

Lint/DeprecatedConstants:
Enabled: true

Lint/DuplicateBranch:
Enabled: true

Lint/DuplicateMagicComment:
Enabled: true

Lint/DuplicateMatchPattern:
Enabled: true

Lint/DuplicateRegexpCharacterClassElement:
Enabled: true

Lint/EmptyBlock:
Enabled: true

Lint/EmptyClass:
Enabled: true

Lint/EmptyInPattern:
Enabled: true

Lint/IncompatibleIoSelectWithFiberScheduler:
Enabled: true

Lint/ItWithoutArgumentsInBlock:
Enabled: true

Lint/LambdaWithoutLiteralBlock:
Enabled: true

Lint/LiteralAssignmentInCondition:
Enabled: true

Lint/MixedCaseRange:
Enabled: true

Lint/NoReturnInBeginEndBlocks:
Enabled: true

Lint/NonAtomicFileOperation:
Enabled: true

Lint/NumberedParameterAssignment:
Enabled: true

Lint/OrAssignmentToConstant:
Enabled: true

Lint/RedundantDirGlobSort:
Enabled: true

Lint/RedundantRegexpQuantifiers:
Enabled: true

Lint/RefinementImportMethods:
Enabled: true

Lint/RequireRangeParentheses:
Enabled: true

Lint/RequireRelativeSelfPath:
Enabled: true

Lint/SymbolConversion:
Enabled: true

Lint/ToEnumArguments:
Enabled: true

Lint/TripleQuotes:
Enabled: true

Lint/UnexpectedBlockArity:
Enabled: true

Lint/UnmodifiedReduceAccumulator:
Enabled: true

Lint/UselessRescue:
Enabled: true

Lint/UselessRuby2Keywords:
Enabled: true

Metrics/CollectionLiteralLength:
Enabled: true

Naming/BlockForwarding:
Enabled: true

Security/CompoundHash:
Enabled: true

Security/IoMethods:
Enabled: true

Style/ArgumentsForwarding:
Enabled: true

Style/ArrayIntersect:
Enabled: true

Style/CollectionCompact:
Enabled: true

Style/ComparableClamp:
Enabled: true

Style/ConcatArrayLiterals:
Enabled: true

Style/DataInheritance:
Enabled: true

Style/DirEmpty:
Enabled: true

Style/DocumentDynamicEvalDefinition:
Enabled: true

Style/EmptyHeredoc:
Enabled: true

Style/EndlessMethod:
Enabled: true

Style/EnvHome:
Enabled: true

Style/ExactRegexpMatch:
Enabled: true

Style/FetchEnvVar:
Enabled: true

Style/FileEmpty:
Enabled: true

Style/FileRead:
Enabled: true

Style/FileWrite:
Enabled: true

Style/HashConversion:
Enabled: true

Style/HashExcept:
Enabled: true

Style/IfWithBooleanLiteralBranches:
Enabled: true

Style/InPatternThen:
Enabled: true

Style/MagicCommentFormat:
Enabled: true

Style/MapCompactWithConditionalBlock:
Enabled: true

Style/MapIntoArray:
Enabled: true

Style/MapToHash:
Enabled: true

Style/MapToSet:
Enabled: true

Style/MinMaxComparison:
Enabled: true

Style/MultilineInPatternThen:
Enabled: true

Style/NegatedIfElseCondition:
Enabled: true

Style/NestedFileDirname:
Enabled: true

Style/NilLambda:
Enabled: true

Style/NumberedParameters:
Enabled: true

Style/NumberedParametersLimit:
Enabled: true

Style/ObjectThen:
Enabled: true

Style/OpenStructUse:
Enabled: false

Style/OperatorMethodCall:
Enabled: true

Style/QuotedSymbols:
Enabled: true

Style/RedundantArgument:
Enabled: true

Style/RedundantArrayConstructor:
Enabled: true

Style/RedundantConstantBase:
Enabled: true

Style/RedundantCurrentDirectoryInPath:
Enabled: true

Style/RedundantDoubleSplatHashBraces:
Enabled: true

Style/RedundantEach:
Enabled: true

Style/RedundantFilterChain:
Enabled: true

Style/RedundantHeredocDelimiterQuotes:
Enabled: true

Style/RedundantInitialize:
Enabled: true

Style/RedundantLineContinuation:
Enabled: true

Style/RedundantRegexpArgument:
Enabled: true

Style/RedundantRegexpConstructor:
Enabled: true

Style/RedundantSelfAssignmentBranch:
Enabled: true

Style/RedundantStringEscape:
Enabled: true

Style/ReturnNilInPredicateMethodDefinition:
Enabled: true

Style/SelectByRegexp:
Enabled: true

Style/SendWithLiteralMethodName:
Enabled: true

Style/SingleLineDoEndBlock:
Enabled: true

Style/StringChars:
Enabled: true

Style/SuperArguments:
Enabled: true

Style/SuperWithArgsParentheses:
Enabled: true

Style/SwapValues:
Enabled: true

Style/YAMLFileRead:
Enabled: true

Style/Documentation:
Enabled: false
Loading

0 comments on commit 7bf0904

Please sign in to comment.