-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from RuboCop to Standard (#28)
* Swap RuboCop for Standard * Run `bundle exec standardrb --fix` * Fix up tests after Standard formatting * Cleanup code that wasn't auto-fixed * Update README * Patch up GHA workflows * Use double quotes in workflow * Remove frozen string literal comments * Fix up tests again * Test a deliberate Standard violation in CI * Try fail level E * Try fail level A, I misunderstood before * Fix the deliberate Standard violation
- Loading branch information
Showing
25 changed files
with
249 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
name: Linting | ||
on: [pull_request] | ||
jobs: | ||
rubocop: | ||
standard: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e | ||
with: | ||
ruby-version: 3.0.0 | ||
bundler-cache: true | ||
- name: Run RuboCop | ||
uses: reviewdog/action-rubocop@v2 | ||
with: | ||
rubocop_version: gemfile | ||
github_token: ${{ secrets.github_token }} | ||
reporter: github-pr-review | ||
- uses: actions/checkout@v2 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e | ||
with: | ||
ruby-version: 3.0.0 | ||
bundler-cache: true | ||
- name: Run Standard | ||
run: bundle exec standardrb --fail-level A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,7 @@ | ||
require: | ||
- rubocop-performance | ||
require: standard | ||
|
||
inherit_mode: | ||
merge: | ||
- Exclude | ||
inherit_gem: | ||
standard: config/base.yml | ||
|
||
AllCops: | ||
NewCops: enable | ||
Exclude: | ||
- 'bin/**/*' | ||
- 'test/mock/app/**/*' | ||
- 'test/mock/examples/**/*' | ||
|
||
Gemspec/RequiredRubyVersion: | ||
Enabled: false | ||
|
||
Layout/LineLength: | ||
Max: 120 | ||
|
||
Metrics/AbcSize: | ||
Exclude: | ||
- 'test/**/*' | ||
|
||
Metrics/MethodLength: | ||
Max: 25 | ||
Exclude: | ||
- 'test/**/*' | ||
|
||
Metrics/ModuleLength: | ||
Max: 250 | ||
|
||
Style/ClassAndModuleChildren: | ||
Exclude: | ||
- 'test/**/*' | ||
DisabledByDefault: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
source "https://rubygems.org" | ||
|
||
# Specify your gem's dependencies in chusaku.gemspec | ||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'bundler/gem_tasks' | ||
require 'rake/testtask' | ||
require "bundler/gem_tasks" | ||
require "rake/testtask" | ||
|
||
Rake::TestTask.new(:test) do |t| | ||
t.libs << 'test' | ||
t.libs << 'lib' | ||
t.test_files = FileList['test/**/*_test.rb'] | ||
t.libs << "test" | ||
t.libs << "lib" | ||
t.test_files = FileList["test/**/*_test.rb"] | ||
end | ||
|
||
task default: :test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'rubygems' | ||
require "rubygems" | ||
|
||
begin | ||
# Use project's bundle. | ||
require 'bundler' | ||
require "bundler" | ||
Bundler.setup | ||
|
||
# Use project's environment. | ||
require 'rake' | ||
load './Rakefile' | ||
require "rake" | ||
load "./Rakefile" | ||
Rake::Task[:environment].invoke | ||
rescue StandardError | ||
rescue | ||
end | ||
|
||
require 'chusaku/cli' | ||
require "chusaku/cli" | ||
|
||
exit Chusaku::CLI.new.call |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.