Skip to content

Commit

Permalink
style: format code with Autopep8, Black, Go fmt, Gofumpt, isort and Yapf
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in 6d61ee6 according to the output
from Autopep8, Black, Go fmt, Gofumpt, isort and Yapf.

Details: #479
  • Loading branch information
deepsource-autofix[bot] committed Mar 30, 2024
1 parent 6d61ee6 commit 4573000
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions src/python/code/gnoll/__init__.py
Expand Up @@ -43,13 +43,15 @@ def raise_gnoll_error(value):
raise err


def roll(s,
verbose=False,
mock=None,
mock_const=3,
breakdown=False,
builtins=False,
keep_temp_file=False):
def roll(
s,
verbose=False,
mock=None,
mock_const=3,
breakdown=False,
builtins=False,
keep_temp_file=False,
):
"""Parse some dice notation with GNOLL.
@param s the string to parse
@param verbose whether to enable verbosity (primarily for debug)
Expand All @@ -60,6 +62,7 @@ def roll(s,
@param force_dll_reload destroy the dll/shared object and reload (inadvisable)
@return return code, final result, dice breakdown (None if disabled)
"""

def make_native_type(v):
"""
Change a string to a more appropriate type if possible.
Expand All @@ -86,9 +89,9 @@ def extract_from_dice_file(lines, seperator):
return v

try:
temp = tempfile.NamedTemporaryFile(prefix="gnoll_roll_",
suffix=".die",
delete=False)
temp = tempfile.NamedTemporaryFile(
prefix="gnoll_roll_", suffix=".die", delete=False
)
temp.close()

die_file = temp.name
Expand Down Expand Up @@ -133,9 +136,11 @@ def extract_from_dice_file(lines, seperator):
arg = "".join(sys.argv[1:])
arg = arg if arg != "" else "1d20"
code, r, detailed_r = roll(arg, verbose=False)
print(f"""
print(
f"""
[[GNOLL Results]]
Dice Roll: {arg}
Result: {r}
Exit Code: {code},
Dice Breakdown: {detailed_r}""")
Dice Breakdown: {detailed_r}"""
)

0 comments on commit 4573000

Please sign in to comment.