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

Invalid default ruleset for twig #746

Closed
a-menshchikov opened this issue Mar 15, 2020 · 12 comments
Closed

Invalid default ruleset for twig #746

a-menshchikov opened this issue Mar 15, 2020 · 12 comments
Labels

Comments

@a-menshchikov
Copy link
Contributor

Q A
Version 0.18.0
Bug? yes
New feature? no
Question? no
Documentation? yes
Related tickets

Ruleset FriendsOfTwig\Twigcs\Ruleset\Official is outdated. Actual default ruleset is Allocine\Twigcs\Ruleset\Official.

@oallain
Copy link
Contributor

oallain commented Mar 18, 2020

Hi @a-menshchikov ,

This is already the case, you can see the PR here #657

Have you update your GrumPHP version ?

@a-menshchikov
Copy link
Contributor Author

Hello @oallain .

When I'm doing composer require friendsoftwig/twigcs --dev, I have allocine/twigcs package.
Thus this PR seems like a bug.

@veewee
Copy link
Contributor

veewee commented Mar 19, 2020

Screen Shot 2020-03-19 at 07 40 17

Can you try to remove the allocine package and use the friendsoftwig package instead?

@a-menshchikov
Copy link
Contributor Author

@veewee I don't use allocine package. As I wrote above, I run composer require friendsoftwig/twigcs --dev in cli. (I've tried to run composer clear-cache before.)

@veewee
Copy link
Contributor

veewee commented Mar 19, 2020

In that case the FriendsOfTwig\Twigcs\Ruleset\Official is the default right?

@a-menshchikov
Copy link
Contributor Author

To be more precise, I will say this: now composer installs allocine version of twigcs instead of friendsoftwig's. And as I'm concerned, this is the wrong behavior.
But now I have no FriendsOfTwig\Twigcs\Ruleset\Official class and I have to specify ruleset: 'Allocine\Twigcs\Ruleset\Official' in grumphp.yml explicitly.

@veewee
Copy link
Contributor

veewee commented Mar 19, 2020

This doesn't look like a GrumPHP issue then:

composer require friendsoftwig/twigcs --dev

composer show                                                                                                                                                                                                                                       
friendsoftwig/twigcs      v3.2.2  Checkstyle automation for Twig

You might be able to validate why the allocine package is being installed by running

composer why allocine/twigcs

I hope you find a solution for your problem soon!

@a-menshchikov
Copy link
Contributor Author

This issue had solved by installing twigcs 4.0 (beta), because 3.2.2 still has allocine as vendor name (https://github.com/friendsoftwig/twigcs/blob/v3.2.2/composer.json#L2).

Maybe this fact should be noted in docs?

@veewee
Copy link
Contributor

veewee commented Mar 19, 2020

This is rather something that should be fixed in the package.
We could add it to the docs, but it seems like a temporary issue until 4 gets released?
Another option is to set the default rule to "null" and fall back to the rule that is configured internally in the package. That looks like a better approach if the tool supports it.

@a-menshchikov
Copy link
Contributor Author

Yes, that solution will be better.

@oallain
Copy link
Contributor

oallain commented Mar 19, 2020

Yeah, twigcs is in v4beta4, stable version will be released soon I think.

@veewee
Copy link
Contributor

veewee commented May 26, 2020

Closing since this issue will solve itself at some point eventually :)

@veewee veewee closed this as completed May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants