dart format line length option
nzoschke opened this issue · comments
I prefer my project to have > 80 char line length.
dart format --line-length 150
in combination with VS Code settings outlined here works, but I don't see how to pass the --line-length
option down to the pre-commit hook.
As a workaround I am doing this in my commit
script
#!/bin/bash
set -ex
dart format --fix --set-exit-if-changed -l 150 .
dart pub run dart_pre_commit --no-format
I am currently working on version 4.0. In that version, the whole configuration system will be overhauled. As part of this, I will add support for configuring the format task.
This is working as expected and documented in 4.0 with this in my pubspec.yml
dart_pre_commit:
format:
line-length: 150
And back to dart run dart_pre_commit
in pre-commit
.
Thank you for this excellent tool.