Skip to content

Commit

Permalink
fix: enable more ruff rules
Browse files Browse the repository at this point in the history
  • Loading branch information
BoboTiG committed Feb 4, 2024
1 parent 2d4b66b commit 4ebe33a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ignore = [
"BLE001",
"C90",
"COM",
"D", # TODO
"D",
"E501",
"EM",
"ERA",
Expand All @@ -48,13 +48,11 @@ ignore = [
"INP001",
"G",
"ISC001",
"PGH003", # TODO
"PTH", # TODO
"PL",
"RUF001",
"RUF002",
"RUF003",
"S", # TODO
"S",
"SLF",
"T201",
"TD",
Expand Down
4 changes: 2 additions & 2 deletions sources/conf.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import os
import sys
from datetime import UTC, datetime
from pathlib import Path

from pygments.lexers.web import PhpLexer
from sphinx.highlighting import lexers

lexers["php"] = PhpLexer(startinline=True, linenos=1)

sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "."))
sys.path.insert(0, f"{Path(__file__).parent}.")

author = "Mickaël Schoentgen"
project = "Base de connaissances du luma"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ def has_function(contract_addr: str, signature: str) -> bool:
return fn_hash in code


contract_addr = "0x00e1656e45f18ec6747F5a8496Fd39B50b38396D" # random
assert has_function(contract_addr, "transfer(address,uint256)")
assert not has_function(contract_addr, "rugMeDaddy(address)")
def check() -> None:
"""
>>> contract_addr = "0x00e1656e45f18ec6747F5a8496Fd39B50b38396D" # random
>>> has_function(contract_addr, "transfer(address,uint256)")
True
>>> has_function(contract_addr, "rugMeDaddy(address)")
False
"""
3 changes: 2 additions & 1 deletion sources/python/web3py-verifier-fonction-contrat-existence.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Fonction bien utile qui renverra `True` si une fonction donnée est présente da
Utilisation :

```{literalinclude} snippets/web3py-verifier-fonction-contrat-existence.py
:lines: 14-16
:lines: 16-20
:dedent:
:language: python
```

Expand Down

0 comments on commit 4ebe33a

Please sign in to comment.