This repository has been archived by the owner on May 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 865
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tools/runlint.py, which will be automatically run by khan-linter.
Summary: If you install the standard pre-commit hook on the git repo, this will be run on every file you change, so you can make sure you're only committing lint-clean code. Modify the blacklist to actually lint the html in exercises/. I don't know why exercises/ was excluded before. Probably by accident. I also added linting of .git/, because linting stuff in there is just wasted effort. Fix up a few lint errors before turning on the linter. We don't want to have raw $._() in code, they should only be in the "vars" section where we can properly translate them. I guess. Fix a place lint_i18n_strings doesn't work right by using i18nDoNotTranslate. lint_i18n_strings doesn't realize that \text{label + ":"} does not actually have any natural-language text in it, so it wants to translate it. Fixing this looks in source looks unduly complicated, so for now I fix it by wrapping this construct in the new i18nDoNotTranslate. It's good practice for it anyway! I also fixed up finding_percents.html, which I had incorrectly fixed last time. Test Plan: Ran tools/runlint.py exercises/* and got the same behavior as when I ran lint_i18n_files over everything. However, it didn't barf on exercises/test like lint_i18n_files does. I also ran tools/runlint.py *.js && echo hi and it printed 'hi', since there's nothing to lint (yet!) in the *.js files. Ran make lint and saw error mesages like: /home/csilvers/khan/third_party/khan-exercises/exercises/unit_circle.html:1: E212 1 node need to be fixed. Run build/lint_i18n_strings.py with --fix to automatically fix them. but no other errors; that is, the linter is running our new runlint, but nothing else that is introducing errors. (Will test with the rest of the lint fixes later.) Ran python -mSimpleHTTPServer and visited http://localhost:8000/exercises/inequalities_on_a_number_line.html and reloaded until I got 'which graph on the number line represents...' and verified the label before each graph ("A", "B", "C", etc) displayed correctly, and without javascript errors. I also tested http://localhost:8000/exercises/arithmetic_word_problems_2.html http://localhost:8000/exercises/comparing_decimals_1.html http://localhost:8000/exercises/completing_the_square_1.html http://localhost:8000/exercises/completing_the_square_2.html http://localhost:8000/exercises/dividing_fractions_word_problems.html http://localhost:8000/exercises/finding_percents.html looking at both text and hints (and the javascript error console!), to make sure the previous commit is also still ok. Reviewers: eater, alpert Reviewed By: alpert Differential Revision: http://phabricator.khanacademy.org/D3904
- Loading branch information
Showing
9 changed files
with
117 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.