obliviousharmony/vscode-phpcs-integration
Composer 安装命令:
composer require obliviousharmony/vscode-phpcs-integration
包简介
The custom PHPCS integration for the obliviousharmony.vscode-php-codesniffer VS Code extension.
README 文档
README
Integrates PHP_CodeSniffer into VS Code.
This extension uses the version of PHPCS defined by the platform-specific executable setting. Through the use of custom reports we are able to generate diagnostics, code actions, and document formatting that fully utilizes VS Code's available features.
Configuration
Until you configure it, this extension will not lint any files.
Standard (phpCodeSniffer.standard)
This dropdown selects the coding standard that will be used. There are a few options that, when selected, will instead change the behavior of the extension.
Disabled
This option will prevent the extension from linting any documents.
Default
Allow PHPCS to decide what standard should apply to the document. It will either use the default standard if one is configured, otherwise, it will try to find one in the workspace root and all parent directories.
Automatic
When selected, this option will cause the extension to search for an applicable coding standard file (.phpcs.xml, phpcs.xml, .phpcs.xml.dist, phpcs.xml.dist). The extension starts in the document's folder and traverses through parent directories until it reaches the workspace root. If the extension fails to find a file it will do nothing and output an error.
Custom
This option will use the content of the phpCodeSniffer.standardCustom input as the standard. This can be the name of a custom ruleset, or, a path to a custom standard file. If a relative path is given it will be based
on the workspace root that the document resides in (untitled documents use the first root).
Executable (phpCodeSniffer.exec.linux, phpCodeSniffer.exec.osx, and phpCodeSniffer.exec.windows)
This text input allows for setting a path to a platform-specific PHPCS executable. If a relative path is given it will be based on the workspace root that the document resides in (untitled documents use the first root). Any arguments or options added after the executable will be passed to it automatically.
You may also set the
phpCodeSniffer.autoExecutable option if you'd like for the extension to automatically search for an executable. This
works by looking for a {vendor-dir}/bin/phpcs ({vendor-dir}\bin\phpcs.bat on Windows) file in the document's directory and then
traversing up to the workspace folder if it does not find one. When it fails to find one automatically it will
fall back to the explicit option.
File and Folder Exclusions (phpCodeSniffer.exclude)
This array of glob patterns allows you to exclude files and folders from linting. While the extension does respect any file rules in your coding standard, this option allows you to define additional rules.
Autofix on Save
Rather than providing an option here, this extension encourages you to use the built-in VS Code editor.formatOnSave option:
{
"[php]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "obliviousharmony.vscode-php-codesniffer"
}
}
Using in Containerized Development Environments (phpCodeSniffer.autoloadPHPCSIntegration)
If you are using a container for your development environment we would strongly recommend using one of VS Code's remote development extensions. However, if this is not possible, we have provided a Composer package with the files required to integrate with PHPCS. You must install these files alongside PHPCS (globally or per-project) in order for the extension to work properly. Once you have installed the package it will be used instead of the build-in integration when phpCodeSniffer.autoloadPHPCSIntegration is enabled.
obliviousharmony/vscode-phpcs-integration 适用场景与选型建议
obliviousharmony/vscode-phpcs-integration 是一款 基于 TypeScript 开发的 Composer 扩展包,目前已累计 6.61k 次下载、GitHub Stars 达 42, 最近一次更新时间为 2024 年 01 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「phpcs」 「phpcbf」 「vscode」 「vscode-extension」 「vscode-phpcs」 「vscode-phpcbf」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 obliviousharmony/vscode-phpcs-integration 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 obliviousharmony/vscode-phpcs-integration 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 obliviousharmony/vscode-phpcs-integration 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP_CodeSniffer Standards Composer Installer Plugin
A suite of utility functions for use with PHP_CodeSniffer
A collection of sniffs and standards for use with PHP_CodeSniffer.
The coding standard applying to all Youdot PHP projects, based on Doctrine set of PHPCS rules, with additional checks.
CodeSniffer ruleset for the ZettaCMS coding standard
Documentation and PHPCS Standard for Nether Notation
统计信息
- 总下载量: 6.61k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 42
- 点击次数: 30
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2024-01-29