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

Update erb-formatter version #2221

Closed
wants to merge 5 commits into from
Closed

Update erb-formatter version #2221

wants to merge 5 commits into from

Conversation

enescakir
Copy link
Member

  • Update erb-formatter version
    We were using a forked version of nebula/erb-formatter due to these two
    commits:

    These issues have been fixed upstream, so I initially planned to switch
    to the official package. However, I encountered another problem and
    created two PRs to address them. Unfortunately, I didn't receive any
    response from the maintainer. Thus, I've decided to continue using our
    updated forked version.

  • Fix icon.erb ignoring for erb-formatter
    We have a large 'when' block in the icon.erb file, and erb-formatter
    makes it difficult to read. Although I tried to exclude the icon.erb
    file, it appears to be wrong. At the moment, all files starting with the
    letters 'i', 'c', 'o', 'n' are ignored, resulting in multiple files not
    being formatted by the erb-formatter.

  • Increase erb-formatter line-width from 120 to 160
    We format HTML/ERB files using the erb-formatter and Tailwind CSS,
    resulting in many long lines in our view files. After trying various
    line-widths, 160 appears to be the most suitable for our needs to me.

  • Fix unclosed
    tag at otp_setup.erb

    Both <br> and </br> are valid HTML tags. But erb-formatter couldn't
    format </br> and raises the following exception.

    ==> ERROR: Unmatched close tag, tried with ["br", "</br>"], but
    ["p", "<p class=\"mt-2 text-sm text-gray-500 text-center\">"] was on
    the stack
    
  • Format with new version of erb-formatter

    rake linter:erb_formatter
    

We were using a forked version of nebula/erb-formatter due to these two
commits:
- ubicloud/erb-formatter@05b30f6
- ubicloud/erb-formatter@a9ff000

These issues have been fixed upstream, so I initially planned to switch
to the official package. However, I encountered another problem and
created two PRs to address them. Unfortunately, I didn't receive any
response from the maintainer. Thus, I've decided to continue using our
updated forked version.
- nebulab/erb-formatter#58
- nebulab/erb-formatter#59
We have a large 'when' block in the icon.erb file, and erb-formatter
makes it difficult to read. Although I tried to exclude the icon.erb
file, it appears to be wrong. At the moment, all files starting with the
letters 'i', 'c', 'o', 'n' are ignored, resulting in multiple files not
being formatted by the erb-formatter.
We format HTML/ERB files using the erb-formatter and Tailwind CSS,
resulting in many long lines in our view files. After trying various
line-widths, 160 appears to be the most suitable for our needs to me.
Both `<br>` and `</br>` are valid HTML tags. But erb-formatter couldn't
format `</br>` and raises the following exception.

    ==> ERROR: Unmatched close tag, tried with ["br", "</br>"], but
    ["p", "<p class=\"mt-2 text-sm text-gray-500 text-center\">"] was on
    the stack
```
rake linter:erb_formatter
```
@enescakir enescakir self-assigned this Nov 7, 2024
@enescakir
Copy link
Member Author

erb-formatter and rubocop are conflicting. Let me check first

@enescakir enescakir closed this Nov 7, 2024
@enescakir enescakir deleted the fix-erb branch November 7, 2024 19:04
@github-actions github-actions bot locked and limited conversation to collaborators Nov 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant