Skip to content

Commit d9ded07

Browse files
[pre-commit.ci] pre-commit autoupdate (TheAlgorithms#11495)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.5.2 → v0.5.4](astral-sh/ruff-pre-commit@v0.5.2...v0.5.4) - [github.com/pre-commit/mirrors-mypy: v1.10.1 → v1.11.0](pre-commit/mirrors-mypy@v1.10.1...v1.11.0) * ruff rule PLR1714 Consider merging multiple comparisons * ruff rule RUF005 Consider `[*self.urls, "", "#"]` instead of concatenation * Update emails_from_url.py * Update emails_from_url.py --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Christian Clauss <[email protected]>
1 parent 2d8f22a commit d9ded07

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
- id: auto-walrus
1717

1818
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: v0.5.2
19+
rev: v0.5.4
2020
hooks:
2121
- id: ruff
2222
- id: ruff-format
@@ -47,7 +47,7 @@ repos:
4747
- id: validate-pyproject
4848

4949
- repo: https://github.com/pre-commit/mirrors-mypy
50-
rev: v1.10.1
50+
rev: v1.11.0
5151
hooks:
5252
- id: mypy
5353
args:

web_programming/emails_from_url.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,7 @@ def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None
3131
# Check the list of defined attributes.
3232
for name, value in attrs:
3333
# If href is defined, not empty nor # print it and not already in urls.
34-
if (
35-
name == "href"
36-
and value != "#"
37-
and value != ""
38-
and value not in self.urls
39-
):
34+
if name == "href" and value not in (*self.urls, "", "#"):
4035
url = parse.urljoin(self.domain, value)
4136
self.urls.append(url)
4237

0 commit comments

Comments
 (0)