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

Create rubyonrails.yml #23

Merged
merged 2 commits into from
Aug 22, 2023
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
48 changes: 48 additions & 0 deletions .github/workflows/rubyonrails.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: "Ruby on Rails CI"
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11-alpine
ports:
- "5432:5432"
env:
POSTGRES_DB: rails_test
POSTGRES_USER: rails
POSTGRES_PASSWORD: password
env:
RAILS_ENV: test
DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
with:
ruby-version: '2.7.4'
bundler-cache: true
- name: Copy config
run: cp config/database.yml.ci config/database.yml
- name: Set up database schema
run: bin/rails db:schema:load
- name: Run tests
run: bin/rake

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
with:
ruby-version: '2.7.4'
bundler-cache: true
- name: Rubocop
run: bundle exec rubocop
35 changes: 12 additions & 23 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --exclude-limit 10000`
# on 2023-08-22 13:25:26 UTC using RuboCop version 1.56.0.
# on 2023-08-22 14:43:11 UTC using RuboCop version 1.56.0.
# 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
Expand Down Expand Up @@ -43,14 +43,6 @@ Layout/EmptyLinesAroundBlockBody:
Exclude:
- 'db/schema.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: require_no_space, require_space
Layout/SpaceInLambdaLiteral:
Exclude:
- 'app/models/account.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets.
Expand Down Expand Up @@ -143,7 +135,7 @@ Lint/UselessAssignment:
Metrics/AbcSize:
Max: 19

# Offense count: 9
# Offense count: 10
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
# AllowedMethods: refine
Metrics/BlockLength:
Expand Down Expand Up @@ -186,7 +178,7 @@ Style/ClassAndModuleChildren:
Exclude:
- 'app/controllers/users/registrations_controller.rb'

# Offense count: 44
# Offense count: 45
# Configuration parameters: AllowedConstants.
Style/Documentation:
Exclude:
Expand All @@ -195,6 +187,7 @@ Style/Documentation:
- 'app/actions/application_action.rb'
- 'app/actions/automatic_topup_action.rb'
- 'app/controllers/account_automatic_topup_configs_controller.rb'
- 'app/controllers/account_invitations_controller.rb'
- 'app/controllers/accounts_controller.rb'
- 'app/controllers/application_controller.rb'
- 'app/controllers/home_controller.rb'
Expand Down Expand Up @@ -273,7 +266,7 @@ Style/FetchEnvVar:
- 'bin/bundle'
- 'config/environments/production.rb'

# Offense count: 93
# Offense count: 96
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Expand All @@ -287,6 +280,7 @@ Style/FrozenStringLiteralComment:
- 'app/channels/application_cable/channel.rb'
- 'app/channels/application_cable/connection.rb'
- 'app/controllers/account_automatic_topup_configs_controller.rb'
- 'app/controllers/account_invitations_controller.rb'
- 'app/controllers/accounts_controller.rb'
- 'app/controllers/application_controller.rb'
- 'app/controllers/home_controller.rb'
Expand Down Expand Up @@ -358,6 +352,7 @@ Style/FrozenStringLiteralComment:
- 'db/seeds.rb'
- 'lib/tasks/scheduler.rake'
- 'spec/controllers/account_automatic_topup_configs_spec.rb'
- 'spec/controllers/account_invitations_spec.rb'
- 'spec/controllers/accounts_spec.rb'
- 'spec/controllers/home_spec.rb'
- 'spec/controllers/my_accounts_spec.rb'
Expand All @@ -367,6 +362,7 @@ Style/FrozenStringLiteralComment:
- 'spec/controllers/transactions_spec.rb'
- 'spec/controllers/users/registrations_spec.rb'
- 'spec/factories/account.rb'
- 'spec/factories/account_invitations.rb'
- 'spec/factories/transaction.rb'
- 'spec/factories/user.rb'
- 'spec/mailers/transactions_spec.rb'
Expand Down Expand Up @@ -396,14 +392,6 @@ Style/IfUnlessModifier:
- 'app/controllers/topups_controller.rb'
- 'bin/bundle'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: line_count_dependent, lambda, literal
Style/Lambda:
Exclude:
- 'app/models/account.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MinDigits, Strict, AllowedNumbers, AllowedPatterns.
Expand Down Expand Up @@ -486,12 +474,13 @@ Style/StringLiterals:
- 'spec/mailers/transactions_spec.rb'
- 'spec/rails_helper.rb'

# Offense count: 7
# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MinSize.
# Configuration parameters: .
# SupportedStyles: percent, brackets
Style/SymbolArray:
EnforcedStyle: brackets
EnforcedStyle: percent
MinSize: 5

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Expand Down