From a49fda9c7930df7ecaa813cc5c6bdfac9308332d Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 15 Oct 2020 10:30:02 -0700 Subject: Use ws-butler At work I have to work with a lot of files that other people work on as well. Other people don’t usually have their editor set up to remove all trailing whitespace, and we’re not allowed to make a change that includes a lot of extra whitespace changes[1]. So I end up having to revert a lot of whitespace changes just before submitting. And if I then have to make more changes, for example because something was pointed out in a code review, I have to do it again. ‘ws-butler’ promises that it will still prevent me from submitting extraneous whitespace, but will not touch lines that I haven’t changed, so that would prevent me from having to revert them all the time. [1]: This is good, having a lot of whitespace changes can distract from or even completely hide the actual change you’re trying to make. --- test/integration/oni-core.bats | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/integration/oni-core.bats') diff --git a/test/integration/oni-core.bats b/test/integration/oni-core.bats index adf6a4f..373d3ea 100755 --- a/test/integration/oni-core.bats +++ b/test/integration/oni-core.bats @@ -35,3 +35,21 @@ [[ "$output" == *"t" ]] } + +@test "Starting Emacs diminishes ws-butler-global-mode" { + run emacs -batch -l package -f package-initialize -l subr-x \ + -eval "(prin1 (string-empty-p (car (alist-get 'ws-butler-mode minor-mode-alist))))" + + echo "$output" + + [[ "$output" == *"t" ]] +} + +@test "Starting Emacs turns on ws-butler-mode" { + run emacs -batch -l package -f package-initialize \ + -eval "(prin1 (bound-and-true-p ws-butler-mode))" + + echo "$output" + + [[ "$output" == *"t" ]] +} -- cgit v1.2.3-54-g00ecf