定制 owlcorp/cli-json-lint 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

owlcorp/cli-json-lint

最新稳定版本:v1.0.0

Composer 安装命令:

composer require --dev owlcorp/cli-json-lint

包简介

JSON linting command line support mimicking Symfony-way of doing things

README 文档

README

This small package adds a more advanced CLI interface over industry-standard Seldaek's JSON Lint. The CLI interface is compatible with Symfony's YAML lint commands and integrates nicely with workflows using both JSON and YAML commands.

Installation

With Symfony

Install package with composer req --dev owlcorp/cli-json-lint. The command will be automatically available in your application's console:

% composer req --dev owlcorp/cli-json-lint
% bin/console list lint | grep json
  lint:json          Lint JSON file(s) and report errors
% bin/console lint:json --help

If you're not using Symfony Flex, you need to add the following to your config/bundles.php:

<?php

return [
    //...
    OwlCorp\CliJsonLint\CliJsonLintBundle::class => ['dev' => true, 'test' => true],
];

Without Symfony

Install package with composer req --dev owlcorp/cli-json-lint. The command will be available to use via vendor/bin/json-lint: application's console:

% composer req --dev owlcorp/cli-json-lint
% vendor/bin/json-lint --help
Description:
  Lint JSON file(s) and report errors

Usage:
  lint:json [options] [--] <source>...
# ...

Usage

The command is available either via bin/console lint:json (if using Symfony) or vendor/bin/json-lint. Use --help to get information about all options. Examples below work with or without Symfony.

Cheatsheet:

  • Lint ./vendor with subdirectories: vendor/bin/json-lint config
  • Lint only files within ./: vendor/bin/json-lint --d 0 .
  • Show detailed error information: vendor/bin/json-lint -v vendor
  • Show all files parsed: vendor/bin/json-lint -vv vendor
  • You can also use wildcards using glob syntax: vendor/bin/json-lint *end*

Practical example

This package was created to unify linting all configs on production. This is usually achieved by adding a script to composer.json like so:

{
    //...
    "scripts": {
        "sc": "bin/console",
        "lint": [
            "@composer validate --strict",
            "@sc lint:yaml config/",
            "@sc lint:yaml config_runtime/",
            "@sc lint:json config_runtime/"
        ]
  }
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固