Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
DOC-5647 :: Feature Internal :: Include in HR linting for PHP (#114)
Browse files Browse the repository at this point in the history
DOC-5647 :: Feature Internal :: Include in HR linting for PHP (#114)
  • Loading branch information
Alex-DA authored Aug 5, 2022
1 parent ea33114 commit e9849dd
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
45 changes: 45 additions & 0 deletions docs/best-practices/code-style-lint.md
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
1 change: 1 addition & 0 deletions src/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ module.exports = {
"best-practices/git-standardization",
"best-practices/pull-request-life-cycle-qa",
"best-practices/code-review",
"best-practices/code-style-lint",
"best-practices/dependency-injection",
"best-practices/presenter-specs",
"best-practices/angular",
Expand Down

0 comments on commit e9849dd

Please sign in to comment.