Skip to content

Commit

Permalink
Update pre-commit and fix Ruff deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Feb 26, 2024
1 parent dc14f49 commit 2d2748d
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 6 deletions.
16 changes: 11 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
rev: v0.2.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
args: [--exit-non-zero-on-fix]

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.12.1
rev: 24.2.0
hooks:
- id: black
args: [--target-version=py310]
Expand All @@ -25,13 +25,13 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.5.3
rev: 1.7.0
hooks:
- id: pyproject-fmt
additional_dependencies: [tox]

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.15
rev: v0.16
hooks:
- id: validate-pyproject

Expand All @@ -40,6 +40,12 @@ repos:
hooks:
- id: tox-ini-fmt

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
args: [--prose-wrap=always, --print-width=88]

- repo: meta
hooks:
- id: check-hooks-apply
Expand Down
1 change: 1 addition & 0 deletions count_pull_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Process pr_list.jsonl created by download_pull_requests.py and
output a CSV of the number of PRs open per day
"""

from __future__ import annotations

import argparse
Expand Down
1 change: 1 addition & 0 deletions download_issues_prs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Thanks to Ammar Askar
https://discuss.python.org/t/decision-needed-should-we-close-stale-prs-and-how-many-lapsed-days-are-prs-considered-stale/4637/11?u=hugovk
"""

from __future__ import annotations

import argparse
Expand Down
1 change: 1 addition & 0 deletions filter_open_prs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Given a list of BPO issues and open PRs, containing some false positives,
check which PRs are really still open using the GitHub API.
"""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions first_non_ascii_commit.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Find first and total commits with non-ASCII messages and authors
"""

from __future__ import annotations

import time
Expand Down
1 change: 1 addition & 0 deletions issues_by_dev.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Find number of open CPython issues per core dev.
"""

from __future__ import annotations

import argparse
Expand Down
1 change: 1 addition & 0 deletions org_users_2fa.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
List users in an org with 2FA disabled
"""

from __future__ import annotations

import argparse
Expand Down
1 change: 1 addition & 0 deletions potential_closeable_prs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Find open CPython issues that have their linked PRs merged.
They're candidates for closing.
"""

from __future__ import annotations

import argparse
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[tool.ruff]
fix = true

[tool.ruff.lint]
select = [
"C4", # flake8-comprehensions
"E", # pycodestyle errors
Expand All @@ -20,5 +23,5 @@ extend-ignore = [
"E241", # Multiple spaces after ','
]

[tool.ruff.isort]
[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
1 change: 1 addition & 0 deletions time_to_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Process pr_list.jsonl created by download_pull_requests.py and
find time from open to merge in days
"""

from __future__ import annotations

import datetime as dt
Expand Down

0 comments on commit 2d2748d

Please sign in to comment.