Skip to content

Commit

Permalink
Run Standard via RuboCop
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Dec 3, 2023
1 parent a901413 commit fea7e34
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 178 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/lint.yml

This file was deleted.

25 changes: 5 additions & 20 deletions .github/workflows/mutant.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
name: Mutant

on:
push:
branches:
- main

pull_request:

on: [push, 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
- 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
12 changes: 12 additions & 0 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: RuboCop
on: [push, pull_request]
jobs:
build:
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
12 changes: 12 additions & 0 deletions .github/workflows/steep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Type Checker
on: [push, pull_request]
jobs:
build:
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 steep
26 changes: 6 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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 }}
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
27 changes: 0 additions & 27 deletions .github/workflows/type_check.yml

This file was deleted.

75 changes: 8 additions & 67 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -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
22 changes: 9 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
[![Tests](https://github.com/sferik/x-ruby/actions/workflows/test.yml/badge.svg)](https://github.com/sferik/x-ruby/actions/workflows/test.yml)
[![RuboCop](https://github.com/sferik/x-ruby/actions/workflows/rubocop.yml/badge.svg)](https://github.com/sferik/x-ruby/actions/workflows/rubocop.yml)
[![Mutant](https://github.com/sferik/x-ruby/actions/workflows/mutant.yml/badge.svg)](https://github.com/sferik/x-ruby/actions/workflows/mutant.yml)
[![Typer Checker](https://github.com/sferik/x-ruby/actions/workflows/type_check.yml/badge.svg)](https://github.com/sferik/x-ruby/actions/workflows/steep.yml)
[![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)
Expand Down Expand Up @@ -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

Expand Down
5 changes: 1 addition & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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]

0 comments on commit fea7e34

Please sign in to comment.