Added rubocop for style checking; added woodpecker CI config
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful

This commit is contained in:
Gregory Ballantine 2023-12-08 12:17:13 -05:00
parent 1a363a5862
commit fa9245d7ec
4 changed files with 51 additions and 0 deletions

21
.rubocop.yml Normal file
View File

@ -0,0 +1,21 @@
require: rubocop-sequel
AllCops:
NewCops: enable
Layout/EmptyLinesAroundClassBody:
EnforcedStyle: 'empty_lines_except_namespace'
Layout/EmptyLinesAroundModuleBody:
EnforcedStyle: 'empty_lines_except_namespace'
Metrics/ClassLength:
Max: 150
Style/ClassVars:
Enabled: false
Style/GlobalVars:
Enabled: false
Style/MethodCallWithoutArgsParentheses:
Enabled: false
Style/MethodCallWithArgsParentheses:
Enabled: true
Style/RedundantReturn:
Enabled: false

19
.woodpecker.yml Normal file
View File

@ -0,0 +1,19 @@
pipeline:
style:
image: ruby:3.0
commands:
- 'gem install rake'
- 'bundle config set --local path "vendor/bundle"'
- 'bundle install'
- 'rake test:rubocop'
gitea_release:
image: plugins/gitea-release
settings:
api_key:
from_secret: gitea_api_key
base_url: https://git.metaunix.net
title: "${CI_COMMIT_TAG}"
when:
event: tag

View File

@ -10,4 +10,8 @@ gem 'sqlite3', '~> 1.6'
group :development, :test do group :development, :test do
gem 'rerun' gem 'rerun'
gem 'wdm', '>= 0.1.0' if Gem.win_platform? gem 'wdm', '>= 0.1.0' if Gem.win_platform?
# rubocop and extensions for code style
gem 'rubocop'
gem 'rubocop-sequel'
end end

View File

@ -22,3 +22,10 @@ namespace :server do
system('rerun --no-notify --exit --dir="src/" puma') system('rerun --no-notify --exit --dir="src/" puma')
end end
end end
namespace :test do
task :rubocop do
system("rubocop app/ server.rb scan.rb")
end
end