-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added project-architecture-sniffer.md
- Loading branch information
1 parent
882cae9
commit d262b95
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
docs/dg/dev/sdks/sdk/development-tools/project-architecture-sniffer.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
title: Project Architecture Sniffer | ||
last_updated: Jan 7, 2024 | ||
--- | ||
|
||
The [Project Architecture Sniffer](https://github.com/spryker/project-architecture-sniffer) is a powerful tool designed specifically for Spryker projects, leveraging the capabilities of the [PHP Mess Detector](https://phpmd.org) to maintain and enforce architectural standards. | ||
|
||
The tool includes: | ||
|
||
* Adapted PHPMD rules tailored to the needs of Spryker projects. | ||
* [Architecture Sniffer](https://github.com/spryker/architecture-sniffer) rules for enforcing core-specific conventions. | ||
* Newly designed rules created specifically to address challenges unique to Spryker projects. | ||
|
||
We recommend using this tool to ensure that your project's architecture aligns with Spryker's best practices and guidelines. | ||
|
||
## Priority Levels | ||
- `1`: Сritical | ||
- `2`: Major | ||
- `3`: Medium | ||
|
||
We recommend minimum priority `3` by default for local and CI checks. | ||
|
||
## Usage | ||
|
||
Make sure you include the sniffer as `require-dev` dependency: | ||
``` | ||
composer require --dev spryker/project-architecture-sniffer | ||
``` | ||
|
||
### Running | ||
|
||
Find [command line option](https://phpmd.org/documentation/index.html). | ||
|
||
You can run the Project Architecture Sniffer from CLI by using: | ||
``` | ||
vendor/bin/phpmd src/Pyz/ text vendor/spryker/project-architecture-sniffer/src/ruleset.xml --minimumpriority 3 | ||
``` | ||
|
||
### Baseline | ||
|
||
Existing projects and demo-shops may contain rule violations. | ||
The decision to refactor existing violations may be at the discretion of each project individually. | ||
It is recommended to approach this in a differentiated manner. | ||
To integrate rules into the project immediately, there recommended to generate a [baseline](https://phpmd.org/documentation/#baseline) and move forward. | ||
It is also permissible to [suppress rules](https://phpmd.org/documentation/suppress-warnings.html) on a case-by-case basis. | ||
|
||
{% info_block infoBox %} | ||
|
||
Spryker demo shops may contain violations when analyzed with the Architecture Sniffer, as the tool includes more specific rules by default. | ||
It is recommended to generate a baseline during the initialization phase of your project development. | ||
This allows you to focus on addressing violations related to project-level integrations. | ||
|
||
{% endinfo_block %} |