Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3513234
codesniffer-readme.md
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
polybuildr
Mar 3 2016, 9:33 AM
2016-03-03 09:33:02 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
codesniffer-readme.md
View Options
MediaWiki
coding
conventions
============================
Abstract
--------
This
project
implements
a
set
of
rules
for
use
with
[
PHP
CodeSniffer
][
0
].
See
[
MediaWiki
conventions
][
1
]
on
our
wiki
for
a
detailed
description
of
the
coding
conventions
that
are
validated
by
these
rules
.
:-)
How
to
install
--------------
1
.
Create
a
composer
.
json
which
adds
this
project
as
a
dependency
:
```
{
"require-dev"
:
{
"mediawiki/mediawiki-codesniffer"
:
"0.6.0"
},
"scripts"
:
{
"test"
:
[
"phpcs -p -s"
],
"fix"
:
"phpcbf"
}
}
```
2
.
Create
a
phpcs
.
xml
with
our
configuration
:
```
<?
xml
version
=
"1.0"
?>
<
ruleset
>
<
rule
ref
=
"vendor/mediawiki/mediawiki-codesniffer/MediaWiki"
/>
<
file
>.</
file
>
<
arg
name
=
"extensions"
value
=
"php,php5,inc"
/>
<
arg
name
=
"encoding"
value
=
"utf8"
/>
<
exclude
-
pattern
>
vendor
</
exclude
-
pattern
>
</
ruleset
>
```
3
.
Install
:
`
composer
update
`
4
.
Run
:
`
composer
test
`
5
.
Run
:
`
composer
fix
`
to
auto
-
fix
some
of
the
errors
,
others
might
need
manual
intervention
.
6
.
Commit
!
Note
that
for
most
MediaWiki
projects
,
we
'
d
also
recommend
adding
a
PHP
linter
to
your
`
composer
.
json
`
–
see
the
[
full
documentation
][
2
]
for
more
details
.
TODO
----
*
Migrate
the
old
code
-
utils
/
check
-
vars
.
php
---
[
0
]:
https
:
//pear.php.net/package/PHP_CodeSniffer
[
1
]:
https
:
//www.mediawiki.org/wiki/Manual:Coding_conventions/PHP
[
2
]:
https
:
//www.mediawiki.org/wiki/Continuous_integration/Entry_points#PHP
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3453426
Default Alt Text
codesniffer-readme.md (1 KB)
Attached To
Mode
P2705 codesniffer-readme.md
Attached
Detach File
Event Timeline
Log In to Comment