From eb721dc7e3e60a022f670d7c967adbff78586c2e Mon Sep 17 00:00:00 2001 From: Soxoj Date: Sun, 6 Jun 2021 17:32:04 +0300 Subject: [PATCH] Makefile, some fixes --- Makefile | 35 +++++++++++++++++++++++++++++++++++ format.sh | 5 ----- lint.sh | 11 ----------- maigret/checking.py | 7 ++++++- maigret/resources/data.json | 11 +++++++---- test.sh | 4 ---- 6 files changed, 48 insertions(+), 25 deletions(-) create mode 100644 Makefile delete mode 100755 format.sh delete mode 100755 lint.sh delete mode 100755 test.sh diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5a29d6f --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +LINT_FILES=maigret wizard.py tests + +test: + coverage run --source=./maigret -m pytest tests + coverage report -m + coverage html + +rerun-tests: + pytest --lf + +lint: + @echo 'syntax errors or undefined names' + flake8 --count --select=E9,F63,F7,F82 --show-source --statistics ${LINT_FILES} maigret.py + + @echo 'warning' + flake8 --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --ignore=E731,W503 ${LINT_FILES} maigret.py + + @echo 'mypy' + mypy ${LINT_FILES} + +format: + @echo 'black' + black --skip-string-normalization ${LINT_FILES} + +pull: + git stash + git checkout main + git pull origin head + git stash pop + +clean: + rm -rf reports htmcov dist + +install: + pip3 install . diff --git a/format.sh b/format.sh deleted file mode 100755 index 2ab9411..0000000 --- a/format.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -FILES="maigret wizard.py maigret.py tests" - -echo 'black' -black --skip-string-normalization $FILES \ No newline at end of file diff --git a/lint.sh b/lint.sh deleted file mode 100755 index 47cd520..0000000 --- a/lint.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -FILES="maigret wizard.py maigret.py tests" - -echo 'syntax errors or undefined names' -flake8 --count --select=E9,F63,F7,F82 --show-source --statistics $FILES - -echo 'warning' -flake8 --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --ignore=E731,W503 $FILES - -echo 'mypy' -mypy ./maigret ./wizard.py ./tests \ No newline at end of file diff --git a/maigret/checking.py b/maigret/checking.py index a612a9d..11fcd73 100644 --- a/maigret/checking.py +++ b/maigret/checking.py @@ -1,6 +1,11 @@ import asyncio import logging -from mock import Mock + +try: + from mock import Mock +except ImportError: + from unittest.mock import Mock + import re import ssl import sys diff --git a/maigret/resources/data.json b/maigret/resources/data.json index be1db3f..bda31a8 100644 --- a/maigret/resources/data.json +++ b/maigret/resources/data.json @@ -7883,11 +7883,14 @@ ], "checkType": "message", "absenceStrs": [ - "@context\": \"https://schema.org" + "https://likee.video/@/" ], - "alexaRank": 1072749, - "urlMain": "https://likee.com", - "url": "https://likee.com/user/@{username}/", + "presenseStrs": [ + "user_name" + ], + "alexaRank": 38032, + "url": "https://likee.video/@{username}", + "urlMain": "https://likee.video", "usernameClaimed": "adam", "usernameUnclaimed": "noonewouldeverusethis7" }, diff --git a/test.sh b/test.sh deleted file mode 100755 index e20c419..0000000 --- a/test.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -coverage run --source=./maigret -m pytest tests -coverage report -m -coverage html