Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reinstate Rubocop #3

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/lint.yml → .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Lint
name: Check

on:
push:

jobs:
lint:
name: Standard Lint
check:
name: Check code
runs-on: ubuntu-latest

steps:
Expand All @@ -15,5 +15,7 @@ jobs:
with:
ruby-version: "3.3.1"
bundler-cache: true
- name: Run the lint task
- name: Lint with StandardRB
run: bundle exec rake standard
- name: Lint with Rubocop
run: bundle exec rake rubocop
17 changes: 17 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require:
- standard
- standard-custom
- standard-performance
- rubocop-performance
- rubocop-rake
- rubocop-minitest

inherit_gem:
standard: config/base.yml
standard-custom: config/base.yml
standard-performance: config/base.yml

AllCops:
TargetRubyVersion: 2.5
SuggestExtensions: false
NewCops: enable
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ group :test do
end

group :check do
gem "rubocop", "~> 1.62.1", require: false
gem "rubocop-minitest", "~> 0.33.0", require: false
gem "rubocop-rake", "~> 0.6.0", require: false
gem "standard", "~> 1.0", require: false
gem "steep", "~> 1.6.0", require: false
end
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Dir.glob(File.join(__dir__ || Dir.pwd, "tasks", "*.rake")) { |f| import f }
task default: [:test, :check]

desc "Run checks"
task check: [:standard, :"steep:check"]
task check: [:standard, :rubocop, :"steep:check"]
7 changes: 7 additions & 0 deletions tasks/rubocop.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

# @type self: Rake::DSL

require "rubocop/rake_task"

RuboCop::RakeTask.new