♻️ Ruff reformatting.

This commit is contained in:
Robert Honz
2024-01-12 08:15:54 +01:00
parent 1f89ce4279
commit a99c42ad02
4 changed files with 52 additions and 51 deletions
+44 -44
View File
@@ -4,53 +4,53 @@ default_language_version:
default_stages: [commit, push] default_stages: [commit, push]
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks # - repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0" # rev: "v4.4.0"
hooks: # hooks:
- id: check-case-conflict # - id: check-case-conflict
- id: check-merge-conflict # - id: check-merge-conflict
- id: check-toml # - id: check-toml
- id: check-yaml # - id: check-yaml
- id: end-of-file-fixer # - id: end-of-file-fixer
- id: trailing-whitespace # - id: trailing-whitespace
- repo: https://github.com/charliermarsh/ruff-pre-commit - repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.230" rev: "v0.0.230"
hooks: hooks:
- id: ruff - id: ruff
- repo: https://github.com/pre-commit/mirrors-prettier # - repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.3" # rev: "v3.0.3"
hooks: # hooks:
- id: prettier # - id: prettier
#
- repo: https://github.com/pre-commit/pre-commit-hooks # - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0 # rev: v2.5.0
hooks: # hooks:
- id: check-yaml # - id: check-yaml
- id: end-of-file-fixer # - id: end-of-file-fixer
exclude: LICENSE # exclude: LICENSE
#
- repo: local # - repo: local
hooks: # hooks:
- id: pyupgrade # - id: pyupgrade
name: pyupgrade # name: pyupgrade
entry: poetry run pyupgrade --py310-plus # entry: poetry run pyupgrade --py310-plus
types: [python] # types: [python]
language: system # language: system
#
- repo: local # - repo: local
hooks: # hooks:
- id: isort # - id: isort
name: isort # name: isort
entry: poetry run isort --settings-path pyproject.toml # entry: poetry run isort --settings-path pyproject.toml
types: [python] # types: [python]
language: system # language: system
#
- repo: local # - repo: local
hooks: # hooks:
- id: black # - id: black
name: black # name: black
entry: poetry run black --config pyproject.toml # entry: poetry run black --config pyproject.toml
types: [python] # types: [python]
language: system # language: system
+3 -3
View File
@@ -1,14 +1,14 @@
from typing import Any
from collections.abc import Callable from collections.abc import Callable
from json import JSONDecodeError from json import JSONDecodeError
from typing import Any
import tidalapi import tidalapi
from requests import HTTPError
from tidal_dl_ng.helper.decorator import SingletonMeta from tidal_dl_ng.helper.decorator import SingletonMeta
from tidal_dl_ng.helper.path import path_file_settings, path_file_token from tidal_dl_ng.helper.path import path_file_settings, path_file_token
from tidal_dl_ng.model.cfg import Settings as ModelSettings from tidal_dl_ng.model.cfg import Settings as ModelSettings
from tidal_dl_ng.model.cfg import Token as ModelToken from tidal_dl_ng.model.cfg import Token as ModelToken
from requests import HTTPError
class BaseConfig: class BaseConfig:
+3 -3
View File
@@ -6,7 +6,7 @@ from collections.abc import Callable
from pathlib import Path from pathlib import Path
from pathvalidate import sanitize_filename from pathvalidate import sanitize_filename
from tidalapi import Album, Playlist, Track, UserPlaylist, Video, Mix from tidalapi import Album, Mix, Playlist, Track, UserPlaylist, Video
def path_base(): def path_base():
@@ -128,7 +128,7 @@ def length_max_name_file() -> int:
try: try:
if system in ['Darwin', 'Linux']: if system in ['Darwin', 'Linux']:
result: int = os.pathconf('/', 'PC_NAME_MAX') result: int = os.pathconf('/', 'PC_NAME_MAX')
except Exception as e: except Exception:
pass pass
return result return result
@@ -141,7 +141,7 @@ def length_max_name_path() -> int:
try: try:
if system in ['Darwin', 'Linux']: if system in ['Darwin', 'Linux']:
result: int = os.pathconf('/', 'PC_PATH_MAX') result: int = os.pathconf('/', 'PC_PATH_MAX')
except Exception as e: except Exception:
pass pass
return result return result
+2 -1
View File
@@ -1,9 +1,10 @@
from dataclasses import dataclass from dataclasses import dataclass
from tidal_dl_ng.constants import QualityVideo
from dataclasses_json import dataclass_json from dataclasses_json import dataclass_json
from tidalapi import Quality from tidalapi import Quality
from tidal_dl_ng.constants import QualityVideo
@dataclass_json @dataclass_json
@dataclass @dataclass