Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow extend-allowed-calls for algopy.GlobalState #26

Open
cusma opened this issue Jun 10, 2024 · 1 comment
Open

Allow extend-allowed-calls for algopy.GlobalState #26

cusma opened this issue Jun 10, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@cusma
Copy link

cusma commented Jun 10, 2024

Problem

Declaring a bool as GlobalState (e.g. ):

self.foo = GlobalState(True, description="A boolean")

Raises the following error on linting: FBT003 Boolean positional value in function call

Solution

Add the following Ruff config to pyproject.toml (@daniel-makerx):

[tool.ruff.lint.flake8-boolean-trap]
extend-allowed-calls = ["algopy.GlobalState"]

Dependencies

Needs ruff >= 0.3.5 (to be bumped in AlgoKit init requirements, as is currently set as ruff = "^0.1.6").

@cusma cusma added the enhancement New feature or request label Jun 10, 2024
@aorumbayev
Copy link
Collaborator

@daniel-makerx i suppose unless there is a way to ignore a specific rule in specific file (containing puya imports) the only workaround is to tweak the stub itself ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants