From 5c67eeafcac3b1e7ff6a33f38ad4756832bf8632 Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Wed, 10 Jul 2024 01:14:12 +0200 Subject: [PATCH] Repository structure --- LICENSE | 7 +++ README.md | 32 ++++++++++++++ infernal_interpreter/__init__.py | 9 ++-- ruff.toml | 76 ++++++++++++++++++++++++++++++++ setup.py | 3 ++ 5 files changed, 123 insertions(+), 4 deletions(-) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 ruff.toml create mode 100644 setup.py diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..02515fe --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +"THE BEER-WARE LICENSE" (Revision 42): + + wrote this program. As long as you retain this notice you +can do whatever you want with this stuff. If we meet some day, and you think +this stuff is worth it, you can buy me a beer in return. + + Jon Michael Aanes diff --git a/README.md b/README.md new file mode 100644 index 0000000..291793c --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ + + + + + +# Infernal Interpreter & Devious Stack Painter ################################# + +A very simple interpreter and stack tracer for the AMD x86-64 ABI written in +**Python 2**. Does not support all commands, and will never ever do. + +It produces output in either ascii or LaTeX with tikz format. +Compiling the LaTeX requires both a LaTeX compiler, and packages +`preview` and `standalone`. Options can be viewed by running +`./infernal --help`. + +## Tests + +Please ignore the `/tests` folder. It is very old, and unsupported, +but kept for archival purposes. + + +# License + +``` +"THE BEER-WARE LICENSE" (Revision 42): + + wrote this program. As long as you retain this notice you +can do whatever you want with this stuff. If we meet some day, and you think +this stuff is worth it, you can buy me a beer in return. + + Jon Michael Aanes +``` diff --git a/infernal_interpreter/__init__.py b/infernal_interpreter/__init__.py index 856a94c..c10d174 100644 --- a/infernal_interpreter/__init__.py +++ b/infernal_interpreter/__init__.py @@ -1,8 +1,9 @@ -""" -# Infernal Interpreter & Devious Stack Painter ################################# +"""# Infernal Interpreter & Devious Stack Painter. -A very simple interpreter and stack tracer for the AMD x86-64 ABI written in -**Python 2**. Does not support all commands, and will never ever do. +Simple interpreter and stack tracer for the AMD x86-64 ABI. + +Recently updated for Python 3. +Does not support all instructions, and will never ever do. It produces output in either ascii or LaTeX with tikz format. Compiling the LaTeX requires both a LaTeX compiler, and packages diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..4f533b8 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,76 @@ +#[tool.ruff] +lint.select = [ 'ALL' ] +lint.ignore = [ + 'ANN', # Type annotations (lots of work.) + 'FBT', # Boolean trap is bullshit. + 'C90', 'PLR0911', 'PLR0915', 'PLR0913', # Code complexity measures are bullshit. + 'Q003', 'D205', # Format conflict + + 'TCH', # Microoptimization at the cost of readability + + 'D100', 'D101', 'D102', 'D103', 'D104', 'D105', 'D106', 'D107', 'D300', 'D401', # Missing docstrings (lots of work) + 'TD002', 'TD003', 'TD004', 'FIX', # Who cares about TODO standards? + "E501", 'PLR0912', 'PTH123', 'F405', 'E402', 'PLW0603', + + 'SIM102', + + 'TRY002', 'TRY003', +] + +# Autofix +lint.fixable = [ + 'SIM', 'C', 'Q', 'D', + 'UP035', 'UP004', 'UP032', 'UP006', 'UP007', 'I001', + 'F401', 'COM812', 'B011', 'PLR1722', 'PLR0402', 'S101', +] +lint.unfixable = ['SIM102', 'SIM114'] + +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".hg", + ".mypy_cache", + ".nox", + ".pants.d", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "venv", +] + +# Same as Black. +line-length = 88 + +# Allow unused variables when underscore-prefixed. +lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +# Assume Python 3.10. +target-version = "py310" + +[lint.flake8-quotes] +inline-quotes = "single" +multiline-quotes = "double" +docstring-quotes = "double" + +[format] +quote-style = "single" +indent-style = "space" +docstring-code-format = true + +[lint.per-file-ignores] +"test/*" = [ + "S101", # Test Asserts + "T201", # Debug prints + "PLR2004", # magic-value-comparison +] diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..09e8f8e --- /dev/null +++ b/setup.py @@ -0,0 +1,3 @@ + +# Dummy +