Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pre-commit autoupdate and annotations fix #270

Merged
merged 2 commits into from
Jul 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -40,7 +40,7 @@ repos:
- --py36-plus

- repo: https://github.com/psf/black
rev: "23.3.0"
rev: "23.7.0"
hooks:
- id: black

Expand All @@ -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
2 changes: 1 addition & 1 deletion autoflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ def _main(
return exit_status


def main():
def main() -> int:
"""Command-line entry point."""
try:
# Exit on broken pipe.
Expand Down
14 changes: 1 addition & 13 deletions test_autoflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down