style: Apply linter fixes

This commit is contained in:
Paul Gauthier (aider) 2024-12-30 14:17:25 -04:00
parent a7242ca846
commit 3d2de00f49
2 changed files with 7 additions and 7 deletions

View file

@ -1119,9 +1119,7 @@ class Commands:
self.io.tool_error("To use /voice you must provide an OpenAI API key.") self.io.tool_error("To use /voice you must provide an OpenAI API key.")
return return
try: try:
self.voice = voice.Voice( self.voice = voice.Voice(audio_format="wav", device_name=self.voice_input_device)
audio_format="wav", device_name=self.voice_input_device
)
except voice.SoundDeviceError: except voice.SoundDeviceError:
self.io.tool_error( self.io.tool_error(
"Unable to import `sounddevice` and/or `soundfile`, is portaudio installed?" "Unable to import `sounddevice` and/or `soundfile`, is portaudio installed?"

View file

@ -113,7 +113,9 @@ def setup_git(git_root, io):
except ANY_GIT_ERROR: except ANY_GIT_ERROR:
pass pass
elif cwd == Path.home(): elif cwd == Path.home():
io.tool_warning("You should probably run aider in your project's directory, not your home dir.") io.tool_warning(
"You should probably run aider in your project's directory, not your home dir."
)
return return
elif cwd and io.confirm_ask( elif cwd and io.confirm_ask(
"No git repo found, create one to track aider's changes (recommended)?" "No git repo found, create one to track aider's changes (recommended)?"
@ -173,7 +175,7 @@ def check_gitignore(git_root, io, ask=True):
existing_lines = content.splitlines() existing_lines = content.splitlines()
for pat in patterns: for pat in patterns:
if pat not in existing_lines: if pat not in existing_lines:
if '*' in pat or (Path(git_root) / pat).exists(): if "*" in pat or (Path(git_root) / pat).exists():
patterns_to_add.append(pat) patterns_to_add.append(pat)
except OSError as e: except OSError as e:
io.tool_error(f"Error when trying to read {gitignore_file}: {e}") io.tool_error(f"Error when trying to read {gitignore_file}: {e}")
@ -395,8 +397,8 @@ def sanity_check_repo(repo, io):
error_msg = str(repo.git_repo_error) error_msg = str(repo.git_repo_error)
except UnicodeDecodeError as exc: except UnicodeDecodeError as exc:
error_msg = ( error_msg = (
f"Failed to read the Git repository. This issue is likely caused by a path encoded " "Failed to read the Git repository. This issue is likely caused by a path encoded "
f"in a format different from the expected encoding \"{sys.getfilesystemencoding()}\".\n" f'in a format different from the expected encoding "{sys.getfilesystemencoding()}".\n'
f"Internal error: {str(exc)}" f"Internal error: {str(exc)}"
) )
except ANY_GIT_ERROR as exc: except ANY_GIT_ERROR as exc: