Skip to content

Commit 9d1b595

Browse files
committed
refact: format all with black
1 parent 275a72c commit 9d1b595

51 files changed

Lines changed: 1486 additions & 866 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

setup.py

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,56 @@
22
import pathlib
33
from setuptools import setup
44

5-
packages = [
6-
'src'
7-
]
5+
packages = ["src"]
86

97
# The directory containing this file
108
HERE = pathlib.Path(__file__).parent
119

1210
# The text of the README file
1311
README = (HERE / "README.md").read_text()
1412

15-
package_data = {'': ['*'], 'arch.zx48k.peephole': ['opts/*']}
13+
package_data = {"": ["*"], "arch.zx48k.peephole": ["opts/*"]}
1614

1715
entry_points = {
18-
'console_scripts': ['zxb = src.libzxbc.zxb:main',
19-
'zxbasm = src.libzxbasm.zxbasm:main',
20-
'zxbc = src.libzxbc.zxb:main',
21-
'zxbpp = src.libzxbpp.zxbpp:entry_point']
16+
"console_scripts": [
17+
"zxb = src.libzxbc.zxb:main",
18+
"zxbasm = src.libzxbasm.zxbasm:main",
19+
"zxbc = src.libzxbc.zxb:main",
20+
"zxbpp = src.libzxbpp.zxbpp:entry_point",
21+
]
2222
}
2323

