diff --git a/organize/action.py b/organize/action.py index bc76132f..261068b3 100644 --- a/organize/action.py +++ b/organize/action.py @@ -20,8 +20,7 @@ class HasActionConfig(Protocol): class HasActionPipeline(Protocol): - def pipeline(self, res: Resource, output: Output, simulate: bool): - ... + def pipeline(self, res: Resource, output: Output, simulate: bool): ... @runtime_checkable diff --git a/organize/actions/confirm.py b/organize/actions/confirm.py index 7d902af4..747e1b67 100644 --- a/organize/actions/confirm.py +++ b/organize/actions/confirm.py @@ -11,7 +11,6 @@ @dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid")) class Confirm: - """Ask for confirmation before continuing.""" msg: str = "Continue?" diff --git a/organize/actions/copy.py b/organize/actions/copy.py index f427fd6c..d6630716 100644 --- a/organize/actions/copy.py +++ b/organize/actions/copy.py @@ -15,7 +15,6 @@ @dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid")) class Copy: - """Copy a file or dir to a new location. If the specified path does not exist it will be created. diff --git a/organize/actions/delete.py b/organize/actions/delete.py index 9c471eff..508dd0d4 100644 --- a/organize/actions/delete.py +++ b/organize/actions/delete.py @@ -24,7 +24,6 @@ def delete(path: Path): @dataclass(config=ConfigDict(extra="forbid")) class Delete: - """ Delete a file from disk. diff --git a/organize/actions/hardlink.py b/organize/actions/hardlink.py index aaabcfdb..ed2a9714 100644 --- a/organize/actions/hardlink.py +++ b/organize/actions/hardlink.py @@ -21,7 +21,6 @@ def create_hardlink(target: Path, link: Path) -> None: @dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid")) class Hardlink: - """Create a hardlink. Attributes: diff --git a/organize/actions/macos_tags.py b/organize/actions/macos_tags.py index 72336cd6..389a4c02 100644 --- a/organize/actions/macos_tags.py +++ b/organize/actions/macos_tags.py @@ -14,7 +14,6 @@ @dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid")) class MacOSTags: - """Add macOS tags. Attributes: diff --git a/organize/actions/move.py b/organize/actions/move.py index bd81878c..e803e63e 100644 --- a/organize/actions/move.py +++ b/organize/actions/move.py @@ -15,7 +15,6 @@ @dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid")) class Move: - """Move a file to a new location. The file can also be renamed. diff --git a/organize/actions/python.py b/organize/actions/python.py index 3969b3f0..d09cdb15 100644 --- a/organize/actions/python.py +++ b/organize/actions/python.py @@ -11,7 +11,6 @@ @dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid")) class Python: - """Execute python code. Attributes: diff --git a/organize/actions/rename.py b/organize/actions/rename.py index 6f09e627..672b53fe 100644 --- a/organize/actions/rename.py +++ b/organize/actions/rename.py @@ -15,7 +15,6 @@ @dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid")) class Rename: - """Renames a file. Attributes: diff --git a/organize/actions/symlink.py b/organize/actions/symlink.py index 0884dbbe..e1092fb3 100644 --- a/organize/actions/symlink.py +++ b/organize/actions/symlink.py @@ -14,7 +14,6 @@ @dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid")) class Symlink: - """Create a symbolic link. Attributes: diff --git a/organize/actions/trash.py b/organize/actions/trash.py index 485e1c6f..edf182d4 100644 --- a/organize/actions/trash.py +++ b/organize/actions/trash.py @@ -17,7 +17,6 @@ def trash(path: Path): @dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid")) class Trash: - """Move a file or dir into the trash.""" action_config: ClassVar[ActionConfig] = ActionConfig( diff --git a/organize/actions/write.py b/organize/actions/write.py index 19a4dd39..21dc9fcc 100644 --- a/organize/actions/write.py +++ b/organize/actions/write.py @@ -16,7 +16,6 @@ @dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid")) class Write: - """ Write text to a file. diff --git a/organize/filter.py b/organize/filter.py index 54cc4f18..744c1dea 100644 --- a/organize/filter.py +++ b/organize/filter.py @@ -20,8 +20,7 @@ class HasFilterConfig(Protocol): class HasFilterPipeline(Protocol): - def pipeline(self, res: Resource, output: Output) -> bool: - ... # pragma: no cover + def pipeline(self, res: Resource, output: Output) -> bool: ... # pragma: no cover @runtime_checkable diff --git a/organize/filters/date_added.py b/organize/filters/date_added.py index fe949d46..17c18e3d 100644 --- a/organize/filters/date_added.py +++ b/organize/filters/date_added.py @@ -17,7 +17,6 @@ def read_date_added(path: Path) -> datetime: class DateAdded(TimeFilter): - """Matches files by the time the file was added to a folder. **`date_added` is only available on macOS!** diff --git a/organize/filters/date_lastused.py b/organize/filters/date_lastused.py index 0843b9fe..b1a7a267 100644 --- a/organize/filters/date_lastused.py +++ b/organize/filters/date_lastused.py @@ -18,7 +18,6 @@ def read_date_lastused(path: Path) -> datetime: class DateLastUsed(TimeFilter): - """Matches files by the time the file was last used. **`date_lastused` is only available on macOS!** diff --git a/organize/filters/duplicate.py b/organize/filters/duplicate.py index 5976c60e..5d5e84f3 100644 --- a/organize/filters/duplicate.py +++ b/organize/filters/duplicate.py @@ -7,6 +7,7 @@ Which was updated for python3 in: https://gist.github.com/tfeldmann/fc875e6630d11f2256e746f67a09c1ae """ + from collections import defaultdict from pathlib import Path from typing import Any, Callable, ClassVar, Literal, NamedTuple, Tuple diff --git a/organize/filters/empty.py b/organize/filters/empty.py index 726b6e5c..8a884c92 100644 --- a/organize/filters/empty.py +++ b/organize/filters/empty.py @@ -10,7 +10,6 @@ @dataclass(config=ConfigDict(extra="forbid")) class Empty: - """Finds empty dirs and files""" filter_config: ClassVar[FilterConfig] = FilterConfig( diff --git a/organize/filters/hash.py b/organize/filters/hash.py index 38a85919..00b82cd7 100644 --- a/organize/filters/hash.py +++ b/organize/filters/hash.py @@ -37,7 +37,6 @@ def hash_first_chunk(path: Path, algo: str, *, chunksize=1024) -> str: @dataclass(config=ConfigDict(extra="forbid")) class Hash: - """Calculates the hash of a file. Attributes: diff --git a/organize/filters/lastmodified.py b/organize/filters/lastmodified.py index 19163f33..8e7a980a 100644 --- a/organize/filters/lastmodified.py +++ b/organize/filters/lastmodified.py @@ -12,7 +12,6 @@ def read_lastmodified(path: Path) -> datetime: class LastModified(TimeFilter): - """Matches files by last modified date Attributes: diff --git a/organize/filters/mimetype.py b/organize/filters/mimetype.py index 161cc9f6..e98e47a0 100644 --- a/organize/filters/mimetype.py +++ b/organize/filters/mimetype.py @@ -18,7 +18,6 @@ def guess_mimetype(path): @dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid")) class MimeType: - """Filter by MIME type associated with the file extension. Supports a single string or list of MIME type strings as argument. diff --git a/organize/filters/python.py b/organize/filters/python.py index a1e32c5b..32c6d52b 100644 --- a/organize/filters/python.py +++ b/organize/filters/python.py @@ -12,7 +12,6 @@ @dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid")) class Python: - """Use python code to filter files. Attributes: diff --git a/organize/filters/regex.py b/organize/filters/regex.py index 49eaa060..43b09cc8 100644 --- a/organize/filters/regex.py +++ b/organize/filters/regex.py @@ -12,7 +12,6 @@ @dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid")) class Regex: - """Matches filenames with the given regular expression Attributes: diff --git a/organize/output/output.py b/organize/output/output.py index 86bde517..d0fbeb9c 100644 --- a/organize/output/output.py +++ b/organize/output/output.py @@ -24,8 +24,7 @@ def start( simulate: bool, config_path: Optional[Path], working_dir: Path, - ) -> None: - ... + ) -> None: ... def msg( self, @@ -33,8 +32,7 @@ def msg( msg: str, sender: SenderType, level: Level = "info", - ) -> None: - ... + ) -> None: ... def confirm( self, @@ -42,8 +40,6 @@ def confirm( msg: str, default: bool, sender: SenderType, - ) -> bool: - ... + ) -> bool: ... - def end(self, success_count: int, error_count: int) -> None: - ... + def end(self, success_count: int, error_count: int) -> None: ...