Skip to content

Commit

Permalink
chore: adding initial logic error exposer
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev committed Dec 3, 2024
1 parent 95613b9 commit 04f8457
Show file tree
Hide file tree
Showing 9 changed files with 403 additions and 71 deletions.
21 changes: 10 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,25 @@
"**/__pycache__": true,
".idea": true
},

// Python
"platformSettings.autoLoad": true,
"python.defaultInterpreterPath": "${workspaceFolder}/.venv",
"python.analysis.extraPaths": ["${workspaceFolder}/src"],
"python.analysis.extraPaths": [
"${workspaceFolder}/src"
],
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
},
"python.analysis.exclude": [
"**/artifacts/**",
"tests/artifacts/**"
],
"python.analysis.typeCheckingMode": "basic",
"ruff.enable": true,
"ruff.lint.run": "onSave",
"ruff.lint.args": ["--config=pyproject.toml"],
"ruff.lint.args": [
"--config=pyproject.toml"
],
"ruff.importStrategy": "fromEnvironment",
"ruff.fixAll": true, //lint and fix all files in workspace
"ruff.organizeImports": true, //organize imports on save
Expand All @@ -37,7 +44,6 @@
"ruff.codeAction.fixViolation": {
"enable": true
},

"mypy.configFile": "pyproject.toml",
// set to empty array to use config from project
"mypy.targets": [],
Expand All @@ -52,11 +58,4 @@
}
]
},

// PowerShell
"[powershell]": {
"editor.defaultFormatter": "ms-vscode.powershell"
},
"powershell.codeFormatting.preset": "Stroustrup",
"python.testing.pytestArgs": ["."]
}
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,15 @@ lint.ignore = [
"Q002", # bad quotes docstring
"Q003", # avoidable escaped quotes
"W191", # indentation contains tabs
"ERA001", # commented out code
]
# Exclude a variety of commonly ignored directories.
extend-exclude = [
"docs",
".git",
".mypy_cache",
".ruff_cache",

"tests/artifacts",
]
# Assume Python 3.10.
target-version = "py310"
Expand All @@ -127,7 +128,7 @@ suppress-none-returning = true

[tool.ruff.lint.per-file-ignores]
"src/algokit_utils/beta/*" = ["ERA001", "E501", "PLR0911"]
"path/to/file.py" = ["E402"]
"src/algokit_utils/applications/app_client.py" = ["SLF001"]
"tests/clients/test_algorand_client.py" = ["ERA001"]

[tool.poe.tasks]
Expand All @@ -140,7 +141,7 @@ pythonpath = ["src", "tests"]

[tool.mypy]
files = ["src", "tests"]
exclude = ["dist"]
exclude = ["dist", "tests/artifacts"]
python_version = "3.10"
warn_unused_ignores = true
warn_redundant_casts = true
Expand Down
2 changes: 1 addition & 1 deletion src/algokit_utils/_legacy_v2/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class AppChanges:
schema_change_description: str | None


def check_for_app_changes( # noqa: PLR0913
def check_for_app_changes(
algod_client: "AlgodClient",
*,
new_approval: bytes,
Expand Down
5 changes: 4 additions & 1 deletion src/algokit_utils/_legacy_v2/logic_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from copy import copy
from typing import TYPE_CHECKING, TypedDict

from deprecated import deprecated

from algokit_utils._legacy_v2.models import SimulationTrace

if TYPE_CHECKING:
Expand Down Expand Up @@ -37,8 +39,9 @@ def parse_logic_error(
}


@deprecated(reason="Use algokit_utils.models.error.LogicError instead", version="3.0.0")
class LogicError(Exception):
def __init__( # noqa: PLR0913
def __init__(
self,
*,
logic_error_str: str,
Expand Down
Loading

0 comments on commit 04f8457

Please sign in to comment.