mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-21 05:37:50 -06:00
Enhance error reporting for deleted files
The code now checks if a requested file is present in the files list before diagnosing issues and generating error reports for it. It will help prevent attempting to diagnose or report on files that do not exist or deleted, thus enhancing efficiency and preventing possible error generation CURA-10903
This commit is contained in:
parent
a965392559
commit
c6ff0d3030
2 changed files with 9 additions and 8 deletions
|
@ -35,5 +35,5 @@ class Directory(Linter):
|
|||
def checkFilesDeleted(self) -> Iterator[GitComment]:
|
||||
if not self._file.exists():
|
||||
""" Check if there is a file that is deleted, this causes upgrade scripts to not work properly """
|
||||
yield GitComment( f"File: {self._file} must not be deleted as it is not allowed. It will create issues upgrading Cura" )
|
||||
yield GitComment( f'File: **{self._file}** must not be deleted as it is not allowed. It will create issues upgrading Cura' )
|
||||
yield
|
|
@ -51,7 +51,8 @@ def main() -> None:
|
|||
|
||||
if args.deleted:
|
||||
for file in args.Files:
|
||||
deletedFiles = diagnoseIssuesWithFile(file, settings )
|
||||
if file not in files:
|
||||
deletedFiles = diagnoseIssuesWithFile(file, settings)
|
||||
comments_check["Error Files"].extend([d.toDict() for d in deletedFiles])
|
||||
|
||||
results = yaml.dump(comments_check, default_flow_style=False, indent=4, width=240)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue