From 1ade1a1a0f79b8d6a4343e02fdd6a799115467e3 Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Wed, 18 Mar 2020 11:36:32 -0300 Subject: [PATCH] Fixed moved comment line on qt/aqt/main.py, long variables names on pylib/Makefile and qt/Makefile, and rg --version not going to /dev/null on .github/scripts/trailing-newlines.sh --- .github/scripts/trailing-newlines.sh | 2 +- pylib/Makefile | 8 +++----- qt/Makefile | 14 ++++++-------- qt/aqt/main.py | 2 +- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/scripts/trailing-newlines.sh b/.github/scripts/trailing-newlines.sh index b5fc4bac4..cf27e9695 100755 --- a/.github/scripts/trailing-newlines.sh +++ b/.github/scripts/trailing-newlines.sh @@ -4,7 +4,7 @@ set -eo pipefail # Checking version to force it fail the build if rg is not installed. # Because `set -e` does not work inside the subshell $() -rg --version +rg --version > /dev/null 2>&1 files=$(rg -l '[^\n]\z' -g '!*.{png,svg,scss,json}' || true) if [ "$files" != "" ]; then diff --git a/pylib/Makefile b/pylib/Makefile index a81d32416..a168d00dc 100644 --- a/pylib/Makefile +++ b/pylib/Makefile @@ -1,6 +1,6 @@ SHELL := /bin/bash FIND := $(if $(wildcard /bin/find),/bin/find,/usr/bin/find) -MYPY_IGNORED_IMPORTS := +MYPY_ARGS := ifndef OS OS := unknown @@ -12,9 +12,7 @@ endif # https://anki.tenderapp.com/discussions/beta-testing/1860-error-unused-type-ignore-comment ifneq (${OS},Windows_NT) - ifneq (${UNAME},Darwin) - MYPY_IGNORED_IMPORTS := --warn-unused-ignores - endif + MYPY_ARGS := --warn-unused-ignores endif .SHELLFLAGS := -eu -o pipefail -c @@ -75,7 +73,7 @@ clean: CHECKDEPS := $(shell ${FIND} anki tests -name '*.py' | grep -v buildinfo.py) .build/mypy: $(CHECKDEPS) - python -m mypy ${MYPY_IGNORED_IMPORTS} anki + python -m mypy ${MYPY_ARGS} anki @touch $@ .build/test: $(CHECKDEPS) diff --git a/qt/Makefile b/qt/Makefile index ce9f8961f..9793e0cb8 100644 --- a/qt/Makefile +++ b/qt/Makefile @@ -1,7 +1,7 @@ SHELL := /bin/bash FIND := $(if $(wildcard /bin/find),/bin/find,/usr/bin/find) -MYPY_IGNORED_IMPORTS := -PYLINT_IGNORED_MODULES := +MYPY_ARGS := +PYLINT_ARGS := ifndef OS OS := unknown @@ -13,11 +13,9 @@ endif # https://anki.tenderapp.com/discussions/beta-testing/1860-error-unused-type-ignore-comment ifneq (${OS},Windows_NT) - ifneq (${UNAME},Darwin) - MYPY_IGNORED_IMPORTS := --warn-unused-ignores - endif + MYPY_ARGS := --warn-unused-ignores else - PYLINT_IGNORED_MODULES := --ignored-modules=win32file,pywintypes,socket,win32pipe + PYLINT_ARGS := --ignored-modules=win32file,pywintypes,socket,win32pipe endif .SHELLFLAGS := -eu -o pipefail -c @@ -99,7 +97,7 @@ PYLIB := ../pylib CHECKDEPS := $(shell ${FIND} aqt tests -name '*.py' | grep -v buildinfo.py) .build/mypy: $(CHECKDEPS) .build/qt-stubs - python -m mypy ${MYPY_IGNORED_IMPORTS} aqt + python -m mypy ${MYPY_ARGS} aqt @touch $@ .build/test: $(CHECKDEPS) @@ -107,7 +105,7 @@ CHECKDEPS := $(shell ${FIND} aqt tests -name '*.py' | grep -v buildinfo.py) @touch $@ .build/lint: $(CHECKDEPS) - python -m pylint -j 0 --rcfile=.pylintrc -f colorized ${PYLINT_IGNORED_MODULES} \ + python -m pylint -j 0 --rcfile=.pylintrc -f colorized ${PYLINT_ARGS} \ --extension-pkg-whitelist=PyQt5,ankirspy aqt tests setup.py @touch $@ diff --git a/qt/aqt/main.py b/qt/aqt/main.py index 7b17bf50f..b31d40ebe 100644 --- a/qt/aqt/main.py +++ b/qt/aqt/main.py @@ -1430,9 +1430,9 @@ will be lost. Continue?""" self.maybeHideAccelerators() self.hideStatusTips() elif isWin: + # make sure ctypes is bundled from ctypes import windll, wintypes # type: ignore - # make sure ctypes is bundled _dummy1 = windll _dummy2 = wintypes