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
26 changes: 26 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint

on:
push:
branches: [master, main]
pull_request:
branches: [master, main]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0.6'
bundler-cache: true

- name: Run RuboCop
run: bundle exec rubocop

- name: Check for files missing newlines
run: bundle exec rake check_newlines
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.6
ruby-version: 3.0.6
bundler-cache: true
- name: Run tests
run: bundle exec rake
Expand Down
64 changes: 64 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
inherit_from: .rubocop_todo.yml

plugins:
- rubocop-rake
- rubocop-rspec

AllCops:
TargetRubyVersion: 3.0
NewCops: enable
Exclude:
- 'vendor/**/*'
- 'spec/fixtures/**/*'
- 'tmp/**/*'
- 'pkg/**/*'
- 'node_modules/**/*'
- 'specs_e2e/**/*'
- 'e2e/**/*'

# Ensure all files end with a newline
Layout/TrailingEmptyLines:
Enabled: true
EnforcedStyle: final_newline

# Ensure no trailing whitespace
Layout/TrailingWhitespace:
Enabled: true

# Line length is configured in .rubocop_todo.yml for existing violations

# Allow longer blocks in specs and rake tasks
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
- '**/*.rake'
- 'Rakefile'
- '*.gemspec'

# Allow longer methods in rake tasks
Metrics/MethodLength:
Exclude:
- '**/*.rake'
- 'Rakefile'

# String literals - configured in .rubocop_todo.yml for gradual adoption

# Frozen string literal pragma - configured in .rubocop_todo.yml for gradual adoption

# Documentation
Style/Documentation:
Enabled: false

# Allow compact module/class definitions
Style/ClassAndModuleChildren:
Enabled: false

# RSpec specific
RSpec/ExampleLength:
Max: 20

RSpec/MultipleExpectations:
Max: 5

RSpec/NestedGroups:
Max: 4
Loading
Loading