-
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
Add rubocop linter and CI job #579
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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,45 @@ | ||
require: | ||
- rubocop-capybara | ||
- rubocop-minitest | ||
- rubocop-performance | ||
- rubocop-rails | ||
- standard | ||
|
||
inherit_gem: | ||
standard: config/base.yml | ||
|
||
AllCops: | ||
SuggestExtensions: false | ||
TargetRubyVersion: 3.3 | ||
NewCops: enable | ||
|
||
Minitest/MultipleAssertions: | ||
Max: 10 # default 3 | ||
|
||
Style/FrozenStringLiteralComment: | ||
Enabled: true | ||
|
||
# These below cops are good practice going forward, but due to legacy we exclude some migrations | ||
Rails/CreateTableWithTimestamps: | ||
Exclude: | ||
- db/migrate/20181101154531_create_cms.rb | ||
- db/migrate/20220603215833_create_active_storage_variant_records.active_storage.rb | ||
|
||
Rails/SkipsModelValidations: | ||
Exclude: | ||
- db/migrate/20220603215832_add_service_name_to_active_storage_blobs.active_storage.rb | ||
|
||
Rails/BulkChangeTable: | ||
Exclude: | ||
- db/migrate/20181101154602_create_friendly_id_slugs.rb | ||
- db/migrate/20181101154832_add_slug_to_profiles.rb | ||
|
||
Rails/ThreeStateBooleanColumn: | ||
Exclude: | ||
- db/migrate/20181101154627_create_profiles.rb | ||
|
||
# Below are cops that are currently disabled, where we should fix in the future | ||
# TODO: Fix ProfilesController so we don't need to use global vars | ||
Style/GlobalVars: | ||
Exclude: | ||
- app/controllers/profiles_controller.rb |
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,59 +1,69 @@ | ||
source 'https://rubygems.org' | ||
# frozen_string_literal: true | ||
|
||
source "https://rubygems.org" | ||
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | ||
|
||
ruby '3.1.4' | ||
ruby "3.1.4" | ||
|
||
gem 'rails', '~> 7.1.3' | ||
gem "rails", "~> 7.1.3" | ||
|
||
gem 'mysql2', '~> 0.5.6' | ||
gem "mysql2", "~> 0.5.6" | ||
# Use Puma as the app server | ||
gem 'puma', '~> 6.4' | ||
gem "puma", "~> 6.4" | ||
|
||
# Use Uglifier as compressor for JavaScript assets | ||
gem 'uglifier', '>= 1.3.0' | ||
gem "uglifier", ">= 1.3.0" | ||
|
||
gem 'rollbar' | ||
gem "rollbar" | ||
|
||
# See https://github.com/rails/execjs#readme for more supported runtimes | ||
gem 'execjs' | ||
gem "execjs" | ||
|
||
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder | ||
gem 'jbuilder', '~> 2.12' | ||
gem "jbuilder", "~> 2.12" | ||
|
||
# Use ActiveStorage variant | ||
gem 'image_processing', '~> 1.12', '>= 1.12.2' | ||
gem "image_processing", "~> 1.12", ">= 1.12.2" | ||
|
||
gem 'comfortable_mexican_sofa', github: 'restarone/comfortable-mexican-sofa', tag: '3.5' | ||
gem "comfortable_mexican_sofa", github: "restarone/comfortable-mexican-sofa", tag: "3.5" | ||
|
||
gem 'friendly_id' | ||
gem "friendly_id" | ||
|
||
gem 'htmlentities' | ||
gem "htmlentities" | ||
# Reduces boot times through caching; required in config/boot.rb | ||
gem 'bootsnap', '>= 1.4.2', require: false | ||
gem "bootsnap", ">= 1.4.2", require: false | ||
|
||
gem 'webpacker', '~> 5.4' | ||
gem "webpacker", "~> 5.4" | ||
|
||
gem "rdoc", ">= 6.6.3.1" | ||
|
||
group :development, :test do | ||
# Call 'byebug' anywhere in the code to stop execution and get a debugger console | ||
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] | ||
gem "byebug", platforms: [:mri, :mingw, :x64_mingw] | ||
|
||
# Linters | ||
gem "rubocop", require: false | ||
gem "rubocop-capybara", require: false | ||
gem "rubocop-minitest", require: false | ||
gem "rubocop-performance", require: false | ||
gem "rubocop-rails", require: false | ||
gem "standard", ">= 1.35.1", require: false | ||
end | ||
|
||
group :development do | ||
# Access an interactive console on exception pages or by calling 'console' anywhere in the code. | ||
gem 'web-console', '>= 3.3.0' | ||
gem "web-console", ">= 3.3.0" | ||
|
||
gem 'listen', '>= 3.0.5', '< 3.10' | ||
gem "listen", ">= 3.0.5", "< 3.10" | ||
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring | ||
gem 'spring', '>= 3.0' | ||
gem "spring", ">= 3.0" | ||
end | ||
|
||
group :test do | ||
# Adds support for Capybara system testing and selenium driver | ||
gem 'capybara', '>= 2.15' | ||
gem 'selenium-webdriver' | ||
gem "capybara", ">= 2.15" | ||
gem "selenium-webdriver" | ||
end | ||
|
||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem | ||
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] | ||
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby] |
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,6 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
# Add your own tasks in files placed in lib/tasks ending in .rake, | ||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | ||
|
||
require_relative 'config/application' | ||
require_relative "config/application" | ||
|
||
Rails.application.load_tasks |
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::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 | ||
|
||
class ErrorsController < ApplicationController | ||
def file_not_found | ||
end | ||
|
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.
This wasn't working for me with Github Actions. Believe you don't use
ruby
anymore and instead break it down by individual platforms like so (this is what a newly generated Rails app will do it appears)