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

Multiline-comment lines containing a colon are indented with each formatter run #32

Open
Wowu opened this issue Apr 20, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Wowu
Copy link

Wowu commented Apr 20, 2021

Given a file:

<%#
Multiline comment
test: test
%>

This is the file content after running prettier for the first time:

<%#
  Multiline comment
    test: test
%>

This is the content after running prettier for the second time:

<%#
  Multiline comment
      test: test
%>

And it goes on, indenting this line with each run 😄

.prettierrc.yml:

printWidth: 100
plugins:
  - "@prettier/plugin-ruby"
  - prettier-plugin-erb

package.json:

...
"devDependencies": {
    "@prettier/plugin-ruby": "^1.5.5",
    "prettier": "2.2.1",
    "prettier-plugin-erb": "git+https://github.com/adamzapasnik/prettier-plugin-erb.git#6374074005"
  },
...

(latest master branch, as of creating this issue)


Other example, from kaminari gem:

<%# Link to the "Previous" page
  - available local variables
    url:           url to the previous page
    current_page:  a page object for the currently displayed page
    total_pages:   total number of pages
    per_page:      number of items to fetch per page
    remote:        data-remote
-%>

After formatting:

<%#
  Link to the "Previous" page
    - available local variables
      url:           url to the previous page
      current_page:  a page object for the currently displayed page
      total_pages:   total number of pages
      per_page:      number of items to fetch per page
      remote:        data-remote
-%>

After formatting again:

<%#
  Link to the "Previous" page
      - available local variables
        url:           url to the previous page
        current_page:  a page object for the currently displayed page
        total_pages:   total number of pages
        per_page:      number of items to fetch per page
        remote:        data-remote
-%>
@adamzapasnik adamzapasnik self-assigned this Apr 20, 2021
@adamzapasnik adamzapasnik added the bug Something isn't working label Apr 20, 2021
@adamzapasnik
Copy link
Owner

Hey @Wowu 👋
Good catch 😜
Working on a fix

@adamzapasnik
Copy link
Owner

should be fixed in a newly released v0.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants