Skip to content
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

Consistify whitespace, code style in Ruby, CoffeeScript, SCSS #711

Merged
merged 9 commits into from
Apr 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
37 changes: 7 additions & 30 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
require: rubocop-performance

AllCops:
TargetRubyVersion: 2.5
Exclude:
- "bin/**/*"
- "db/schema.rb"
- "db/migrate/**/*"
- "node_modules/**/*"

FrozenStringLiteralComment:
Layout:
Enabled: false

Metrics/LineLength:
Expand All @@ -25,34 +28,8 @@ Metrics/BlockLength:
Exclude:
- "**/*_spec.rb"

Style/AndOr:
Enabled: false

Style/Documentation:
Enabled: false

Style/SymbolProc:
Enabled: false

# I'm a fan of defining convenience methods in single lines
Style/SingleLineMethods:
Enabled: false

# https://anti-pattern.com/always-use-double-quoted-strings-in-ruby
# All future updates should use double quotes, don't enforce so there aren't a ton of errors
Style/StringLiterals:
EnforcedStyle: double_quotes # Always do it, lower cost cognitively
Enabled: false

Style/NumericPredicate:
Enabled: false

Layout/EmptyLineAfterGuardClause:
Enabled: false

NumericLiterals:
Enabled: false

ParameterLists:
Metrics/ParameterLists:
CountKeywordArgs: false

Style:
Enabled: false
193 changes: 98 additions & 95 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,124 +1,124 @@
source 'https://rubygems.org'
# If you bump the Ruby version, make sure to update the Vagrantfile appropriately
source "https://rubygems.org"
# If you bump the Ruby version, make sure to update the Vagrantfile appropriately
ruby "2.5.1"
gem "rails", "4.2.11"

gem 'pg'
gem 'jquery-rails'
gem 'bcrypt', '~> 3.1.7'
gem 'active_model_serializers', '~> 0.9.3'
gem 'aws-sdk', '~> 1.33'
gem "active_model_serializers", "~> 0.9.3"
gem "aws-sdk", "~> 1.33"
gem "bcrypt", "~> 3.1.7"
gem "jquery-rails"
gem "pg"

# Speed
gem 'fast_blank', '~> 1.0'
gem "fast_blank", "~> 1.0"

# Redis and redis dependents
gem "hiredis"
gem "redis", ">= 3.2.0", require: ["redis", "redis/connection/hiredis"]
gem "rollout" # Feature flags
gem "sidekiq", "~> 5.1.0" # Background processing
gem "sidekiq-failures"
gem 'rollout' # Feature flags
gem 'soulheart', '~> 0.3.0'

gem 'rack-contrib'
gem 'unicorn' # Use Puma as the app server
gem 'unicorn-worker-killer'
gem 'geocoder'
gem 'money-rails'
gem 'i18n'
gem 'hamlit'
gem 'journey', '~> 1.0.3'
gem 'kramdown' # Markdown
gem 'redcarpet' # Something to do with swagger? Guess we needed another markdown parser
gem 'kaminari' # pagination
gem 'pg_search'
gem 'nokogiri', '~> 1.8.1'
gem "soulheart", "~> 0.3.0"

gem "carrierwave", "~> 0.11.2"
gem "carrierwave_backgrounder"
gem 'rmagick'
gem 'mini_magick' # a smaller implementation of rmagick, required for rqrcode
gem 'rqrcode-rails3'
gem 'libv8', '~> 3.16.14.7'
gem "stripe"
gem 'high_voltage'
gem 'omniauth-facebook'
gem 'omniauth-strava'
gem 'omniauth', '~> 1.3.1'
gem "dalli"
gem "draper", require: false
gem "eventmachine"
gem "fog-aws"
gem 'dalli'
gem 'draper', require: false
gem 'eventmachine'
gem 'httparty'
gem "geocoder"
gem "hamlit"
gem "high_voltage"
gem "httparty"
gem "i18n"
gem "journey", "~> 1.0.3"
gem "kaminari" # pagination
gem "kramdown" # Markdown
gem "libv8", "~> 3.16.14.7"
gem "mini_magick" # a smaller implementation of rmagick, required for rqrcode
gem "money-rails"
gem "nokogiri", "~> 1.8.1"
gem "omniauth", "~> 1.3.1"
gem "omniauth-facebook"
gem "omniauth-strava"
gem "paranoia"
gem "pg_search"
gem "rack-contrib"
gem "redcarpet" # Something to do with swagger? Guess we needed another markdown parser
gem "rmagick"
gem "rqrcode-rails3"
gem "sitemap_generator", "~> 6"
gem 'paranoia'
gem "stripe"
gem "unicorn" # Use Puma as the app server
gem "unicorn-worker-killer"

# Making other files
gem "wkhtmltopdf-binary"
gem "wicked_pdf"
gem "axlsx" # Write Excel files - OrganizationExports
gem "wicked_pdf"
gem "wkhtmltopdf-binary"

