Skip to content

[pre-commit.ci] pre-commit autoupdate #12234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 22, 2024
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
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repos:
- id: auto-walrus

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
rev: v0.7.0
hooks:
- id: ruff
- id: ruff-format
Expand All @@ -29,7 +29,7 @@ repos:
- tomli

- repo: https://github.com/tox-dev/pyproject-fmt
rev: "2.3.0"
rev: "2.4.3"
hooks:
- id: pyproject-fmt

Expand All @@ -42,12 +42,12 @@ repos:
pass_filenames: false

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.20.2
rev: v0.21
hooks:
- id: validate-pyproject

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
rev: v1.12.1
hooks:
- id: mypy
args:
Expand Down
12 changes: 6 additions & 6 deletions project_euler/problem_047/sol1.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
def unique_prime_factors(n: int) -> set:
"""
Find unique prime factors of an integer.
Tests include sorting because only the set really matters,
Tests include sorting because only the set matters,
not the order in which it is produced.
>>> sorted(set(unique_prime_factors(14)))
[2, 7]
Expand Down Expand Up @@ -58,7 +58,7 @@ def upf_len(num: int) -> int:

def equality(iterable: list) -> bool:
"""
Check equality of ALL elements in an iterable
Check the equality of ALL elements in an iterable
>>> equality([1, 2, 3, 4])
False
>>> equality([2, 2, 2, 2])
Expand All @@ -69,23 +69,23 @@ def equality(iterable: list) -> bool:
return len(set(iterable)) in (0, 1)


def run(n: int) -> list:
def run(n: int) -> list[int]:
"""
Runs core process to find problem solution.
>>> run(3)
[644, 645, 646]
"""

# Incrementor variable for our group list comprehension.
# This serves as the first number in each list of values
# This is the first number in each list of values
# to test.
base = 2

while True:
# Increment each value of a generated range
group = [base + i for i in range(n)]

# Run elements through out unique_prime_factors function
# Run elements through the unique_prime_factors function
# Append our target number to the end.
checker = [upf_len(x) for x in group]
checker.append(n)
Expand All @@ -98,7 +98,7 @@ def run(n: int) -> list:
base += 1


def solution(n: int = 4) -> int:
def solution(n: int = 4) -> int | None:
"""Return the first value of the first four consecutive integers to have four
distinct prime factors each.
>>> solution()
Expand Down