Skip to content

Commit

Permalink
Merge pull request #390 from Shopify/updates
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
gmcgibbon committed Jan 12, 2022
2 parents e613d86 + 32f2fcc commit 12ee08b
Show file tree
Hide file tree
Showing 7 changed files with 225 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: ci
on:
pull_request:
branches:
- master
- main
push:
branches:
- master
- main
schedule:
- cron: '45 4 * * *'

Expand Down
8 changes: 5 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
inherit_from:
- http://shopify.github.io/ruby-style-guide/rubocop.yml
inherit_from: .rubocop_todo.yml

inherit_gem:
rubocop-shopify: rubocop.yml

AllCops:
Exclude:
- 'vendor/**/*'
- 'tmp/**/*'
TargetRubyVersion: '2.4'
TargetRubyVersion: 2.5

# This doesn't take into account retrying from an exception
Lint/SuppressedException:
Expand Down
213 changes: 213 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2022-01-12 21:26:07 UTC using RuboCop version 1.24.1.
# 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: 1
# Configuration parameters: Include.
# Include: **/*.gemspec
Gemspec/DuplicatedAssignment:
Exclude:
- 'bootsnap.gemspec'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
# Include: **/*.gemspec
Gemspec/OrderedDependencies:
Exclude:
- 'bootsnap.gemspec'

# Offense count: 37
# Cop supports --auto-correct.
Layout/EmptyLineAfterMagicComment:
Enabled: false

# Offense count: 1
# Cop supports --auto-correct.
Layout/EmptyLines:
Exclude:
- 'lib/bootsnap.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
Layout/ExtraSpacing:
Exclude:
- 'lib/bootsnap/cli.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: aligned, indented
Layout/LineEndStringConcatenationIndentation:
Exclude:
- 'lib/bootsnap/compile_cache.rb'
- 'test/load_path_cache/realpath_cache_test.rb'

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: aligned, indented
Layout/MultilineOperationIndentation:
Exclude:
- 'lib/bootsnap/compile_cache.rb'
- 'lib/bootsnap/load_path_cache.rb'

# Offense count: 1
# Cop supports --auto-correct.
Layout/RescueEnsureAlignment:
Exclude:
- 'lib/bootsnap/load_path_cache/path.rb'

# Offense count: 12
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
# SupportedStyles: space, no_space, compact
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceInsideHashLiteralBraces:
Exclude:
- 'test/compile_cache/json_test.rb'
- 'test/compile_cache/yaml_test.rb'

# Offense count: 5
# Configuration parameters: AllowSafeAssignment.
Lint/AssignmentInCondition:
Exclude:
- 'lib/bootsnap/cli.rb'
- 'lib/bootsnap/compile_cache/json.rb'
- 'lib/bootsnap/compile_cache/yaml.rb'
- 'lib/bootsnap/load_path_cache/loaded_features_index.rb'

# Offense count: 5
# Configuration parameters: IgnoredPatterns.
# SupportedStyles: snake_case, camelCase
Naming/MethodName:
EnforcedStyle: snake_case

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
# SupportedStyles: assign_to_condition, assign_inside_condition
Style/ConditionalAssignment:
Exclude:
- 'lib/bootsnap.rb'

# Offense count: 36
# Cop supports --auto-correct.
# Configuration parameters: IgnoreMacros, IgnoredMethods, IgnoredPatterns, IncludedMacros, AllowParenthesesInMultilineCall, AllowParenthesesInChaining, AllowParenthesesInCamelCaseMethod, AllowParenthesesInStringInterpolation, EnforcedStyle.
# SupportedStyles: require_parentheses, omit_parentheses
Style/MethodCallWithArgsParentheses:
Exclude:
- 'lib/bootsnap.rb'
- 'lib/bootsnap/cli.rb'
- 'test/cli_test.rb'
- 'test/compile_cache/json_test.rb'
- 'test/compile_cache/yaml_test.rb'
- 'test/compile_cache_test.rb'
- 'test/load_path_cache/cache_test.rb'
- 'test/load_path_cache/core_ext/kernel_require_test.rb'
- 'test/load_path_cache/store_test.rb'
- 'test/worker_pool_test.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AllowedMethods.
# AllowedMethods: be, be_a, be_an, be_between, be_falsey, be_kind_of, be_instance_of, be_truthy, be_within, eq, eql, end_with, include, match, raise_error, respond_to, start_with
Style/NestedParenthesizedCalls:
Exclude:
- 'test/load_path_cache/core_ext/kernel_require_test.rb'

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, MinBodyLength.
# SupportedStyles: skip_modifier_ifs, always
Style/Next:
Exclude:
- 'lib/bootsnap/cli.rb'

