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

Fix windows support #196

Merged
merged 13 commits into from
Feb 21, 2024
Merged

Fix windows support #196

merged 13 commits into from
Feb 21, 2024

Conversation

VincentLanglet
Copy link
Owner

@VincentLanglet VincentLanglet commented Feb 19, 2024

Closes #193

@codecov-commenter
Copy link

codecov-commenter commented Feb 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (db0e05e) 100.00% compared to head (2dcb2bd) 100.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##                main      #196   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity       590       591    +1     
===========================================
  Files             54        54           
  Lines           1823      1828    +5     
===========================================
+ Hits            1823      1828    +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@seb-jean
Copy link

It works.

@VincentLanglet VincentLanglet force-pushed the fixWindows branch 2 times, most recently from 0929cda to 0e2782c Compare February 19, 2024 12:47
@VincentLanglet
Copy link
Owner Author

It works.

Ok, I'll try to add a CI for windows then I'll merge this and release it.

@VincentLanglet VincentLanglet force-pushed the fixWindows branch 12 times, most recently from 9e816d3 to f2eaeec Compare February 19, 2024 15:44
@VincentLanglet VincentLanglet force-pushed the fixWindows branch 2 times, most recently from 6fd88cc to 228f90e Compare February 19, 2024 17:54
@VincentLanglet VincentLanglet force-pushed the fixWindows branch 2 times, most recently from 21b287e to 1811142 Compare February 19, 2024 18:43
@VincentLanglet VincentLanglet force-pushed the fixWindows branch 2 times, most recently from 88fa8fb to bdb220a Compare February 19, 2024 19:40
@VincentLanglet
Copy link
Owner Author

Can you confirm this still works fine for you @seb-jean ?

Do you get a nice render of the errors in your console ?

@seb-jean
Copy link

I have an error :
Warning: Undefined array key 15 in {...}\vendor\vincentlanglet\twig-cs-fixer\src\Report\Reporter\TextReporter.php on line 117

@VincentLanglet
Copy link
Owner Author

VincentLanglet commented Feb 20, 2024

I have an error : Warning: Undefined array key 15 in {...}\vendor\vincentlanglet\twig-cs-fixer\src\Report\Reporter\TextReporter.php on line 117

Here https://github.com/VincentLanglet/Twig-CS-Fixer/pull/196/files#diff-f9506c2d1272ccbfc89aaf636c36724ec6c6118c134f6e9c96c6dc672ee2fcb6R109

Can you dump $templates, $lines and $line ?

I feel like you're on Windows but your template is using \n for EOL.

@seb-jean
Copy link

seb-jean commented Feb 20, 2024

$template

^ """
<!DOCTYPE html>\n
<html>\n
    <head>\n
        <meta charset="UTF-8">\n
        <title>{% block title %}Welcome!{% endblock %}</title>\n
        <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">\n
        {% block stylesheets %}\n
        {% endblock %}\n
\n
        {% block javascripts %}\n
{% block importmap %}{{ importmap('app') }}{% endblock %}\n
        {% endblock %}\n
    </head>\n
    <body>\n
        {% block body %}{% endblock %}\n
        {% set Test = 'a' %}\n
{#  </body> #}\n
</html>\n
\n
\n
"""

$lines

^ array:1 [
  0 => """
    <!DOCTYPE html>\n
    <html>\n
        <head>\n
            <meta charset="UTF-8">\n
            <title>{% block title %}Welcome!{% endblock %}</title>\n
            <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">\n
            {% block stylesheets %}\n
            {% endblock %}\n
    \n
            {% block javascripts %}\n
    {% block importmap %}{{ importmap('app') }}{% endblock %}\n
            {% endblock %}\n
        </head>\n
        <body>\n
            {% block body %}{% endblock %}\n
            {% set Test = 'a' %}\n
    {#  </body> #}\n
    </html>\n
    \n
    \n
    """
]

$line
17

@VincentLanglet
Copy link
Owner Author

I feel like you're on Windows but your template is using \n for EOL.

Ok so it's indeed the fact that:

  • You running the tool on windows
  • the file use \n as EOL.

Can you try the latest commit ?

@seb-jean
Copy link

Yeah ! It works !

@VincentLanglet VincentLanglet merged commit 5f364b9 into main Feb 21, 2024
16 checks passed
@VincentLanglet VincentLanglet deleted the fixWindows branch February 21, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FileNameRule not works
3 participants