Unibeautify / beautifier-php-cs-fixer

PHP-CS-Fixer beautifier for Unibeautify
https://github.com/FriendsOfPHP/PHP-CS-Fixer
MIT License
2 stars 1 forks source link

Allow global config file #136

Open chipco opened 4 years ago

chipco commented 4 years ago

I want to use a global config file, outside the project folder.

The documentation suggest that prefer_beautifier_config can be used to provide a path, but it's not taken into account. The function resolveConfig only looks between file and project path.

I changed finishPath: "/", but maybe you can find a better solution to use a path provided in unibeautify config.

Glavin001 commented 4 years ago

Would passing the path to the desired global config file work for you? https://unibeautify.com/docs/options-for-beautifiers#config-file-path

---
PHP:
  beautifiers:
  - PHP-CS-Fixer
  PHP-CS-Fixer:
-   prefer_beautifier_config: true
+   prefer_beautifier_config: "path/to/beautifier/config/file" # <-- Change true to config file absolute path
chipco commented 4 years ago

Yes that would be a good solution.