搜索插件、代码仓与 APP 分类

插件详情v3.0.0

pyramid_lint

用于 Dart 和 Flutter 项目的代码检查工具,以鼓励良好的编码实践。

AndroidiOSmacOSWindowsLinux
近 30 天下载
8160
喜欢数
13
Pub 分数
150

安装插件

flutter pub add pyramid_lint

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Pyramid Lint 是一个用于 Dart 和 Flutter 的代码检查工具包,旨在强制执行一致的编码实践并提高代码质量。它提供了一组可自定义的规则,帮助开发者在开发过程中尽早发现常见问题,从而编写出干净、可维护且易读的代码。该工具可无缝集成到 Flutter 工作流中,并支持 Android、iOS、macOS、Windows 和 Linux 等多个平台。通过清晰的反馈和可配置选项,它促进了团队和项目中的最佳实践。

适合场景

  • 在团队间强制执行一致的代码风格
  • 在开发过程中识别潜在的错误
  • 提高代码的可读性和可维护性
  • 将 linting 集成到 CI/CD 流水线中
  • 支持大规模Flutter项目维护

主要特点

  • 可自定义的 lint 规则
  • 与 Flutter CLI 的无缝集成
  • 跨平台支持
  • 清除错误消息
  • 通过 YAML 文件配置

适合对象

  • Flutter 团队优先考虑代码质量
  • 使用自动化代码审查的开发者
  • 需要严格编码标准的项目
  • CI/CD 环境
  • 开源贡献者

使用建议

  • 需要配置才能最佳使用
  • 可能需要根据团队偏好调整规则
  • 依赖于 Dart 分析工具
  • 不适合没有 linting 需求的基础项目
  • 初始设置可能需要学习曲线

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Pyramid Lint logo

Pub Version Build Status License

Custom lints, quick fixes, and assists for Dart and Flutter.

Pyramid Lint

Pyramid Lint extends the Dart analyzer with optional rules for general Dart code and Flutter widgets. Enable only the checks you want, apply quick fixes from your IDE, and run the same analysis from the command line with dart analyze or flutter analyze.

Built as an analyzer plugin on analysis_server_plugin.

Features

  • Lints — Opt-in rules for Dart and Flutter (see available lints).
  • Quick fixes — Automated corrections for many diagnostics in the IDE.
  • Assists — Refactorings such as wrap_with_stack and convert_to_for_in_iterable_indexed_loop.

Requirements

  • Dart 3.10+ or Flutter 3.38+

Installation

Analyzer plugins are configured in the root analysis_options.yaml of your package or workspace via the top-level plugins section (not the legacy analyzer.plugins list).

To add pyramid_lint to your project, add the following to your analysis_options.yaml file:

plugins:
  pyramid_lint: ^3.0.0 # replace with the latest version

Configuration

Enable lints

All Pyramid Lint rules are disabled by default. Turn them on under diagnostics:

plugins:
  pyramid_lint: ^3.0.0
    diagnostics:
      specific_lint_rule: true

Browse the full list in the documentation or copy the recommended preset.

Configure a lint

Some rules accept options under options:

plugins:
  pyramid_lint: ^3.0.0
    diagnostics:
      max_lines_for_file: true
    options:
      max_lines_for_file:
        max_lines: 300

Documentation

Full guides, rule reference, and assists: docs.page/charlescyt/pyramid_lint

Contributing

Contributions are welcome—issues, pull requests, and doc improvements.

See the contributing guide to get started.

License

MIT

所属分类

依赖

依赖清单 9 项

源码仓库

使用此插件的项目