Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 13, 2024
1 parent e86a21c commit 8a04f40
Show file tree
Hide file tree
Showing 23 changed files with 7 additions and 31 deletions.
3 changes: 1 addition & 2 deletions organize/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion organize/actions/confirm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

@dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid"))
class Confirm:

"""Ask for confirmation before continuing."""

msg: str = "Continue?"
Expand Down
1 change: 0 additions & 1 deletion organize/actions/copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion organize/actions/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def delete(path: Path):

@dataclass(config=ConfigDict(extra="forbid"))
class Delete:

"""
Delete a file from disk.
Expand Down
1 change: 0 additions & 1 deletion organize/actions/hardlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion organize/actions/macos_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

@dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid"))
class MacOSTags:

"""Add macOS tags.
Attributes:
Expand Down
1 change: 0 additions & 1 deletion organize/actions/move.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion organize/actions/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

@dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid"))
class Python:

"""Execute python code.
Attributes:
Expand Down
1 change: 0 additions & 1 deletion organize/actions/rename.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

@dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid"))
class Rename:

"""Renames a file.
Attributes:
Expand Down
1 change: 0 additions & 1 deletion organize/actions/symlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

@dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid"))
class Symlink:

"""Create a symbolic link.
Attributes:
Expand Down
1 change: 0 additions & 1 deletion organize/actions/trash.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 0 additions & 1 deletion organize/actions/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

@dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid"))
class Write:

"""
Write text to a file.
Expand Down
3 changes: 1 addition & 2 deletions organize/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion organize/filters/date_added.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!**
Expand Down
1 change: 0 additions & 1 deletion organize/filters/date_lastused.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!**
Expand Down
1 change: 1 addition & 0 deletions organize/filters/duplicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion organize/filters/empty.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

@dataclass(config=ConfigDict(extra="forbid"))
class Empty:

"""Finds empty dirs and files"""

filter_config: ClassVar[FilterConfig] = FilterConfig(
Expand Down
1 change: 0 additions & 1 deletion organize/filters/hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion organize/filters/lastmodified.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ def read_lastmodified(path: Path) -> datetime:


class LastModified(TimeFilter):

"""Matches files by last modified date
Attributes:
Expand Down
1 change: 0 additions & 1 deletion organize/filters/mimetype.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion organize/filters/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

@dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid"))
class Python:

"""Use python code to filter files.
Attributes:
Expand Down
1 change: 0 additions & 1 deletion organize/filters/regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

@dataclass(config=ConfigDict(coerce_numbers_to_str=True, extra="forbid"))
class Regex:

"""Matches filenames with the given regular expression
Attributes:
Expand Down
12 changes: 4 additions & 8 deletions organize/output/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,22 @@ def start(
simulate: bool,
config_path: Optional[Path],
working_dir: Path,
) -> None:
...
) -> None: ...

def msg(
self,
res: Resource,
msg: str,
sender: SenderType,
level: Level = "info",
) -> None:
...
) -> None: ...

def confirm(
self,
res: Resource,
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: ...

0 comments on commit 8a04f40

Please sign in to comment.