Skip to content

Instantly share code, notes, and snippets.

@dotcink
dotcink / pre_commit_dartfmt
Last active August 1, 2021 09:58
set line_width
#!/bin/bash
# Origin: https://gist.githubusercontent.com/Cynnexis/16b64199d9a94684a638f08b3fc893d3/raw/pre-commit
#
# This pre-commit hook run dartfmt on your code. If the code is not
# well-formatted, it will format it automatically, and then abort the commit
# (so you can review the changes). Make sure you changed "/path/to/dartfmt". On
# Windows, you can use an absolute path to your path.exe formatted as POSIX. For
# instance: "/d/Developer/Dart/dart-sdk/bin/dartfmt.bat" (note that the driver
# name is in lower case, and that the back-slashes are replaced with slashes).