nette/code-checker 问题修复 & 功能扩展

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

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

nette/code-checker

Composer 安装命令:

composer create-project nette/code-checker

包简介

✅ Nette CodeChecker: A simple tool to check source code against a set of Nette coding standards.

README 文档

README

Downloads this Month Tests Latest Stable Version License

Introduction

Code Checker is a command-line tool that scans your source code for common formal errors – and can fix many of them automatically. It works with PHP, Latte, NEON, JSON and YAML files, checking encoding, line endings, indentation, trailing whitespace and more.

It runs as a standalone application, not as a project dependency.

Documentation can be found on the website. If you like it, please make a donation now. Thank you!

Installation

Install it globally via Composer:

composer global require nette/code-checker

Make sure your global Composer bin directory is in your PATH. The code-checker command is then available from anywhere, on any operating system.

Alternatively, install it as a standalone project:

composer create-project nette/code-checker

It requires PHP 8.0 or higher.

Usage

By default, Code Checker runs in read-only mode and only reports the problems it finds:

code-checker

To actually repair the files, add --fix. Back up your files first, or run it on a clean working tree so you can review the changes afterwards with git diff:

code-checker --fix

You can limit the scan to a specific path, skip files, or run faster syntax-only checks:

code-checker -d src --ignore "temp/*"
code-checker --only-syntax

In read-only mode the tool exits with code 0 when everything is fine and 1 when any problem is found, so it fits nicely into CI pipelines.

Full list of options:

Usage: code-checker [options]

Options:
    -d <path>             Folder or file to scan (default: current directory)
    -i | --ignore <mask>  Files to ignore
    -f | --fix            Fix the files
    -l | --eol            Normalize line endings to the system default
    --only-syntax         Check syntax only (faster)
    --no-progress         Do not show progress dots
    --version             Show version

What Code Checker Does

  • checks the syntax of PHP, Latte, NEON and JSON files
  • removes the BOM
  • verifies that files are valid UTF-8
  • checks for control characters
  • detects malformed phpDoc comments around annotations (e.g. /* @var instead of /** @var)
  • checks that PHP files declare strict_types=1
  • enforces tabs for indentation in PHP, CSS, JS and TS files, and spaces in YAML
  • removes trailing whitespace and blank lines at the end of files
  • normalizes line endings to the system default (with the -l parameter)

nette/code-checker 适用场景与选型建议

nette/code-checker 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.7M 次下载、GitHub Stars 达 89, 最近一次更新时间为 2014 年 08 月 16 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 nette/code-checker 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 1.7M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 91
  • 点击次数: 24
  • 依赖项目数: 7
  • 推荐数: 0

GitHub 信息

  • Stars: 89
  • Watchers: 18
  • Forks: 30
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-08-16