diff --git a/pyproject.toml b/pyproject.toml index 38dfed58a..2d8e72a44 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -107,6 +107,7 @@ target-version = "py310" select = [ "C4", "E", + "EXE", "F", "I", "PLR", @@ -120,6 +121,7 @@ ignore = [ "E722", "E731", "E741", + "EXE002", "PLR0124", "PLR0911", "PLR0912", diff --git a/src/__init__.py b/src/__init__.py index b31320ab4..b259a367a 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3 - import sys PYTHON_VERSION = 3, 10 # Minimum python version required diff --git a/src/api/check.py b/src/api/check.py index 7c817a6f4..b2dedbdba 100644 --- a/src/api/check.py +++ b/src/api/check.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim:ts=4:sw=4:et: # ---------------------------------------------------------------------- diff --git a/src/api/config.py b/src/api/config.py index 90e68d515..c60832464 100644 --- a/src/api/config.py +++ b/src/api/config.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim:ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/api/constants.py b/src/api/constants.py index 3e2e74218..67ff04a91 100644 --- a/src/api/constants.py +++ b/src/api/constants.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/api/debug.py b/src/api/debug.py index ed5a1a5e2..24ace48d4 100644 --- a/src/api/debug.py +++ b/src/api/debug.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim:ts=4:sw=4:et: # Simple debugging module diff --git a/src/api/decorator.py b/src/api/decorator.py index e1e6b5155..fa62bdf7f 100644 --- a/src/api/decorator.py +++ b/src/api/decorator.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from collections.abc import Callable diff --git a/src/api/errmsg.py b/src/api/errmsg.py index da6906a90..1c2bf295a 100644 --- a/src/api/errmsg.py +++ b/src/api/errmsg.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/api/exception.py b/src/api/exception.py index 435f9d6c3..01bfb9efb 100644 --- a/src/api/exception.py +++ b/src/api/exception.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim:ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/api/global_.py b/src/api/global_.py index a15eeb1d0..03dd03f22 100644 --- a/src/api/global_.py +++ b/src/api/global_.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim:ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/api/opcodestemps.py b/src/api/opcodestemps.py index cd315ba29..a17aa27b3 100644 --- a/src/api/opcodestemps.py +++ b/src/api/opcodestemps.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - # ---------------------------------------------------------------------- # Copyleft (K), Jose M. Rodriguez-Rosa (a.k.a. Boriel) # diff --git a/src/api/optimize.py b/src/api/optimize.py index e72a99ae4..87d2e7312 100644 --- a/src/api/optimize.py +++ b/src/api/optimize.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python import symtable from collections.abc import Generator from typing import Any, NamedTuple diff --git a/src/api/options.py b/src/api/options.py index e65fb4839..c6508f70d 100644 --- a/src/api/options.py +++ b/src/api/options.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:sw=4:et: # ---------------------------------------------------------------------- diff --git a/src/api/string_labels.py b/src/api/string_labels.py index d33f70861..35a87841c 100644 --- a/src/api/string_labels.py +++ b/src/api/string_labels.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - # ---------------------------------------------------------------------- # Copyleft (K), Jose M. Rodriguez-Rosa (a.k.a. Boriel) # diff --git a/src/api/symboltable/scope.py b/src/api/symboltable/scope.py index 9ae1931d7..2ef7deefc 100644 --- a/src/api/symboltable/scope.py +++ b/src/api/symboltable/scope.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/api/symboltable/symboltable.py b/src/api/symboltable/symboltable.py index 6054d3ad9..d5a9e0eb6 100644 --- a/src/api/symboltable/symboltable.py +++ b/src/api/symboltable/symboltable.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/api/utils.py b/src/api/utils.py index f23c5ea62..78a7f5684 100644 --- a/src/api/utils.py +++ b/src/api/utils.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - import errno import os import shelve diff --git a/src/arch/z80/backend/_16bit.py b/src/arch/z80/backend/_16bit.py index 5ed052a7e..77b1278c4 100644 --- a/src/arch/z80/backend/_16bit.py +++ b/src/arch/z80/backend/_16bit.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - # -------------------------------------------------------------- # Copyleft (k) 2008, by Jose M. Rodriguez-Rosa # (a.k.a. Boriel, http://www.boriel.com) diff --git a/src/arch/z80/backend/_32bit.py b/src/arch/z80/backend/_32bit.py index 3e6133995..0ac274e2a 100644 --- a/src/arch/z80/backend/_32bit.py +++ b/src/arch/z80/backend/_32bit.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - # -------------------------------------------------------------- # Copyleft (k) 2008, by Jose M. Rodriguez-Rosa # (a.k.a. Boriel, http://www.boriel.com) diff --git a/src/arch/z80/backend/_8bit.py b/src/arch/z80/backend/_8bit.py index e3df938a5..6028c9036 100644 --- a/src/arch/z80/backend/_8bit.py +++ b/src/arch/z80/backend/_8bit.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim: ts=4:sw=4:et # -------------------------------------------------------------- diff --git a/src/arch/z80/backend/__init__.py b/src/arch/z80/backend/__init__.py index 0a4750bed..2cf942857 100644 --- a/src/arch/z80/backend/__init__.py +++ b/src/arch/z80/backend/__init__.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from src.arch.z80.optimizer.helpers import HI16, LO16 from src.arch.z80.peephole import engine diff --git a/src/arch/z80/backend/_array.py b/src/arch/z80/backend/_array.py index 4f3a37143..c25c6429f 100644 --- a/src/arch/z80/backend/_array.py +++ b/src/arch/z80/backend/_array.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim:ts=4:et:sw=4: # -------------------------------------------------------------- diff --git a/src/arch/z80/backend/_f16.py b/src/arch/z80/backend/_f16.py index 91df46c5b..771214cb6 100644 --- a/src/arch/z80/backend/_f16.py +++ b/src/arch/z80/backend/_f16.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - # -------------------------------------------------------------- # Copyleft (k) 2008, by Jose M. Rodriguez-Rosa # (a.k.a. Boriel, http://www.boriel.com) diff --git a/src/arch/z80/backend/_float.py b/src/arch/z80/backend/_float.py index 7df7b0871..f1fc0324d 100644 --- a/src/arch/z80/backend/_float.py +++ b/src/arch/z80/backend/_float.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - # -------------------------------------------------------------- # Copyleft (k) 2008, by Jose M. Rodriguez-Rosa # (a.k.a. Boriel, http://www.boriel.com) diff --git a/src/arch/z80/backend/_parray.py b/src/arch/z80/backend/_parray.py index a7938a168..4dd28b105 100644 --- a/src/arch/z80/backend/_parray.py +++ b/src/arch/z80/backend/_parray.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim:ts=4:et:sw=4: # -------------------------------------------------------------- diff --git a/src/arch/z80/backend/_pload.py b/src/arch/z80/backend/_pload.py index c4ee5ae80..99cc9062b 100644 --- a/src/arch/z80/backend/_pload.py +++ b/src/arch/z80/backend/_pload.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim: et:ts=4:sw=4 # -------------------------------------------------------------- diff --git a/src/arch/z80/backend/_str.py b/src/arch/z80/backend/_str.py index 0e238b892..4492b636c 100644 --- a/src/arch/z80/backend/_str.py +++ b/src/arch/z80/backend/_str.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim:ts=4:et:sw=4: # -------------------------------------------------------------- diff --git a/src/arch/z80/backend/common.py b/src/arch/z80/backend/common.py index ad959a0af..d870ca89d 100644 --- a/src/arch/z80/backend/common.py +++ b/src/arch/z80/backend/common.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim ts=4:et:sw=4:ai import math diff --git a/src/arch/z80/backend/exception.py b/src/arch/z80/backend/exception.py index d018b8606..47845e5a9 100644 --- a/src/arch/z80/backend/exception.py +++ b/src/arch/z80/backend/exception.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim:ts=4:et:sw=4: from src.api.exception import Error diff --git a/src/arch/z80/peephole/engine.py b/src/arch/z80/peephole/engine.py index 3c50cc6e2..abb56d743 100644 --- a/src/arch/z80/peephole/engine.py +++ b/src/arch/z80/peephole/engine.py @@ -1,7 +1,4 @@ -#!/usr/bin/env python3 - import os -import sys from collections.abc import Iterable from typing import NamedTuple @@ -161,7 +158,3 @@ def main(list_of_directories: list[str] | None = None, force: bool = False): for directory in list_of_directories or [OPTS_PATH]: read_opts(directory, PATTERNS) - - -if __name__ == "__main__": - main(sys.argv[1:]) diff --git a/src/arch/z80/peephole/parser.py b/src/arch/z80/peephole/parser.py index 2f49b5654..f17959420 100644 --- a/src/arch/z80/peephole/parser.py +++ b/src/arch/z80/peephole/parser.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python3 import re -import sys from collections import defaultdict from types import MappingProxyType from typing import Any, Final, NamedTuple @@ -337,7 +335,3 @@ def parse_file(fname: str): global_.FILENAME = tmp # restores original filename return result - - -if __name__ == "__main__": - print(parse_file(sys.argv[1])) diff --git a/src/arch/z80/visitor/translator.py b/src/arch/z80/visitor/translator.py index 64d511066..da7cdf637 100644 --- a/src/arch/z80/visitor/translator.py +++ b/src/arch/z80/visitor/translator.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from collections import namedtuple import src.api.errmsg diff --git a/src/ast/__init__.py b/src/ast/__init__.py index 95798a877..cf01e415a 100644 --- a/src/ast/__init__.py +++ b/src/ast/__init__.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from .ast import Ast, NodeVisitor, types from .tree import Tree diff --git a/src/ast/ast.py b/src/ast/ast.py index aac88c7d4..0ad86e4b3 100644 --- a/src/ast/ast.py +++ b/src/ast/ast.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/ast/tree.py b/src/ast/tree.py index c14570611..aa5e1ee2a 100644 --- a/src/ast/tree.py +++ b/src/ast/tree.py @@ -1,4 +1,3 @@ -#!/usr/bin/python from __future__ import annotations import collections.abc diff --git a/src/outfmt/__init__.py b/src/outfmt/__init__.py index f35c15ddd..1609a4dd5 100644 --- a/src/outfmt/__init__.py +++ b/src/outfmt/__init__.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from .binary import BinaryEmitter from .codeemitter import CodeEmitter from .sna import SnaEmitter diff --git a/src/outfmt/binary.py b/src/outfmt/binary.py index 26999f504..463521ded 100644 --- a/src/outfmt/binary.py +++ b/src/outfmt/binary.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3 - # -------------------------------------------- # KopyLeft (K) 2008 # by Jose M. Rodriguez de la Rosa diff --git a/src/outfmt/codeemitter.py b/src/outfmt/codeemitter.py index d672708a0..aa19ec687 100644 --- a/src/outfmt/codeemitter.py +++ b/src/outfmt/codeemitter.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3 - # -------------------------------------------- # KopyLeft (K) 2008 # by Jose M. Rodriguez de la Rosa diff --git a/src/outfmt/gensnapshot.py b/src/outfmt/gensnapshot.py index 918e4a238..ba1e5b605 100644 --- a/src/outfmt/gensnapshot.py +++ b/src/outfmt/gensnapshot.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3 - # 48K Snapshot generation module # # © Copyright 2008-2024 José Manuel Rodríguez de la Rosa and contributors. diff --git a/src/outfmt/sna.py b/src/outfmt/sna.py index 58fd55e2c..b934b79d0 100644 --- a/src/outfmt/sna.py +++ b/src/outfmt/sna.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3 - # 48K .SNA format output module # # © Copyright 2008-2024 José Manuel Rodríguez de la Rosa and contributors. diff --git a/src/outfmt/z80.py b/src/outfmt/z80.py index 7298dc40a..2cb44ae46 100644 --- a/src/outfmt/z80.py +++ b/src/outfmt/z80.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3 - # 48K .Z80 format output module # # © Copyright 2008-2024 José Manuel Rodríguez de la Rosa and contributors. diff --git a/src/parsetab/__init__.py b/src/parsetab/__init__.py index 4265cc3e6..e69de29bb 100644 --- a/src/parsetab/__init__.py +++ b/src/parsetab/__init__.py @@ -1 +0,0 @@ -#!/usr/bin/env python diff --git a/src/symbols/arglist.py b/src/symbols/arglist.py index fa586afc9..a7195e165 100644 --- a/src/symbols/arglist.py +++ b/src/symbols/arglist.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - # ---------------------------------------------------------------------- # Copyleft (K), Jose M. Rodriguez-Rosa (a.k.a. Boriel) # diff --git a/src/symbols/argument.py b/src/symbols/argument.py index 61e497f87..87fbd014c 100644 --- a/src/symbols/argument.py +++ b/src/symbols/argument.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/arrayaccess.py b/src/symbols/arrayaccess.py index 378b0ef8f..bf40ea01b 100644 --- a/src/symbols/arrayaccess.py +++ b/src/symbols/arrayaccess.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4: from functools import cached_property from typing import Optional diff --git a/src/symbols/arraydecl.py b/src/symbols/arraydecl.py index 1e62ad898..3aff49d26 100644 --- a/src/symbols/arraydecl.py +++ b/src/symbols/arraydecl.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/arrayload.py b/src/symbols/arrayload.py index 22ea71e83..171e34d93 100644 --- a/src/symbols/arrayload.py +++ b/src/symbols/arrayload.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/asm.py b/src/symbols/asm.py index 88c3d753b..130fc9eb5 100644 --- a/src/symbols/asm.py +++ b/src/symbols/asm.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/binary.py b/src/symbols/binary.py index 919790b54..ab89d3a2a 100644 --- a/src/symbols/binary.py +++ b/src/symbols/binary.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/block.py b/src/symbols/block.py index e80a581f2..e573ba1f1 100644 --- a/src/symbols/block.py +++ b/src/symbols/block.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/bound.py b/src/symbols/bound.py index 111d0d722..e313e9bd4 100644 --- a/src/symbols/bound.py +++ b/src/symbols/bound.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/boundlist.py b/src/symbols/boundlist.py index 29b06d6ab..38ea04d4b 100644 --- a/src/symbols/boundlist.py +++ b/src/symbols/boundlist.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/builtin.py b/src/symbols/builtin.py index 986173b0e..54565d6cc 100644 --- a/src/symbols/builtin.py +++ b/src/symbols/builtin.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - # ---------------------------------------------------------------------- # Copyleft (K), Jose M. Rodriguez-Rosa (a.k.a. Boriel) # diff --git a/src/symbols/call.py b/src/symbols/call.py index 920dbfddd..aebc1d4b1 100644 --- a/src/symbols/call.py +++ b/src/symbols/call.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/constexpr.py b/src/symbols/constexpr.py index bf8fd4ff7..123abdbe6 100644 --- a/src/symbols/constexpr.py +++ b/src/symbols/constexpr.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/funccall.py b/src/symbols/funccall.py index c47030be6..fc973fb42 100644 --- a/src/symbols/funccall.py +++ b/src/symbols/funccall.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/funcdecl.py b/src/symbols/funcdecl.py index 537528ecf..7517fca16 100644 --- a/src/symbols/funcdecl.py +++ b/src/symbols/funcdecl.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/id_/_id.py b/src/symbols/id_/_id.py index b78c5f4e3..93679fad7 100644 --- a/src/symbols/id_/_id.py +++ b/src/symbols/id_/_id.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/nop.py b/src/symbols/nop.py index 1fc13ab2e..0b1e02225 100644 --- a/src/symbols/nop.py +++ b/src/symbols/nop.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/number.py b/src/symbols/number.py index 59067c00e..e4b766ba9 100644 --- a/src/symbols/number.py +++ b/src/symbols/number.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/paramlist.py b/src/symbols/paramlist.py index 403735704..b3e2b285e 100644 --- a/src/symbols/paramlist.py +++ b/src/symbols/paramlist.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/sentence.py b/src/symbols/sentence.py index 7263a8853..5b90fd443 100644 --- a/src/symbols/sentence.py +++ b/src/symbols/sentence.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/string_.py b/src/symbols/string_.py index 13047e770..83b8e9839 100644 --- a/src/symbols/string_.py +++ b/src/symbols/string_.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/strslice.py b/src/symbols/strslice.py index 4903da3cd..8435852bc 100644 --- a/src/symbols/strslice.py +++ b/src/symbols/strslice.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/sym.py b/src/symbols/sym.py index 3e131f74e..4188bed34 100644 --- a/src/symbols/sym.py +++ b/src/symbols/sym.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/symbol_.py b/src/symbols/symbol_.py index f18235296..7f63a3aae 100644 --- a/src/symbols/symbol_.py +++ b/src/symbols/symbol_.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/type_.py b/src/symbols/type_.py index be6ccaaa1..5d48b0c95 100644 --- a/src/symbols/type_.py +++ b/src/symbols/type_.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/typecast.py b/src/symbols/typecast.py index 5a6e0508e..b81af8832 100644 --- a/src/symbols/typecast.py +++ b/src/symbols/typecast.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/unary.py b/src/symbols/unary.py index c1af89af1..5649b43c0 100644 --- a/src/symbols/unary.py +++ b/src/symbols/unary.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/symbols/vardecl.py b/src/symbols/vardecl.py index b74128596..d0bb32f6b 100644 --- a/src/symbols/vardecl.py +++ b/src/symbols/vardecl.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/zxbasm/asm_instruction.py b/src/zxbasm/asm_instruction.py index 0e1ed856a..563f4cd4a 100644 --- a/src/zxbasm/asm_instruction.py +++ b/src/zxbasm/asm_instruction.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4 import re diff --git a/src/zxbasm/z80.py b/src/zxbasm/z80.py index 431177ca6..67704d5a8 100644 --- a/src/zxbasm/z80.py +++ b/src/zxbasm/z80.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim:ts=4:et: from typing import Final, NamedTuple diff --git a/src/zxbc/__init__.py b/src/zxbc/__init__.py index 335b1b66b..375ff7c6c 100644 --- a/src/zxbc/__init__.py +++ b/src/zxbc/__init__.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- diff --git a/src/zxbc/args_config.py b/src/zxbc/args_config.py index c3ae2e59c..64d9e70dc 100644 --- a/src/zxbc/args_config.py +++ b/src/zxbc/args_config.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python3 from __future__ import annotations import os diff --git a/src/zxbpp/prepro/__init__.py b/src/zxbpp/prepro/__init__.py index cb8e793f3..6f2f6ae77 100644 --- a/src/zxbpp/prepro/__init__.py +++ b/src/zxbpp/prepro/__init__.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim: ts=4:sw=4:et: from .args import Arg, ArgList diff --git a/src/zxbpp/prepro/args.py b/src/zxbpp/prepro/args.py index c68d9c066..6ac2cc33c 100644 --- a/src/zxbpp/prepro/args.py +++ b/src/zxbpp/prepro/args.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim:ts=4:et:sw=4: from .macrocall import MacroCall diff --git a/src/zxbpp/prepro/definestable.py b/src/zxbpp/prepro/definestable.py index 6139cbfac..682327fb2 100644 --- a/src/zxbpp/prepro/definestable.py +++ b/src/zxbpp/prepro/definestable.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim: ts=4:sw=4:et: """Class for a Table of Defines. diff --git a/src/zxbpp/prepro/exceptions.py b/src/zxbpp/prepro/exceptions.py index 5c3cc202d..cbd0f9271 100644 --- a/src/zxbpp/prepro/exceptions.py +++ b/src/zxbpp/prepro/exceptions.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python - - class PreprocError(Exception): """Denotes an exception in the preprocessor""" diff --git a/src/zxbpp/prepro/id_.py b/src/zxbpp/prepro/id_.py index cee343c68..6e50cdc71 100644 --- a/src/zxbpp/prepro/id_.py +++ b/src/zxbpp/prepro/id_.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # vim: ts=4:sw=4:et: __doc__ = """ A class for an identifier parsed by the preprocessor. diff --git a/src/zxbpp/prepro/macrocall.py b/src/zxbpp/prepro/macrocall.py index 96853b8ee..af7d5b981 100644 --- a/src/zxbpp/prepro/macrocall.py +++ b/src/zxbpp/prepro/macrocall.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim:ts=4:et:sw=4: import copy diff --git a/src/zxbpp/prepro/output.py b/src/zxbpp/prepro/output.py index c65db7dd3..05fc10887 100644 --- a/src/zxbpp/prepro/output.py +++ b/src/zxbpp/prepro/output.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # vim:ts=4:et:sw=4: """Common output functions for the preprocessor. diff --git a/tests/__init__.py b/tests/__init__.py index c21325ec5..5ace62cdb 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - import os import os.path import sys diff --git a/tests/api/__init__.py b/tests/api/__init__.py index 4265cc3e6..e69de29bb 100644 --- a/tests/api/__init__.py +++ b/tests/api/__init__.py @@ -1 +0,0 @@ -#!/usr/bin/env python diff --git a/tests/api/test_check.py b/tests/api/test_check.py index ac4968c6a..7e5ed55c1 100644 --- a/tests/api/test_check.py +++ b/tests/api/test_check.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - import unittest from src.api import check diff --git a/tests/api/test_config.py b/tests/api/test_config.py index 463d25b0c..5308575c6 100644 --- a/tests/api/test_config.py +++ b/tests/api/test_config.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python import sys import unittest from unittest import mock diff --git a/tests/api/test_symbolTable.py b/tests/api/test_symbolTable.py index 7ac28fcfb..c0a7f69f5 100644 --- a/tests/api/test_symbolTable.py +++ b/tests/api/test_symbolTable.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 - -import unittest from io import StringIO from unittest import TestCase @@ -182,7 +179,3 @@ def clearOutput(self): @property def OUTPUT(self): return OPTIONS.stderr.getvalue() - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/api/test_utils.py b/tests/api/test_utils.py index f0cf8e939..34bb62fb4 100644 --- a/tests/api/test_utils.py +++ b/tests/api/test_utils.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - import unittest from src.api import utils diff --git a/tests/cmdline/__init__.py b/tests/cmdline/__init__.py index 77940f4ec..69b0c613c 100644 --- a/tests/cmdline/__init__.py +++ b/tests/cmdline/__init__.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - import os import os.path import sys diff --git a/tests/symbols/__init__.py b/tests/symbols/__init__.py index 4dad801e0..a8507a547 100644 --- a/tests/symbols/__init__.py +++ b/tests/symbols/__init__.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - import os import sys diff --git a/tests/symbols/test_symbolARGLIST.py b/tests/symbols/test_symbolARGLIST.py index f660fb024..fb39c0ecf 100644 --- a/tests/symbols/test_symbolARGLIST.py +++ b/tests/symbols/test_symbolARGLIST.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 - -import unittest from unittest import TestCase from src.symbols import sym @@ -46,7 +43,3 @@ def test_make_node_single2(self): def test_make_node_fails(self): self.assertRaises(AssertionError, sym.ARGLIST.make_node, "blah") - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/symbols/test_symbolARRAYACCESS.py b/tests/symbols/test_symbolARRAYACCESS.py index ed37df8a2..aed45bacb 100644 --- a/tests/symbols/test_symbolARRAYACCESS.py +++ b/tests/symbols/test_symbolARRAYACCESS.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from io import StringIO from unittest import TestCase diff --git a/tests/symbols/test_symbolBASICTYPE.py b/tests/symbols/test_symbolBASICTYPE.py index a2fc7f9ea..8554d13ac 100644 --- a/tests/symbols/test_symbolBASICTYPE.py +++ b/tests/symbols/test_symbolBASICTYPE.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 - -import unittest from unittest import TestCase from src.api.constants import TYPE @@ -61,7 +58,3 @@ def test_bool(self): self.assertFalse(t) else: self.assertTrue(t) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/symbols/test_symbolBINARY.py b/tests/symbols/test_symbolBINARY.py index 661a9d8b2..de299c314 100644 --- a/tests/symbols/test_symbolBINARY.py +++ b/tests/symbols/test_symbolBINARY.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from io import StringIO from unittest import TestCase diff --git a/tests/symbols/test_symbolBLOCK.py b/tests/symbols/test_symbolBLOCK.py index b2a29cdc3..073c492ce 100644 --- a/tests/symbols/test_symbolBLOCK.py +++ b/tests/symbols/test_symbolBLOCK.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from unittest import TestCase from src.symbols.sym import BLOCK, NUMBER diff --git a/tests/symbols/test_symbolBOUND.py b/tests/symbols/test_symbolBOUND.py index b8f6653af..fe1751952 100644 --- a/tests/symbols/test_symbolBOUND.py +++ b/tests/symbols/test_symbolBOUND.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 - -import unittest from io import StringIO from unittest import TestCase @@ -60,7 +57,3 @@ def clearOutput(self): @property def stderr(self): return OPTIONS.stderr.getvalue() - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/symbols/test_symbolBOUNDLIST.py b/tests/symbols/test_symbolBOUNDLIST.py index 3ba7c4b3e..8313e7dc1 100644 --- a/tests/symbols/test_symbolBOUNDLIST.py +++ b/tests/symbols/test_symbolBOUNDLIST.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 - -import unittest from unittest import TestCase from src.symbols import sym @@ -35,7 +32,3 @@ def test__len__(self): c = sym.BOUND(l3, l4) a = sym.BOUNDLIST(b, c) self.assertEqual(len(a), 2) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/symbols/test_symbolFUNCDECL.py b/tests/symbols/test_symbolFUNCDECL.py index bfe79ec6c..e826b0360 100644 --- a/tests/symbols/test_symbolFUNCDECL.py +++ b/tests/symbols/test_symbolFUNCDECL.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 - -import unittest from unittest import TestCase import src.api.global_ as gl @@ -54,7 +51,3 @@ def test_mangled_(self): def test_make_node(self): f = FUNCDECL.make_node("f", 1, class_=CLASS.function) self.assertIsNotNone(f) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/symbols/test_symbolFUNCTION.py b/tests/symbols/test_symbolFUNCTION.py index 5ea693f09..6573666ff 100644 --- a/tests/symbols/test_symbolFUNCTION.py +++ b/tests/symbols/test_symbolFUNCTION.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 - -import unittest from unittest import TestCase from src.api.constants import CLASS @@ -45,7 +42,3 @@ def test_body_setter(self): self.f.ref.body = body self.assertEqual(len(self.f.body), len(body)) self.assertEqual(self.f.body, body) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/symbols/test_symbolNOP.py b/tests/symbols/test_symbolNOP.py index fc6483df8..d8afe0573 100644 --- a/tests/symbols/test_symbolNOP.py +++ b/tests/symbols/test_symbolNOP.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from unittest import TestCase from src.symbols.sym import NOP diff --git a/tests/symbols/test_symbolNUMBER.py b/tests/symbols/test_symbolNUMBER.py index b23592ce5..f2c01a791 100644 --- a/tests/symbols/test_symbolNUMBER.py +++ b/tests/symbols/test_symbolNUMBER.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 - -import unittest from unittest import TestCase from src.api.constants import TYPE @@ -194,7 +191,3 @@ def test__ge__num_num(self): a = NUMBER(4, 0) b = NUMBER(3, 0) self.assertGreaterEqual(a, b) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/symbols/test_symbolSENTENCE.py b/tests/symbols/test_symbolSENTENCE.py index fee7c024e..a14fd8820 100644 --- a/tests/symbols/test_symbolSENTENCE.py +++ b/tests/symbols/test_symbolSENTENCE.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from unittest import TestCase from src.symbols import sym diff --git a/tests/symbols/test_symbolSTRING.py b/tests/symbols/test_symbolSTRING.py index 2ff3e9634..6ec0d6a4a 100644 --- a/tests/symbols/test_symbolSTRING.py +++ b/tests/symbols/test_symbolSTRING.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 - -import unittest from unittest import TestCase from src.symbols import sym @@ -30,7 +27,3 @@ def test__init__(self): self.assertEqual(s.t, _ZXBASIC) self.assertRaises(AssertionError, sym.STRING.t.fset, s, 0) self.assertEqual(s.value, _zxbasic) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/symbols/test_symbolSTRSLICE.py b/tests/symbols/test_symbolSTRSLICE.py index f1203aeae..a383cc657 100644 --- a/tests/symbols/test_symbolSTRSLICE.py +++ b/tests/symbols/test_symbolSTRSLICE.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 - -import unittest from unittest import TestCase import src.api.global_ as gl @@ -58,7 +55,3 @@ def test_make_node_wrong(self): bad_index = sym.ID("a", 0, type_=gl.SYMBOL_TABLE.basic_types[gl.TYPE.string]).to_var() s = sym.STRSLICE.make_node(1, self.str_, bad_index, bad_index) self.assertIsNone(s) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/symbols/test_symbolTYPE.py b/tests/symbols/test_symbolTYPE.py index f3e4ca07b..b526a567a 100644 --- a/tests/symbols/test_symbolTYPE.py +++ b/tests/symbols/test_symbolTYPE.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 - -import unittest from unittest import TestCase from src.api.constants import TYPE @@ -53,7 +50,3 @@ def test_cmp_types(self): tr = SymbolTYPEREF(Type.unknown, 0) self.assertTrue(tr == Type.unknown) self.assertRaises(AssertionError, tr.__eq__, TYPE.unknown) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/symbols/test_symbolTYPEALIAS.py b/tests/symbols/test_symbolTYPEALIAS.py index 867bee0cd..fc36245d2 100644 --- a/tests/symbols/test_symbolTYPEALIAS.py +++ b/tests/symbols/test_symbolTYPEALIAS.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 - -import unittest from unittest import TestCase from src.api.constants import TYPE @@ -24,7 +21,3 @@ def test_is_alias(self): self.assertTrue(ta.is_alias) self.assertTrue(ta.is_basic) self.assertFalse(t.is_alias) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/symbols/test_symbolTYPECAST.py b/tests/symbols/test_symbolTYPECAST.py index 3ac3f21f4..681aaa396 100644 --- a/tests/symbols/test_symbolTYPECAST.py +++ b/tests/symbols/test_symbolTYPECAST.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from io import StringIO from unittest import TestCase diff --git a/tests/symbols/test_symbolVAR.py b/tests/symbols/test_symbolVAR.py index 6b160c609..d2335f5a2 100644 --- a/tests/symbols/test_symbolVAR.py +++ b/tests/symbols/test_symbolVAR.py @@ -1,6 +1,3 @@ -#!/usr/bin/env python3 - -import unittest from unittest import TestCase from src.api.constants import SCOPE @@ -44,7 +41,3 @@ def test_type_(self): def test_type_fail(self): self.assertRaises(AssertionError, sym.ID.type_.fset, self.v, "blah") - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/symbols/test_symbolVARARRAY.py b/tests/symbols/test_symbolVARARRAY.py index d72db6847..caa273488 100644 --- a/tests/symbols/test_symbolVARARRAY.py +++ b/tests/symbols/test_symbolVARARRAY.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - import functools from unittest import TestCase diff --git a/tools/fixed.py b/tools/fixed.py index 76ce2d070..35738452c 100644 --- a/tools/fixed.py +++ b/tools/fixed.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - # A program that displays fixed point numbers in hexa import sys