Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
dorianmariecom committed Apr 3, 2024
1 parent 377627b commit 7361ee0
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 20 deletions.
24 changes: 12 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
version: 2
updates:
- directory: "/"
package-ecosystem: github-actions
schedule:
interval: daily
- directory: "/"
package-ecosystem: npm
schedule:
interval: daily
- directory: "/"
package-ecosystem: bundler
schedule:
interval: daily
- directory: "/"
package-ecosystem: github-actions
schedule:
interval: daily
- directory: "/"
package-ecosystem: npm
schedule:
interval: daily
- directory: "/"
package-ecosystem: bundler
schedule:
interval: daily
8 changes: 8 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
inherit_gem:
rubocop-rails-omakase: rubocop.yml

Layout/SpaceInsideArrayLiteralBrackets:
Enabled: false

Performance/UnfreezeString:
Enabled: false
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ ruby "3.3.0"

gem "rspec"
gem "ruby-prof"
gem "rubocop-rails-omakase"
10 changes: 7 additions & 3 deletions bin/rspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
if File.read(bundle_binstub, 300).include?(
"This file was generated by Bundler"
)
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
abort(
"Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again."
)
end
end

Expand Down
6 changes: 1 addition & 5 deletions lib/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ def evaluate
parsed = Template.parse(input)
Node::Template.new(parsed).evaluate(context:, output:, error:)

if output.is_a?(StringIO)
output.string
else
""
end
output.is_a?(StringIO) ? output.string : ""
end
end

Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"license": "MIT"
}
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# frozen_string_literal: true

require "rspec"
require_relative "../lib/template-ruby"
2 changes: 2 additions & 0 deletions template-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ Gem::Specification.new do |s|
s.add_dependency "code-ruby", "~> 0"
s.add_dependency "language-ruby", "~> 0"
s.add_dependency "zeitwerk", "~> 2"

s.required_ruby_version = ">= 3.3.0"
end

0 comments on commit 7361ee0

Please sign in to comment.