Skip to main content

anal 0.3.2 copy "anal: ^0.3.2" to clipboard
anal: ^0.3.2 copied to clipboard

discontinuedreplaced by: lintforge

A pluggable static analysis framework for Dart and Flutter projects with an extensible runner, rule registry, and CLI.

Changelog #

Unreleased #

Added #

  • New default-on unused_source_file rule. It flags Dart source files in the analyzed set that are never reached from any entry point via an import, export, or part directive. Entry points are files under bin/ or test/, files that declare a top-level main, and lib/<package>.dart plus any other file sitting directly under lib/ (i.e. not nested inside lib/src/). Generated-file basenames such as *.g.dart and *.freezed.dart are skipped defensively even when the runner's default excludes are turned off. Diagnostics are emitted at Severity.warning. The rule is registered by the built-in CLI and enabled automatically. Running dart run anal against a project that previously produced no diagnostics may now surface new warnings from this rule.
  • New MultiFileAnalyzerRule extension point for custom rules that need to reason across multiple files in a single invocation (for example to build an import graph or a cross-file symbol index). Multi-file rules are registered with the same RuleRegistry as AnalyzerRule implementations and are dispatched once per run with the full set of resolved compilation units. Existing AnalyzerRule implementations continue to be dispatched once per file and do not need any changes.
  • New --no-default-excludes CLI flag that opts out of the built-in default exclude patterns. Pair it with explicit --exclude flags when you want full control over which paths are skipped.
  • New AnalOptions.defaultExcludePaths constant exposing the list of glob patterns excluded by AnalOptions.defaults(). Useful when composing custom AnalOptions instances programmatically.
  • New default-on unused_function rule. It flags file-local function declarations that are never referenced, specifically private top-level functions in libraries that have no part files and local function declarations inside another function or method body. Diagnostics are emitted at Severity.warning. The rule is registered by the built-in CLI and enabled automatically. Running dart run anal against a project that previously produced no diagnostics may now surface new warnings from this rule.
  • New default-on unused_class rule. It flags file-local declarations that are never referenced within the same compilation unit, covering class, mixin, enum, and extension type declarations whose names begin with _. The rule only runs against libraries that have no part files and skips declarations annotated with @pragma('vm:entry-point'). Diagnostics are emitted at Severity.warning. The rule is registered by the built-in CLI and enabled automatically. Running dart run anal against a project that previously produced no diagnostics may now surface new warnings from this rule.
  • Open-source project guidance, issue templates, pull request checklist, security policy, code of conduct, and Dependabot configuration.
  • Coverage artifact upload to CI.
  • .pubignore to keep automation and assistant-only files out of the published package archive.
  • .gitattributes for predictable text file line endings.

Changed #

  • Updated CI and release automation to target the repository default branch.
  • Tightened package metadata for pub.dev discovery.
  • Widened the analyzer dependency to >=9.0.0 <13.0.0 so projects using freezed >=3.2.5 can add anal without a version-solver conflict.

Fixed #

  • Fixed directory include discovery on Windows.
  • anal is now installable alongside freezed ^3.2.5.
  • dart run anal --version now prints the correct package version (0.2.0) instead of the stale hardcoded 0.1.0.
  • Restored analyzer 9.0.0 compatibility for the unused_class rule. The rule previously reached into ExtensionTypeDeclaration.primaryConstructor, which only exists in analyzer 10+, causing a build break for consumers pinned to analyzer 9.0.0 ('primaryConstructor' isn't defined for the type 'ExtensionTypeDeclaration'). The rule now uses the cross-version ExtensionTypeDeclaration.name accessor.

Changed #

  • Default exclude patterns now include *.g.dart and *.freezed.dart. Pass an empty excludePaths (or --no-default-excludes on the CLI) to opt out.
  • --exclude now layers on top of the default excludes instead of replacing them. Patterns you pass are added to the built-in defaults; use --no-default-excludes if you need to suppress the defaults.

0.3.2 - 2026-05-27 #

Bug Fixes #

  • removed invalid version (67cdcac)

0.3.1 - 2026-05-27 #

Continuous Integration #

  • release: wire bin/anal.dart into release-please and trigger 0.3.1 (e544060)

0.3.0 - 2026-05-27 #

Features #

  • fixing version handling (3460776)

Bug Fixes #

0.2.0 - 2026-05-27 #

⚠ BREAKING CHANGES #

  • api: Calculator is removed from the public API.

Features #

  • add Severity, SourceLocation, Diagnostic value types (0b965cd)
  • api: re-export public surface from lib/anal.dart (4cef459)
  • cli: add bin/anal.dart CLI entry point (ae0fa3b)
  • frame basics (44c400e)
  • options: add AnalOptions value class (2c0cb6c)
  • reporter: add Reporter abstraction and ConsoleReporter (85e556d)
  • rules: add AnalyzerRule contract, AnalysisContext, RuleRegistry (0e45827)
  • rules: add unused_class rule (4adcd8e)
  • rules: add unused_function rule (84e9528)
  • rules: register unused_function rule in CLI (2ea76c1)
  • runner: add AnalysisRunner orchestrator and smoke test (b721079)

0.1.0 #

  • Added a pluggable static-analysis framework for Dart and Flutter projects:
    • AnalyzerRule: abstract plugin contract for custom rules.
    • Diagnostic, Severity, SourceLocation: value types describing analysis findings.
    • AnalysisContext: carrier passed into each rule invocation, exposing the resolved compilation unit.
    • RuleRegistry: in-memory registration and lookup of rules, with duplicate-id rejection.
    • AnalysisRunner: orchestrator that resolves target files, dispatches rules, and collects diagnostics.
    • AnalOptions: value class describing include/exclude paths and enabled rule ids.
    • Reporter / ConsoleReporter: pluggable diagnostic output, with a stdout implementation.
    • CLI executable anal (dart run anal) with --help, --version, --rules, and --exclude flags.

BREAKING CHANGE #

  • Removed the Calculator stub that shipped in 0.0.1. Consumers that depended on it must remove the import; it was a generator placeholder and not part of any intended public API.

0.0.1 #

  • Initial package scaffold.
0
likes
0
points
55
downloads

Publisher

unverified uploader

Weekly Downloads

A pluggable static analysis framework for Dart and Flutter projects with an extensible runner, rule registry, and CLI.

Repository (GitHub)
View/report issues

Topics

#analyzer #cli #flutter #lint #static-analysis

License

unknown (license)

Dependencies

analyzer, args, flutter, glob, path

More

Packages that depend on anal