Skip to content

Commit

Permalink
Merge pull request #1486 from geeksforsocialchange/rubocop-ignore-schema
Browse files Browse the repository at this point in the history
Let Rails manage the schema file's formatting
  • Loading branch information
erbridge authored Nov 10, 2022
2 parents 46f36cf + 8402fcf commit 98e5154
Show file tree
Hide file tree
Showing 8 changed files with 383 additions and 371 deletions.
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ require:

AllCops:
NewCops: enable
Exclude:
- "node_modules/**/*"
- "tmp/**/*"
- "vendor/**/*"
- ".git/**/*"
- "db/schema.rb"

GraphQL/FieldName:
Enabled: false
Expand Down
2 changes: 2 additions & 0 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
2 changes: 2 additions & 0 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require_relative '../config/boot'
require 'rake'
Rake.application.run
2 changes: 2 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'fileutils'

# path to your application root.
Expand Down
31 changes: 15 additions & 16 deletions bin/test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'fileutils'

# path to your application root.
Expand All @@ -8,27 +10,23 @@ APP_ROOT = File.expand_path('..', __dir__)

def process_argv(option)
case option
when "-h"
when "--help"
puts "Run the tests."
puts " -u, --unit Run unit tests"
puts " -s, --system Run system tests"
puts " -l, --lint Run linters and formatters"
puts " --no-lint Disable linters and formatters"
puts " --no-fix Lint and format without autocorrection"
when '-h', '--help'
puts 'Run the tests.'
puts ' -u, --unit Run unit tests'
puts ' -s, --system Run system tests'
puts ' -l, --lint Run linters and formatters'
puts ' --no-lint Disable linters and formatters'
puts ' --no-fix Lint and format without autocorrection'
exit
when "-u"
when "--unit"
when '-u', '--unit'
@options[:unit_only] = true
when "-s"
when "--system"
when '-s', '--system'
@options[:system_only] = true
when "-l"
when "--lint"
when '-l', '--lint'
@options[:lint_only] = true
when "--no-lint"
when '--no-lint'
@options[:without_lint] = true
when "--no-fix"
when '--no-fix'
@options[:without_fix] = true
end
end
Expand Down Expand Up @@ -56,6 +54,7 @@ FileUtils.chdir APP_ROOT do
puts "\n== Running system tests =="
system! 'bin/rails test:system'
elsif @options[:lint_only]
# Do nothing
else
puts "\n== Running all tests =="
system! 'bin/rails test:all'
Expand Down
2 changes: 1 addition & 1 deletion bin/update
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

require 'pathname'
require 'fileutils'
include FileUtils
include FileUtils # rubocop:disable Style/MixinUsage

# path to your application root.
APP_ROOT = Pathname.new File.expand_path('..', __dir__)
Expand Down
2 changes: 2 additions & 0 deletions bin/yarn
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

APP_ROOT = File.expand_path('..', __dir__)
Dir.chdir(APP_ROOT) do
exec 'yarnpkg', *ARGV
Expand Down
Loading

0 comments on commit 98e5154

Please sign in to comment.