Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog][keepachangelog] and this project adheres to [Semantic Versioning][semver].

## Unreleased

### Added

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

## v1.6.1

### Fixed
Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ return [
];
```

Так же в корне можете разместить файл `.cs_excludes.php`, содержащий пути директорий, которые следует исключить при обработке, вида:
Также в корне можете разместить файл `.cs_excludes.php`, содержащий пути директорий, которые следует исключить при обработке, вида:

```php
<?php
Expand All @@ -76,6 +76,22 @@ return [
];
```

Также в корне можете разместить файл `.cs_includes.php`, содержащий пути директорий, которые, наоборот, следует включить при обработке, вида:

```php
<?php

/**
* Includes directories names.
*/
return [
'app',
'src',
'tests',
];
```
Если такой файл не представлен, "включенными" будут все директории и файлы от корня.

Для переопределения пути файла кэша - установите в переменной окружения переменную с именем `PHP_CS_FIX_CACHE_FILE_PATH`, значение которой - необходимый путь. Например:

```shell
Expand Down
4 changes: 3 additions & 1 deletion config.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
->exclude(\file_exists($user_excludes = $project_root_dir . '/.cs_excludes.php')
? \array_replace_recursive($excludes, require $user_excludes)
: $excludes)
->in($project_root_dir)
->in(\file_exists($user_includes = $project_root_dir . '/.cs_includes.php')
? require $user_includes
: $project_root_dir)
)
->setRiskyAllowed(true)
->setUsingCache(true)
Expand Down