This repository has been archived by the owner on Sep 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOC-5647 :: Feature Internal :: Include in HR linting for PHP (#114)
DOC-5647 :: Feature Internal :: Include in HR linting for PHP (#114)
- Loading branch information
Showing
2 changed files
with
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
title: Code Style and Linting | ||
--- | ||
|
||
## Android | ||
|
||
@todo | ||
|
||
## iOS | ||
|
||
@todo | ||
|
||
## PHP | ||
|
||
### Code Style | ||
|
||
We are using [Prettier](https://prettier.io/) with the [Plugin Prettier PHP](https://github.com/prettier/plugin-php) | ||
and this configuration in file `.prettierrc.json` to have exactly the same default configuration as Prettier: | ||
|
||
```json | ||
{ | ||
"phpVersion": "8.0", | ||
"tabWidth": 2, | ||
"braceStyle": "1tbs" | ||
} | ||
``` | ||
|
||
### Linting | ||
|
||
All code must be audited by all this tools: | ||
|
||
1. PHP Lint with the default configuration using command `php -l` | ||
2. [Psalm](https://psalm.dev/) with configuration `errorLevel="1"` (the strictest level) | ||
3. [PHPStan](https://phpstan.org/) with configuration `--level 9` (the strictest level) | ||
|
||
@todo This other tools are pending to implement also in Harmony PHP: | ||
|
||
1. [PHP Mess Detector](https://phpmd.org/), currently not compatible with the last version of PHP | ||
2. [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer), currently have some incompatibilities with Prettier | ||
3. [Sonarlint](https://www.sonarlint.org/), currently it can be used for free in the IDE but not in the pipeline | ||
|
||
|
||
## TypeScript | ||
|
||
@todo |
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