Skip to content

Commit

Permalink
Run rubocop autocorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
aktfrikshun authored Jun 22, 2022
1 parent bc613a2 commit 466c0b6
Show file tree
Hide file tree
Showing 335 changed files with 8,729 additions and 8,403 deletions.
145 changes: 145 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,148 @@ AllCops:
- 'db/seeds.rb'

require: rubocop-rails

Layout/SpaceAroundOperators:
AllowForAlignment: false
EnforcedStyleForExponentOperator: no_space

Layout/DotPosition:
EnforcedStyle: leading

Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma

Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma

Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma

Layout/ArrayAlignment:
Enabled: false

Layout/MultilineMethodCallIndentation:
Enabled: false

Style/ConditionalAssignment:
Enabled: false

Style/Documentation:
Enabled: false

Style/CommentAnnotation:
Enabled: false

Style/MixinUsage:
Enabled: false

Style/CombinableLoops:
Enabled: false

Style/ClassVars:
Enabled: false

Style/GuardClause:
Enabled: false

Style/HashLikeCase:
Enabled: false

Layout/LineLength:
Enabled: false

Metrics/AbcSize:
Enabled: false

Metrics/BlockLength:
Enabled: false

Metrics/CyclomaticComplexity:
Enabled: false

Metrics/ClassLength:
Enabled: false

Metrics/MethodLength:
Enabled: false

Metrics/ModuleLength:
Enabled: false

Metrics/PerceivedComplexity:
Enabled: false

Naming/VariableNumber:
Enabled: false

Naming/AccessorMethodName:
Enabled: false

Naming/ConstantName:
Enabled: false

Naming/MethodName:
Enabled: false

Naming/PredicateName:
Enabled: false

Lint/AssignmentInCondition:
Enabled: false

Lint/DuplicateBranch:
Enabled: false

Lint/EmptyClass:
Enabled: false

Lint/UselessAssignment:
Enabled: false

Lint/DuplicateMethods:
Enabled: false

Lint/EmptyBlock:
Enabled: false

Rails/Date:
Enabled: false

Rails/I18nLocaleTexts:
Enabled: false

Rails/SkipsModelValidations:
Enabled: false

Rails/CreateTableWithTimestamps:
Enabled: false

Rails/HasManyOrHasOneDependent:
Enabled: false

Rails/HasAndBelongsToMany:
Enabled: false

Rails/BulkChangeTable:
Enabled: false

Rails/ReversibleMigration:
Enabled: false

Rails/FilePath:
Enabled: false

Rails/UniqueValidationWithoutIndex:
Enabled: false

Rails/OutputSafety:
Enabled: false

Rails/LexicallyScopedActionFilter:
Enabled: false

Rails/DynamicFindBy:
Enabled: false

Security/Open:
Enabled: false
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ gem "image_processing", "~> 1.12"
gem "brakeman"
gem "bundler-audit"
gem "rubocop-rails"

gem "rubocop-rspec"
gem 'active_model_serializers', '>= 0.10.13'
gem 'acts-as-list'
gem 'aws-sdk-rails', '>= 3.6.1'
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,8 @@ GEM
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-rspec (2.11.1)
rubocop (~> 1.19)
ruby-graphviz (1.2.5)
rexml
ruby-progressbar (1.11.0)
Expand Down Expand Up @@ -535,6 +537,7 @@ DEPENDENCIES
rspec-rails (>= 5.1.1)
rspec_junit_formatter
rubocop-rails
rubocop-rspec
sass-rails (>= 6.0.0)
selenium-webdriver
sidekiq
Expand Down
2 changes: 2 additions & 0 deletions app/channels/application_cable/channel.rb
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
Expand Down
2 changes: 2 additions & 0 deletions app/channels/application_cable/connection.rb
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
Expand Down
5 changes: 3 additions & 2 deletions app/channels/export_channel.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# frozen_string_literal: true

class ExportChannel < ApplicationCable::Channel
def subscribed
stream_from "exports_channel_#{params[:uuid]}"
end

def unsubscribed
end
def unsubscribed; end
end
65 changes: 34 additions & 31 deletions app/controllers/admin/barriers_controller.rb
Original file line number Diff line number Diff line change
@@ -1,50 +1,53 @@
class Admin::BarriersController < AdminController
before_action :ensure_admin
before_action :set_barrier, only: [:show, :edit, :update, :destroy]
# frozen_string_literal: true

def index
@barriers = Barrier.all
end
module Admin
class BarriersController < AdminController
before_action :ensure_admin
before_action :set_barrier, only: %i[show edit update destroy]

def show
end
def index
@barriers = Barrier.all
end

def new
@barrier = Barrier.new
end
def show; end

def edit
end
def new
@barrier = Barrier.new
end

def edit; end

def create
@barrier = Barrier.new(barrier_params)
def create
@barrier = Barrier.new(barrier_params)

if @barrier.save
redirect_to admin_barrier_path(@barrier), notice: 'Barrier was successfully created.'
else
render :new
if @barrier.save
redirect_to admin_barrier_path(@barrier), notice: 'Barrier was successfully created.'
else
render :new
end
end
end

def update
if @barrier.update(barrier_params)
redirect_to admin_barrier_path(@barrier), notice: 'Barrier was successfully updated.'
else
render :edit
def update
if @barrier.update(barrier_params)
redirect_to admin_barrier_path(@barrier), notice: 'Barrier was successfully updated.'
else
render :edit
end
end
end

def destroy
@barrier.destroy
redirect_to admin_barriers_url, notice: 'Barrier was successfully destroyed.'
end
def destroy
@barrier.destroy
redirect_to admin_barriers_url, notice: 'Barrier was successfully destroyed.'
end

private

private
def set_barrier
@barrier = Barrier.find(params[:id])
end

def barrier_params
params.require(:barrier).permit(:name, :description)
end
end
end
Loading

0 comments on commit 466c0b6

Please sign in to comment.