From eefd5fd49bce5fdeb152153f01f82a9b52d4cff1 Mon Sep 17 00:00:00 2001 From: crdx Date: Sat, 16 Mar 2024 09:28:00 +0000 Subject: [PATCH] Lint --- .rubocop.yml | 65 +++++++++++++++++++++++++++-------------------- Gemfile | 4 +++ Gemfile.lock | 2 ++ Justfile | 15 +++++------ docwatch.gemspec | 3 +-- spec/.rubocop.yml | 4 +-- 6 files changed, 53 insertions(+), 40 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index dc849b1..8ca0e0b 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 @@ -103,7 +109,7 @@ Style/MethodCallWithArgsParentheses: - extension Style/RescueModifier: - Enabled: no + Enabled: false Style/RescueStandardError: EnforcedStyle: implicit @@ -140,3 +146,6 @@ Layout/IndentationWidth: Layout/SpaceAroundOperators: EnforcedStyleForExponentOperator: space + +Gemspec/DevelopmentDependencies: + EnforcedStyle: gemspec diff --git a/Gemfile b/Gemfile index 851fabc..1fb6794 100644 --- a/Gemfile +++ b/Gemfile @@ -1,2 +1,6 @@ source 'https://rubygems.org' gemspec + +gem 'rake', '~> 13.0' +gem 'rspec', '~> 3.8' +gem 'simplecov', '~> 0' diff --git a/Gemfile.lock b/Gemfile.lock index dc15dd5..e4ba20f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,6 +4,7 @@ PATH docwatch-bin (2.3.0) colorize (~> 0.8.1) docopt (~> 0.6.1) + json (~> 2.7) nokogiri (~> 1.10) redcarpet (~> 3.5) require_all (~> 3.0) @@ -16,6 +17,7 @@ GEM diff-lcs (1.5.0) docile (1.4.0) docopt (0.6.1) + json (2.7.1) mini_portile2 (2.8.5) nokogiri (1.16.2) mini_portile2 (~> 2.8.2) diff --git a/Justfile b/Justfile index 494d564..c86e662 100644 --- a/Justfile +++ b/Justfile @@ -8,32 +8,31 @@ import? 'internal.just' help: just --list --unsorted -# build gem +init: + bundle install + 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 -# run the gem's binary run +args: {{ BIN }} {{ args }} -# run tests test: bundle exec rspec echo echo o coverage/index.html -# run linter lint: rubocop -# fix lint errors fix: - rubocop -a + rubocop -A + +fmt: + just --fmt diff --git a/docwatch.gemspec b/docwatch.gemspec index e9ae412..f87551b 100644 --- a/docwatch.gemspec +++ b/docwatch.gemspec @@ -16,12 +16,11 @@ 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 'nokogiri', '~> 1.10' spec.add_runtime_dependency 'redcarpet', '~> 3.5' spec.add_runtime_dependency 'require_all', '~> 3.0' spec.add_runtime_dependency 'rouge', '~> 4.0' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rspec', '~> 3.8' - spec.add_development_dependency 'simplecov', '~> 0' end 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