Skip to content
This repository has been archived by the owner on Jan 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #53 from lopopolo/nemesis-ruby-build
Browse files Browse the repository at this point in the history
Lint Nemesis Ruby runtime in CI build
  • Loading branch information
lopopolo committed May 24, 2019
2 parents 7d467b9 + aa2c8b2 commit e6e729b
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 12 deletions.
30 changes: 25 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,26 +94,46 @@ jobs:
-print0 | xargs -0 -n1 bash -c '_check_clang_format "$@"' _
ruby:
docker:
- image: circleci/ruby:2.6
- image: circleci/ruby:2.6.0
steps:
- checkout
- run:
name: Install bundler 2
command: sudo gem install bundler
- restore_cache:
keys:
- ruby-bundler-v1-foolsgold-{{ checksum "./foolsgold/ruby/Gemfile.lock" }}
- run:
name: Bundle Install
name: FoolsGold Bundle Install
working_directory: ./foolsgold/ruby
command: bundle install --path ~/vendor/bundle
command: bundle install --path ~/vendor/foolsgold-bundle
- save_cache:
key: ruby-bundler-v1-foolsgold-{{ checksum "./foolsgold/ruby/Gemfile.lock" }}
paths:
- ~/vendor/bundle
- ~/vendor/foolsgold-bundle
- run:
name: Lint Ruby With RuboCop
name: FoolsGold Lint Ruby With RuboCop
working_directory: ./foolsgold/ruby
command: |
bundle exec rubocop --version
bundle exec rubocop
- restore_cache:
keys:
- ruby-bundler-v1-nemesis-{{ checksum "./nemesis/ruby/Gemfile.lock" }}
- run:
name: Nemesis Bundle Install
working_directory: ./nemesis/ruby
command: bundle install --path ~/vendor/nemesis-bundle
- save_cache:
key: ruby-bundler-v1-nemesis-{{ checksum "./nemesis/ruby/Gemfile.lock" }}
paths:
- ~/vendor/nemesis-bundle
- run:
name: Nemesis Lint Ruby With RuboCop
working_directory: ./nemesis/ruby
command: |
bundle exec rubocop --version
bundle exec rubocop
text:
docker:
- image: circleci/node:lts
Expand Down
5 changes: 0 additions & 5 deletions foolsgold/ruby/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
AllCops:
TargetRubyVersion: 2.5
DisplayCopNames: true
Exclude:
- 'lib/rack/**/*.rb'
Metrics:
Enabled: false
Style/Documentation:
Enabled: false
Style/MutableConstant:
# freeze is not implemented on mruby
Enabled: false
7 changes: 7 additions & 0 deletions nemesis/ruby/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
AllCops:
TargetRubyVersion: 2.5
DisplayCopNames: true
Metrics:
Enabled: false
Style/Documentation:
Enabled: false
4 changes: 3 additions & 1 deletion nemesis/ruby/lib/nemesis.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'nemesis/response'

module Nemesis
VERSION = "0.0.1"
VERSION = '0.0.1'
end
2 changes: 2 additions & 0 deletions nemesis/ruby/lib/nemesis/response.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Nemesis
class Response
attr_accessor :length, :status, :body
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"eslint-check": "eslint --print-config . | eslint-config-prettier-check",
"fmt-c": "find . \\( -name '*.h' -or -name '*.c' \\) -and -not -path '*vendor*' -and -not -path '*target*' | xargs clang-format -i",
"fmt-text": "prettier --write --prose-wrap always './*.{css,html,js,json,md}' '{mruby*,foolsgold}/**/*.{css,html,js,json,md}'",
"lint": "cargo clippy --all-targets && cd foolsgold/ruby && bundle exec rubocop",
"lint": "cargo clippy --all-targets && pushd foolsgold/ruby && bundle exec rubocop && popd && pushd nemesis/ruby && bundle exec rubocop",
"loc": "sloc --format cli-table --keys total,source,comment,todo --exclude '.*(node_modules|vendor|target).*|ffi\\.rs' mruby* foolsgold nemesis"
}
}

0 comments on commit e6e729b

Please sign in to comment.