When there are autofixable lint errors detected by eslint, the order of operations is:
1) arc diff
2) if there are uncommited changes, amend or commit
3) arc lint, which autofixes and returns successful
4) autofixed changes are not committed nor staged
5) diff is pushed to phabricator without changes
This means that arc diff fails to properly apply lint changes before creating a diff.
Summary of changes:
1) Parse the fix fields in each message, and build ArcanistLintMessage with originalText and replacementText populated, along with a severity of ArcanistLintSeverity::SEVERITY_AUTOFIX. This means that the user will receive a prompt asking if they'd like to apply the fixes.
2) Remove the eslint.fix flag because it likely causes more confusion that it helps.
3) Use the existing eslint.fix flag to toggle this logic for backwards compatibility and as a way of gating these changes.
Pasted from https://github.com/pinterest/arcanist-linters/issues/80
When there are autofixable lint errors detected by eslint, the order of operations is: 1)
arc diff
2) if there are uncommited changes, amend or commit 3) arc lint, which autofixes and returns successful 4) autofixed changes are not committed nor staged 5) diff is pushed to phabricator without changesThis means that
arc diff
fails to properly apply lint changes before creating a diff.See messages for a file provided by eslint@6.8.0
Summary of changes: 1) Parse the
fix
fields in each message, and buildArcanistLintMessage
withoriginalText
andreplacementText
populated, along with a severity ofArcanistLintSeverity::SEVERITY_AUTOFIX
. This means that the user will receive a prompt asking if they'd like to apply the fixes. 2)Remove the3) Use the existingeslint.fix
flag because it likely causes more confusion that it helps.eslint.fix
flag to toggle this logic for backwards compatibility and as a way of gating these changes.