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

twig dump #1

Closed
ajakov opened this issue Jun 15, 2021 · 13 comments
Closed

twig dump #1

ajakov opened this issue Jun 15, 2021 · 13 comments
Labels
blocked by dependency Waiting for a fix to be done on the packages used

Comments

@ajakov
Copy link

ajakov commented Jun 15, 2021

Hi @umutphp

Can this action check for dump in twig files?

Like, for example:
{{ dump() }}
or
{{ dump(variable) }}

@umutphp
Copy link
Owner

umutphp commented Jun 15, 2021

Hi @ajakov ,

Yes, you need to use checktype: 'symfony'.

You can configure as follows;

on: [push]

jobs:
  var_dump_checker:
    runs-on: ubuntu-latest
    name: Dump Function Checks
    steps:
    - name: Check 1
      id: check1
      uses: umutphp/php-var-dump-check-action@v1
      with:
        checktype: 'symfony'
        exclude: 'vendor,test'
        extensions: 'php'

@umutphp
Copy link
Owner

umutphp commented Jun 15, 2021

@ajakov
Can you please check and update me?

@ajakov
Copy link
Author

ajakov commented Jun 15, 2021

Thank you for your quick response.
That is exactly what I tried.
Unfortunately, looks like the tool used in this action does not support it: https://github.com/php-parallel-lint/PHP-Var-Dump-Check

I installed it also locally (to dismiss the possibility that my github actions configuration is wrong) and it doesn't detect dump in twig files.

@umutphp
Copy link
Owner

umutphp commented Jun 15, 2021

What is the extension for your twig files? If it is other than "php", please try adding it to extensions parameter.

@ajakov
Copy link
Author

ajakov commented Jun 15, 2021

Yes, I added that, too.

@umutphp
Copy link
Owner

umutphp commented Jun 15, 2021

I found an issue which was created in the former repository (JakubOnderka/PHP-Var-Dump-Check) and It seems it is not implemented :(.

@ajakov
Copy link
Author

ajakov commented Jun 15, 2021

Exactly.
At least now we know where to look. Maybe it's not too complicated to add it.

@umutphp
Copy link
Owner

umutphp commented Jun 15, 2021

If you create the issue in the new repo, I will also comment to promote it.

PS: I am not sure If l have time to contribute to fix the issue, but I will try if I have :)

@ajakov
Copy link
Author

ajakov commented Jun 15, 2021

I will check the codebase, but on the first glance it looks the tool is made exclusively for PHP, since it uses token_get_all and then checks against the results of it.

So, maybe using different tool for checking twig is better in this case. I will double-check when I have more time.

@umutphp
Copy link
Owner

umutphp commented Jun 15, 2021

Please, do not forget to update me :)

@ajakov
Copy link
Author

ajakov commented Jun 19, 2021

Hey @umutphp, I published this in the meantime: https://github.com/ajakov/twig-dump-checker

@umutphp
Copy link
Owner

umutphp commented Jun 19, 2021

Hi @ajakov,

Great news :).

PS: The link is wrong in your comment is wrong by the way.

@ajakov
Copy link
Author

ajakov commented Jun 19, 2021

Fixed the link, thank you! :)

@umutphp umutphp closed this as completed Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked by dependency Waiting for a fix to be done on the packages used
Projects
None yet
Development

No branches or pull requests

2 participants