2424
setup_kwargs = {
25-
'name': 'zxbasic',
26-
'version': '1.15.2',
27-
'description': "Boriel's ZX BASIC Compiler",
28-
'classifiers': [
25+
"name": "zxbasic",
26+
"version": "1.15.2",
27+
"description": "Boriel's ZX BASIC Compiler",
28+
"classifiers": [
2929
# How mature is this project? Common values are
3030
# 3 - Alpha
3131
# 4 - Beta
3232
# 5 - Production/Stable
33-
'Development Status :: 5 - Production/Stable',
34-
33+
"Development Status :: 5 - Production/Stable",
3534
# Indicate who your project is intended for
36-
'Intended Audience :: Developers',
37-
'Topic :: Software Development :: Build Tools',
38-
35+
"Intended Audience :: Developers",
36+
"Topic :: Software Development :: Build Tools",
3937
# Pick your license as you wish (should match "license" above)
40-
'License :: OSI Approved :: GNU Affero General Public License v3',
41-
38+
"License :: OSI Approved :: GNU Affero General Public License v3",
4239
# Specify the Python versions you support here. In particular, ensure
4340
# that you indicate whether you support Python 2, Python 3 or both.
44-
'Programming Language :: Python :: 3.6',
45-
'Programming Language :: Python :: 3.8',
41+
"Programming Language :: Python :: 3.6",
42+
"Programming Language :: Python :: 3.8",
4643
],
47-
'long_description_content_type': "text/markdown",
48-
'long_description': README,
49-
'author': 'Jose Rodriguez',
50-
'author_email': 'boriel@gmail.com',
51-
'maintainer': None,
52-
'maintainer_email': None,
53-
'url': 'http://zxbasic.net',
54-
'packages': packages,
55-
'package_data': package_data,
56-
'entry_points': entry_points,
57-
'python_requires': '>=3.6,<4.0',
44+
"long_description_content_type": "text/markdown",
45+
"long_description": README,
46+
"author": "Jose Rodriguez",
47+
"author_email": "boriel@gmail.com",
48+
"maintainer": None,
49+
"maintainer_email": None,
50+
"url": "http://zxbasic.net",
51+
"packages": packages,
52+
"package_data": package_data,
53+
"entry_points": entry_points,
54+
"python_requires": ">=3.6,<4.0",
5855
}
5956

6057
setup(**setup_kwargs)

tests/api/test_arg_parser.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@
44

55

66
class TestArgParser(unittest.TestCase):
7-
""" Test argument options from the cmdline
8-
"""
7+
"""Test argument options from the cmdline"""
8+
99
def setUp(self):
1010
self.parser = parser()
1111

1212
def test_autorun_defaults_to_none(self):
13-
""" Some boolean options, when not specified from the command line
13+
"""Some boolean options, when not specified from the command line
1414
must return None (null) instead of False to preserve .INI saved
1515
value.
1616
"""
1717
options = self.parser.parse_args(["test.bas"])
1818
self.assertIsNone(options.autorun)
1919

2020
def test_loader_defaults_to_none(self):
21-
""" Some boolean options, when not specified from the command line
21+
"""Some boolean options, when not specified from the command line
2222
must return None (null) instead of False to preserve .INI saved
2323
value.
2424
"""

tests/api/test_check.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99

1010
class TestCheck(unittest.TestCase):
11-
""" Tests api.check
12-
"""
11+
"""Tests api.check"""
12+
1313
def test_is_temporary_value_const_string(self):
1414
node = symbols.STRING("Hello world", 1)
1515
self.assertFalse(check.is_temporary_value(node))
@@ -24,5 +24,5 @@ def test_is_temporary_value_param(self):
2424

2525
def test_is_temporary_value_expr(self):
2626
child = symbols.VAR("a", 1)
27-
node = symbols.BINARY('PLUS', child, child, 1)
27+
node = symbols.BINARY("PLUS", child, child, 1)
2828
self.assertTrue(check.is_temporary_value(node))

tests/api/test_config.py

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99

1010
class TestConfig(unittest.TestCase):
11-
""" Tests api.config initialization
12-
"""
11+
"""Tests api.config initialization"""
12+
1313
def setUp(self):
1414
config.OPTIONS(config.Action.CLEAR)
1515
config.init()
@@ -29,8 +29,8 @@ def test_init(self):
2929
self.assertEqual(config.OPTIONS.force_asm_brackets, False)
3030
self.assertEqual(config.OPTIONS.use_basic_loader, False)
3131
self.assertEqual(config.OPTIONS.autorun, False)
32-
self.assertEqual(config.OPTIONS.output_file_type, 'bin')
33-
self.assertEqual(config.OPTIONS.include_path, '')
32+
self.assertEqual(config.OPTIONS.output_file_type, "bin")
33+
self.assertEqual(config.OPTIONS.include_path, "")
3434
self.assertEqual(config.OPTIONS.memory_check, False)
3535
self.assertEqual(config.OPTIONS.strict_bool, False)
3636
self.assertEqual(config.OPTIONS.array_check, False)
@@ -40,58 +40,61 @@ def test_init(self):
4040
self.assertEqual(config.OPTIONS.expected_warnings, 0)
4141

4242
# private options that cannot be accessed with #pragma
43-
self.assertEqual(config.OPTIONS['__DEFINES'].value, {})
43+
self.assertEqual(config.OPTIONS["__DEFINES"].value, {})
4444
self.assertEqual(config.OPTIONS.explicit, False)
4545
self.assertEqual(config.OPTIONS.sinclair, False)
4646
self.assertEqual(config.OPTIONS.strict, False)
4747

4848
def test_initted_values(self):
49-
self.assertEqual(sorted(config.OPTIONS._options.keys()), [
50-
'__DEFINES',
51-
config.OPTION.ARCH,
52-
config.OPTION.ARRAY_BASE,
53-
config.OPTION.CHECK_ARRAYS,
54-
config.OPTION.AUTORUN,
55-
config.OPTION.CASE_INS,
56-
config.OPTION.DEBUG,
57-
config.OPTION.DEFAULT_BYREF,
58-
config.OPTION.EMIT_BACKEND,
59-
config.OPTION.ENABLE_BREAK,
60-
config.OPTION.EXPECTED_WARNINGS,
61-
config.OPTION.EXPLICIT,
62-
config.OPTION.FORCE_ASM_BRACKET,
63-
config.OPTION.HIDE_WARNING_CODES,
64-
config.OPTION.INCLUDE_PATH,
65-
config.OPTION.INPUT_FILENAME,
66-
config.OPTION.MAX_SYN_ERRORS,
67-
config.OPTION.CHECK_MEMORY,
68-
config.OPTION.MEMORY_MAP,
69-
config.OPTION.O_LEVEL,
70-
config.OPTION.OUTPUT_FILE_TYPE,
71-
config.OPTION.OUTPUT_FILENAME,
72-
'project_filename',
73-
'sinclair',
74-
config.OPTION.STDERR,
75-
config.OPTION.STDERR_FILENAME,
76-
config.OPTION.STDIN,
77-
config.OPTION.STDOUT,
78-
config.OPTION.STRICT,
79-
config.OPTION.STRICT_BOOL,
80-
config.OPTION.STR_BASE,
81-
config.OPTION.USE_BASIC_LOADER,
82-
config.OPTION.ASM_ZXNEXT
83-
])
49+
self.assertEqual(
50+
sorted(config.OPTIONS._options.keys()),
51+
[
52+
"__DEFINES",
53+
config.OPTION.ARCH,
54+
config.OPTION.ARRAY_BASE,
55+
config.OPTION.CHECK_ARRAYS,
56+
config.OPTION.AUTORUN,
57+
config.OPTION.CASE_INS,
58+
config.OPTION.DEBUG,
59+
config.OPTION.DEFAULT_BYREF,
60+
config.OPTION.EMIT_BACKEND,
61+
config.OPTION.ENABLE_BREAK,
62+
config.OPTION.EXPECTED_WARNINGS,
63+
config.OPTION.EXPLICIT,
64+
config.OPTION.FORCE_ASM_BRACKET,
65+
config.OPTION.HIDE_WARNING_CODES,
66+
config.OPTION.INCLUDE_PATH,
67+
config.OPTION.INPUT_FILENAME,
68+
config.OPTION.MAX_SYN_ERRORS,
69+
config.OPTION.CHECK_MEMORY,
70+
config.OPTION.MEMORY_MAP,
71+
config.OPTION.O_LEVEL,
72+
config.OPTION.OUTPUT_FILE_TYPE,
73+
config.OPTION.OUTPUT_FILENAME,
74+
"project_filename",
75+
"sinclair",
76+
config.OPTION.STDERR,
77+
config.OPTION.STDERR_FILENAME,
78+
config.OPTION.STDIN,
79+
config.OPTION.STDOUT,
80+
config.OPTION.STRICT,
81+
config.OPTION.STRICT_BOOL,
82+
config.OPTION.STR_BASE,
83+
config.OPTION.USE_BASIC_LOADER,
84+
config.OPTION.ASM_ZXNEXT,
85+
],
86+
)
8487

8588
def test_loader_ignore_none(self):
86-
""" Some settings must ignore "None" assignments, since
89+
"""Some settings must ignore "None" assignments, since
8790
this means the user didn't specify anything from the command line
8891
"""
8992
config.OPTIONS.use_basic_loader = True
9093
config.OPTIONS.use_basic_loader = None
9194
self.assertEqual(config.OPTIONS.use_basic_loader, True)
9295

9396
def test_autorun_ignore_none(self):
94-
""" Some settings must ignore "None" assignments, since
97+
"""Some settings must ignore "None" assignments, since
9598
this means the user didn't specify anything from the command line
9699
"""
97100
config.OPTIONS.autorun = True

0 commit comments

Comments
 (0)