phpro / grumphp

A PHP code-quality tool
MIT License
4.12k stars 430 forks source link

Always call addFiles in Stylelint task (like in ESLint) #932

Closed leonexcc closed 2 years ago

leonexcc commented 2 years ago
Q A
Branch master for features and deprecations
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Documented? no
Fixed tickets #926

The current Stylelint task does not add files to the command if run outside of a git commit. This results in an error because stylelint expects a list of files or a glob.

This pull request changes the behaviour of Stylelint task to the one of ESLint, to fix the error.

There was some discussion about the current implementation in https://github.com/phpro/grumphp/pull/904#discussion_r646086110. But i couldn't find a way to specify files or a globs in the stylelint config file.

veewee commented 2 years ago

Taken a look at the cli options of stylelint and agree that always adding the files is the best option for the tool at this moment. Thanks for pointing it out!