Skip to content

Lint and code-munging tools for Khan Academy codebase

License

Notifications You must be signed in to change notification settings

Khan/khan-linter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

bfdfbe5 · Oct 7, 2024
Jun 4, 2020
Oct 18, 2019
Apr 15, 2020
Oct 7, 2024
Jul 14, 2015
Apr 27, 2017
Jan 10, 2020
Dec 21, 2011
Apr 3, 2024
Apr 27, 2017
Sep 11, 2015
May 7, 2024
Jan 11, 2018
Nov 9, 2018
Dec 21, 2016
Aug 1, 2019
Mar 31, 2016
Oct 5, 2017
Nov 9, 2018
Aug 1, 2019
Apr 3, 2024
Oct 7, 2024
Oct 7, 2024
Mar 18, 2020
Apr 3, 2024
Oct 18, 2019
Mar 31, 2016
Jul 11, 2022
Jan 10, 2017
Apr 3, 2024
Oct 7, 2024
Apr 15, 2020
Apr 15, 2020
Oct 7, 2024
Oct 7, 2024
Apr 3, 2024
Apr 14, 2017
Apr 3, 2024
Apr 29, 2020
Nov 9, 2018
Apr 9, 2020

Repository files navigation

This repository contains linting tools for Khan Academy's codebase.

It uses existing linting tools (pep8, pyflakes, jshint, etc), but has been modified to suit Khan Academy's slightly different style guides.

This repository also contains a wrapper scripts that can be used as a pre-commit hook for Git.

Installation

You should add the local bin/ directory to your system $PATH, for example:

export PATH=$PATH:~/path/to/khan-linter/bin

All dependencies are vendored within the repository itself, so no installation beyond cloning this repository is required.

Usage

Manual

If you would like to lint manually, invoke /path/to/runlint.py or ka-lint.

By default, this will lint all files under the current directory. Alternately, you can specify files on the command line to lint. See

ka-lint --help

for more options.

Automatic

You can update the blacklist file in this repository to control what files should not be linted at all. Alternately, you can create a blacklist of your own, and use the --blacklist_file flag to runlint.py (you'll have to modify hghook.py or githook.py to pass in the name of the blacklist file as well).

To suppress the lint check, set the environment variable FORCE_COMMIT=1 prior to calling git commit.