# Offense count: 2
# Cop supports --auto-correct.
Style/RedundantBegin:
Exclude:
- 'lib/bootsnap/load_path_cache/path.rb'
- 'lib/bootsnap/load_path_cache/store.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantFreeze:
Exclude:
- 'lib/bootsnap/load_path_cache/store.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantParentheses:
Exclude:
- 'lib/bootsnap/load_path_cache/cache.rb'

# Offense count: 7
# Cop supports --auto-correct.
Style/RedundantSelf:
Exclude:
- 'lib/bootsnap/cli.rb'
- 'lib/bootsnap/compile_cache/json.rb'
- 'lib/bootsnap/compile_cache/yaml.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
# AllowedMethods: present?, blank?, presence, try, try!
Style/SafeNavigation:
Exclude:
- 'lib/bootsnap/compile_cache/json.rb'
- 'lib/bootsnap/compile_cache/yaml.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: RequireEnglish, EnforcedStyle.
# SupportedStyles: use_perl_names, use_english_names
Style/SpecialGlobalVars:
Exclude:
- 'test/worker_pool_test.rb'

# Offense count: 593
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Enabled: false

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiteralsInInterpolation:
Exclude:
- 'test/load_path_cache/path_test.rb'
- 'test/load_path_cache/realpath_cache_test.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: .
# SupportedStyles: percent, brackets
Style/SymbolArray:
EnforcedStyle: percent
MinSize: 3

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInHashLiteral:
Exclude:
- 'bootsnap.gemspec'

# Offense count: 15
# Cop supports --auto-correct.
# Configuration parameters: MinSize, WordRegex.
# SupportedStyles: percent, brackets
Style/WordArray:
EnforcedStyle: percent
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ end

group :development do
gem 'rubocop'
gem 'rubocop-shopify', require: false
gem 'byebug', platform: :ruby
end
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2017 Shopify, Inc.
Copyright (c) 2017-present Shopify, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ getting progressively slower, this is almost certainly the cause.**
It's technically possible to simply specify `gem 'bootsnap', require: 'bootsnap/setup'`, but it's
important to load Bootsnap as early as possible to get maximum performance improvement.

You can see how this require works [here](https://github.com/Shopify/bootsnap/blob/master/lib/bootsnap/setup.rb).
You can see how this require works [here](https://github.com/Shopify/bootsnap/blob/main/lib/bootsnap/setup.rb).

If you are not using Rails, or if you are but want more control over things, add this to your
application setup immediately after `require 'bundler/setup'` (i.e. as early as possible: the sooner
Expand Down Expand Up @@ -161,7 +161,7 @@ The only directories considered "stable" are things under the Ruby install prefi
"volatile".

In addition to the [`Bootsnap::LoadPathCache::Cache`
source](https://github.com/Shopify/bootsnap/blob/master/lib/bootsnap/load_path_cache/cache.rb),
source](https://github.com/Shopify/bootsnap/blob/main/lib/bootsnap/load_path_cache/cache.rb),
this diagram may help clarify how entry resolution works:

![How path searching works](https://cloud.githubusercontent.com/assets/3074765/25388270/670b5652-299b-11e7-87fb-975647f68981.png)
Expand Down
2 changes: 1 addition & 1 deletion bootsnap.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |spec|

spec.metadata = {
'bug_tracker_uri' => 'https://github.com/Shopify/bootsnap/issues',
'changelog_uri' => 'https://github.com/Shopify/bootsnap/blob/master/CHANGELOG.md',
'changelog_uri' => 'https://github.com/Shopify/bootsnap/blob/main/CHANGELOG.md',
'source_code_uri' => 'https://github.com/Shopify/bootsnap',
'allowed_push_host' => 'https://rubygems.org'
}
Expand Down

0 comments on commit 12ee08b

Please sign in to comment.