├── .gitignore ├── .github ├── CODEOWNERS └── dependabot.yml ├── composer.json ├── WMDE └── Fundraising │ └── ruleset.xml └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | composer.lock 2 | 3 | vendor -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # This marks the default owner group of all files in this repository 2 | * @wmde/funtech-core 3 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wmde/fundraising-phpcs", 3 | "description": "PHP coding style for the WMDE FUN team", 4 | "require": { 5 | "mediawiki/mediawiki-codesniffer": "~48.0" 6 | }, 7 | "license": "GPL-2.0-or-later" 8 | } 9 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Please see the documentation for all configuration options: 2 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 3 | 4 | version: 2 5 | updates: 6 | - package-ecosystem: "composer" # See documentation for possible values 7 | directory: "/" # Location of package manifests 8 | schedule: 9 | interval: "daily" 10 | 11 | -------------------------------------------------------------------------------- /WMDE/Fundraising/ruleset.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | */tests/* 33 | 34 | 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PHP Code style for the WMDE FUN team 2 | 3 | This is [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer) rule set based on the 4 | [`wikimedia/mediawiki-tools-codesniffer`](https://github.com/wikimedia/mediawiki-tools-codesniffer) 5 | rules which encode the [conventions for MediaWiki 6 | projects](https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP). 7 | 8 | ## Deviations from the Mediawiki conventions 9 | 10 | * Allow longer line lengths. Lines longer than 120 chars will generate a 11 | warning. Ignore line length in `tests/*` directory. 12 | * Allow unknown annotations. 13 | * Do not check PHPUnit tests for `@covers` annotations - we're using PHP 14 | attributes which are not supported yet. See https://phabricator.wikimedia.org/T329048 15 | We're enforcing the existence of coverage information with the `requireCoversAnnotation` 16 | config setting of PHPUnit. 17 | 18 | ## How to install 19 | 20 | 1. Require the library as a composer dependency: 21 | 22 | composer require-dev wmde/fundraising-phpcs 23 | 24 | 25 | 2. Create a .phpcs.xml with the following minimal configuration: 26 | 27 | ``` 28 | 29 | 30 | 31 | . 32 | 33 | 34 | 35 | ``` 36 | 37 | ## How to run 38 | 39 | The installation automatically installs the `phpcs` (style checker) and 40 | `phpcbf` (style fixer) binaries into `vendor/bin`. When your `.phpcs.xml` 41 | file is in place, run the command 42 | 43 | vendor/bin/phpcs 44 | 45 | 46 | ## Versioning 47 | This repository should create a new major release whenever the MediaWiki 48 | coding standard has a new major release or you add a rule that will break 49 | existing code. 50 | 51 | If you disable a rule, you can do a minor release. 52 | 53 | 54 | --------------------------------------------------------------------------------