From ce68e5ee36ca2da4910b3933b9281b9664fe4fca Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 19 Apr 2026 11:37:52 -0700 Subject: [PATCH] Linter additions and adding ingress controllers to the diagrams --- wiki-resources/diagrams/__main__.py | 12 ++++--- wiki-resources/pyproject.toml | 55 +++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 wiki-resources/pyproject.toml diff --git a/wiki-resources/diagrams/__main__.py b/wiki-resources/diagrams/__main__.py index ab2ae74..6e9e3de 100644 --- a/wiki-resources/diagrams/__main__.py +++ b/wiki-resources/diagrams/__main__.py @@ -7,8 +7,9 @@ from diagrams import Cluster from diagrams import Diagram from diagrams.k8s.compute import Pod from diagrams.k8s.network import Service -from diagrams.custom import Custom +from diagrams.k8s.network import Ingress from diagrams.generic.compute import Rack +from diagrams.generic.blank import Blank from personal import Gitea from personal import StaticSite @@ -21,7 +22,10 @@ if __name__ == '__main__': git = Gitea('Gitea') >> nginx tmp = StaticSite('Temper Blog') >> nginx dev = StaticSite('Dev Blog') >> nginx + _ = nginx >> Blank() with Cluster('Namespace - playground'): - s = Pod('Sanity') >> Service('sanity.shockrah.xyz') - u = Pod('Uptime') >> Service('uptime.shockrah.xyz') - p = Pod('Wiki') >> Service('wiki.shockrah.xyz') + ingress = Ingress('Nginx Controller') + s = Pod('Sanity') >> Service('sanity.shockrah.xyz') >> ingress + u = Pod('Uptime') >> Service('uptime.shockrah.xyz') >> ingress + p = Pod('Wiki') >> Service('wiki.shockrah.xyz') >> ingress + _ = ingress >> Blank() diff --git a/wiki-resources/pyproject.toml b/wiki-resources/pyproject.toml new file mode 100644 index 0000000..ee98d6d --- /dev/null +++ b/wiki-resources/pyproject.toml @@ -0,0 +1,55 @@ +[tool.ruff] +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".ipynb_checkpoints", + ".mypy_cache", + ".nox", + ".pants.d", + ".pyenv", + ".pytest_cache", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + ".vscode", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "site-packages", + "venv", +] + +line-length = 80 +indent-width = 4 + +# Assume Python 3.10 +target-version = "py310" + +[tool.ruff.lint] +# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. +# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or +# McCabe complexity (`C901`) by default. +select = ["E4", "E7", "E9", "F"] +ignore = [] + +# Allow fix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[tool.ruff.format] +# Like Black, use double quotes for strings. +quote-style = "single" +