From 450a2d21e36abee1705a5b3565a156253fa48e45 Mon Sep 17 00:00:00 2001 From: Hood Chatham Date: Fri, 25 Jun 2021 18:59:29 -0700 Subject: [PATCH] Consolidate apply-lint into clang-format-precommit and fix test_asyncio test after linting html files (#1667) --- Makefile | 3 --- src/tests/test_asyncio.py | 4 ++-- tools/apply-lint.sh | 17 ----------------- tools/clang-format-precommit.sh | 2 +- 4 files changed, 3 insertions(+), 23 deletions(-) delete mode 100755 tools/apply-lint.sh diff --git a/Makefile b/Makefile index 3fcc1165a..121bbee74 100644 --- a/Makefile +++ b/Makefile @@ -157,9 +157,6 @@ lint: node_modules/.installed conftest.py \ docs -apply-lint: - ./tools/apply-lint.sh - benchmark: all python benchmark/benchmark.py $(HOSTPYTHON) build/benchmarks.json python benchmark/plot_benchmark.py build/benchmarks.json build/benchmarks.png diff --git a/src/tests/test_asyncio.py b/src/tests/test_asyncio.py index 5e9dc5d08..0441d5b9a 100644 --- a/src/tests/test_asyncio.py +++ b/src/tests/test_asyncio.py @@ -174,7 +174,7 @@ def test_await_fetch(selenium): """ ) time.sleep(0.1) - msg = "StopIteration: " + msg = "StopIteration: " with pytest.raises(selenium.JavascriptException, match=msg): selenium.run( """ @@ -293,7 +293,7 @@ def test_eval_code_await_fetch(selenium): """ ) time.sleep(0.1) - msg = "StopIteration: " + msg = "StopIteration: " with pytest.raises(selenium.JavascriptException, match=msg): selenium.run( """ diff --git a/tools/apply-lint.sh b/tools/apply-lint.sh deleted file mode 100755 index f11ccc31b..000000000 --- a/tools/apply-lint.sh +++ /dev/null @@ -1,17 +0,0 @@ -FILES="$(git ls-files --others --exclude-standard '*.js' '*.html')" -FILES+=" $(git diff HEAD --name-only '*.js' '*.html')" -if [[ $FILES != " " ]]; then - prettier --write ${FILES} -fi - -FILES="$(git ls-files --others --exclude-standard '*.c' '*.h')" -FILES+=" $(git diff HEAD --name-only '*.c' '*.h')" -if [[ $FILES != " " ]]; then - clang-format-6.0 -i -verbose ${FILES} -fi - -FILES="$(git ls-files --others --exclude-standard '*.py')" -FILES+=" $(git diff HEAD --name-only '*.py')" -if [[ $FILES != " " ]]; then - black ${FILES} -fi diff --git a/tools/clang-format-precommit.sh b/tools/clang-format-precommit.sh index 7679f5cde..84e39b59a 100755 --- a/tools/clang-format-precommit.sh +++ b/tools/clang-format-precommit.sh @@ -6,7 +6,7 @@ if [ -n "$FILES" ]; then git add $FILES fi -FILES=$(git diff --cached --name-only *.js) +FILES=$(git diff --cached --name-only *.js '*.html') if [ -n "$FILES" ]; then # Change files, stage changes ./node_modules/.bin/prettier --write $FILES