Skip to content

tools: fix lint-py with Ruff 0.17.4 - #67792

Open
aduh95 wants to merge 1 commit into
nodejs:mainfrom
aduh95:fix-lint-py
Open

aduh95 wants to merge 1 commit into
nodejs:mainfrom
aduh95:fix-lint-py

Conversation

@aduh95

@aduh95 aduh95 commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

I'm seeing the following error:

ICN001 `datetime` should be imported as `dt`
  --> tools/sbom/generate_sbom.py:14:8
   |
13 | import argparse
14 | import datetime
   |        ^^^^^^^^
15 | import glob
16 | import json
   |
help: Alias `datetime` to `dt`
    |
13  | import argparse
    - import datetime
14  + import datetime as dt
15  | import glob
--------------------------------------------------------------------------------
818 |     'metadata': {
    -       'timestamp': datetime.datetime.now(datetime.timezone.utc).isoformat(),
819 +       'timestamp': dt.datetime.now(dt.timezone.utc).isoformat(),
820 |       'lifecycles': [{'phase': 'build'}],
    |
note: This is an unsafe fix and may change runtime behavior

Was introduced by #66761 /cc @BethGriggs

Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
@nodejs-github-bot nodejs-github-bot added the tools Issues and PRs related to the tools directory. label Nov 26, 2026
@aduh95 aduh95 added author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue PRs queued for automated landing through the Commit Queue. labels Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue PRs queued for automated landing through the Commit Queue. tools Issues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants