diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index a82cfae..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Linter - -on: - push: - branches: - - main - - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - name: Ruby ${{ matrix.ruby }} - strategy: - matrix: - ruby: - - "3.0" - - steps: - - uses: actions/checkout@v3 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - name: Run the default task - run: bundle exec rake lint diff --git a/.github/workflows/mutant.yml b/.github/workflows/mutant.yml index 6c37c71..c1968ae 100644 --- a/.github/workflows/mutant.yml +++ b/.github/workflows/mutant.yml @@ -1,27 +1,12 @@ name: Mutant - -on: - push: - branches: - - main - - pull_request: - +on: [push, pull_request] jobs: - build: + test: runs-on: ubuntu-latest - name: Ruby ${{ matrix.ruby }} - strategy: - matrix: - ruby: - - "3.0" - steps: - - uses: actions/checkout@v3 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby }} + ruby-version: "3.0" bundler-cache: true - - name: Run the default task - run: bundle exec rake mutant + - run: bundle exec rake mutant diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml new file mode 100644 index 0000000..eff0bbd --- /dev/null +++ b/.github/workflows/rubocop.yml @@ -0,0 +1,12 @@ +name: RuboCop +on: [push, pull_request] +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.0" + bundler-cache: true + - run: bundle exec rake rubocop diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 27d47d4..29ab1d5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,29 +1,15 @@ name: Tests - -on: - push: - branches: - - main - - pull_request: - +on: [push, pull_request] jobs: - build: - runs-on: ubuntu-latest - name: Ruby ${{ matrix.ruby }} + test: strategy: matrix: - ruby: - - "3.0" - - "3.1" - - "3.2" - + ruby: ["3.0", "3.1", "3.2"] + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - - name: Run the default task - run: bundle exec rake test + - run: bundle exec rake test diff --git a/.github/workflows/type_check.yml b/.github/workflows/type_check.yml index 60aed5c..3130a2c 100644 --- a/.github/workflows/type_check.yml +++ b/.github/workflows/type_check.yml @@ -1,27 +1,12 @@ name: Type Checker - -on: - push: - branches: - - main - - pull_request: - +on: [push, pull_request] jobs: - build: + test: runs-on: ubuntu-latest - name: Ruby ${{ matrix.ruby }} - strategy: - matrix: - ruby: - - "3.0" - steps: - - uses: actions/checkout@v3 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby }} + ruby-version: "3.0" bundler-cache: true - - name: Run the default task - run: bundle exec rake steep + - run: bundle exec rake steep diff --git a/.rubocop.yml b/.rubocop.yml index 165fa21..53b054f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,78 +1,19 @@ require: - - standard - - standard-performance - rubocop-minitest - rubocop-performance - rubocop-rake + - standard + - standard-custom + - standard-performance + +inherit_gem: + standard: config/base.yml + standard-custom: config/base.yml + standard-performance: config/base.yml AllCops: NewCops: enable TargetRubyVersion: 3.0 -Layout/ArgumentAlignment: - Enabled: true - EnforcedStyle: with_fixed_indentation - -Layout/ArrayAlignment: - Enabled: true - EnforcedStyle: with_fixed_indentation - -Layout/CaseIndentation: - Enabled: true - EnforcedStyle: end - -Layout/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - -Layout/HashAlignment: - Enabled: true - EnforcedHashRocketStyle: key - EnforcedColonStyle: key - EnforcedLastArgumentHashStyle: always_inspect - -Layout/MultilineMethodCallIndentation: - Enabled: true - EnforcedStyle: indented - IndentationWidth: ~ - -Layout/ParameterAlignment: - Enabled: true - EnforcedStyle: with_fixed_indentation - IndentationWidth: ~ - -Layout/SpaceInsideHashLiteralBraces: - Enabled: false - -Metrics/ParameterLists: - CountKeywordArgs: false - Minitest/MultipleAssertions: Max: 5 - -Style/Alias: - Enabled: true - EnforcedStyle: prefer_alias_method - -Style/Documentation: - Enabled: false - -Style/EmptyMethod: - Enabled: false - -Style/FrozenStringLiteralComment: - Enabled: false - -Style/OpenStructUse: - Enabled: false - -Style/StringLiterals: - Enabled: true - EnforcedStyle: double_quotes - -Style/StringLiteralsInInterpolation: - Enabled: true - EnforcedStyle: double_quotes - -Style/TernaryParentheses: - Enabled: false diff --git a/README.md b/README.md index 9853d96..085b897 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ![Tests](https://github.com/sferik/x-ruby/actions/workflows/test.yml/badge.svg) ![Linter](https://github.com/sferik/x-ruby/actions/workflows/lint.yml/badge.svg) ![Mutant](https://github.com/sferik/x-ruby/actions/workflows/mutant.yml/badge.svg) -![Typer Checker](https://github.com/sferik/x-ruby/actions/workflows/type_check.yml/badge.svg) +[![Typer Checker](https://github.com/sferik/x-ruby/actions/workflows/type_check.yml/badge.svg)]() [![Gem Version](https://badge.fury.io/rb/x.svg)](https://rubygems.org/gems/x) # A [Ruby](https://www.ruby-lang.org) interface to the [X API](https://developer.x.com) @@ -149,24 +149,20 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/sferik Pull requests will only be accepted if they meet all the following criteria: -1. 100% C0 code coverage. This can be verified with: - - bundle exec rake test - -2. Code must conform to [RuboCop rules](https://github.com/rubocop/rubocop). This can be verified with: +1. Code must conform to [RuboCop rules](https://github.com/rubocop/rubocop). This can be verified with: bundle exec rubocop -3. Code must conform to [Standard Ruby](https://github.com/standardrb/standard). This can be verified with: +2. 100% C0 code coverage. This can be verified with: - bundle exec rake standard + bundle exec rake test -4. 100% mutation coverage. This can be verified with: +3. 100% mutation coverage. This can be verified with: git remote add upstream https://github.com/sferik/x-ruby bundle exec rake mutant -5. RBS type signatures (in `sig/x.rbs`). This can be verified with: +4. RBS type signatures (in `sig/x.rbs`). This can be verified with: bundle exec rake steep diff --git a/Rakefile b/Rakefile index 6752544..a90c817 100644 --- a/Rakefile +++ b/Rakefile @@ -28,7 +28,4 @@ task :mutant do system(*%w[bundle exec mutant run]) or raise "Mutant task failed" end -desc "Run linters" -task lint: %i[rubocop standard] - -task default: %i[test lint mutant steep] +task default: %i[test rubocop mutant steep]