承接 sitegeist/fluid-components-linter 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

sitegeist/fluid-components-linter

Composer 安装命令:

composer require sitegeist/fluid-components-linter

包简介

Tool to validate fluid components based on a specified ruleset

README 文档

README

CLI tool to validate your Fluid Components based on a specific ruleset for code quality.

Features

  • check basic Fluid syntax
  • check correct component structure (e. g. correct nesting of component ViewHelpers)
  • enforce naming scheme and min/max length of parameter names
  • limit parameter count per component (which should lead to simpler components)
  • enforce parameter descriptions
  • enforce presence of markdown documentation and fixture files used by Fluid Styleguide
  • normalize syntax of namespaces in parameter type
  • encourage strict data types instead of generic array or object
  • suggest usage of correct types if parameter names contain hints like link or image
  • enforce that component prefixer and class param are used
  • enforce that certain ViewHelpers can't be used inside components
  • enforce that content param is always wrapped in <f:format.raw>

Getting Started

To use the linter, require this package as a dev dependency via composer:

composer req --dev sitegeist/fluid-components-linter

The package provides the binary fclint which can be used to validate individual component files as well as whole directory structures containing component files.

fclint lint Resources/Private/Components/

For ease of use you might want to define a custom composer command in your project:

composer.json:

{
    ...

    "scripts": {
        "lint:components": "fclint lint Resources/Private/Components/"
    }
}

and then just call:

composer lint:components

(on-demand, in git hooks, in your CI...)

Customize Ruleset

If you want to modify the code quality ruleset, you can overwrite the predefined rules in default.fclint.json:

fclint lint -c ./myRules.fclint.json Resources/Private/Components/

For convenience, a file named .fclint.json in the current working directory will be picked up automatically and doesn't need to be specified with -c.

Your adjusted configuration will be merged with the selected configuration preset, so you only need to specify the rules you want to change. To make the following changes to the default rules:

  • ignore all components inside a folder called Template/
  • don't require a markdown documentation file if a fixture file is present
  • limit length of parameter names to 30 characters (default is 40)

you would use the following configuration file:

.fclint.json:

{
    "files": {
        "ignorePatterns": [
            "**/Template/**"
        ]
    },
    "component": {
        "requireDocumentationWithFixtureFile": {
            "check": false
        }
    },
    "params": {
        "nameLength": {
            "max": 30
        }
    }
}

Command Line Options

There are a few command line options that can be specified:

$ fclint lint --help
Description:
Validates fluid components based on a specified ruleset

Usage:
lint [options] [--] <paths>...

Arguments:
paths                        Component files that should be included

Options:
-e, --extension[=EXTENSION]  Component file extension [default: ".html"]
-p, --preset[=PRESET]        Name of configuration preset [default: false]
-c, --config[=CONFIG]        Path to custom configuration file (.fclint.json in the current working directory will be picked up automatically) [default: false]
    --severity[=SEVERITY]    Minimum severity, all issues below this severity will be skipped. Possible values: info, minor, major, critical, blocker [default: "info"]
-i, --ignore[=IGNORE]        Glob pattern that defines which files should be skipped (multiple values allowed)
    --json                   Output results as json (compatible to codeclimate spec)

Support & Discussion

If you have any questions, need support or want to discuss components in TYPO3, feel free to join #ext-fluid_components.

sitegeist/fluid-components-linter 适用场景与选型建议

sitegeist/fluid-components-linter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 78.91k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2020 年 07 月 28 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 sitegeist/fluid-components-linter 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-28