https://github.com/cretezy/dart-format-pre-commit
Format Dart code with pre-commit
https://github.com/cretezy/dart-format-pre-commit
Last synced: about 1 year ago
JSON representation
Format Dart code with pre-commit
- Host: GitHub
- URL: https://github.com/cretezy/dart-format-pre-commit
- Owner: Cretezy
- License: mit
- Created: 2018-09-22T15:35:08.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2025-03-16T03:37:47.000Z (over 1 year ago)
- Last Synced: 2025-03-28T17:12:00.874Z (about 1 year ago)
- Language: Shell
- Homepage:
- Size: 3.91 KB
- Stars: 6
- Watchers: 1
- Forks: 21
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dart Format `pre-commit`
[`pre-commit`](https://pre-commit.com) hook for formatting Dart files.
Add the following in your `.pre-commit-config.yaml`:
```yaml
- repo: https://github.com/Cretezy/dart-format-pre-commit
rev: "master"
hooks:
- id: dart-format
```
You can also only include/exclude some files (defaults to only `.dart`, is a pattern):
```yaml
- repo: https://github.com/Cretezy/dart-format-pre-commit
rev: "master"
hooks:
- id: dart-format
files: lib/* # Only format source files
exclude: lib/src/utils.dart # Exclude utils
```
## Flutter
Also see [Flutter Format `pre-commit`](https://github.com/Cretezy/flutter-format-pre-commit) for formatting Flutter code.