From 16ecc8de3bf17ae559b0f485dbe7a07959a5de56 Mon Sep 17 00:00:00 2001 From: crdx Date: Sat, 16 Mar 2024 10:57:23 +0000 Subject: [PATCH] Lint --- .rubocop.yml | 65 ++++++++++++++++++++++++++-------------------- Gemfile.lock | 2 ++ Justfile | 43 +++++++++++++++--------------- enparallel.gemspec | 1 + spec/.rubocop.yml | 4 +-- 5 files changed, 63 insertions(+), 52 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 94d1245..beb2d18 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,63 +7,69 @@ AllCops: # —————————————————————————————————————————————————————————————————————————————————————————————————— Style/MixinUsage: - Enabled: no + Enabled: false Style/FormatString: - Enabled: no + Enabled: false Style/FormatStringToken: - Enabled: no + Enabled: false Style/StringConcatenation: - Enabled: no + Enabled: false Style/IfUnlessModifier: - Enabled: no + Enabled: false Style/RedundantReturn: - Enabled: no + Enabled: false Style/FrozenStringLiteralComment: - Enabled: no + Enabled: false Style/NegatedIf: - Enabled: no + Enabled: false Style/NegatedWhile: - Enabled: no + Enabled: false Style/Documentation: - Enabled: no + Enabled: false Style/MultilineBlockChain: - Enabled: no + Enabled: false Style/PerlBackrefs: - Enabled: no + Enabled: false Style/StderrPuts: - Enabled: no + Enabled: false Style/ClassAndModuleChildren: - Enabled: no + Enabled: false Style/ZeroLengthPredicate: - Enabled: no + Enabled: false Style/GuardClause: - Enabled: no + Enabled: false Style/WhileUntilModifier: - Enabled: no + Enabled: false Style/MutableConstant: - Enabled: no + Enabled: false Style/ClassVars: - Enabled: no + Enabled: false Metrics/AbcSize: - Enabled: no + Enabled: false Metrics/PerceivedComplexity: - Enabled: no + Enabled: false Metrics/CyclomaticComplexity: - Enabled: no + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/BlockLength: + Enabled: false +Metrics/ClassLength: + Enabled: false Naming/HeredocDelimiterNaming: - Enabled: no + Enabled: false Naming/AccessorMethodName: - Enabled: no + Enabled: false Naming/MethodParameterName: - Enabled: no + Enabled: false Layout/LineLength: Enabled: false Lint/AmbiguousOperatorPrecedence: - Enabled: no + Enabled: false # —————————————————————————————————————————————————————————————————————————————————————————————————— # Configured @@ -79,7 +85,7 @@ Style/Semicolon: AllowAsExpressionSeparator: yes Style/MethodCallWithArgsParentheses: - Enabled: yes + Enabled: true IgnoreMacros: false # Top-level calls will not be included otherwise. AllowedMethods: - puts @@ -102,7 +108,7 @@ Style/MethodCallWithArgsParentheses: - source Style/RescueModifier: - Enabled: no + Enabled: false Style/RescueStandardError: EnforcedStyle: implicit @@ -139,3 +145,6 @@ Layout/IndentationWidth: Layout/SpaceAroundOperators: EnforcedStyleForExponentOperator: space + +Gemspec/DevelopmentDependencies: + EnforcedStyle: gemspec diff --git a/Gemfile.lock b/Gemfile.lock index 2255500..2e295a1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,6 +4,7 @@ PATH enparallel-bin (1.0.11) colorize (~> 0.8.1) docopt (~> 0.6.1) + json (~> 2.7) require_all (~> 3.0) soml (~> 1.0.1) @@ -14,6 +15,7 @@ GEM diff-lcs (1.4.4) docile (1.4.0) docopt (0.6.1) + json (2.7.1) rake (13.0.6) require_all (3.0.0) rspec (3.10.0) diff --git a/Justfile b/Justfile index 84f38d4..7c2a8ed 100644 --- a/Justfile +++ b/Justfile @@ -8,40 +8,39 @@ import? 'internal.just' help: just --list --unsorted -# build gem -build: - bundle exec rake build - -# remove built gems -clean: - rm -vf pkg/* - -# build and install the gem globally to the system -install: - bundle exec rake install +init: + bundle install -# run the gem's binary run +args: {{ BIN }} {{ args }} -# run tests +fmt: + just --fmt + +lint: + rubocop + +fix: + rubocop -A + test: bundle exec rspec echo echo o coverage/index.html -# build the asciicasts of enparallel in action +build: + bundle exec rake build + +install: + bundle exec rake install + +clean: + rm -vf pkg/* + +# build the asciicasts build-readme: tools/build-readme # run 50 unpredictable tasks run-50: seq 50 | {{ BIN }} --workers 32 --pick random -- tools/unpredictable-task - -# run linter -lint: - rubocop - -# fix lint errors -fix: - rubocop -a diff --git a/enparallel.gemspec b/enparallel.gemspec index ea6b34a..26c6569 100644 --- a/enparallel.gemspec +++ b/enparallel.gemspec @@ -16,6 +16,7 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency 'colorize', '~> 0.8.1' spec.add_runtime_dependency 'docopt', '~> 0.6.1' + spec.add_runtime_dependency 'json', '~> 2.7' spec.add_runtime_dependency 'require_all', '~> 3.0' spec.add_runtime_dependency 'soml', '~> 1.0.1' diff --git a/spec/.rubocop.yml b/spec/.rubocop.yml index 1e1a060..06ab5ed 100644 --- a/spec/.rubocop.yml +++ b/spec/.rubocop.yml @@ -1,6 +1,6 @@ inherit_from: ../.rubocop.yml Style/MethodCallWithArgsParentheses: - Enabled: no + Enabled: false Lint/ParenthesesAsGroupedExpression: - Enabled: no + Enabled: false