Page MenuHomePhabricator

Improve `LINT_DOS_NEWLINE` behavior
ClosedPublic

Authored by joshuaspence on Sep 11 2014, 12:24 PM.
Tags
None
Referenced Files
F14094591: D10472.diff
Mon, Nov 25, 4:27 PM
Unknown Object (File)
Fri, Nov 22, 11:13 PM
Unknown Object (File)
Tue, Nov 19, 5:10 AM
Unknown Object (File)
Tue, Nov 12, 7:43 AM
Unknown Object (File)
Sun, Nov 10, 11:30 AM
Unknown Object (File)
Sun, Nov 10, 10:29 AM
Unknown Object (File)
Fri, Nov 8, 8:55 AM
Unknown Object (File)
Oct 23 2024, 3:52 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.