Page MenuHomePhabricator

Improve `LINT_DOS_NEWLINE` behavior
ClosedPublic

Authored by joshuaspence on Sep 11 2014, 12:24 PM.
Tags
None
Referenced Files
F14027706: D10472.diff
Fri, Nov 8, 8:55 AM
F13995820: D10472.id25184.diff
Wed, Oct 23, 3:52 PM
F13991982: D10472.id25348.diff
Tue, Oct 22, 1:39 PM
F13979932: D10472.id25314.diff
Sat, Oct 19, 7:21 AM
F13978895: D10472.id.diff
Sat, Oct 19, 1:33 AM
F13976743: D10472.id.diff
Fri, Oct 18, 3:32 PM
F13971439: D10472.id25349.diff
Thu, Oct 17, 1:24 PM
Unknown Object (File)
Sun, Oct 13, 10:19 PM
Subscribers

Details

Summary

Improve the behavior of ArcanistTextLinter in dealing with LINT_DOS_NEWLINE. In particular, provide replacement text so that these linter issues can be autofixed.

Test Plan

Added a unit test.

Diff Detail

Repository
rARC Arcanist
Branch
master
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 2508
Build 2512: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

joshuaspence retitled this revision from to Improve `LINT_DOS_NEWLINE` behavior.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.

If the file has OS9 newlines (\r only), this will completely destroy them and mangle the file. We should only remove \r if the next character is \n.

Also, maybe it's better to emit one giant whole-file patch than one patch for each line?

This revision now requires changes to proceed.Sep 11 2014, 12:38 PM
joshuaspence edited edge metadata.
  • Don't suggest a fix if the file has OS9 newlines
  • Suggest one patch per file rather than one patch per line
epriestley edited edge metadata.

We could also suggest one patch per contiguous block of lines with bad newlines as an ideal behavior, but this should usually accomplish the same thing.

This revision is now accepted and ready to land.Sep 24 2014, 8:59 PM
This revision was automatically updated to reflect the committed changes.