Skip to content
Open
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
18 changes: 18 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,21 @@ jobs:
reporter: github-pr-review # Default is github-pr-check
rubocop_version: 1.1.6 # note: this actually refers to standardb version, not Rubocop
rubocop_flags: --format progress

rubocop:
name: runner / rubocop
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
- name: Install dependencies
run: |
bundle config path vendor/bundle
bundle install
- name: Run RuboCop
run: |
bundle exec rubocop
13 changes: 4 additions & 9 deletions .github/workflows/specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,15 @@ jobs:
matrix:
include:
# Rails 6.0
- ruby: "3.1"
rails: "6.0"
- ruby: "3.2"
rails: "6.0"
# Rails 6.1
- ruby: "3.1"
rails: "6.1"
- ruby: "3.2"
rails: "6.1"
# Rails 7.0
- ruby: "3.1"
rails: "7.0"
- ruby: "3.2"
rails: "7.0"
# Rails 7.1
- ruby: "3.1"
rails: "7.1"
- ruby: "3.2"
rails: "7.1"
- ruby: "3.3"
Expand All @@ -43,6 +35,9 @@ jobs:
rails: "8.0"
- ruby: "3.4"
rails: "8.0"
# Rails 8.1
- ruby: "3.4"
rails: "8.1"
steps:
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby }}
Expand All @@ -63,6 +58,6 @@ jobs:
bundle exec rake
- name: Simplecov Report
uses: k1LoW/octocov-action@v1
if: matrix.ruby == '3.4' && matrix.rails == '8.0'
if: matrix.ruby == '3.4' && matrix.rails == '8.1'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
165 changes: 165 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
plugins:
- rubocop-rspec
- rubocop-performance
- rubocop-rspec_rails

AllCops:
NewCops: enable
TargetRubyVersion: 3.2
SuggestExtensions: false
Exclude:
- 'vendor/**/*'
- 'bin/**/*'
- 'spec/dummy_app/**/*'
- 'coverage/**/*'
- 'gemfiles/**/*'
- '.bundle/**/*'
- 'Gemfile.lock'
- '*.gemspec'
- 'Appraisals'

# Style preferences
Style/Documentation:
Enabled: false
Exclude:
- 'spec/**/*'

Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: always

Style/StringLiterals:
EnforcedStyle: double_quotes

Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma

Style/ClassAndModuleChildren:
Enabled: true
EnforcedStyle: nested

Style/Lambda:
EnforcedStyle: literal

Style/RedundantConstantBase:
Enabled: false

# Layout preferences
Layout/LineLength:
Max: 120
AllowedPatterns: ['^(\s*#)']
Exclude:
- 'spec/**/*'

Layout/MultilineMethodCallIndentation:
EnforcedStyle: aligned

Layout/FirstHashElementIndentation:
EnforcedStyle: consistent

Layout/CaseIndentation:
EnforcedStyle: case

Layout/LineContinuationLeadingSpace:
EnforcedStyle: leading

# Metrics preferences
Metrics/BlockLength:
Max: 35
Exclude:
- 'spec/**/*'
- 'Rakefile'
- '*.gemspec'
- 'Gemfile'

Metrics/ModuleLength:
Max: 300
Exclude:
- 'spec/**/*'

Metrics/ClassLength:
Max: 200

Metrics/MethodLength:
Max: 40
Exclude:
- 'spec/**/*'

Metrics/AbcSize:
Max: 30
Exclude:
- 'spec/**/*'

Metrics/CyclomaticComplexity:
Max: 10
Exclude:
- 'spec/**/*'

Metrics/PerceivedComplexity:
Max: 10
Exclude:
- 'spec/**/*'

# RSpec preferences
RSpec/ExampleLength:
Max: 30

RSpec/MultipleExpectations:
Max: 8

RSpec/NestedGroups:
Max: 4

RSpec/DescribeClass:
Enabled: true

RSpec/MessageSpies:
Enabled: false

RSpec/MultipleMemoizedHelpers:
Enabled: false

RSpec/ContextWording:
Enabled: false

RSpec/NoExpectationExample:
Enabled: false

RSpec/IncludeExamples:
Enabled: false

RSpec/SharedExamples:
Enabled: false

# Performance preferences
Performance/CollectionLiteralInLoop:
Enabled: true

# Naming preferences
Naming/VariableNumber:
EnforcedStyle: snake_case

Naming/MethodParameterName:
MinNameLength: 2

# Lint preferences
Lint/MissingSuper:
Enabled: true

Lint/UnusedBlockArgument:
Enabled: true

Lint/UnusedMethodArgument:
Enabled: true

Lint/AmbiguousBlockAssociation:
AllowedMethods: ['change']

# Security preferences
Security/YAMLLoad:
Enabled: true

# Bundler preferences
Bundler/OrderedGems:
Enabled: true

4 changes: 4 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ end
appraise "rails-8.0" do
gem "railties", "~> 8.0"
end

appraise "rails-8.1" do
gem "railties", "~> 8.1"
end
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## [Unreleased][main]

## [0.6.0] - 2025-01-XX
- Add Rails 8.1 support

## [0.5.0] - 2025-06-17
- Throw a warning instead of an error for the `$login.failed` event when an exception is raised
- Security fixes and dependency updates
Expand Down Expand Up @@ -33,7 +36,8 @@

- Initial release

[main]: https://github.com/castle/castle_devise/compare/v0.5.0...HEAD
[main]: https://github.com/castle/castle_devise/compare/v0.6.0...HEAD
[0.6.0]: https://github.com/castle/castle_devise/compare/v0.5.0...v0.6.0
[0.5.0]: https://github.com/castle/castle_devise/compare/v0.4.3...v0.5.0
[0.4.3]: https://github.com/castle/castle_devise/compare/v0.4.2...v0.4.3
[0.4.2]: https://github.com/castle/castle_devise/compare/v0.4.1...v0.4.2
Expand Down
12 changes: 8 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ gemspec
gem "actionmailer"
gem "activerecord"
gem "byebug"
gem "railties", "~> 7.2"
gem "logger"
gem "mutex_m"
gem "railties", "< 8.0"
gem "rake"
gem "rspec"
gem "rspec-rails"
gem "rubocop"
gem "rubocop-performance"
gem "rubocop-rspec"
gem "rubocop-rspec_rails"
gem "simplecov"
gem "standard"
gem "sqlite3", "~> 1.7"
gem "standard"
gem "vcr"
gem "webmock"
gem "mutex_m"
gem "logger"
Loading