Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#11495)
Browse files Browse the repository at this point in the history
* [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]>
  • Loading branch information
pre-commit-ci[bot] and cclauss authored Jul 23, 2024
1 parent 2d8f22a commit d9ded07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 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.5.2
rev: v0.5.4
hooks:
- id: ruff
- id: ruff-format
Expand Down Expand Up @@ -47,7 +47,7 @@ repos:
- id: validate-pyproject

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.1
rev: v1.11.0
hooks:
- id: mypy
args:
Expand Down
7 changes: 1 addition & 6 deletions web_programming/emails_from_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None
# Check the list of defined attributes.
for name, value in attrs:
# If href is defined, not empty nor # print it and not already in urls.
if (
name == "href"
and value != "#"
and value != ""
and value not in self.urls
):
if name == "href" and value not in (*self.urls, "", "#"):
url = parse.urljoin(self.domain, value)
self.urls.append(url)

Expand Down

0 comments on commit d9ded07

Please sign in to comment.