denis-korchagin95/fs-control

fs-control helps you to keep your directory tree under control.

v1.2.0 2024-06-23 09:12 UTC

This package is auto-updated.

Last update: 2025-03-23 10:35:39 UTC


README

fs-control is an analyzer for your directory tree to allow you to keep it under control.

Maybe you have some agreements in your project and rules to the directory tree, but actually in real life it may not work on 100%. This tool can allow you to define your variant of configuration and help you to fix that and control.

If your mindset changes about the directory tree, okay, it's cool. Just edit configuration and fs-control will care about for you. Also set you free from some "review battles" and allow you to concentrate on more important things.

Getting started

You can install fs-control via Composer using the main composer.json:

composer require --dev denis-korchagin95/fs-control

Or you may to install fs-control via Composer in a dedicated composer.json, for example, in the tools/fs-control directory:

mkdir -p tools/fs-control
composer require --working-dir=tools/fs-control denis-korchagin95/fs-control

Usage

You need to create a configuration file for a whole project or just its small part.

The basic configuration file may look like:

fs_control:
  paths:
    - ./example-fs/Shared
  exclude_paths:
    - ./example-fs/Shared/Infrastructure/ParamConverter/Check
  groups:
    Application: ~
    Domain: ~
    Infrastructure: ~
  bindings:
    $/Application: Application
    $/Domain: Domain
    $/Infrastructure: Infrastructure
  rules:
    Entity:
      - Domain
    ParamConverter:
      - Infrastructure
    Command:
      - Application

You can analyze the project using a configuration file for some project.

./vendor/bin/fs-control example-fs-config.yaml

See usage, tool concepts, built-in extension list, and config reference documentation for more examples and details.

If you need to solve your specific problems that are not supported by the tool, you can create a custom extension.

Contribute

Any contributions are welcome. This repository is open to pull requests.