forked from bolt/bolt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.codeclimate.yml
84 lines (76 loc) · 3.26 KB
/
.codeclimate.yml
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
engines:
grep:
enabled: true
exclude_paths:
- "!tests"
config:
patterns:
twig-namespace:
pattern: ([^use ]Twig_[^Simple])
annotation: "Don't use un-aliased, snake_cased, `Twig_*` references"
severity: blocker
categories: Compatibility
content: >
In preparation for Twig eventually namespacing, and in the interests of keeping
things clear and clean, alias `Twig_*` classes, e.g.
* `use Twig_Environment as Environment;`
* `use Twig_Extension as Extension;`
* `use Twig_Markup as Markup;`
path_patterns:
- "**/*.php"
twig-simple:
pattern: ([^use ]Twig_Simple)
annotation: "Don't use deprecated `Twig_Simple*` extension references"
severity: blocker
categories: Compatibility
content: >
Twig version 2 has deprecated `Twig_Simple*` extension functions, and
replaced them with class names minus the "Simple".
In preparation for this, ensure that `Twig_Simple*` classes are imported
using an alias, e.g.
* `use Twig_SimpleFilter as TwigFilter;`
* `use Twig_SimpleFunction as TwigFunction;`
* `use Twig_SimpleTest as TwigTest;`
path_patterns:
- "**/*.php"
phpunit-namespace:
pattern: ([^use ]PHPUnit_(Framework|Util|Extensions|Runner|TextUI|Exception)_)
annotation: "Don't use deprecated, snake_cased, `PHPUnit_*` references"
severity: blocker
categories: Compatibility
content: >
PHPUnit 6 has migrated to namespaces, and as such we're using import aliases
for PHPUnit classes that match the version 6 namespace, e.g.
* `use PHPUnit_Framework_MockObject_MockObject as MockObject;`
Note that PHPUnit already has alias classes defined for `PHPUnit_Framework_Assert`
and `PHPUnit_Framework_TestCase`, so imports need simply be, e.g.
* `use PHPUnit\Framework\Assert;`
* `use PHPUnit\Framework\TestCase;`
path_patterns:
- "tests/phpunit/**/*.php"
duplication:
enabled: true
config:
languages:
php:
mass_threshold: 32
phpcodesniffer:
enabled: true
config:
standard: "ruleset.xml"
prepare:
fetch:
- url: "https://raw.githubusercontent.com/bolt/codingstyle/master/PhpCodeSniffer/Bolt/ruleset.xml"
path: "ruleset.xml"
ratings:
paths:
- "**.php"
exclude_paths:
- app/cache/
- app/resources/
- app/src/lib/
- app/view/
- extensions/
- files/
- tests/
- theme/base-2016/js/