Skip to content

Commit

Permalink
Update deprecated linter settings
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotwutingfeng committed Feb 22, 2024
1 parent 22f2ff7 commit d7001c6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ strict = true
addopts = "--doctest-modules"

[tool.ruff]
select = [
lint.select = [
"A",
"B",
"C",
Expand All @@ -97,9 +97,9 @@ select = [
"UP",
"W",
]
ignore = [
lint.ignore = [
"E501", # line too long; if Black does its job, not worried about the rare long line
]

[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "pep257"
6 changes: 2 additions & 4 deletions tldextract/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ def md5(*args: bytes) -> hashlib._Hash:


def get_pkg_unique_identifier() -> str:
"""
Generate an identifier unique to the python version, tldextract version, and python instance.
"""Generate an identifier unique to the python version, tldextract version, and python instance.
This will prevent interference between virtualenvs and issues that might arise when installing
a new version of tldextract
Expand All @@ -66,8 +65,7 @@ def get_pkg_unique_identifier() -> str:


def get_cache_dir() -> str:
"""
Get a cache dir that we have permission to write to.
"""Get a cache dir that we have permission to write to.
Try to follow the XDG standard, but if that doesn't work fallback to the package directory
http://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
Expand Down
1 change: 0 additions & 1 deletion tldextract/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from ipaddress import AddressValueError, IPv6Address
from urllib.parse import scheme_chars


IP_RE = re.compile(
r"^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.)"
r"{3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
Expand Down
15 changes: 5 additions & 10 deletions tldextract/tldextract.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ class ExtractResult:

@property
def registered_domain(self) -> str:
"""
Joins the domain and suffix fields with a dot, if they're both set.
"""Joins the domain and suffix fields with a dot, if they're both set.
>>> extract('http://forums.bbc.co.uk').registered_domain
'bbc.co.uk'
Expand All @@ -89,8 +88,7 @@ def registered_domain(self) -> str:

@property
def fqdn(self) -> str:
"""
Returns a Fully Qualified Domain Name, if there is a proper domain/suffix.
"""Returns a Fully Qualified Domain Name, if there is a proper domain/suffix.
>>> extract('http://forums.bbc.co.uk/path/to/file').fqdn
'forums.bbc.co.uk'
Expand All @@ -103,8 +101,7 @@ def fqdn(self) -> str:

@property
def ipv4(self) -> str:
"""
Returns the ipv4 if that is what the presented domain/url is.
"""Returns the ipv4 if that is what the presented domain/url is.
>>> extract('http://127.0.0.1/path/to/file').ipv4
'127.0.0.1'
Expand All @@ -123,8 +120,7 @@ def ipv4(self) -> str:

@property
def ipv6(self) -> str:
"""
Returns the ipv6 if that is what the presented domain/url is.
"""Returns the ipv6 if that is what the presented domain/url is.
>>> extract('http://[aBcD:ef01:2345:6789:aBcD:ef01:127.0.0.1]/path/to/file').ipv6
'aBcD:ef01:2345:6789:aBcD:ef01:127.0.0.1'
Expand Down Expand Up @@ -334,8 +330,7 @@ def update(

@property
def tlds(self, session: requests.Session | None = None) -> list[str]:
"""
Returns the list of tld's used by default.
"""Returns the list of tld's used by default.
This will vary based on `include_psl_private_domains` and `extra_suffixes`
"""
Expand Down

0 comments on commit d7001c6

Please sign in to comment.