From 6ad8fa5129ba55a7fba56144d5325c960b16e39c Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Wed, 31 Jul 2024 11:10:07 +1200 Subject: [PATCH] Modernize gem. --- .github/workflows/rubocop.yaml | 24 +++++++++++++++ .github/workflows/test-coverage.yaml | 2 +- .rubocop.yml | 46 ++++++++++++++++++++++++++++ async-http-faraday.gemspec | 2 +- gems.rb | 1 + lib/async/http/faraday/adapter.rb | 1 + license.md | 1 + test/async/http/faraday/adapter.rb | 1 + 8 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/rubocop.yaml create mode 100644 .rubocop.yml diff --git a/.github/workflows/rubocop.yaml b/.github/workflows/rubocop.yaml new file mode 100644 index 0000000..287c06d --- /dev/null +++ b/.github/workflows/rubocop.yaml @@ -0,0 +1,24 @@ +name: RuboCop + +on: [push, pull_request] + +permissions: + contents: read + +env: + CONSOLE_OUTPUT: XTerm + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ruby + bundler-cache: true + + - name: Run RuboCop + timeout-minutes: 10 + run: bundle exec rubocop diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index d7e5b24..f9da2ff 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -33,7 +33,7 @@ jobs: - name: Run tests timeout-minutes: 5 run: bundle exec bake test - + - uses: actions/upload-artifact@v3 with: name: coverage-${{matrix.os}}-${{matrix.ruby}} diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..442c667 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,46 @@ +AllCops: + DisabledByDefault: true + +Layout/IndentationStyle: + Enabled: true + EnforcedStyle: tabs + +Layout/InitialIndentation: + Enabled: true + +Layout/IndentationWidth: + Enabled: true + Width: 1 + +Layout/IndentationConsistency: + Enabled: true + EnforcedStyle: normal + +Layout/EndAlignment: + Enabled: true + EnforcedStyleAlignWith: start_of_line + +Layout/BeginEndAlignment: + Enabled: true + EnforcedStyleAlignWith: start_of_line + +Layout/ElseAlignment: + Enabled: true + +Layout/DefEndAlignment: + Enabled: true + +Layout/CaseIndentation: + Enabled: true + +Layout/CommentIndentation: + Enabled: true + +Layout/EmptyLinesAroundClassBody: + Enabled: true + +Layout/EmptyLinesAroundModuleBody: + Enabled: true + +Style/FrozenStringLiteralComment: + Enabled: true diff --git a/async-http-faraday.gemspec b/async-http-faraday.gemspec index 49ed415..82d49d8 100644 --- a/async-http-faraday.gemspec +++ b/async-http-faraday.gemspec @@ -7,7 +7,7 @@ Gem::Specification.new do |spec| spec.version = Async::HTTP::Faraday::VERSION spec.summary = "Provides an adaptor between async-http and faraday." - spec.authors = ["Samuel Williams", "Igor Sidorov", "Andreas Garnaes", "Genki Takiuchi", "Olle Jonsson", "Benoit Daloze", "Denis Talakevich", "Flavio Fernandes"] + spec.authors = ["Samuel Williams", "Igor Sidorov", "Andreas Garnaes", "Genki Takiuchi", "Olle Jonsson", "Benoit Daloze", "Denis Talakevich", "Flavio Fernandes", "Jacob Frautschi"] spec.license = "MIT" spec.cert_chain = ['release.cert'] diff --git a/gems.rb b/gems.rb index 1494b60..9539d77 100644 --- a/gems.rb +++ b/gems.rb @@ -18,6 +18,7 @@ gem "sus" gem "covered" gem "decode" + gem "rubocop" gem "bake-test" gem "bake-test-external" diff --git a/lib/async/http/faraday/adapter.rb b/lib/async/http/faraday/adapter.rb index 23becf1..0d2a95d 100644 --- a/lib/async/http/faraday/adapter.rb +++ b/lib/async/http/faraday/adapter.rb @@ -7,6 +7,7 @@ # Copyright, 2019-2020, by Igor Sidorov. # Copyright, 2023, by Genki Takiuchi. # Copyright, 2023, by Flavio Fernandes. +# Copyright, 2024, by Jacob Frautschi. require 'faraday' require 'faraday/adapter' diff --git a/license.md b/license.md index 7dc70da..dbbc208 100644 --- a/license.md +++ b/license.md @@ -8,6 +8,7 @@ Copyright, 2020-2021, by Olle Jonsson. Copyright, 2020, by Benoit Daloze. Copyright, 2023, by Genki Takiuchi. Copyright, 2023, by Flavio Fernandes. +Copyright, 2024, by Jacob Frautschi. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/async/http/faraday/adapter.rb b/test/async/http/faraday/adapter.rb index 09a423c..8acf5f7 100644 --- a/test/async/http/faraday/adapter.rb +++ b/test/async/http/faraday/adapter.rb @@ -6,6 +6,7 @@ # Copyright, 2019, by Denis Talakevich. # Copyright, 2019-2020, by Igor Sidorov. # Copyright, 2023, by Genki Takiuchi. +# Copyright, 2024, by Jacob Frautschi. require 'async/http/faraday'