FLUTTER ECOSYSTEM

dart_pre_commit

A small collection of pre commit hooks to format and lint dart code

Latest version
6.1.2
30-day downloads
8.8K
Likes
26
Pub points
160

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

dart_pre_commit is a lightweight package that provides pre-commit hooks for Dart projects, automating code formatting and linting before each commit. It integrates seamlessly with Git, ensuring consistent code quality by running tools like `dart format` and `dart analyze` automatically. Designed for developers who value clean, standardized code, it reduces manual checks and prevents style violations from entering the codebase. The package supports macOS, Windows, and Linux, making it accessible across platforms. It’s ideal for teams enforcing strict coding standards.

Use cases
  • Enforcing code formatting in team projects
  • Automating lint checks before commits
  • Maintaining consistent code style across repositories
  • Reducing merge conflicts due to formatting
  • Integrating with CI/CD pipelines
Key features
  • Pre-commit code formatting
  • Automatic linting on commit
  • Cross-platform support (macOS, Windows, Linux)
  • Simple integration via Flutter pub add
  • Minimal configuration required
Suitable for
  • Dart development teams
  • Projects requiring strict code style
  • CI/CD pipeline setup
  • Developers using Git for version control
  • Those wanting automated code quality checks
Considerations
  • Requires Git and hook setup
  • May slow down commits if formatting takes time
  • Not compatible with all existing hook systems
  • Limited to Dart-specific tools
  • Depends on external tools like dart format and analyze
Supported platformsmacOSWindowsLinux

Install package

flutter pub add dart_pre_commit

Categories

Source repository

Related projects