Skip to content

Commit

Permalink
Merge pull request #84 from Sonnet-Discord/dev-unstable
Browse files Browse the repository at this point in the history
Sonnet V1.2.11
  • Loading branch information
ultrabear authored Jan 9, 2022
2 parents f224356 + ead1d34 commit 94eb0e7
Show file tree
Hide file tree
Showing 23 changed files with 1,098 additions and 477 deletions.
1 change: 1 addition & 0 deletions .github/workflows/python-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install base deps
run: |
python -m pip install pyflakes mypy
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install base deps
run: |
python -m pip install -r requirements.buildtime.txt # dont pin linter versions
Expand Down Expand Up @@ -56,4 +57,4 @@ jobs:
python -m pip install mariadb
- name: linting pass
run: |
pylint */ -E -j4
pylint **/*.py -E -j4
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ GOCMD=go
GOversion=2.0.0-DEV.3
compilefolder=./libs/compiled

typecheck:
pyflakes .
mypy . --strict --ignore-missing-imports --warn-unreachable

all: ${compilefolder} ./libs/sfdbcloader.c
${CC} -fPIC -shared -Wall -Wextra -Werror -O3 -o ${compilefolder}/sonnet.${version}.so ./libs/sfdbcloader.c

Expand Down
6 changes: 3 additions & 3 deletions build_tools/autotest.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ def main() -> None:

tests: Dict[str, Union[str, Shell]] = {
"pyflakes": "pyflakes .",
"mypy": "mypy . --ignore-missing-imports --strict --warn-unreachable",
"mypy": "mypy . --ignore-missing-imports --strict --warn-unreachable --python-version 3.8",
"yapf": "yapf -drp .",
"pylint": Shell("pylint */ -E -j4"),
"pytype": "pytype .",
"pylint": Shell("pylint **/*.py -E -j4"),
#"pytype": "pytype .",
}

nottest = set(sys.argv[1:])
Expand Down
6 changes: 5 additions & 1 deletion build_tools/cmds_to_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import importlib
import os
import sys
import inspect

from typing import Dict, List, cast

Expand Down Expand Up @@ -59,7 +60,10 @@
if cmd.permission in ["everyone", "moderator", "administrator", "owner"]:
continue
elif isinstance(cmd.permission, (tuple, list)):
if isinstance(cmd.permission[0], str) and cmd.permission[1]:
if isinstance(cmd.permission[0], str) and callable(cmd.permission[1]):
spec = inspect.getfullargspec(cmd.permission[1])
if len(spec.args) > 2: # Support for object instances with self first argument
raise SyntaxError(f"ERROR IN [{cmd.execute.__module__} : {command}] PERMISSION FUNCTION({cmd.permission[1]}) IS NOT VALID (EXPECTED ONE ARGUMENT)")
continue

raise SyntaxError(f"ERROR IN [{cmd.execute.__module__} : {command}] PERMISSION TYPE({cmd.permission}) IS NOT VALID")
Expand Down
2 changes: 1 addition & 1 deletion build_tools/wordlist_adder.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
data = input("> ")
if data in used:
print("Already taken")
elif data and all([(o := ord(i)) >= ord('a') and o <= ord('z') for i in data]):
elif data and all('a' <= i <= 'z' for i in data):
used.add(data)
else:
print("Nil input/contains non a-z")
Expand Down
8 changes: 6 additions & 2 deletions cmds/cmd_automod.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
from typing import Final # pytype: disable=import-error
import lib_constants as constants

re: Any = importlib.import_module(REGEX_VERSION)
# Import re to trick type checker into using re stubs
import re

# Import into globals hashmap to ignore pyflakes redefinition errors
globals()["re"] = importlib.import_module(REGEX_VERSION)

wb_allowedrunes = string.ascii_lowercase + string.digits + ","
urlb_allowedrunes = string.ascii_lowercase + string.digits + "-,."
Expand Down Expand Up @@ -685,4 +689,4 @@ async def add_joinrule(message: discord.Message, args: List[str], client: discor
},
}

version_info: str = "1.2.10"
version_info: str = "1.2.11"
Loading

0 comments on commit 94eb0e7

Please sign in to comment.