搜尋套件、儲存庫與 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 項

原始碼儲存庫

使用此套件的專案