Skip to content

Commit

Permalink
Added Bun to setup
Browse files Browse the repository at this point in the history
  • Loading branch information
yatish27 committed May 30, 2024
1 parent 278e16e commit ea365b6
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 11 deletions.
139 changes: 138 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
require:
- rubocop-rails
- rubocop-factory_bot

AllCops:
TargetRubyVersion: 3.3.1

Expand Down Expand Up @@ -1842,4 +1846,137 @@ Style/YodaExpression:

Style/ZeroLengthPredicate:
Enabled: false

Style/SendWithLiteralMethodName: # new in 1.64
Enabled: true
Style/SuperArguments: # new in 1.64
Enabled: true
Rails/ActionControllerFlashBeforeRender: # new in 2.16
Enabled: true
Rails/ActionControllerTestCase: # new in 2.14
Enabled: true
Rails/ActionOrder: # new in 2.17
Enabled: true
Rails/ActiveRecordCallbacksOrder: # new in 2.7
Enabled: true
Rails/ActiveSupportOnLoad: # new in 2.16
Enabled: true
Rails/AddColumnIndex: # new in 2.11
Enabled: true
Rails/AfterCommitOverride: # new in 2.8
Enabled: true
Rails/AttributeDefaultBlockValue: # new in 2.9
Enabled: true
Rails/CompactBlank: # new in 2.13
Enabled: true
Rails/DangerousColumnNames: # new in 2.21
Enabled: true
Rails/DeprecatedActiveModelErrorsMethods: # new in 2.14
Enabled: true
Rails/DotSeparatedKeys: # new in 2.15
Enabled: true
Rails/DuplicateAssociation: # new in 2.14
Enabled: true
Rails/DuplicateScope: # new in 2.14
Enabled: true
Rails/DurationArithmetic: # new in 2.13
Enabled: true
Rails/EagerEvaluationLogMessage: # new in 2.11
Enabled: true
Rails/EnvLocal: # new in 2.22
Enabled: true
Rails/ExpandedDateRange: # new in 2.11
Enabled: true
Rails/FindById: # new in 2.7
Enabled: true
Rails/FreezeTime: # new in 2.16
Enabled: true
Rails/I18nLazyLookup: # new in 2.14
Enabled: true
Rails/I18nLocaleAssignment: # new in 2.11
Enabled: true
Rails/I18nLocaleTexts: # new in 2.14
Enabled: true
Rails/IgnoredColumnsAssignment: # new in 2.17
Enabled: true
Rails/Inquiry: # new in 2.7
Enabled: true
Rails/MailerName: # new in 2.7
Enabled: true
Rails/MatchRoute: # new in 2.7
Enabled: true
Rails/MigrationClassName: # new in 2.14
Enabled: true
Rails/NegateInclude: # new in 2.7
Enabled: true
Rails/Pluck: # new in 2.7
Enabled: true
Rails/PluckInWhere: # new in 2.7
Enabled: true
Rails/RedundantActiveRecordAllMethod: # new in 2.21
Enabled: true
Rails/RedundantPresenceValidationOnBelongsTo: # new in 2.13
Enabled: true
Rails/RedundantTravelBack: # new in 2.12
Enabled: true
Rails/RenderInline: # new in 2.7
Enabled: true
Rails/RenderPlainText: # new in 2.7
Enabled: true
Rails/ResponseParsedBody: # new in 2.18
Enabled: true
Rails/RootJoinChain: # new in 2.13
Enabled: true
Rails/RootPathnameMethods: # new in 2.16
Enabled: true
Rails/RootPublicPath: # new in 2.15
Enabled: true
Rails/SelectMap: # new in 2.21
Enabled: true
Rails/ShortI18n: # new in 2.7
Enabled: true
Rails/SquishedSQLHeredocs: # new in 2.8
Enabled: true
Rails/StripHeredoc: # new in 2.15
Enabled: true
Rails/ThreeStateBooleanColumn: # new in 2.19
Enabled: true
Rails/TimeZoneAssignment: # new in 2.10
Enabled: true
Rails/ToFormattedS: # new in 2.15
Enabled: true
Rails/ToSWithArgument: # new in 2.16
Enabled: true
Rails/TopLevelHashWithIndifferentAccess: # new in 2.16
Enabled: true
Rails/TransactionExitStatement: # new in 2.14
Enabled: true
Rails/UnusedRenderContent: # new in 2.21
Enabled: true
Rails/WhereEquals: # new in 2.9
Enabled: true
Rails/WhereExists: # new in 2.7
Enabled: true
Rails/WhereMissing: # new in 2.16
Enabled: true
Rails/WhereNot: # new in 2.8
Enabled: true
Rails/WhereNotWithMultipleConditions: # new in 2.17
Enabled: true
Rails/WhereRange: # new in 2.25
Enabled: true
FactoryBot/AssociationStyle: # new in 2.23
Enabled: true
FactoryBot/ConsistentParenthesesStyle: # new in 2.14
Enabled: true
FactoryBot/ExcessiveCreateList: # new in 2.25
Enabled: true
FactoryBot/FactoryAssociationWithStrategy: # new in 2.23
Enabled: true
FactoryBot/FactoryNameStyle: # new in 2.16
Enabled: true
FactoryBot/IdSequence: # new in 2.24
Enabled: true
FactoryBot/RedundantFactoryOption: # new in 2.23
Enabled: true
FactoryBot/SyntaxMethods: # new in 2.7
Enabled: true
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ GEM
net-smtp
marcel (1.0.4)
mini_mime (1.1.5)
minitest (5.23.0)
minitest (5.23.1)
minitest-reporters (1.6.1)
ansi
builder
Expand Down Expand Up @@ -243,14 +243,14 @@ GEM
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.2.1)
rdoc (6.6.3.1)
rdoc (6.7.0)
psych (>= 4.0.0)
regexp_parser (2.9.2)
reline (0.5.7)
reline (0.5.8)
io-console (~> 0.5)
rexml (3.2.8)
strscan (>= 3.0.9)
rubocop (1.63.5)
rubocop (1.64.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down Expand Up @@ -318,7 +318,7 @@ GEM
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.6.14)
zeitwerk (2.6.15)

PLATFORMS
aarch64-linux
Expand Down
9 changes: 4 additions & 5 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ end

# Check if a command exists
def command?(name)
[name,
*ENV["PATH"].split(File::PATH_SEPARATOR).map { |p| File.join(p, name) }].find { |f| File.executable?(f) }
[name, *ENV["PATH"].split(File::PATH_SEPARATOR).map { |p| File.join(p, name) }].find { |f| File.executable?(f) }
end

FileUtils.chdir APP_ROOT do
Expand All @@ -37,10 +36,10 @@ FileUtils.chdir APP_ROOT do
puts "Gems installed".green

puts "\n== Installing packages using yarn=="
if command?("yarn") && `yarn -v`.to_f < 2
system("yarn check") || system!("yarn install")
if command?("bun")
system!("bun install")
else
system!("yarn install")
puts "bun not found, visit https://bun.sh/docs/installation to install bun".red
end

puts "\n== Preparing database =="
Expand Down

0 comments on commit ea365b6

Please sign in to comment.