Skip to content
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

refactor: default annotate_rendered_view_with_filenames to true in development #50436

Conversation

adrianthedev
Copy link
Contributor

@adrianthedev adrianthedev commented Dec 25, 2023

Motivation / Background

This Pull Request has been created to set config.action_view.annotate_rendered_view_with_filenames to true in development.
This is such a powerful tool, and I find myself (and probably others too) turning it on for every project in the development environment.

This also disables the feature in tests, so users can test views without having the comments muddy up the output.

Detail

This Pull Request changes development.rb.tt and un-comments the line that sets this setting to true.

Additional information

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature. Not needed.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

@adrianthedev
Copy link
Contributor Author

It's my first PR to Rails, and I'm not sure why the option is applied in the test environment.
Can anyone point me in the right direction?

Ideally, the option would be turned off for all tests so we can test without the comments.

@adrianthedev
Copy link
Contributor Author

I'm following the code and see that in build_app the environment is set to development.
Probably to test it as close as possible to real-world.

@adrianthedev adrianthedev force-pushed the refactor/enable-view-annotations-in-development branch 2 times, most recently from 7c48db1 to 5e26cf0 Compare December 27, 2023 09:50
@zzak zzak added this to the 7.2.0 milestone Dec 31, 2023
@rafaelfranca
Copy link
Member

Can you please fix the build?

@adrianthedev
Copy link
Contributor Author

Yup. On it!

@adrianthedev adrianthedev force-pushed the refactor/enable-view-annotations-in-development branch from dba4715 to 475bb4b Compare January 4, 2024 19:25
@rafaelfranca rafaelfranca merged commit 64370c9 into rails:main Jan 4, 2024
3 of 4 checks passed
@adrianthedev
Copy link
Contributor Author

Thanks @rafaelfranca!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants