From 01a7e9b52d4a5afea67975212f56b76da6e58818 Mon Sep 17 00:00:00 2001 From: francisco souza <108725+fsouza@users.noreply.github.com> Date: Fri, 28 Jul 2023 22:18:50 -0300 Subject: [PATCH 1/2] pre-commit autoupdate --- .pre-commit-config.yaml | 8 ++++---- test_autoflake.py | 14 +------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 873bf81..c37a5d8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,12 +21,12 @@ repos: - from __future__ import annotations - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.276 + rev: v0.0.280 hooks: - id: ruff - repo: https://github.com/asottile/pyupgrade - rev: v3.8.0 + rev: v3.9.0 hooks: - id: pyupgrade args: @@ -40,7 +40,7 @@ repos: - --py36-plus - repo: https://github.com/psf/black - rev: "23.3.0" + rev: "23.7.0" hooks: - id: black @@ -50,6 +50,6 @@ repos: - id: validate-pyproject - repo: https://github.com/fsouza/mirrors-pyright - rev: v1.1.316 + rev: v1.1.319 hooks: - id: pyright diff --git a/test_autoflake.py b/test_autoflake.py index 507f69c..9acdbb3 100755 --- a/test_autoflake.py +++ b/test_autoflake.py @@ -3186,19 +3186,7 @@ def effective_path(self, path: str, is_file: bool = True) -> str: def create_dir(self, path) -> None: effective_path = self.effective_path(path, False) - if sys.version_info >= (3, 2, 0): - os.makedirs(effective_path, exist_ok=True) - else: - if os.path.exists(effective_path): - return - try: - os.mkdir(effective_path) - except OSError: - parent = os.path.split(path)[0] - if not parent: - raise - self.create_dir(parent) - os.mkdir(effective_path) + os.makedirs(effective_path, exist_ok=True) def create_file(self, path, contents="") -> None: effective_path = self.effective_path(path) From 85898d105a94a0130a4ac7d0c9a46a3a8c08d2b1 Mon Sep 17 00:00:00 2001 From: francisco souza <108725+fsouza@users.noreply.github.com> Date: Fri, 28 Jul 2023 22:19:00 -0300 Subject: [PATCH 2/2] autoflake: add missing type annotation --- autoflake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoflake.py b/autoflake.py index 67815b0..d4ef466 100755 --- a/autoflake.py +++ b/autoflake.py @@ -1574,7 +1574,7 @@ def _main( return exit_status -def main(): +def main() -> int: """Command-line entry point.""" try: # Exit on broken pipe.