Commit e3a3d25
Config: drop support for setting language via
This has been implemented slightly differently from the original PHPCS 4.0 branch implementation.
1. The array format of the `Config::$extensions` property has not been changed.
The format is an associative array with the extensions as keys and the tokenizer type as the value.
Originally, the format was changed to a list with the extensions as values.
While information on the tokenizer type now no longer has any value as the only supported tokenizer is PHP, changing the array format could break integrations in unexpected ways, so I have decided against this.
2. I have also elected to throw an error when the passed extensions contain the `/tokenizer` switch, but only if the tokenizer is set to something other than PHP.
In the original implementation, no information was provided to the user and all extensions values would be accepted and expected to be acceptable, including values which contained the `/tokenizer` switch.
Note: users can still pass extensions for unsupported file types. This is no different than before, either in the previous implementation or in PHPCS 3.x. I mean, users could already pass `html` as an extension and it would be scanned as if it were PHP. Whether the results of such scans would be useful is doubtful, but that's the user's responsibility.
So if the user passes `--extensions=php,js`, as of PHPCS 4.0, javascript files will be scanned as if they were PHP.
Ref:
* squizlabs/PHP_CodeSniffer 2448
Co-authored-by: Greg Sherwood <[email protected]>--extensions CLI arg1 parent 0242dfb commit e3a3d25
File tree
4 files changed
+68
-27
lines changed- src
- Util
- tests/Core
- Config
- Filters
4 files changed
+68
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
| |||
545 | 548 | | |
546 | 549 | | |
547 | 550 | | |
548 | | - | |
549 | | - | |
550 | 551 | | |
551 | 552 | | |
552 | 553 | | |
| |||
1146 | 1147 | | |
1147 | 1148 | | |
1148 | 1149 | | |
1149 | | - | |
1150 | | - | |
| 1150 | + | |
1151 | 1151 | | |
1152 | 1152 | | |
1153 | | - | |
1154 | | - | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
1155 | 1160 | | |
1156 | 1161 | | |
1157 | | - | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
1161 | | - | |
| 1162 | + | |
1162 | 1163 | | |
1163 | 1164 | | |
1164 | 1165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
415 | | - | |
416 | | - | |
| 415 | + | |
417 | 416 | | |
418 | 417 | | |
419 | 418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | 72 | | |
81 | 73 | | |
82 | 74 | | |
83 | 75 | | |
84 | | - | |
85 | | - | |
| 76 | + | |
| 77 | + | |
86 | 78 | | |
87 | 79 | | |
88 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
89 | 83 | | |
90 | 84 | | |
91 | 85 | | |
92 | 86 | | |
93 | 87 | | |
94 | | - | |
| 88 | + | |
95 | 89 | | |
96 | 90 | | |
97 | 91 | | |
| |||
125 | 119 | | |
126 | 120 | | |
127 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
128 | 169 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
0 commit comments