google / keep-sorted

keep-sorted is a language-agnostic formatter that sorts lines between two markers in a larger file.
Apache License 2.0
132 stars 15 forks source link

refactor(options): Define default options as an explicit instance. #34

Closed JeffFaer closed 7 months ago

JeffFaer commented 7 months ago

This simplifies option parsing logic a bit, and sets us up to add a flag to override the default options (https://github.com/google/keep-sorted/pull/35).

I also tweaked most of the tests in keep_sorted_test to not rely on the default options at all and instead be more explicit about the behavior they need to pass.