mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
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
This commit is contained in:
parent
802c5b59cb
commit
1ade1a1a0f
4 changed files with 11 additions and 15 deletions
2
.github/scripts/trailing-newlines.sh
vendored
2
.github/scripts/trailing-newlines.sh
vendored
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
14
qt/Makefile
14
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 $@
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue