-
-
Notifications
You must be signed in to change notification settings - Fork 62
Add RuboCop linting and newline enforcement #193
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
base: master
Are you sure you want to change the base?
Changes from 10 commits
61129b8
329ef92
e07193d
2fb3c37
b2e27af
c6a126a
353ed05
3a9342a
7ee676c
3ea78ab
f6b7c6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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: | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pinning to Ruby 3.0 reached end-of-life in March 2024. Lint failures on modern Ruby (3.3/3.4) may silently go undetected. Consider using the same version strategy as your test matrix, or at least a supported Ruby like
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The lint workflow uses 3.0.6 to match the gem's minimum supported version ( |
||||||
| ruby-version: '3.0.6' | ||||||
|
justin808 marked this conversation as resolved.
Outdated
|
||||||
| bundler-cache: true | ||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||
|
|
||||||
| - name: Run RuboCop | ||||||
| run: bundle exec rubocop | ||||||
|
|
||||||
| - name: Check for files missing newlines | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ruby 3.0 reached end-of-life in March 2024 and no longer receives security fixes. Consider using a supported version here (and in
Suggested change
Using a minor version without a patch (e.g. |
||||||
| run: bundle exec rake check_newlines | ||||||
| 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 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Consider
Suggested change
|
||||||
| 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 | ||||||
Uh oh!
There was an error while loading. Please reload this page.