Skip to content

[WIP] [pre-commit.ci] pre-commit autoupdate - #467

Closed
pre-commit-ci[bot] wants to merge 6 commits into
mainfrom
pre-commit-ci-update-config
Closed

pre-commit-ci[bot] wants to merge 6 commits into
mainfrom
pre-commit-ci-update-config

Conversation

@pre-commit-ci

@pre-commit-ci pre-commit-ci Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

@EZoni
EZoni self-requested a review July 28, 2026 17:33
@EZoni EZoni self-assigned this Jul 28, 2026
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from 8bc4cd5 to 5766d76 Compare August 3, 2026 18:25
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from 55b1b0f to ec3f867 Compare August 10, 2026 18:32
@EZoni EZoni changed the title [pre-commit.ci] pre-commit autoupdate [WIP] [pre-commit.ci] pre-commit autoupdate Aug 10, 2026
@EZoni EZoni added CI/CD Changes related to CI/CD workflows cleaning Changes related to code cleaning labels Aug 10, 2026
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from 1adaceb to 34023be Compare August 17, 2026 18:53
@EZoni
EZoni force-pushed the pre-commit-ci-update-config branch from 34023be to a03e400 Compare August 24, 2026 16:43
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from dda690a to e0ba12a Compare August 24, 2026 18:31
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from ba7cff6 to 08c2278 Compare September 7, 2026 18:31
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from 369c4ad to 0a260b4 Compare September 21, 2026 18:26
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from e2f0324 to a25a1b8 Compare September 28, 2026 18:50
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.15.22 → v0.16.10](astral-sh/ruff-pre-commit@v0.15.22...v0.16.10)
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from 93927d6 to aa62a8d Compare October 5, 2026 19:24
Comment thread .pre-commit-config.yaml
# Run the linter
- id: ruff-check
args: [--fix, --exit-non-zero-on-fix]
args: [--fix, --exit-non-zero-on-fix, "--extend-ignore=ASYNC230,BLE001,SIM117"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are even less trivial than the other rules fixed in this PR, so I'd suggest that we try to resolve them one by one in separate PRs, if necessary and if possible.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, I think SIM117 (combining with contexts) is a bit in conflict with the trame style we have been using so far, most likely because it is the one used in the trame codebase itself. To be double checked whether they adopted the pattern corresponding to this Ruff rule recently as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually see that SIM117 was already applied partially. I may try to redo this manually in a separate PR.

@EZoni EZoni changed the title [WIP] [pre-commit.ci] pre-commit autoupdate [pre-commit.ci] pre-commit autoupdate Oct 8, 2026
@EZoni
EZoni requested a review from RemiLehe October 8, 2026 00:34
@EZoni

EZoni commented Oct 8, 2026

Copy link
Copy Markdown
Member

@RemiLehe

Many fixes were applied automatically by Ruff through pre-commit, others were applied one by one, manually, by myself in b33bfa4.

I think this PR will benefit from an accurate review. I may put the diff into an LLM to see if it catches any bugs that may have been introduced by mistake, but I definitely encourage you to review it independently as well.

This is a good example of a PR where having a comprehesive suite of automated tests could have helped. I think we should work on that sooner or later.

@EZoni

EZoni commented Oct 8, 2026

Copy link
Copy Markdown
Member

Given the amount of code changes, it may conflict with #439 and we may need to decide in which PR we will prefer to resolve conflicts, before deciding which one we will merge first.

@EZoni

EZoni commented Oct 8, 2026

Copy link
Copy Markdown
Member

@RemiLehe

I think it is okay to merge first this PR and then resolve conflicts in #439, so I will go ahead with another round of review on my end, then wait for your review as well.

Comment thread dashboard/sfapi_manager.py Outdated
Comment on lines +56 to +60
expiration = datetime.strptime(credential_client.expiresAt, sfapi_format)
expiration = datetime.strptime(
credential_client.expiresAt, sfapi_format
).astimezone()
# if key is not expired, update info, else set to expired/unavailable
if expiration.replace(tzinfo=None) > datetime.now():
if expiration.replace(tzinfo=None) > datetime.now().astimezone():

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is likely to raise a TypeError because there is a conflict between replace(tzinfo=None) and astimezone().

The original code was also subtly wrong, because it stripped the offset and compared against naive local time.

The correct fix should be to compare two aware datetimes:

expiration = datetime.strptime(credential_client.expiresAt, sfapi_format)
if expiration > datetime.now(timezone.utc):

@EZoni EZoni changed the title [pre-commit.ci] pre-commit autoupdate [WIP] [pre-commit.ci] pre-commit autoupdate Oct 8, 2026
@EZoni

EZoni commented Oct 8, 2026

Copy link
Copy Markdown
Member

Replaced by #470.

@EZoni EZoni closed this Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD Changes related to CI/CD workflows cleaning Changes related to code cleaning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant