B607/603 coverage
This commit is contained in:
parent
54b242fe9c
commit
a8c757072b
|
@ -23,7 +23,9 @@ class Completion:
|
|||
for point in self.entry_points:
|
||||
self.env[f"_{point.upper().replace('-', '_')}_COMPLETE"] = "bash_source"
|
||||
with Path(comp_dir + point).open(mode="w") as file:
|
||||
file.write(subprocess.run([point], env=self.env, capture_output=True, text=True).stdout)
|
||||
file.write(
|
||||
subprocess.run([point], env=self.env, capture_output=True, text=True).stdout, # noqa: S603
|
||||
)
|
||||
print(f"Bash completion for {point} written to {comp_dir}{point}")
|
||||
if self.shell in ("all", "fish"):
|
||||
comp_dir = self.share_dir + "/fish/vendor_completions.d/"
|
||||
|
@ -33,7 +35,9 @@ class Completion:
|
|||
for point in self.entry_points:
|
||||
self.env[f"_{point.upper().replace('-', '_')}_COMPLETE"] = "fish_source"
|
||||
with Path(comp_dir + point + ".fish").open(mode="w") as file:
|
||||
file.write(subprocess.run([point], env=self.env, capture_output=True, text=True).stdout)
|
||||
file.write(
|
||||
subprocess.run([point], env=self.env, capture_output=True, text=True).stdout, # noqa: S603
|
||||
)
|
||||
print(f"Fish completion for {point} written to {comp_dir}{point}.fish")
|
||||
if self.shell in ("all", "zsh"):
|
||||
comp_dir = self.share_dir + "/zsh/site-functions/"
|
||||
|
@ -43,7 +47,9 @@ class Completion:
|
|||
for point in self.entry_points:
|
||||
self.env[f"_{point.upper().replace('-', '_')}_COMPLETE"] = "zsh_source"
|
||||
with Path(comp_dir + "_" + point).open(mode="w") as file:
|
||||
file.write(subprocess.run([point], env=self.env, capture_output=True, text=True).stdout)
|
||||
file.write(
|
||||
subprocess.run([point], env=self.env, capture_output=True, text=True).stdout, # noqa: S603
|
||||
)
|
||||
print(f"Zsh completion for {point} written to {comp_dir}_{point}")
|
||||
|
||||
def uninstall(self) -> None:
|
||||
|
|
|
@ -171,7 +171,7 @@ class FileNameFormatter:
|
|||
@staticmethod
|
||||
def find_max_path_length() -> int:
|
||||
try:
|
||||
return int(subprocess.check_output(["getconf", "PATH_MAX", "/"]))
|
||||
return int(subprocess.check_output(["getconf", "PATH_MAX", "/"])) # noqa: S603, S607
|
||||
except (ValueError, subprocess.CalledProcessError, OSError):
|
||||
if platform.system() == "Windows":
|
||||
return FileNameFormatter.WINDOWS_MAX_PATH_LENGTH
|
||||
|
|
Loading…
Reference in a new issue