パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v2.34.0

dart_code_metrics_presets

Flutter開発チーム向けのコード品質ツールであるDCMの事前定義されたプリセット。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
11.8万
いいね数
39
Pub ポイント
150

パッケージをインストール

flutter pub add dart_code_metrics_presets

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Flutter開発チームが一貫したコーディング基準を維持するのを支援するコード品質ツールであるDart Code Metrics(DCM)向けの事前定義された設定プリセットのコレクションです。これらのプリセットは、異なるプロジェクトタイプやチームの好みに合わせて調整された、すぐに使えるルールセットを提供し、コードスタイル、複雑さ、保守性に関するベストプラクティスの設定と適用を簡素化します。DCMと統合することで、手動での設定なしに業界標準に沿ったガイドラインを迅速に適用できます。このパッケージはすべての主要なプラットフォームをサポートしており、クロスプラットフォームのFlutterプロジェクトに最適です。

用途

  • チーム間で一貫したコードスタイルを適用する
  • CI/CDパイプラインにおけるコード品質チェックの自動化
  • 標準化されたルールで新しい開発者をオンボーディングする
  • 大規模なFlutterアプリにおけるコードの保守性向上
  • 特定のプロジェクト要件に合わせたlintルールのカスタマイズ

主な機能

  • 事前に定義された、実戦で検証されたプリセット
  • pub add を通じた簡単な統合
  • すべてのFlutterプラットフォームをサポート
  • Dart および Flutter のベストプラクティスに準拠
  • カスタム設定用に拡張可能

適している対象

  • コード品質を最優先とするFlutterチーム
  • 自動化されたLintingを必要とするCI/CD環境
  • 迅速なセットアップが必要な新しいFlutterプロジェクト
  • 標準化されたコーディング規約を採用するチーム
  • 最小限の構成オーバーヘッドを求める開発者

注意事項

  • Dart Code Metrics のインストールが必要です
  • 固有のプロジェクト要件に合わせてプリセットを調整する必要がある場合があります
  • スタンドアロンのリンターではない。DCMランタイムに依存する。
  • プリセット定義内のカスタマイズが限定されている
  • チーム全体のドキュメントと併用するのが最適です

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Pub Version License package publisher

DCM Presets

DCM is an advanced linter for Dart and Flutter that helps you analyze and improve your code quality. You can find all available lint rules here.

This repository contains a list of predefined DCM presets for lints:

  • All: contains all available lint rules for Dart and Flutter.
  • Recommended: contains recommended Dart and Flutter rules (with an emphasis on finding errors).
  • Dart: contains all lint rules applicable to any Dart app.
  • Flutter: contains all lint rules applicable to any Flutter app.
  • Pub: contains all lint rules for linting the pubspec.yaml files.
  • Flame: contains all lint rules for the Flame package.
  • Provider: contains all lint rules for the Provider package.
  • Bloc: contains all lint rules for the Bloc package.
  • Riverpod: contains all lint rules for the Riverpod package.
  • Equatable: contains all lint rules for the Equatable package.
  • Patrol: contains all lint rules for the Patrol package.
  • FakeAsync: contains all lint rules for the FakeAsync package.
  • Mocktail: contains all lint rules for the Mocktail package.
  • GetIt: contains all lint rules for the GetIt package.
  • JsonSerializable: contains all lint rules for the JsonSerializable package.
  • FlutterHooks: contains all lint rules for the FlutterHooks package.
  • FirebaseAnalytics: contains all lint rules for the FirebaseAnalytics package.
  • GetX: contains all lint rules for the GetX package.
  • Intl: contains all lint rules for the Intl package.
  • EasyLocalization: contains all lint rules for the EasyLocalization package.

and for metrics:

  • All Metrics: contains all available metrics with recommended default thresholds.
  • Recommended metrics: contains recommended metrics with default thresholds.

How to use a preset

Take these steps to enable a preset:

  1. Install this package as a dev dependency:

    dart pub add --dev dart_code_metrics_presets
    

    or:

    flutter pub add --dev dart_code_metrics_presets
    
  2. For DCM configuration add the extents entry:

    dart_code_metrics:
      extends:
        - package:dart_code_metrics_presets/all.yaml
    

Disabling or reconfiguring a rule from the preset

To disable a rule, simply set its value to false:

dart_code_metrics:
  extends:
    - package:dart_code_metrics_presets/all.yaml
  rules:
    - avoid-banned-imports: false

To reconfigure a rule, that is included into a preset:

dart_code_metrics:
  extends:
    - package:dart_code_metrics_presets/all.yaml
  rules:
    - arguments-ordering:
        child-last: true

Defining a custom preset

Any other preset can be passed to the extends entry. To create a custom preset create a yaml file with the same structure as for regular DCM configuration.

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト