Skip to content

Update with deprecation notice.md #100

New issue

Have a question about this project? Sign up for a free account to open an issue and contact its maintainers and the community.

By clicking “Sign up for ”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on ? Sign in to your account

Merged
merged 1 commit into from
Apr 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 21 additions & 58 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,31 @@
# Code Climate PHP_CodeSniffer Engine
# Try Qlty today, the newest edition of Code Climate Quality.
#### This repository is deprecated and archived.

[![Code Climate](https://codeclimate.com//codeclimate/codeclimate-phpcodesniffer/badges/gpa.svg)](https://codeclimate.com//codeclimate/codeclimate-phpcodesniffer)
This is a repository for a Code Climate Quality plugin which is packaged as a Docker image.

`codeclimate-phpcodesniffer` is a Code Climate engine that wraps the [PHP_Code Sniffer](https://.com/squizlabs/PHP_CodeSniffer) static analysis tool. You can run it on your command line using the Code Climate CLI, or on our hosted analysis platform.
Code Climate Quality is being replaced with the new [Qlty](qlty.sh) code quality platform. Qlty uses a new plugin system which does not require packaging plugins as Docker images.

PHP_CodeSniffer helps you detect violations of a defined coding standard.
As a result, this repository is no longer maintained and has been archived.

### Installation
## Advantages of Qlty plugins
The new Qlty plugins system provides key advantages over the older, Docker-based plugin system:

1. If you haven't already, [install the Code Climate CLI](https://.com/codeclimate/codeclimate).
2. Run `codeclimate engines:enable phpcodesniffer`. This command both installs the engine and enables it in your `.codeclimate.yml` file.
3. You're ready to analyze! Browse into your project's folder and run `codeclimate analyze`.
- Linting runs much faster without the overhead of virtualization
- New versions of linters are available immediately without needing to wait for a re-packaged release
- Plugins can be run with any arbitrary extensions (like extra rules and configs) without requiring pre-packaging
- Eliminates security issues associated with exposing a Docker daemon

### Config Options
## Try out Qlty today free

Format the values for these config options per the [PHP_CodeSniffer documentation](https://.com/squizlabs/PHP_CodeSniffer).
[Qlty CLI](https://docs.qlty.sh/cli/quickstart) is the fastest linter and auto-formatter for polyglot teams. It is completely free and available for Mac, Windows, and Linux.

* file_extensions - This is where you can configure the file extensions for the files that you want PHP_CodeSniffer to analyze.
* standard - This is the comma delimited list of standards that you want
PHP_CodeSniffer to use while analyzing your files. You may optionally include
a relative path to a custom phpcs ruleset.xml file.
* ignore_warnings - You can hide warnings, and only report errors with this option.
* encoding - By default, PHPCS uses ISO-8859-1. Use this to change it to your encoding, e.g. UTF-8.
- Install Qlty CLI:
`
curl https://qlty.sh | sh # Mac or Linux
`
or ` <windows install line> `

### Sample Config
[Qlty Cloud](https://docs.qlty.sh/cloud/quickstart) is a full code health platform for integrating code quality into development team workflows. It is free for unlimited private contributors.
- [Try Qlty Cloud today](https://docs.qlty.sh/cloud/quickstart)

exclude_paths:
- "/examples/**/*"
engines:
phpcodesniffer:
enabled: true
config:
file_extensions: "php,inc,lib"
standard: "PSR1,PSR2,my_custom_php_ruleset.xml"
ignore_warnings: true
encoding: utf-8
ratings:
paths:
- "**.php"

### Supported Coding Standards

In addition to standards provided by [default](https://.com/squizlabs/PHP_CodeSniffer/wiki/Usage#printing-a-list-of-installed-coding-standards) with PHP_CodeSniffer, the [Drupal](https://.com/klausi/coder), [WordPress](https://.com/WordPress-Coding-Standards/WordPress-Coding-Standards), [Yii2](https://.com/yiisoft/yii2-coding-standards), and [Magento Extension](https://.com/magento/marketplace-eqp) coding standards are supported. Here is the full list:

* Drupal
* DrupalPractice
* MEQP1
* MEQP2
* MySource
* PEAR
* PHPCS
* PSR1
* PSR2
* Squiz
* WordPress
* WordPress-Core
* WordPress-Docs
* WordPress-Extra
* WordPress-VIP
* Yii2
* Zend

### Need help?

For help with PHP_CodeSniffer, [check out their documentation](https://.com/squizlabs/PHP_CodeSniffer).

If you're running into a Code Climate issue, first look over this project's [ Issues](https://.com/squizlabs/PHP_CodeSniffer/issues), as your question may have already been covered. If not, [go ahead and open a support ticket with us](https://codeclimate.com/help).
**Note**: For existing customers of Quality, please see our [Migration Guide](https://docs.qlty.sh/migration/guide) for more information and resources.