Page MenuHomePhabricator

Improve `LINT_DOS_NEWLINE` behavior
ClosedPublic

Authored by joshuaspence on Sep 11 2014, 12:24 PM.
Tags
None
Referenced Files
F14117654: D10472.id25315.diff
Thu, Nov 28, 7:51 PM
F14117653: D10472.id25314.diff
Thu, Nov 28, 7:51 PM
F14117651: D10472.id25348.diff
Thu, Nov 28, 7:50 PM
F14117650: D10472.id25184.diff
Thu, Nov 28, 7:50 PM
F14117649: D10472.id25349.diff
Thu, Nov 28, 7:50 PM
F14117648: D10472.id.diff
Thu, Nov 28, 7:50 PM
F14117614: D10472.diff
Thu, Nov 28, 7:32 PM
Unknown Object (File)
Tue, Nov 26, 2:38 AM
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
arcpatch-D10472
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 2604
Build 2608: [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.