Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ repos:
hooks:
- id: doccmd
name: Ruff format docs
language: python
alias: ruff-format-docs
args: ["--language", "python", "--no-pad-file", "--no-pad-groups", "--command", "ruff format", "docs/"]
additional_dependencies:
- ruff==0.14.8
- ruff==0.15.0
- id: doccmd
name: Ruff check fix docs
language: python
alias: ruff-check-fix-docs
args: ["--language", "python", "--no-pad-file", "--no-pad-groups", "--command", "ruff check --fix", "docs/"]
additional_dependencies:
- ruff==0.14.8
- ruff==0.15.0
5 changes: 3 additions & 2 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,9 @@ def upload_to_s3(bucket, key, data):
@backoff.on_exception(
backoff.expo,
ClientError,
giveup=lambda e: e.response["Error"]["Code"]
!= "ProvisionedThroughputExceededException",
giveup=lambda e: (
e.response["Error"]["Code"] != "ProvisionedThroughputExceededException"
),
max_time=30,
)
def write_to_dynamodb(table_name, item):
Expand Down
16 changes: 7 additions & 9 deletions docs/user-guide/event-handlers.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,13 @@ logger = logging.getLogger(__name__)

def structured_log_backoff(details):
logger.warning(
json.dumps(
{
"event": "retry",
"function": details["target"].__name__,
"tries": details["tries"],
"wait": details["wait"],
"elapsed": details["elapsed"],
}
)
json.dumps({
"event": "retry",
"function": details["target"].__name__,
"tries": details["tries"],
"wait": details["wait"],
"elapsed": details["elapsed"],
})
)


Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ docs = [
"zensical==0.0.20",
]
lint = [
"ruff>=0.12.9",
"ruff>=0.15.0",
]
test = [
"coverage>=7.2.7",
Expand Down Expand Up @@ -124,7 +124,7 @@ description = "format code"
dependency_groups = [ "lint" ]
commands = [
[ "ruff", "check", "--fix", { replace = "posargs", default = [ "backoff", "tests" ], extend = true } ],
# [ "ruff", "format", { replace = "posargs", default = [ "backoff", "tests" ], extend = true } ],
[ "ruff", "format", { replace = "posargs", default = [ "backoff", "tests" ], extend = true } ],
]

[tool.tox.env.lint]
Expand Down Expand Up @@ -177,7 +177,10 @@ package = [
]

[tool.ruff]
extend-include = ["docs/**/*.md"]
line-length = 88
preview = true
required-version = ">=0.15"

[tool.ruff.format]
docstring-code-format = true
Expand Down
Loading