-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make code compatible with Shopify ruby style.
Add .editorconfig to support common config for editors. Update Github action workflow to run Linter task. Update code to support Shopify ruby style. Sidecar: Update tests that never worked and always successed.
- Loading branch information
Showing
57 changed files
with
1,312 additions
and
1,078 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
max_line_length = 120 | ||
tab_width = 2 | ||
trim_trailing_whitespace = true | ||
|
||
[{*.rb,*.rake}] | ||
indent_size = 2 | ||
indent_style = space | ||
|
||
[{*.har,*.json}] | ||
indent_size = 2 | ||
indent_style = space | ||
|
||
[{*.lock,*.yaml,*.yml}] | ||
indent_size = 2 |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Gemfile.lock linguist-generated |
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,5 +1,19 @@ | ||
inherit_from: | ||
- http://shopify.github.io/ruby-style-guide/rubocop.yml | ||
require: | ||
- rubocop-minitest | ||
- rubocop-rake | ||
|
||
inherit_from: .rubocop_todo.yml | ||
|
||
inherit_gem: | ||
rubocop-shopify: rubocop.yml | ||
|
||
AllCops: | ||
TargetRubyVersion: '2.6' | ||
TargetRubyVersion: '2.7' | ||
NewCops: enable | ||
|
||
Naming/InclusiveLanguage: | ||
Enabled: false | ||
|
||
Style/GlobalVars: | ||
Exclude: | ||
- ext/semian/extconf.rb |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2022-05-19 18:59:22 UTC using RuboCop version 1.29.1. | ||
# The point is for the user to remove these configuration records | ||
# one by one as the offenses are removed from the code base. | ||
# Note that changes in the inspected code, or installation of new | ||
# versions of RuboCop, may require this file to be generated again. | ||
|
||
# Offense count: 4 | ||
# Configuration parameters: AllowComments, AllowNil. | ||
Lint/SuppressedException: | ||
Exclude: | ||
- 'test/helpers/circuit_breaker_helper.rb' | ||
- 'test/net_http_test.rb' | ||
- 'test/protected_resource_test.rb' |
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,5 +1,6 @@ | ||
{ | ||
"recommendations": [ | ||
"ms-vscode-remote.vscode-remote-extensionpack" | ||
], | ||
"recommendations": [ | ||
"ms-vscode-remote.vscode-remote-extensionpack", | ||
"EditorConfig.EditorConfig" | ||
] | ||
} |
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,20 +1,30 @@ | ||
source 'https://rubygems.org' | ||
# frozen_string_literal: true | ||
|
||
gem 'benchmark-memory' | ||
gem 'grpc' | ||
gem 'hiredis', '~> 0.6' | ||
gem 'memory_profiler' | ||
gem 'minitest' | ||
gem 'mocha' | ||
gem 'mysql2', '~> 0.5', github: 'brianmario/mysql2' | ||
gem 'pry-byebug', require: false | ||
gem 'rake-compiler' | ||
gem 'rake' | ||
gem 'redis-client', '0.2.0' | ||
gem 'redis' | ||
gem 'rubocop' | ||
gem 'timecop' | ||
gem 'toxiproxy', '~> 1.0.0' | ||
gem 'webrick' | ||
source "https://rubygems.org" | ||
|
||
group :test do | ||
gem "benchmark-memory" | ||
gem "grpc" | ||
gem "hiredis", "~> 0.6" | ||
gem "memory_profiler" | ||
gem "minitest" | ||
gem "mocha" | ||
gem "mysql2", "~> 0.5", github: "brianmario/mysql2" | ||
gem "pry-byebug", require: false | ||
gem "rake-compiler" | ||
gem "rake" | ||
gem "redis-client", "0.2.0" | ||
gem "redis" | ||
gem "timecop" | ||
gem "toxiproxy", "~> 1.0.0" | ||
gem "webrick" | ||
end | ||
|
||
group :lint do | ||
gem "rubocop-minitest", require: false | ||
gem "rubocop-rake", require: false | ||
gem "rubocop-shopify", require: false | ||
gem "rubocop", require: false | ||
end | ||
|
||
gemspec |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,59 +1,63 @@ | ||
require 'bundler/gem_tasks' | ||
begin | ||
require 'rubocop/rake_task' | ||
RuboCop::RakeTask.new | ||
rescue LoadError | ||
# frozen_string_literal: true | ||
|
||
require "bundler/gem_tasks" | ||
require "rubocop/rake_task" | ||
RuboCop::RakeTask.new do |task| | ||
task.requires << "rubocop-minitest" | ||
task.requires << "rubocop-rake" | ||
end | ||
|
||
# ========================================================== | ||
# Packaging | ||
# ========================================================== | ||
|
||
GEMSPEC = eval(File.read('semian.gemspec')) | ||
GEMSPEC = eval(File.read("semian.gemspec")) # rubocop:disable Security/Eval | ||
|
||
require 'rubygems/package_task' | ||
require "rubygems/package_task" | ||
Gem::PackageTask.new(GEMSPEC) do |_pkg| | ||
end | ||
|
||
# ========================================================== | ||
# Ruby Extension | ||
# ========================================================== | ||
|
||
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__) | ||
require 'semian/platform' | ||
$LOAD_PATH.unshift(File.expand_path("../lib", __FILE__)) | ||
require "semian/platform" | ||
if Semian.sysv_semaphores_supported? | ||
require 'rake/extensiontask' | ||
Rake::ExtensionTask.new('semian', GEMSPEC) do |ext| | ||
ext.ext_dir = 'ext/semian' | ||
ext.lib_dir = 'lib/semian' | ||
require "rake/extensiontask" | ||
Rake::ExtensionTask.new("semian", GEMSPEC) do |ext| | ||
ext.ext_dir = "ext/semian" | ||
ext.lib_dir = "lib/semian" | ||
end | ||
desc "Build gem" | ||
task build: :compile | ||
else | ||
task :build do | ||
desc "Build gem" | ||
task :build do # rubocop:disable Rake/DuplicateTask | ||
end | ||
end | ||
|
||
# ========================================================== | ||
# Testing | ||
# ========================================================== | ||
|
||
require 'rake/testtask' | ||
Rake::TestTask.new 'test' do |t| | ||
t.libs = %w(lib test) | ||
require "rake/testtask" | ||
Rake::TestTask.new("test") do |t| | ||
t.libs = ["lib", "test"] | ||
t.pattern = "test/*_test.rb" | ||
t.warning = false | ||
if ENV["CI"] || ENV["VERBOSE"] | ||
t.options = '-v' | ||
t.options = "-v" | ||
end | ||
end | ||
|
||
# ========================================================== | ||
# Documentation | ||
# ========================================================== | ||
require 'rdoc/task' | ||
require "rdoc/task" | ||
RDoc::Task.new do |rdoc| | ||
rdoc.rdoc_files.include("lib/*.rb", "ext/semian/*.c") | ||
end | ||
|
||
task default: :build | ||
task default: :test | ||
task default: :test # rubocop:disable Rake/DuplicateTask |
Oops, something went wrong.