diff --git a/.github/workflows/documentation-coverage.yaml b/.github/workflows/documentation-coverage.yaml new file mode 100644 index 0000000..b3bac9a --- /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 0000000..edfd9bc --- /dev/null +++ b/.github/workflows/rubocop.yaml @@ -0,0 +1,36 @@ +name: Test External + +on: [push, pull_request] + +permissions: + contents: read + +env: + CONSOLE_OUTPUT: XTerm + +jobs: + test: + name: ${{matrix.ruby}} on ${{matrix.os}} + runs-on: ${{matrix.os}}-latest + + strategy: + matrix: + os: + - ubuntu + - macos + + ruby: + - "3.1" + - "3.2" + - "3.3" + + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{matrix.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 98% rename from .github/workflows/coverage.yaml rename to .github/workflows/test-coverage.yaml index 68adbf2..d7e5b24 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] 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/examples/chat/config.ru b/examples/chat/config.ru index fa4f7d5..5d9c8e5 100755 --- a/examples/chat/config.ru +++ b/examples/chat/config.ru @@ -1,4 +1,5 @@ #!/usr/bin/env -S falcon serve --bind https://localhost:8080 --count 1 -c +# frozen_string_literal: true require_relative '../../lib/async/websocket/adapters/rack' require 'async/clock' diff --git a/examples/mud/config.ru b/examples/mud/config.ru index 2ebed91..24c7c28 100755 --- a/examples/mud/config.ru +++ b/examples/mud/config.ru @@ -1,4 +1,5 @@ #!/usr/bin/env -S falcon serve --count 1 --bind http://127.0.0.1:7070 -c +# frozen_string_literal: true require 'async/websocket/adapters/rack' diff --git a/examples/rack/config.ru b/examples/rack/config.ru index ace7a6d..6ecc3e4 100755 --- a/examples/rack/config.ru +++ b/examples/rack/config.ru @@ -1,4 +1,5 @@ #!/usr/bin/env -S falcon serve --bind http://127.0.0.1:7070 --count 1 -c +# frozen_string_literal: true require 'async/websocket/adapters/rack' diff --git a/fixtures/async/websocket/rack_application/config.ru b/fixtures/async/websocket/rack_application/config.ru index 03d934f..f6cd30b 100644 --- a/fixtures/async/websocket/rack_application/config.ru +++ b/fixtures/async/websocket/rack_application/config.ru @@ -1,4 +1,5 @@ #!/usr/bin/env -S falcon serve --bind http://localhost:7070 --count 1 -c +# frozen_string_literal: true require 'async/websocket/adapters/rack' require 'set' diff --git a/gems.rb b/gems.rb index 4ba7d0e..678f099 100644 --- a/gems.rb +++ b/gems.rb @@ -19,6 +19,8 @@ group :test do gem "sus" gem "covered" + gem "decode" + gem "rubocop" gem "sus-fixtures-async-http"