Skip to content

Commit

Permalink
Improve dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
martinzamuner committed Oct 25, 2023
1 parent 697d8fb commit 4568edb
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 208 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ jobs:
tests:
strategy:
matrix:
ruby-version:
- "2.7"
- "3.0"
rails-version:
- "6.1"
- "7.0"
- "7.1"
- "main"
include:
- rails-version: "6.1"
ruby-version: "2.5"
- rails-version: "7.0"
ruby-version: "2.7"
- rails-version: "7.1"
ruby-version: "2.7"
- rails-version: "main"
ruby-version: "3.2"

env:
RAILS_VERSION: "${{ matrix.rails-version }}"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.gem
Gemfile.lock
.byebug_history

test/dummy/db/*.sqlite3
Expand Down
122 changes: 122 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
require:
- rubocop-rails
- rubocop-performance

AllCops:
Exclude:
- '**/db/**/*'
- '**/config/**/*'
- '**/tmp/**/*'
- '**/templates/**/*'
- '**/vendor/**/*'
- '**/node_modules/**/*'
TargetRubyVersion: 3.2.2

# Relaxed Ruby Style
Style/Alias:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylealias

Style/AsciiComments:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleasciicomments

Style/BeginBlock:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylebeginblock

Style/BlockDelimiters:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleblockdelimiters

Style/Documentation:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styledocumentation

Style/EndBlock:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleendblock

Style/GuardClause:
Enabled: false

Style/IfUnlessModifier:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleifunlessmodifier

Style/ModuleFunction:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylemodulefunction

Style/MultilineBlockChain:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylemultilineblockchain

Style/NegatedIf:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylenegatedif

Style/NegatedWhile:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylenegatedwhile

Style/NumericPredicate:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylenumericpredicate

Style/PercentLiteralDelimiters:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylepercentliteraldelimiters

Style/WhileUntilModifier:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylewhileuntilmodifier

Style/WordArray:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylewordarray

Lint/AmbiguousRegexpLiteral:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#lintambiguousregexpliteral

Lint/AssignmentInCondition:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#lintassignmentincondition

Layout/LineLength:
Enabled: false

Metrics:
Enabled: false

# Custom
Performance:
Exclude:
- '**/spec/**/*'

Style/FrozenStringLiteralComment:
Enabled: false

Style/AndOr:
Enabled: true
EnforcedStyle: conditionals

Style/ClassAndModuleChildren:
Enabled: false

Style/HashSyntax:
Enabled: false

Style/MixinGrouping:
Enabled: false

Style/RegexpLiteral:
Enabled: false

Style/StringConcatenation:
Enabled: false

Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes
20 changes: 17 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,22 @@ source "https://rubygems.org"

gemspec

gem "rake"
gem "byebug"
rails_version = ENV.fetch("RAILS_VERSION", "7.1")

gem "rails", ">= 6.1"
rails_constraint =
if rails_version == "main"
{ github: "rails/rails" }
else
"~> #{rails_version}.0"
end

gem "rails", rails_constraint
gem "sqlite3"

group :debug do
gem "byebug"

gem "rubocop"
gem "rubocop-performance"
gem "rubocop-rails"
end
199 changes: 0 additions & 199 deletions Gemfile.lock

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Example
end
```

If those options don't work for you, you can always [write custom serializer](https://guides.rubyonrails.org/active_job_basics.html#serializers) for your classes.
If those options don't work for you, you can always [write custom serializers](https://guides.rubyonrails.org/active_job_basics.html#serializers) for your classes.


## Configuration
Expand Down
Loading

0 comments on commit 4568edb

Please sign in to comment.