-
-
Notifications
You must be signed in to change notification settings - Fork 282
/
@home.texy
65 lines (45 loc) · 1.87 KB
/
@home.texy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Code Checker
************
.[perex]
[Code Checker |https://github.com/nette/code-checker] sprawdzi i ewentualnie naprawi niektóre błędy formalne w Twoim kodzie źródłowym.
Instalacja
==========
Code Checker nie powinien być dodawany do zależności, ale instalowany jako projekt.
```shell
composer create-project nette/code-checker
```
Lub zainstaluj go globalnie używając:
```shell
composer global require nette/code-checker
```
i upewnij się, że twój globalny katalog `vendor/bin` jest w [zmiennej środowiskowej $PATH |https://getcomposer.org/doc/03-cli.md#global].
Korzystanie z
=============
```
Usage: php code-checker [options]
Options:
-d <path> Folder or file to scan (default: current directory)
-i | --ignore <mask> Files to ignore
-f | --fix Fixes files
-l | --eol Convert newline characters
--no-progress Do not show progress dots
--strict-types Checks whether PHP 7.0 directive strict_types is enabled
```
Bez parametrów sprawdza bieżący katalog w trybie tylko do odczytu, z `-f`, naprawia pliki.
Pamiętaj, aby najpierw wykonać kopię zapasową swoich plików, zanim się z nim zapoznasz.
Aby ułatwić jego uruchomienie, możemy stworzyć plik `code.bat`:
```shell
php cesta_k_Nette_tools\Code-Checker\code-checker %*
```
Co to robi?
===========
- usuwa [BOM |nette:glossary#bom]
- sprawdza ważność szablonów [Latte |latte:]
- sprawdza ważność stron `.neon`, `.php` oraz `.json`
- sprawdza obecność [znaków sterujących |nette:glossary#Control-Characters]
- sprawdza czy plik jest zakodowany w UTF-8
- sprawdza, czy nie ma błędnie napisanej strony `/* @anotace */` (brak gwiazdki)
- usuwa terminator `?>` z plików PHP
- usuwa prawe spacje i niepotrzebne linie na końcu pliku
- normalizuje separatory linii do systemowych separatorów linii (jeśli podano opcję `-l`)
{{leftbar: www:@menu-common}}