-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 implement rubocop #15
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ee52b7e
Create todo list for rubocop on initial generation
mikeheft f0391dc
Auto correct rubocop errors
mikeheft e968251
Add action for rubocop checks on each push
mikeheft fb77d69
remove comment
mikeheft 6ffce66
Remove unused file from rubocop config
mikeheft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: RuboCop | ||
|
||
on: [push] | ||
|
||
jobs: | ||
rubocop: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.3.0 | ||
|
||
- name: Install dependencies | ||
run: | | ||
gem install bundler | ||
bundle install --jobs 4 --retry 3 | ||
|
||
- name: Run RuboCop | ||
run: bundle exec rubocop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
require: | ||
- rubocop-rails | ||
- ./lib/rubocop/init_autoloader | ||
|
||
AllCops: | ||
TargetRubyVersion: 3.3.0 | ||
Exclude: | ||
- "spec/**/*.rb" | ||
- "db/**/*" | ||
- "config/**/*" | ||
- "bin/**/*" | ||
################### | ||
# Custom Cops # | ||
################### | ||
Custom/PrivateMethodStyle: | ||
Enabled: true | ||
################### | ||
# End Custom Cops # | ||
################### | ||
Layout/IndentationWidth: | ||
Enabled: true | ||
Width: 2 | ||
Lint/UnusedMethodArgument: | ||
AutoCorrect: false | ||
Metrics/CyclomaticComplexity: | ||
Exclude: | ||
- "lib/rubocop/cop/custom/*.rb" | ||
Metrics/MethodLength: | ||
Exclude: | ||
- "lib/rubocop/cop/custom/*.rb" | ||
Metrics/PerceivedComplexity: | ||
Exclude: | ||
- "lib/rubocop/cop/custom/*.rb" | ||
Style/AccessModifierDeclarations: | ||
EnforcedStyle: inline | ||
Style/Documentation: | ||
Enabled: false | ||
Style/Lambda: | ||
EnforcedStyle: literal | ||
Style/RedundantArgument: | ||
AutoCorrect: false | ||
Style/StringLiterals: | ||
EnforcedStyle: double_quotes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2024-07-02 18:02:47 UTC using RuboCop version 1.63.5. | ||
# 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 | ||
# versions of RuboCop, may require this file to be generated again. | ||
|
||
# Offense count: 6 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
Layout/EmptyLineAfterGuardClause: | ||
Exclude: | ||
- 'bin/bundle' | ||
|
||
# Offense count: 1 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
Layout/EmptyLines: | ||
Exclude: | ||
- 'config/environments/development.rb' | ||
|
||
# Offense count: 2 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: EnforcedStyle, IndentationWidth. | ||
# SupportedStyles: aligned, indented, indented_relative_to_receiver | ||
Layout/MultilineMethodCallIndentation: | ||
Exclude: | ||
- 'config/environments/production.rb' | ||
|
||
# Offense count: 2 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets. | ||
# SupportedStyles: space, no_space, compact | ||
# SupportedStylesForEmptyBrackets: space, no_space | ||
Layout/SpaceInsideArrayLiteralBrackets: | ||
Exclude: | ||
- 'config/environments/production.rb' | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: AllowedMethods, AllowedPatterns. | ||
Metrics/CyclomaticComplexity: | ||
Max: 9 | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. | ||
Metrics/MethodLength: | ||
Max: 13 | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: AllowedMethods, AllowedPatterns. | ||
Metrics/PerceivedComplexity: | ||
Max: 9 | ||
|
||
# Offense count: 3 | ||
# Configuration parameters: AllowedConstants. | ||
Style/Documentation: | ||
Exclude: | ||
- 'spec/**/*' | ||
- 'test/**/*' | ||
- 'app/mailers/application_mailer.rb' | ||
- 'app/models/application_record.rb' | ||
- 'config/application.rb' | ||
|
||
# Offense count: 27 | ||
# This cop supports unsafe autocorrection (--autocorrect-all). | ||
# Configuration parameters: EnforcedStyle. | ||
# SupportedStyles: always, always_true, never | ||
Style/FrozenStringLiteralComment: | ||
Enabled: false | ||
|
||
# Offense count: 1 | ||
# This cop supports unsafe autocorrection (--autocorrect-all). | ||
Style/GlobalStdStream: | ||
Exclude: | ||
- 'config/environments/production.rb' | ||
|
||
# Offense count: 2 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
Style/IfUnlessModifier: | ||
Exclude: | ||
- 'bin/bundle' | ||
|
||
# Offense count: 1 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: PreferredDelimiters. | ||
Style/PercentLiteralDelimiters: | ||
Exclude: | ||
- 'config/application.rb' | ||
|
||
# Offense count: 1 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
Style/PerlBackrefs: | ||
Exclude: | ||
- 'bin/bundle' | ||
|
||
# Offense count: 2 | ||
# This cop supports unsafe autocorrection (--autocorrect-all). | ||
# Configuration parameters: SafeForConstants. | ||
Style/RedundantFetchBlock: | ||
Exclude: | ||
- 'config/puma.rb' | ||
|
||
# Offense count: 1 | ||
# This cop supports unsafe autocorrection (--autocorrect-all). | ||
# Configuration parameters: RequireEnglish. | ||
# SupportedStyles: use_perl_names, use_english_names, use_builtin_english_names | ||
Style/SpecialGlobalVars: | ||
EnforcedStyle: use_perl_names | ||
|
||
# Offense count: 73 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. | ||
# SupportedStyles: single_quotes, double_quotes | ||
Style/StringLiterals: | ||
Exclude: | ||
- 'Rakefile' | ||
- 'app/mailers/application_mailer.rb' | ||
- 'bin/bundle' | ||
- 'bin/rails' | ||
- 'bin/rake' | ||
- 'bin/setup' | ||
- 'config.ru' | ||
- 'config/application.rb' | ||
- 'config/boot.rb' | ||
- 'config/environment.rb' | ||
- 'config/environments/development.rb' | ||
- 'config/environments/production.rb' | ||
- 'config/environments/test.rb' | ||
- 'config/puma.rb' | ||
- 'config/routes.rb' | ||
|
||
# Offense count: 1 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: . | ||
# SupportedStyles: percent, brackets | ||
Style/SymbolArray: | ||
EnforcedStyle: percent | ||
MinSize: 10 | ||
|
||
# Offense count: 2 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. | ||
# URISchemes: http, https | ||
Layout/LineLength: | ||
Max: 198 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module ApplicationCable | ||
class Channel < ActionCable::Channel::Base | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module ApplicationCable | ||
class Connection < ActionCable::Connection::Base | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
class ApplicationController < ActionController::API | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
class ApplicationRecord < ActiveRecord::Base | ||
primary_abstract_class | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the rubocop documentation, this will autocorrect issues when using
rails g