Skip to content

pedrox-hs/dart-pre-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Dart pre-commit hooks

Some Dart hooks for pre-commit.

Can be used in Flutter projects.

Using dart-pre-commit with pre-commit

Add this to your .pre-commit-config.yaml

- repo: https://github.com/pedrox-hs/flutter-pre-commit
  rev: v1.1.0  # Use the ref you want to point at
  hooks:
  - id: dart-analyze
  # - id: ...

Hooks available

dart-analyze

Analyze Dart code.

dart-format

Dart source code format.

By default it just check for code format, to apply format use:

  - id: dart-format
    args: ["--output=write"]

dart-fix

Apply automated fixes to Dart source code.

fvm-dart-analyze

Alternative for dart-analyze with FVM.

fvm-dart-format

Alternative for dart-format with FVM.

fvm-dart-fix

Alternative for dart-fix with FVM.