amberframework / amber

A Crystal web framework that makes building applications fast, simple, and enjoyable. Get started with quick prototyping, less bugs, and blazing fast performance.
https://amberframework.org
MIT License
2.58k stars 206 forks source link

Indentation issues in amber generator #748

Closed faustinoaq closed 6 years ago

faustinoaq commented 6 years ago

Description

I found some issues in generated code

  1. config/routes.cr:

screenshot_20180411_104313

    1. src/models/**:

screenshot_20180411_104455

  1. src/controllers/**:

screenshot_20180411_104540

screenshot_20180411_104639

Steps to Reproduce

  1. Create a new amber project
  2. Do some scaffolding
  3. Use crystal tool format --check

Expected behavior: Generated files are formatted well

Actual behavior: Generated files aren't formatted well

Reproduces how often: 100%

Versions

v0.7.2

Additional Information

crystal tool format --check output

➜  forum crystal tool format --check
Error: formatting './config/routes.cr' produced changes
Error: formatting './config/application.cr' produced changes
Error: formatting './config/initializers/database.cr' produced changes
Error: formatting './src/controllers/session_controller.cr' produced changes
Error: formatting './src/controllers/user_controller.cr' produced changes
Error: formatting './src/controllers/home_controller.cr' produced changes
Error: formatting './src/controllers/application_controller.cr' produced changes
Error: formatting './src/pipes/authenticate.cr' produced changes
Error: formatting './src/models/user.cr' produced changes
Error: formatting './src/models/tasks.cr' produced changes

^ This doesn't check .ecr or .slang files, so we should be careful with the indentation on these files.

faustinoaq commented 6 years ago

@epergo Did your PR (https://github.com/amberframework/amber/pull/780) fix this? :sweat_smile:

I guess there is still some indentation issues (see point 2. and 3. above)

epergo commented 6 years ago

Wops, I didn't see this issue. I only fixed config/routes.cr indentation.

faustinoaq commented 6 years ago

@epergo No problem, Thank you!