# Rails upgrade
gem "where-or" # backports rails 5 or query support - TODO: Rails 5 update, remove

# API wrappers
gem 'twitter' # Twitter. For rendering tweets
gem 'simple_spark' # Sparkpost gem - we use it to send newsletters
gem "simple_spark" # Sparkpost gem - we use it to send newsletters
gem "twitter" # Twitter. For rendering tweets

# OAuth provider, Grape, associated parts of API V2
gem 'doorkeeper', '~> 3.1.0'
gem 'wine_bouncer'
gem 'grape', '~> 0.14.0'
gem 'grape-active_model_serializers', '~> 1.4.0'
gem 'grape-swagger', '~> 0.10.4'
gem 'swagger-ui_rails'
gem 'api-pagination'
gem "api-pagination"
gem "doorkeeper", "~> 3.1.0"
gem "grape", "~> 0.14.0"
gem "grape-active_model_serializers", "~> 1.4.0"
gem "grape-swagger", "~> 0.10.4"
gem "swagger-ui_rails"
gem "wine_bouncer"

# Secure things
gem 'rack-throttle'
gem 'secure_headers', '~> 2.5.0'
gem "rack-throttle"
gem "secure_headers", "~> 2.5.0"

# Frontend
gem 'sprockets-rails', '~> 3.0.4'
gem 'coffee-rails'
gem 'therubyracer'
gem 'uglifier'
gem 'premailer-rails' # Inline styles for email
gem 'backbone-on-rails', '~>0.9.10.0' # Legacy js
gem 'chartkick' # Display charts
gem 'groupdate' # Required for charts
gem 'bootstrap', '~> 4.0.0.alpha3' # Bootstrap 4 - used for revised stylesheets
gem 'jquery-datatables-rails', '~>3.4.0'
gem 'webpacker', '~> 4.x'
gem "backbone-on-rails", "~>0.9.10.0" # Legacy js
gem "bootstrap", "~> 4.0.0.alpha3" # Bootstrap 4 - used for revised stylesheets
gem "chartkick" # Display charts
gem "coffee-rails"
gem "groupdate" # Required for charts
gem "jquery-datatables-rails", "~>3.4.0"
gem "premailer-rails" # Inline styles for email
gem "sprockets-rails", "~> 3.0.4"
gem "therubyracer"
gem "uglifier"
gem "webpacker", "~> 4.x"

# Show performance metrics
gem 'stackprof', require: false
gem 'memory_profiler', require: false
gem 'flamegraph', require: false
gem 'rack-mini-profiler', require: false # If you can't see it you can't make it better

gem 'responders', '~> 2.0' # required because of class level respond_to blocks (API v1)
gem 'thor', '0.19.1' # Locking it; http://stackoverflow.com/questions/40986923/meaning-of-expected-string-default-value-for-on-ruby-on-rails

gem 'bundler', '>= 1.8.4' # required for rails-assets.org - JS and CSS assets
source 'https://rails-assets.org' do # JS land is crazy, so lock everything
gem 'rails-assets-lodash', '~> 4.9.0'
gem 'rails-assets-tether', '~> 1.1.0' # Required by bootstrap 4, but not included :(
gem 'rails-assets-mustache', '~> 2.2.1'
gem 'rails-assets-jquery.dirtyforms', '~> 2.0.0' # Alert on attempts to leave with dirt on forms
gem 'rails-assets-selectize', '~> 0.12.1' # Manually configured scss
gem 'rails-assets-select2', '~> 4.0.3' # Use select2 for a few things, it's a bit better sometimes
gem 'rails-assets-Stickyfill', '~> 1.1.3' # Affix bike edit menu
gem 'rails-assets-mailcheck', '~> 1.1.2' # Check for common email errors
gem 'rails-assets-waypoints', '~> 3.1.1' # For documentation pages
gem 'rails-assets-moment', '~> 2.18.1' # Javascript Time - localizing :)
gem 'rails-assets-moment-timezone', '~> 0.5.13' # Timezones for moment
gem "flamegraph", require: false
gem "memory_profiler", require: false
gem "rack-mini-profiler", require: false # If you can't see it you can't make it better
gem "stackprof", require: false

gem "responders", "~> 2.0" # required because of class level respond_to blocks (API v1)
gem "thor", "0.19.1" # Locking it; http://stackoverflow.com/questions/40986923/meaning-of-expected-string-default-value-for-on-ruby-on-rails

