Added docs directory with descriptions of current analyzers.

This commit is contained in:
Mikael Lindemann 2020-03-15 19:23:18 +01:00
Родитель 47983e0721
Коммит 26bd098ca9
8 изменённых файлов: 81 добавлений и 0 удалений

Просмотреть файл

@ -1,2 +1,6 @@
# piranha.core.analyzers
Roslyn analyzers for Piranha CMS.
Check the [analyzer docs][docs] for a list of available analyzers and code fixes.
[docs]: ./docs/README.md

Двоичные данные
docs/PA0001/PA0001-after-move.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 79 KiB

Двоичные данные
docs/PA0001/PA0001-before-move.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 83 KiB

Двоичные данные
docs/PA0001/PA0001-move-to-existing-region.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 69 KiB

50
docs/PA0001/README.md Normal file
Просмотреть файл

@ -0,0 +1,50 @@
# PA0001 - `FieldType` should not be used as a single field region
According to official documentation, the editors for the following field types are best suited for complex regions.
| Severity | Category |
|----------|----------|
| Info | Usage |
| Applicable built-in field types |
|---------------------------------|
| `AudioField` |
| `CheckBoxField` |
| `DateField` |
| `DocumentField` |
| `ImageField` |
| `MediaField` |
| `NumberField` |
| `PageField` |
| `PostField` |
| `StringField` |
| `VideoField` |
## Available code fixes
### Move `FieldType` to `ExistingRegion`
Moves the single field region into `ExistingRegion` as a field.
Note that this action only appears if the content class has an existing complex region.
Code with suggestion:
![""][before]
Choose code fix:
![""][action]
After code fix:
![""][after]
### ~~Replace with complex region~~
~~Introduces a new complex region and updates the content class to use it.~~
Note: With the introduction of [PA0002] this code fix has been disabled as it generates the exact pattern that [PA0002] marks as an error.
[before]: ./PA0001-before-move.png "Before fix"
[action]: ./PA0001-move-to-existing-region.png "Fix"
[after]: ./PA0001-after-move.png "After fix"
[PA0002]: ../PA0002/README.md

Двоичные данные
docs/PA0002/PA0002.gif Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 446 KiB

18
docs/PA0002/README.md Normal file
Просмотреть файл

@ -0,0 +1,18 @@
# PA0002 - Piranha does not support single field complex regions
According to documentation, Piranha is not able to handle complex regions with only a single field.
The analyzer will check types of properties marked with the `RegionAttribute` and mark the region properties as violating if they have a single field property marked with the `FieldAttribute`.
| Severity | Category |
|----------|----------|
| Error | Usage |
Animation that shows when and how the error is shown:
![][animation]
## Available code fixes
None currently.
[animation]: ./PA0002.gif

9
docs/README.md Normal file
Просмотреть файл

@ -0,0 +1,9 @@
# Piranha.Analyzers
| ID | Title | Severity | Category |
|----------|---------------------------------------------------------|----------|----------|
| [PA0001] | `FieldType` should not be used as a single field region | Info | Usage |
| [PA0002] | Piranha does not support single field complex regions | Error | Usage |
[PA0001]: ./PA0001/README.md
[PA0002]: ./PA0002/README.md