Skip to content

Conversation

@LeTraceurSnork
Copy link

@LeTraceurSnork LeTraceurSnork commented Jul 1, 2025

Description

Added

  • Possibility to set only ->in() directories via .cs_includes.php

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I wrote unit tests for my code (if tests is required for my changes)
  • I have made changes in CHANGELOG.md file

@eldario
Copy link
Contributor

eldario commented Jul 14, 2025

@LeTraceurSnork

For what purpose do you need to add a new config file?

What about overriding these settings with arguments?

Example

$ ./vendor/bin/cs-fix  app/Client.php app/YourService/YourServiceInterface.php
Paths from configuration file have been overridden by paths provided as command arguments.
 2/2 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

   1) /app/Client.php (class_attributes_separation, unary_operator_spaces, not_operator_with_successor_space)
   2) /app/YourService/YourServiceInterface.php (class_attributes_separation)

Fixed 2 of 2 files in 0.090 seconds, 10.00 MB memory used

@LeTraceurSnork
Copy link
Author

LeTraceurSnork commented Jul 14, 2025

@eldario I want to use this package in WordPress environment inside a docker-image. So, if have some WordPress vendor files in root category that is absent from repo (like wp-config.php). You can't exclude them via .cs_excludes as it only excludes directories, and your example is quite unhandy - imagine I want to include 3,4,5 directories (like src, tests, wp-content/themes/my-theme, wp-content/plugins/my-plugin1 --2 --3 etc) - it is easier to do via .cs_includes rather than arguments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants