Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow repos to override khan-linter's linting on a per-language basis.
Summary: Khan-linter now looks for a config file in a repo, before deciding how to lint any files in that repo. If it finds one, it sees if the config file has its own rules for how to lint that file. If so, it does those rules rather than its built-in ones. This will let us migrate linters from khan-linter to webapp piece-by-piece, without having to change khan-linter each time we do so. It also means we don't have to worry about forward- and backward-compability as people change branches, since any new webapp linters will be committed in the same commit as the config-file change. Issue: TODO Test Plan: I created this lintconfig.yaml in webapp: ``` khan-linter-overrides: yaml: - ["echo", "hi""] ``` and ran ka-lint lintconfig.yaml and it emitted: hi lintconfig.yaml like the new rule said! I then ran `ka-lint main.py` and it did not print `hi`. I then ran cd assignments; ka-lint ../lintconfig.yaml and it said ka-lint lintconfig.yaml again, because we run stuff from webapp-root. That may yield a bit of a surprise to folks that lint is being run in a different directory than they're in, but hopefully it won't be too bad. Reviewers: benkraft, aviddy Reviewed By: benkraft Subscribers: davidbraley, kevinb Differential Revision: https://phabricator.khanacademy.org/D62448
- Loading branch information