Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle an arc-autofix-script in lintconfig.yaml.
Summary: This is a continuing part of our effort to move logic from khan-linter into the repos. In this case the logic is the data we append to some lint lines to tell `arc lint` how to fix the lint error. If the repo's lintconfig.yaml says it has such a script, we use it for autofixing. This will allow us to move linters with autofixing, such as our eslint linter, into other repos, which was not possible before. Test Plan: First, I made sure webapp's lintconfig.yaml did //not// have an `arc-autofix-script`, to test legacy behavior. I added this "bad" line to the end of webapp's pubsub.yaml: - t: "4"% I then ran ka-lint pubsub.yaml and it said: Error (S&RX) E=yaml= bad indentation of a sequence entry at line 345, column 9: so it properly ran when no autofix-script was specified. I then added this line to lintconfig.yaml: arc-autofix-script: ["sed", "s/q/QQQ/"] and re-ran `ka-lint pubsub.yaml`. This time it emitted Error (S&RX) E=yaml= bad indentation of a seQQQuence entry at line 345, column 9: showing that the pipe works! Reviewers: benkraft Reviewed By: benkraft Subscribers: kevinb Differential Revision: https://phabricator.khanacademy.org/D63014
- Loading branch information