summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Honz <exislow+github@gmail.com>2024-01-12 08:15:54 +0100
committerRobert Honz <exislow+github@gmail.com>2024-01-12 08:15:54 +0100
commita99c42ad02871658111bb6ce4ef89620e18215e1 (patch)
treefc9ce1a02a8ec57c4053adefe6b536b6e26e3158
parent1f89ce42794bda0c88dc30843e64e7b090e78221 (diff)
downloadtidal-dl-ng-a99c42ad02871658111bb6ce4ef89620e18215e1.tar.gz
♻️ Ruff reformatting.
-rw-r--r--.pre-commit-config.yaml88
-rw-r--r--tidal_dl_ng/config.py6
-rw-r--r--tidal_dl_ng/helper/path.py6
-rw-r--r--tidal_dl_ng/model/cfg.py3
4 files changed, 52 insertions, 51 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 0f56a8f..904ede1 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -4,53 +4,53 @@ default_language_version:
default_stages: [commit, push]
repos:
- - repo: https://github.com/pre-commit/pre-commit-hooks
- rev: "v4.4.0"
- hooks:
- - id: check-case-conflict
- - id: check-merge-conflict
- - id: check-toml
- - id: check-yaml
- - id: end-of-file-fixer
- - id: trailing-whitespace
+# - repo: https://github.com/pre-commit/pre-commit-hooks
+# rev: "v4.4.0"
+# hooks:
+# - id: check-case-conflict
+# - id: check-merge-conflict
+# - id: check-toml
+# - id: check-yaml
+# - id: end-of-file-fixer
+# - id: trailing-whitespace
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.230"
hooks:
- id: ruff
- - repo: https://github.com/pre-commit/mirrors-prettier
- rev: "v3.0.3"
- hooks:
- - id: prettier
-
- - repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v2.5.0
- hooks:
- - id: check-yaml
- - id: end-of-file-fixer
- exclude: LICENSE
-
- - repo: local
- hooks:
- - id: pyupgrade
- name: pyupgrade
- entry: poetry run pyupgrade --py310-plus
- types: [python]
- language: system
-
- - repo: local
- hooks:
- - id: isort
- name: isort
- entry: poetry run isort --settings-path pyproject.toml
- types: [python]
- language: system
-
- - repo: local
- hooks:
- - id: black
- name: black
- entry: poetry run black --config pyproject.toml
- types: [python]
- language: system
+# - repo: https://github.com/pre-commit/mirrors-prettier
+# rev: "v3.0.3"
+# hooks:
+# - id: prettier
+#
+# - repo: https://github.com/pre-commit/pre-commit-hooks
+# rev: v2.5.0
+# hooks:
+# - id: check-yaml
+# - id: end-of-file-fixer
+# exclude: LICENSE
+#
+# - repo: local
+# hooks:
+# - id: pyupgrade
+# name: pyupgrade
+# entry: poetry run pyupgrade --py310-plus
+# types: [python]
+# language: system
+#
+# - repo: local
+# hooks:
+# - id: isort
+# name: isort
+# entry: poetry run isort --settings-path pyproject.toml
+# types: [python]
+# language: system
+#
+# - repo: local
+# hooks:
+# - id: black
+# name: black
+# entry: poetry run black --config pyproject.toml
+# types: [python]
+# language: system
diff --git a/tidal_dl_ng/config.py b/tidal_dl_ng/config.py
index cc5ca2d..aeb5492 100644
--- a/tidal_dl_ng/config.py
+++ b/tidal_dl_ng/config.py
@@ -1,14 +1,14 @@
-from typing import Any
-
from collections.abc import Callable
from json import JSONDecodeError
+from typing import Any
import tidalapi
+from requests import HTTPError
+
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.model.cfg import Settings as ModelSettings
from tidal_dl_ng.model.cfg import Token as ModelToken
-from requests import HTTPError
class BaseConfig:
diff --git a/tidal_dl_ng/helper/path.py b/tidal_dl_ng/helper/path.py
index c5bf988..f354dec 100644
--- a/tidal_dl_ng/helper/path.py
+++ b/tidal_dl_ng/helper/path.py
@@ -6,7 +6,7 @@ from collections.abc import Callable
from pathlib import Path
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():
@@ -128,7 +128,7 @@ def length_max_name_file() -> int:
try:
if system in ['Darwin', 'Linux']:
result: int = os.pathconf('/', 'PC_NAME_MAX')
- except Exception as e:
+ except Exception:
pass
return result
@@ -141,7 +141,7 @@ def length_max_name_path() -> int:
try:
if system in ['Darwin', 'Linux']:
result: int = os.pathconf('/', 'PC_PATH_MAX')
- except Exception as e:
+ except Exception:
pass
return result
diff --git a/tidal_dl_ng/model/cfg.py b/tidal_dl_ng/model/cfg.py
index 413e661..74e0305 100644
--- a/tidal_dl_ng/model/cfg.py
+++ b/tidal_dl_ng/model/cfg.py
@@ -1,9 +1,10 @@
from dataclasses import dataclass
-from tidal_dl_ng.constants import QualityVideo
from dataclasses_json import dataclass_json
from tidalapi import Quality
+from tidal_dl_ng.constants import QualityVideo
+
@dataclass_json
@dataclass