tysonandre/phantypocheck 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tysonandre/phantypocheck

Composer 安装命令:

composer create-project tysonandre/phantypocheck

包简介

A plugin for Phan that checks for typos (using codespell's dictionary).

README 文档

README

Build Status Latest Stable Version License

This Phan plugin checks for typos in PHP files, with low false positives.

It checks all string literals, inline html, and doc comments (on by default). It also checks variables, element names, and element usages (using heuristics to guess individual words of camelCase or snake_case identifiers).

This also emits warnings if strings with typos are passed to calls to gettext(), _(), and ngettext().

Installing

This can be installed with composer

composer require --dev tysonandre/phantypocheck

After it is installed, add the relative path to TypoCheckPlugin.php to the plugins section of .phan/config.php, e.g.

    'plugins' => [
       // other plugins,
       'vendor/tysonandre/phantypocheck/src/TypoCheckPlugin.php',
    ],

This can also be manually downloaded (the current version doesn't have external dependencies).

Running (standalone)

This can be run as vendor/bin/phptypocheck path/to/file.php path/to/folder.

When passed a folder name, this will check for .php files within that folder, recursively.

Details

The typo checks use dictionary.txt from https://github.com/codespell-project/codespell/

  • It might be easier to just use codespell, depending on the use case.

    However, that would not tell you what type of identifier the string occurred in (and allow filtering by that).

    codespell also has issues analyzing the start/end of single quoted strings.

Options

Options can be passed in your .phan/config.php.

    'plugin_config' => [
        // can provide a path to a file with a list of typos to not warn about (case insensitive)
        // See tests/phantypocheck_ignore.txt for an example file.
        'typo_check_ignore_words_file' => 'phantypocheck_ignore.txt'

        // can be added to Phan configuration to make this skip checking comments, strings, and inline HTML for typos.
        // (will *only* check uses of gettext()/_()/ngettext())
        'typo_check_comments_and_strings' => false,
    ],

License

dictionary.txt is a derived work of English Wikipedia and is released under the Creative Commons Attribution-Share-Alike License 3.0 http://creativecommons.org/licenses/by-sa/3.0/ (according to https://github.com/codespell-project/codespell#license)

PhanTypoCheck is available under the GPL v3 License (see LICENSE)

PhanTypoCheck is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

PhanTypoCheck is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with PhanTypoCheck.  If not, see <https://www.gnu.org/licenses/>.

tysonandre/phantypocheck 适用场景与选型建议

tysonandre/phantypocheck 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.75k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2019 年 03 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「gettext」 「typo」 「phan」 「phan-plugin」 「codespell」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 tysonandre/phantypocheck 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 tysonandre/phantypocheck 我们能提供哪些服务?
定制开发 / 二次开发

基于 tysonandre/phantypocheck 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 5.75k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 7
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2019-03-25