fix(executor): use math.isclose for float comparison (S1244) #78

Open
Claude wants to merge 1 commit from Claude/backup-script:fix/issue-24-S1244-executor-duration-isclose into master
First-time contributor

Closes #24

Line 241 of src/gardien/core/executor.py compared a float with ==, flagged by SonarQube
python:S1244. Replaced with math.isclose (prod code)
with a small abs_tol=1e-9 tolerance, which preserves the original sentinel-default
semantic (detecting an unset duration_s left at its dataclass default of 0.0)
while satisfying the linter.

No behavior change for passing inputs; tolerates floating-point representational
drift for edge inputs that should still be considered equal.

Closes #24 Line 241 of `src/gardien/core/executor.py` compared a float with `==`, flagged by SonarQube `python:S1244`. Replaced with `math.isclose` (prod code) with a small `abs_tol=1e-9` tolerance, which preserves the original sentinel-default semantic (detecting an unset `duration_s` left at its dataclass default of `0.0`) while satisfying the linter. No behavior change for passing inputs; tolerates floating-point representational drift for edge inputs that should still be considered equal.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u fix/issue-24-S1244-executor-duration-isclose:Claude-fix/issue-24-S1244-executor-duration-isclose
git switch Claude-fix/issue-24-S1244-executor-duration-isclose

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff Claude-fix/issue-24-S1244-executor-duration-isclose
git switch Claude-fix/issue-24-S1244-executor-duration-isclose
git rebase master
git switch master
git merge --ff-only Claude-fix/issue-24-S1244-executor-duration-isclose
git switch Claude-fix/issue-24-S1244-executor-duration-isclose
git rebase master
git switch master
git merge --no-ff Claude-fix/issue-24-S1244-executor-duration-isclose
git switch master
git merge --squash Claude-fix/issue-24-S1244-executor-duration-isclose
git switch master
git merge --ff-only Claude-fix/issue-24-S1244-executor-duration-isclose
git switch master
git merge Claude-fix/issue-24-S1244-executor-duration-isclose
git push origin master
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bc1bb/backup-script!78
No description provided.