diff --git a/.github/workflows/documentation-coverage.yaml b/.github/workflows/documentation-coverage.yaml new file mode 100644 index 00000000..b3bac9a7 --- /dev/null +++ b/.github/workflows/documentation-coverage.yaml @@ -0,0 +1,25 @@ +name: Documentation Coverage + +on: [push, pull_request] + +permissions: + contents: read + +env: + CONSOLE_OUTPUT: XTerm + COVERAGE: PartialSummary + +jobs: + validate: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.3" + bundler-cache: true + + - name: Validate coverage + timeout-minutes: 5 + run: bundle exec bake decode:index:coverage lib diff --git a/.github/workflows/rubocop.yaml b/.github/workflows/rubocop.yaml new file mode 100644 index 00000000..287c06d9 --- /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/coverage.yaml b/.github/workflows/test-coverage.yaml similarity index 97% rename from .github/workflows/coverage.yaml rename to .github/workflows/test-coverage.yaml index 68adbf24..f9da2ffe 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,4 +1,4 @@ -name: Coverage +name: Test Coverage on: [push, pull_request] @@ -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 00000000..442c6674 --- /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.gemspec b/async-http.gemspec index f34cd30d..ec722743 100644 --- a/async-http.gemspec +++ b/async-http.gemspec @@ -28,7 +28,7 @@ Gem::Specification.new do |spec| spec.add_dependency "async-pool", "~> 0.7" spec.add_dependency "io-endpoint", "~> 0.11" spec.add_dependency "io-stream", "~> 0.4" - spec.add_dependency "protocol-http", "~> 0.26" + spec.add_dependency "protocol-http", "~> 0.28" spec.add_dependency "protocol-http1", "~> 0.19" spec.add_dependency "protocol-http2", "~> 0.18" spec.add_dependency "traces", ">= 0.10" diff --git a/examples/fetch/config.ru b/examples/fetch/config.ru index 1363f150..0a29fa6f 100644 --- a/examples/fetch/config.ru +++ b/examples/fetch/config.ru @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'rack' diff --git a/examples/trenni/Gemfile b/examples/trenni/Gemfile index 507ac5e1..d7bdde98 100644 --- a/examples/trenni/Gemfile +++ b/examples/trenni/Gemfile @@ -1,3 +1,4 @@ +# frozen_string_literal: true source 'https://rubygems.org' diff --git a/gems.rb b/gems.rb index 26cdf5a1..1fe0e809 100644 --- a/gems.rb +++ b/gems.rb @@ -24,24 +24,25 @@ gem "bake-modernize" gem "bake-gem" - gem "falcon", "~> 0.46" + gem "falcon", "~> 0.47" gem "utopia-project" end group :test do - gem "covered" gem "sus" + gem "covered" + gem "decode" + gem "rubocop" + gem "sus-fixtures-async" gem "sus-fixtures-async-http", "~> 0.8" gem "sus-fixtures-openssl" - gem "bake" gem "bake-test" gem "bake-test-external" gem "async-container", "~> 0.14" - gem "async-rspec", "~> 1.10" - + gem "localhost" gem "rack-test" end diff --git a/lib/async/http.rb b/lib/async/http.rb index 3eac9b4b..c18c3596 100644 --- a/lib/async/http.rb +++ b/lib/async/http.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2017-2023, by Samuel Williams. +# Copyright, 2017-2024, by Samuel Williams. require_relative 'http/version' diff --git a/lib/async/http/internet/instance.rb b/lib/async/http/internet/instance.rb index ec16ee63..1ea58323 100644 --- a/lib/async/http/internet/instance.rb +++ b/lib/async/http/internet/instance.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2021-2023, by Samuel Williams. +# Copyright, 2021-2024, by Samuel Williams. require_relative '../internet' diff --git a/lib/async/http/mock.rb b/lib/async/http/mock.rb index 050f1c2b..d9ecae34 100644 --- a/lib/async/http/mock.rb +++ b/lib/async/http/mock.rb @@ -1,23 +1,6 @@ # frozen_string_literal: true -# -# Copyright, 2019, by Samuel G. D. Williams. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. + +# Released under the MIT License. +# Copyright, 2024, by Samuel Williams. require_relative 'mock/endpoint' diff --git a/lib/async/http/mock/endpoint.rb b/lib/async/http/mock/endpoint.rb index 798caef4..91c92792 100644 --- a/lib/async/http/mock/endpoint.rb +++ b/lib/async/http/mock/endpoint.rb @@ -1,24 +1,7 @@ # frozen_string_literal: true -# -# Copyright, 2019, by Samuel G. D. Williams. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. + +# Released under the MIT License. +# Copyright, 2024, by Samuel Williams. require_relative '../protocol' diff --git a/readme.md b/readme.md index 79fc3e22..076e223d 100644 --- a/readme.md +++ b/readme.md @@ -22,14 +22,6 @@ We welcome contributions to this project. 4. Push to the branch (`git push origin my-new-feature`). 5. Create new Pull Request. -### Developer Certificate of Origin - -This project uses the [Developer Certificate of Origin](https://developercertificate.org/). All contributors to this project must agree to this document to have their contributions accepted. - -### Contributor Covenant - -This project is governed by the [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms. - ## See Also - [benchmark-http](https://github.com/socketry/benchmark-http) — A benchmarking tool to report on web server concurrency. @@ -37,3 +29,11 @@ This project is governed by the [Contributor Covenant](https://www.contributor-c - [async-websocket](https://github.com/socketry/async-websocket) — Asynchronous client and server websockets. - [async-rest](https://github.com/socketry/async-rest) — A RESTful resource layer built on top of `async-http`. - [async-http-faraday](https://github.com/socketry/async-http-faraday) — A faraday adapter to use `async-http`. + +### Developer Certificate of Origin + +In order to protect users of this project, we require all contributors to comply with the [Developer Certificate of Origin](https://developercertificate.org/). This ensures that all contributions are properly licensed and attributed. + +### Community Guidelines + +This project is best served by a collaborative and respectful environment. Treat each other professionally, respect differing viewpoints, and engage constructively. Harassment, discrimination, or harmful behavior is not tolerated. Communicate clearly, listen actively, and support one another. If any issues arise, please inform the project maintainers. diff --git a/test/async/http/body/pipe.rb b/test/async/http/body/pipe.rb index 94cdcb07..0760de24 100644 --- a/test/async/http/body/pipe.rb +++ b/test/async/http/body/pipe.rb @@ -25,7 +25,7 @@ def before super - # input writer task + # input writer task Async do |task| first, second = data.split(' ') input.write("#{first} ") diff --git a/test/async/http/client/google.rb b/test/async/http/client/google.rb index c1232d78..cc1f70f4 100644 --- a/test/async/http/client/google.rb +++ b/test/async/http/client/google.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2018-2023, by Samuel Williams. +# Copyright, 2018-2024, by Samuel Williams. require 'async/http/client' require 'async/http/endpoint' diff --git a/test/async/http/mock.rb b/test/async/http/mock.rb index d54840cc..8396fe15 100644 --- a/test/async/http/mock.rb +++ b/test/async/http/mock.rb @@ -1,22 +1,7 @@ -# Copyright, 2019, by Samuel G. D. Williams. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# frozen_string_literal: true + +# Released under the MIT License. +# Copyright, 2024, by Samuel Williams. require 'async/http/mock' require 'async/http/endpoint'