gem "bundler", ">= 1.8.4" # required for rails-assets.org - JS and CSS assets
source "https://rails-assets.org" do # JS land is crazy, so lock everything
gem "rails-assets-jquery.dirtyforms", "~> 2.0.0" # Alert on attempts to leave with dirt on forms
gem "rails-assets-lodash", "~> 4.9.0"
gem "rails-assets-mailcheck", "~> 1.1.2" # Check for common email errors
gem "rails-assets-moment", "~> 2.18.1" # Javascript Time - localizing :)
gem "rails-assets-moment-timezone", "~> 0.5.13" # Timezones for moment
gem "rails-assets-mustache", "~> 2.2.1"
gem "rails-assets-select2", "~> 4.0.3" # Use select2 for a few things, it's a bit better sometimes
gem "rails-assets-selectize", "~> 0.12.1" # Manually configured scss
gem "rails-assets-Stickyfill", "~> 1.1.3" # Affix bike edit menu
gem "rails-assets-tether", "~> 1.1.0" # Required by bootstrap 4, but not included :(
gem "rails-assets-waypoints", "~> 3.1.1" # For documentation pages
# Sortable breaks assets:precompile, so it's included manually
# gem 'rails-assets-jquery-sortable', '~> 0.9.12' # Sort photo order
end

gem 'grape_logging' # Grape logging. Also how we pass it to lograge. Always used, not just in Prod
gem 'lograge' # Structure log data, put it in single lines to improve the functionality
gem 'logstash-event' # Use logstash format for logging data
gem "grape_logging" # Grape logging. Also how we pass it to lograge. Always used, not just in Prod
gem "lograge" # Structure log data, put it in single lines to improve the functionality
gem "logstash-event" # Use logstash format for logging data

group :production do
gem "honeybadger", "~> 2.0" # Error monitoring
Expand All @@ -127,31 +127,34 @@ end

group :development do
# gem 'test-unit', '~> 3.0'
gem 'rerun'
gem 'bullet'
gem "bullet"
gem "rerun"
# gem 'pry-rails'
end

group :development, :test do
gem "database_cleaner"
gem "dotenv-rails"
gem "foreman"
gem "rb-fsevent", "~> 0.9.1"
gem "rspec", "~> 3.3.0"
gem "rspec-rails", "~> 3.3.0"
gem "rspec_junit_formatter" # For circle ci
gem "rubocop", "~> 0.67", require: false
gem "rubocop-daemon", "~> 0.3.1", require: false
gem "rubocop-performance", "~> 1.1.0", require: false
gem "rufo", "~> 0.6.0", require: false
gem "shoulda-matchers", "~> 2.8.0"
gem "foreman"
gem "database_cleaner"
gem "dotenv-rails"
end

group :test do
gem "simplecov", require: false
gem "airborne"
gem "factory_bot_rails"
gem "rspec-sidekiq"
gem "guard"
gem "guard-rspec"
gem "rubocop", require: false
gem "guard-rubocop", require: false
gem "rspec-sidekiq"
gem "simplecov", require: false
gem "vcr" # Stub external HTTP requests
gem "webmock" # mocking for VCR
gem "airborne"
end
22 changes: 14 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -315,17 +315,16 @@ GEM
omniauth-strava (0.0.6)
omniauth (~> 1.0)
omniauth-oauth2 (~> 1.0)
parallel (1.14.0)
parallel (1.17.0)
paranoia (2.1.5)
activerecord (~> 4.0)
parser (2.6.0.0)
parser (2.6.2.1)
ast (~> 2.4.0)
pg (0.18.4)
pg_search (1.0.6)
activerecord (>= 3.1)
activesupport (>= 3.1)
arel
powerpack (0.1.2)
premailer (1.8.7)
css_parser (>= 1.4.5)
htmlentities (>= 4.0.0)
Expand Down Expand Up @@ -447,18 +446,22 @@ GEM
rspec-support (3.3.0)
rspec_junit_formatter (0.4.1)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (0.65.0)
rubocop (0.67.2)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1)
psych (>= 3.1.0)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.4.0)
unicode-display_width (>= 1.4.0, < 1.6)
rubocop-daemon (0.3.1)
rubocop
rubocop-performance (1.1.0)
rubocop (>= 0.67.0)
ruby-progressbar (1.10.0)
ruby_dep (1.5.0)
rubyzip (1.0.0)
rufo (0.6.0)
safe_yaml (1.0.4)
sass (3.4.22)
sass-rails (5.0.4)
Expand Down Expand Up @@ -533,7 +536,7 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.7.5)
unicode-display_width (1.4.1)
unicode-display_width (1.5.0)
unicorn (5.4.1)
kgio (~> 2.6)
raindrops (~> 0.7)
Expand Down Expand Up @@ -655,7 +658,10 @@ DEPENDENCIES
rspec-rails (~> 3.3.0)
rspec-sidekiq
rspec_junit_formatter
rubocop
rubocop (~> 0.67)
rubocop-daemon (~> 0.3.1)
rubocop-performance (~> 1.1.0)
rufo (~> 0.6.0)
secure_headers (~> 2.5.0)
shoulda-matchers (~> 2.8.0)
sidekiq (~> 5.1.0)
Expand Down
Loading