-
Notifications
You must be signed in to change notification settings - Fork 204
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
Applies crystal tool format to master branch #42
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've marked some places where macros needs manual indentations (crystal tool format doesn't know how to indent macros...)
I think there are other places where macro are incorrectly indented..
src/amber/controller/render.cr
Outdated
@@ -1,21 +1,21 @@ | |||
module Amber::Controller | |||
module Render | |||
macro render_both(filename, layout) | |||
macro render_both(filename, layout) | |||
content = render_template("{{filename.id}}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Macros needs manual indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
src/amber/controller/render.cr
Outdated
# helper to render a template. The view name is relative to `src/views` directory. | ||
macro render_template(filename, *args) | ||
# helper to render a template. The view name is relative to `src/views` directory. | ||
macro render_template(filename, *args) | ||
{% if filename.id.split("/").size > 2 %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Macros needs manual indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
src/amber/controller/render.cr
Outdated
{% if filename.id.split("/").size > 2 %} | ||
Kilt.render("{{filename.id}}", {{*args}}) | ||
{% else %} | ||
Kilt.render("src/views/{{filename.id}}", {{*args}}) | ||
{% end %} | ||
end | ||
|
||
macro render(filename, layout = "layouts/application.slang", path = "src/views", folder = __FILE__) | ||
macro render(filename, layout = "layouts/application.slang", path = "src/views", folder = __FILE__) | ||
render_both "#{{{path}}}/#{{{folder.split("/").last.gsub(/\_controller\.cr|\.cr/, "")}}}/#{{{filename}}}", "#{{{path}}}/#{{{layout}}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Macros needs manual indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
33d35d4
to
666e248
Compare
Please review |
Issue: https://app.clubhouse.io/amber/story/45/apply-tool-format-to-master Some files needed to be formatted by the crystal tool format * Applied crystal tool formats and formatted a couple of files. * Cleans up the formatting in static_controller, render, router dsl, and route class.
22b5866
to
c2091ed
Compare
* fixed DockerFile and cleaned up flash in controller template * fixed ecr rendering and bumped * removed sidekiq from shard template and index action from appliction controller * fixed specs
Applies crystal tool format to master branch
Issue: https://app.clubhouse.io/amber/story/45/apply-tool-format-to-master
Some files needed to be formatted by the crystal tool format
Applied crystal tool formats and formatted a couple of files.
Cleans up the formatting in static_controller, render, router dsl, and
route class.