`arc lint` doesn't show added trailing newlines

#1

arc lint doesn’t correctly show diffs from linters that are suggesting a trailing newline be added to a file. For example, for Go files, if gofmt suggests a trailing newline be added to the file, arc lint doesn’t show the diff correctly:

$ arc lint

>>> Lint for some_file.go:


   Auto-Fix  (GOFMT1) Autoformatter wants to make changes
    Autoformatter wants to make changes

              61 	// code goes here
              62 	if err := doStuff(); err != nil {
              63 		logger.Fatalf("it broke: %s", err)
    >>>       64 	}
              65 	logger.Info("Successfully did stuff.")
              66 	os.Exit(0)
              67 }
 OKAY  No lint warnings.

Where as the actual diff looks like this:

$ diff main.go <(gofmt main.go)

67c67
< }
\ No newline at end of file
---
> }

This happens for other linters that suggest adding a trailing newline, too, so looks like the problem is in Arcanist’s diff engine.

Is there a way to change diff engines, or is this likely to require a code change to arc?

0 Likes