bento icon indicating copy to clipboard operation
bento copied to clipboard

Support and respect underlying tool's `--fix` feature

Open dlukeomalley opened this issue 6 years ago • 4 comments

Proposal is to respect, where possible, a tool's underlying fixes. Related ask from a user:

I also wouldn't mind a way to apply changes (kind of like python's 2to3 converts files).

dlukeomalley avatar Oct 22 '19 21:10 dlukeomalley

Honestly https://libcst.readthedocs.io is way better than 2to3 for enabling this feature. See https://github.com/returntocorp/r2c-authentication-checks/pull/4 for previous work!

ulziibay avatar Oct 24 '19 20:10 ulziibay

@ulziibay unfortunately libCST only supports python 3.5+ as input, so it couldn't do 2to3 workflow

ievans avatar Nov 05 '19 21:11 ievans

User comment:

  • There were some things that would be nice to fix, but would be a pain to go through and manually fix them. Ex: == vs ===. Would be nice to have something like tslint's tslint --fix.

dlukeomalley avatar Nov 08 '19 16:11 dlukeomalley

Spatch can also implement easily many autofixes. See https://github.com/facebookarchive/pfff/wiki/Spatch I have a version that can work on many languages that is similar to the recent paper by claire Goues on parser combinators for program transformation.

aryx avatar Nov 11 '19 08:11 aryx