mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12: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.
|
# Checking version to force it fail the build if rg is not installed.
|
||||||
# Because `set -e` does not work inside the subshell $()
|
# 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)
|
files=$(rg -l '[^\n]\z' -g '!*.{png,svg,scss,json}' || true)
|
||||||
if [ "$files" != "" ]; then
|
if [ "$files" != "" ]; then
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
SHELL := /bin/bash
|
SHELL := /bin/bash
|
||||||
FIND := $(if $(wildcard /bin/find),/bin/find,/usr/bin/find)
|
FIND := $(if $(wildcard /bin/find),/bin/find,/usr/bin/find)
|
||||||
MYPY_IGNORED_IMPORTS :=
|
MYPY_ARGS :=
|
||||||
|
|
||||||
ifndef OS
|
ifndef OS
|
||||||
OS := unknown
|
OS := unknown
|
||||||
|
@ -12,9 +12,7 @@ endif
|
||||||
|
|
||||||
# https://anki.tenderapp.com/discussions/beta-testing/1860-error-unused-type-ignore-comment
|
# https://anki.tenderapp.com/discussions/beta-testing/1860-error-unused-type-ignore-comment
|
||||||
ifneq (${OS},Windows_NT)
|
ifneq (${OS},Windows_NT)
|
||||||
ifneq (${UNAME},Darwin)
|
MYPY_ARGS := --warn-unused-ignores
|
||||||
MYPY_IGNORED_IMPORTS := --warn-unused-ignores
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.SHELLFLAGS := -eu -o pipefail -c
|
.SHELLFLAGS := -eu -o pipefail -c
|
||||||
|
@ -75,7 +73,7 @@ clean:
|
||||||
CHECKDEPS := $(shell ${FIND} anki tests -name '*.py' | grep -v buildinfo.py)
|
CHECKDEPS := $(shell ${FIND} anki tests -name '*.py' | grep -v buildinfo.py)
|
||||||
|
|
||||||
.build/mypy: $(CHECKDEPS)
|
.build/mypy: $(CHECKDEPS)
|
||||||
python -m mypy ${MYPY_IGNORED_IMPORTS} anki
|
python -m mypy ${MYPY_ARGS} anki
|
||||||
@touch $@
|
@touch $@
|
||||||
|
|
||||||
.build/test: $(CHECKDEPS)
|
.build/test: $(CHECKDEPS)
|
||||||
|
|
14
qt/Makefile
14
qt/Makefile
|
@ -1,7 +1,7 @@
|
||||||
SHELL := /bin/bash
|
SHELL := /bin/bash
|
||||||
FIND := $(if $(wildcard /bin/find),/bin/find,/usr/bin/find)
|
FIND := $(if $(wildcard /bin/find),/bin/find,/usr/bin/find)
|
||||||
MYPY_IGNORED_IMPORTS :=
|
MYPY_ARGS :=
|
||||||
PYLINT_IGNORED_MODULES :=
|
PYLINT_ARGS :=
|
||||||
|
|
||||||
ifndef OS
|
ifndef OS
|
||||||
OS := unknown
|
OS := unknown
|
||||||
|
@ -13,11 +13,9 @@ endif
|
||||||
|
|
||||||
# https://anki.tenderapp.com/discussions/beta-testing/1860-error-unused-type-ignore-comment
|
# https://anki.tenderapp.com/discussions/beta-testing/1860-error-unused-type-ignore-comment
|
||||||
ifneq (${OS},Windows_NT)
|
ifneq (${OS},Windows_NT)
|
||||||
ifneq (${UNAME},Darwin)
|
MYPY_ARGS := --warn-unused-ignores
|
||||||
MYPY_IGNORED_IMPORTS := --warn-unused-ignores
|
|
||||||
endif
|
|
||||||
else
|
else
|
||||||
PYLINT_IGNORED_MODULES := --ignored-modules=win32file,pywintypes,socket,win32pipe
|
PYLINT_ARGS := --ignored-modules=win32file,pywintypes,socket,win32pipe
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.SHELLFLAGS := -eu -o pipefail -c
|
.SHELLFLAGS := -eu -o pipefail -c
|
||||||
|
@ -99,7 +97,7 @@ PYLIB := ../pylib
|
||||||
CHECKDEPS := $(shell ${FIND} aqt tests -name '*.py' | grep -v buildinfo.py)
|
CHECKDEPS := $(shell ${FIND} aqt tests -name '*.py' | grep -v buildinfo.py)
|
||||||
|
|
||||||
.build/mypy: $(CHECKDEPS) .build/qt-stubs
|
.build/mypy: $(CHECKDEPS) .build/qt-stubs
|
||||||
python -m mypy ${MYPY_IGNORED_IMPORTS} aqt
|
python -m mypy ${MYPY_ARGS} aqt
|
||||||
@touch $@
|
@touch $@
|
||||||
|
|
||||||
.build/test: $(CHECKDEPS)
|
.build/test: $(CHECKDEPS)
|
||||||
|
@ -107,7 +105,7 @@ CHECKDEPS := $(shell ${FIND} aqt tests -name '*.py' | grep -v buildinfo.py)
|
||||||
@touch $@
|
@touch $@
|
||||||
|
|
||||||
.build/lint: $(CHECKDEPS)
|
.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
|
--extension-pkg-whitelist=PyQt5,ankirspy aqt tests setup.py
|
||||||
@touch $@
|
@touch $@
|
||||||
|
|
||||||
|
|
|
@ -1430,9 +1430,9 @@ will be lost. Continue?"""
|
||||||
self.maybeHideAccelerators()
|
self.maybeHideAccelerators()
|
||||||
self.hideStatusTips()
|
self.hideStatusTips()
|
||||||
elif isWin:
|
elif isWin:
|
||||||
|
# make sure ctypes is bundled
|
||||||
from ctypes import windll, wintypes # type: ignore
|
from ctypes import windll, wintypes # type: ignore
|
||||||
|
|
||||||
# make sure ctypes is bundled
|
|
||||||
_dummy1 = windll
|
_dummy1 = windll
|
||||||
_dummy2 = wintypes
|
_dummy2 = wintypes
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue